1) Do following configuration in struts.xml
<!--If Single interceptor -->
<struts>
<package name="default" namespace="/" extends="struts-default" >
<interceptors>
</interceptors>
<action name="testAction" class="com.test.action. TestAction"
</package>
<!-- Add packages here -->
</struts>
<!--If Multiple interceptors then prepare a Stack -->
<struts>
<package name="default" namespace="/" extends="struts-default" >
<interceptors>
</interceptors>
<action name="testAction" class="com.test.action. TestAction"
</action>
</package>
<!-- Add packages here -->
</struts>
2) Write Interceptor Class
import com.opensymphony.xwork2. ActionInvocation;
import com.opensymphony.xwork2. interceptor.Interceptor;
public class TestInterceptor implements Interceptor {
@Override
public String intercept(ActionInvocation arg0) throws Exception {
//Write your Specific code here.
return SUCCESS;
}
}
bro apni template to change kr lo
ReplyDeleteThanks Man!! will do that
DeleteMy Pleasure
Delete