webwork2拦截器问题
我自己实现拦截器接口,如:
public class MyInterceptor implements Interceptor{
public void destroy() {
System.out.println("销毁拦截器");
}
public void init() {
System.out.println("初始化拦截器");
}
public String intercept(ActionInvocation actionInvocation) throws Exception {
// TODO Auto-generated method stub
System.out.println("先执行拦截器");
String result = actionInvocation.invoke();
System.out.println("方法执行完了再次执行拦截器");
return result;
}
}
下面是我的xwork.xml文件配置
<package name="" extends="webwork-default">
<interceptors>
<interceptor name="myinterceptor" class="cn.king.webwork.interceptor.MyInterceptor"/>
</interceptors>
<action name="first" class="first">
<interceptor-ref name="myinterceptor"/>
<interceptor-ref name="params"></interceptor-ref>
<result name="success">success.jsp</result>
</action>
</package>
我的疑问是只要加了拦截器
如果不用这个拦截器
<interceptor-ref name="params"></interceptor-ref>
那我页面上的参数将不能够得到
这是为什么呢
望各位大侠指点
小弟谢过了