Hi,
Sorry for my late reply. Yes I m setting the parent package property to the
default s2 package (not class package).
*struts.xml*
<struts>
<!--===== Struts2 Configuration details =====-->
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="false" />
<constant name="struts.multipart.maxSize" value="-1"></constant>
<!-- Set java templates as default theme -->
<constant name="struts.ui.templateSuffix" value="java" />
<constant name="struts.ui.theme" value="simple" />
<!-- Other config -->
<constant name="struts.multipart.saveDir" value="." />
<constant name="struts.custom.i18n.resources" value="global-messages" />
<!--===== Convention plug-in config =====-->
<!-- list of action packages -->
<constant name="struts.convention.action.packages"
value="com.sify.s2.action" />
<constant name="struts.convention.default.parent.package"
value="s2-conv-default" />
<!-- Set to scan only packages that start with the below value -->
<constant name="struts.convention.package.locators.basePackage"
value="com.sify.s2.action" />
<!-- <constant name="struts.convention.result.path" value="/jsp" /> -->
<!--===== FullHibernateSession plug-in config =====-->
<constant name="hibernatePlugin.configurationFiles"
value="hibernate.cfg.xml" />
<!--===== Application' action config's =====-->
<include file="s2-default.xml" />
</struts>
*s2-default.xml*
<struts>
<package name="eawedan-conv-default" extends="convention-default" >
<result-types>
<result-type name="tiles"
class="org.apache.struts2.views.tiles.TilesResult" default="true" />
</result-types>
<!-- interceptors & interceptor-stack configuration -->
<interceptors>
<interceptor name="auth"
class="com.sify.s2.interceptor.AuthInterceptor" />
<!-- interceptor-stack with authentication -->
<interceptor-stack name="userStack">
<interceptor-ref name="auth" />
<interceptor-ref name="params" />
<interceptor-ref name="defaultStack"/>
</interceptor-stack>
<!-- interceptor-stack with out authentication -->
<interceptor-stack name="guestStack">
<interceptor-ref name="defaultStack" />
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="userStack" />
<!-- when an interceptor returns, the corresponding result in the
global-results will be selected, if present -->
<global-results>
<result name="ngo-login"
type="redirectAction">ngo-login</result>
<result name="no-privilege"
type="redirectAction">no-privilege</result>
<result name="no-admin-privilege"
type="redirectAction">no-admin-privilege</result>
<result name="error"
type="dispatcher">/WEB-INF/content/error/excep.jsp</result>
<result
name="invalid.token">/WEB-INF/content/error/error.jsp</result>
</global-results>
<!-- global exceptions -->
<global-exception-mappings>
<exception-mapping result="error"
exception="java.lang.Throwable"/>
</global-exception-mappings>
<action name="ngo-login" >
<result
type="dispatcher">/WEB-INF/content/ngo-login.jsp</result>
</action>
</package>
</struts>
Please help.
Regards,
ManiKanta G
twitter.com/manikantag
On Fri, Aug 21, 2009 at 7:32 PM, <[email protected]> wrote:
>
> 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 <[email protected]>
> To: Struts-User <[email protected]>
> 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
>
>
>
>
>
>