I am trying to implement the execAndWait interceptor along with a custom
authentication interceptor in an interceptor stack that most of my actions
will call. I understand that the action being called needs to implement
sessionAware if it wants to access the session. My question is: what about
other interceptors on the stack...do they also need to implement
sessionAware? 

In my example, my authIntercept is accessing the session from the invocation
object. Is this a problem? Should my authIntercept be implementing
sessionAware and getting the session object from there?

Thanks
john


<package name="userMgmt" namespace="/userMgmt" extends="struts-default">

 <interceptors>
                   <interceptor-stack name="waitStack">
                    <interceptor-ref name="authenticationIntercept"/>
                        <interceptor-ref name="paramsPrepareParamsStack"/>      
                  
                        <interceptor-ref name="execAndWait" />
                  </interceptor-stack>
   </interceptors>

<default-interceptor-ref name="waitStack"/>

 <global-results>
                <result name="wait">/WEB-INF/pages/wait.jsp</result>
        </global-results>


<action name="userMaint_*" method="{1}"
class="pages.userManagement.userMaintenance">
                  <result 
name="deleteUser">/WEB-INF/pages/userMgmt/index.jsp</result>
                  <result 
name="findUsers">/WEB-INF/pages/userMgmt/index.jsp</result>    
                  <result 
name="success">/WEB-INF/pages/userMgmt/index.jsp</result>
                  <result 
name="input">/WEB-INF/pages/userMgmt/index.jsp</result>
 </action>




public class authIntercept  implements Interceptor, AVConstants,
Serializable
{
  
  public void destroy(){
        
  }
  public void init(){
        
  }
  public String intercept (ActionInvocation invocation) throws Exception {
        
        Map attributes = invocation.getInvocationContext().getSession();
        
        Object user = attributes.get(USER_OBJ);
                if (user == null) {                                             
                   return "login";
                } else {                   
                   return invocation.invoke ();
                }
        }

}
-- 
View this message in context: 
http://www.nabble.com/execAndWait-and-session-access-tp16850755p16850755.html
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to