Dave,

Thanks a lot for providing the solution. I put default stack in the
interceptor stack and the functionality is running properly. However if I
do not use stack and directly use the interceptor, it gives the following
error :

HTTP Status 404 -
/Struts2/login.action;jsessionid=B902A6322742861B6ED2F1FB35C61766

Please help.

struts.xml (modified)

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd";>
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="true" />
<include file="struts-default.xml" />
<package name="practice" extends="struts-default">
<interceptors>
*<interceptor name="logger1" class="com.home.practice.LoggerInterceptor" />*
<interceptor name="before" class="com.home.practice.PreViewInterceptor" />
<interceptor name="after" class="com.home.practice.PostViewInterceptor" />
</interceptors>
<action name="loginCancel">
<result>/Login.jsp</result>
</action>
<action name="login" class="com.home.practice.LoginAction">
* **<interceptor-ref name="logger1" />*
<result name="input">/Login.jsp</result>
<result name="error">/Login.jsp</result>
<result name="cancel" type="redirect">/Login.jsp</result>
<result>/UserInfo.jsp</result>
</action>
<action name="userinfo" class="com.home.practice.UserInfoAction">
<result name="summary">/Welcome.jsp</result>
</action>

</package>
</struts>


On Mon, Nov 21, 2011 at 1:34 AM, Dave Newton <davelnew...@gmail.com> wrote:

> By using a complete stack in the action's <interceptor-ref> config element,
> or by combining stacks as with any interceptor configuration.
>
> http://struts.apache.org/2.x/docs/interceptor-configuration.html
>
> Dave
>
> On Sun, Nov 20, 2011 at 2:59 PM, Srineel Mazumdar <smaz19...@gmail.com
> >wrote:
>
> > Hi Dave,
> > *
> > *
> > *"In any case, when you define an <interceptor-ref> for a specific
> action,*
> > *you must define *all* of the interceptors for that action"*
> > *
> > *
> > How can this be done ?
> >
> > Thanks,
> > Srineel
> >
> > On Mon, Nov 21, 2011 at 1:26 AM, Dave Newton <davelnew...@gmail.com>
> > wrote:
> >
> > > On Sun, Nov 20, 2011 at 2:47 PM, Srineel Mazumdar <smaz19...@gmail.com
> > > >wrote:
> > >
> > > > I intend to use only logger1 interceptor.
> > > >
> > > > I want to enable only one interceptor ie logger1. How can I do so?
> > > >
> > >
> > > By doing what you did.
> > >
> > > However, as I stated, this means that essentially no other S2
> > functionality
> > > will be present, including setting form values on the action,
> validation,
> > > workflow, etc.
> > >
> > > Dave
> > >
> >
>

Reply via email to