Check it out with the config-browser -- you should see on the results tab if 
your login result is 
really there.


 


Chris

 


 

-----Original Message-----
From: ManiKanta G <go4m...@gmail.com>
To: Struts-User <user@struts.apache.org>
Sent: Fri, Aug 21, 2009 3:36 am
Subject: Problem with result returning from interceptor










Hi,

In my application actions are distributed into several namespaces using
Conventions plugin.
When a request come for an action in a namespace (other than default one,
say, myapp/admin/action-name), and when there is no user session found, I m
returning 'login', which is configured as global-result in the default
namespace. But I m getting exception saying 'No result found with name...'.

Result config:

<global-results> <result name="login" type="redirectAction">login</result>
</global-results>


Intercept() of interceptor:

 public String intercept(ActionInvocation invocation) throws Exception {


Map<String, Object> session =
invocation.getInvocationContext().getSession();

      User user = (User) session.get(Constants.USER_HANDLE);

   if(user == null) {

return "login";

  }else{

 invocation.invoke();

  }


}


Action is in other namespace (package) and so jsp. But the result is
configured in default namespace, as login result should be accessible from
any namespace.


I m not getting what is the mistake I m doing. Is there any this kind of
problem with conventions plugin?

Some one please help.

Regards,
ManiKanta G
twitter.com/manikantag



 

Reply via email to