In my action classes, I am getting a populated JavaBean from my SessionBean,
and I want to know how to get an exception into the errors using errors.add().

The difference between this and traditional errors is that there is no key in
ApplicationResource.properties, but rather, I am grabbing a string from the
EntityException.

<code snippet>
                // Populate the EntityDO
                try
                {       EntityDO aEntityDO = new EntityDO(request.getParameter("id");
                        InitialContext ctx = new InitialContext();
                        EntityManagerHome home = (EntityManagerHome) ctx.lookup(
EntityManagerHome.CLASS_CTX );
                        EntityManager entityMgr = home.create();
                        aEntityDO = entityMgr.getEntityDetails(aEntityDO);      
                }
                catch (NamingException ne)
                {
                        log(_className, " NamingException occurred in 
getEntityDetails()");
                        errors.add(ActionErrors.GLOBAL_ERROR, new
ActionError("errors.namingException"));
                } 
                catch (EntityException re)
                {
                        log(_className, " ResourceException occurred in 
getResourceDetails()");
                        // Get EntityException from SessionBean
                        // *** HELP NEEDED HERE *** //
                        // How do I get the "re" String into an errors.add ??
                }
</code snippent>

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

Reply via email to