struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Security Management" <>
Subject Problem with store interceptor
Date Thu, 26 Feb 2009 18:36:16 GMT
Here's my struts.xml, partially

			<interceptor name="loggedIn"
			<interceptor-stack name="defaultSMCStack">
				<interceptor-ref name="store">
				<interceptor-ref name="defaultStack"/>

			<interceptor-stack name="defaultLoggedInStack">
				<interceptor-ref name="createSession"/>
				<interceptor-ref name="loggedIn"/>
				<interceptor-ref name="defaultSMCStack"/>

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

    <default-action-ref name="home" />

		<result name="login" type="redirectAction"> 
	        <param name="actionName">home</param> 
      	  <param name="namespace">/default</param> 

Here's my LoggedInInteceptor code:

public String intercept(ActionInvocation ai) throws Exception
            if(this.getSession() == null)
                throw new Exception("Session is null");
            if(this.getSession().get("username") != null)
                String res = ai.invoke();
                return res;
                l.warn("LoggedInInterceptor didn't see a seession
                addActionError(ai, "You must be authenticated to access this
                return "login";

    private void addActionError(ActionInvocation invocation, String message)
            Object action = invocation.getAction();
            if(action instanceof ValidationAware)
                l.warn("Adding error message");
                ((ValidationAware) action).addActionError(message);
                l.error("Action is not ValidationAware...");

I see in the catalina.out that it's adding an action error, but the redirect
action is stripping it (store interceptor should be saving/reload it,
right??), and it's not showing up after the global result runs and redirects
to the home action.

Any ideas?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message