论坛首页 Java版 Struts

Struts2 我在URL中调用upload.do,不能执行用@after,和@before声明方法

浏览 302 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
最后更新时间:2008-07-04 关键字: 我在url中调用upload.do, 不能执行用@after, 和@before声明方法
我在URL中调用upload.do,不能执行用@after,和@before声明方法,我应该如何,帮帮我?
另外,如何声明annotation的annotationWorkflow
(1)Struts.xml配置


<struts>
    <constant name="struts.action.extension" value="do" />
    <constant name="struts.enable.DynamicMethodInvocation" value="true" />
    <constant name="struts.devMode" value="false" />
</struts>




(2)一个测试类


public class UploadAction extends BaseAction{
	
	
	         @Before(priority=5)
		public String before5() {
			System.out.println("before-5");
			return null;
		}

		@After(priority=5)
		public void after5() {
			System.out.println("after-5");
		}
		
		public String execute(){
			System.out.println("ddddd-c=");
			return MESSAGES;
		}

   
最后更新时间:2008-07-04
interceptor-ref 如何使用annotation在action上声明
   
0 请登录后投票
最后更新时间:2008-07-04
需要用到这个interceptor
<interceptor name="annotationWorkflow" class="com.opensymphony.xwork2.interceptor.annotations.AnnotationWorkflowInterceptor" />

BTW:向某ray炫耀一下,这些Annotaion的priority是我贡献的.
   
0 请登录后投票
最后更新时间:2008-07-04
quaff 写道
需要用到这个interceptor
<interceptor name="annotationWorkflow" class="com.opensymphony.xwork2.interceptor.annotations.AnnotationWorkflowInterceptor" />

BTW:向某ray炫耀一下,这些Annotaion的priority是我贡献的.



少自得其乐了,增加个Annotation的attribute,早玩腻了,俺自己还增加了点呢。
   
0 请登录后投票
最后更新时间:2008-07-04
感觉楼上quaff 和ray_linn 朋友回答!

我刚struts2入门.ray_linn 能不能提供一个完整的struts.xml的annotationworkflow配置和一个java annotation class.
能够让我参与一下.
   
0 请登录后投票
最后更新时间:2008-07-04
感觉楼上quaff 和ray_linn 朋友回答!

我刚struts2入门.ray_linn 能不能提供一个完整的struts.xml的annotationworkflow配置和一个java annotation class.
能够让我参与一下.
   
0 请登录后投票
最后更新时间:2008-07-04
Doc上写得很清楚
http://struts.apache.org/2.0.11.1/docs/annotationworkflowinterceptor.html
   
0 请登录后投票
论坛首页 Java版 Struts

跳转论坛:
JavaEye推荐