NutzCN Logo
问答 filter可以传动态参数吗?
发布于 2610天前 作者 lovegenii 1863 次浏览 复制 上一个帖子 下一个帖子
标签:

大神,不知道可不可以直接传过滤器一个动态的变量值?
@Filters(@By(type = IndexFilter.class, args = {"@Param:quest_name"}))//quest_name是请求串中的参数,可以直接传进去吗?
public Object index(@Param("quest_name") String quest_name, HttpServletRequest req) {
try {
return null;
} catch (Exception e) {
return null;
}
}

2 回复

并不能

但是呢, 传个参数名, 然后IndexFilter里面直接从req取就好了

哦,明白了, 我可以通过
HttpServletRequest request = actionContext.getRequest();
String name = request.getParameter("quest_name");
获取,谢谢大神

添加回复
请先登陆
回到顶部