Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter 过滤器 getMethodArgs 似乎无法获取参数 #320

Closed
gongrui opened this issue Sep 5, 2012 · 8 comments
Closed

filter 过滤器 getMethodArgs 似乎无法获取参数 #320

gongrui opened this issue Sep 5, 2012 · 8 comments
Assignees
Labels
Milestone

Comments

@gongrui
Copy link

gongrui commented Sep 5, 2012

public View match(ActionContext ac) {


        log.debugf("Module[%s]>method[%s]>args[%s] ",ac.getModule().getClass().getName(),ac.getMethod().getName(),ac.getMethodArgs());

        return null;
    }

ac.getMethodArgs为null

@wendal
Copy link
Member

wendal commented Sep 5, 2012

最新版吗?

@gongrui
Copy link
Author

gongrui commented Sep 5, 2012

我再试试看

@gongrui
Copy link
Author

gongrui commented Sep 5, 2012

最新版,返回还是null
入口参数如下:
(@param("cno") String cno,@param("::_testo1.") TestObject testo1,@param("::_testo2.") TestObject testo2)

@wendal
Copy link
Member

wendal commented Sep 5, 2012

ActionFilter在Adaptor之前调用,所以这个时候还没有方法参数

@wendal
Copy link
Member

wendal commented Sep 5, 2012

如果你需要method args , 只能通过aop了

@gongrui
Copy link
Author

gongrui commented Sep 5, 2012

主要是想返回不同的视图类型,Interceptor没法做到这点

@wendal
Copy link
Member

wendal commented Sep 7, 2012

Interceptor也可以的
你设置方法的返回值是一个View对象就可以了

chain.setReturnValue(new JspView("xxxx"));

@wendal wendal closed this as completed Sep 7, 2012
@ghost ghost assigned wendal Sep 7, 2012
@gongrui
Copy link
Author

gongrui commented Sep 9, 2012

哦,原来担心所有的action不一定都返回的View类型,
例如
@at("jsp:aaa.jsp")
public Map<String,Object> testme(){

}

Interceptor这样写能强制转到另一个视图吗?

我去试试,多谢了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants