Oh right, sorry yeah my code looks in the Application scope in this instance.  

For getting the request scope variables I needed I had subclassed DispatchAction for 
my project and
set the properties on my form bean which were grabbed from the request from within an 
overriden
dispatchMethod (execute if subclassing normal Action) method.  I suppose you could do 
the same as
well and add a get/set UserSession property on your a subclassed ActionForm.  Not sure 
how great an
option that is?

Here's what my code looked like:

protected ActionForward dispatchMethod(
        ActionMapping mappings,
        ActionForm form,
        HttpServletRequest request,
        HttpServletResponse response,
        String methodToCall)
        throws Exception {
                
        if (form instanceof ApptiusForm) {
//here's where I grab some user session variables and present them to my form bean
                
((ApptiusForm)form).setSessionUserName((String)request.getSession().getAttribute(POActionServlet.USER_KEY));
                
((ApptiusForm)form).setSessionUserId((String)request.getSession().getAttribute(POActionServlet.USERID_KEY));
        }

        String dispatchTo = ApptiusUtils.isNull(methodToCall,"initialize");
        ActionForward forward = null;
        
        try {
                forward = super.dispatchMethod(mappings, form, request, response, "do" 
+
ApptiusUtils.UCaseFirst(dispatchTo));
        } catch (Exception e){
                ApptiusLog.logError(e, this.getClass().getName() + "::" + "do" +
ApptiusUtils.UCaseFirst(methodToCall) + " does not exist, or an error occured within 
that function,
check stack trace below");
                throw e;
        }
                
        if (forward == null) {
                return mappings.findForward(dispatchTo);
        } else {
                return forward;
        }
}


Craig.
<tataryn:craig/>

On Mon, 15 Mar 2004 10:13:41 -0700, Wendy Smoak wrote:

> 
> > From: Craig Tataryn [mailto:[EMAIL PROTECTED] 
> 
> > this.servlet.getServletContext().getAttribute() should give 
> > you access to beans in the user session.
> 
> Application/Context scope != Session scope
> 
> -- 
> Wendy Smoak
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


<tataryn:craig/>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to