//代码如下
//请问,如何把 score 对象传到跳转后的 module (试过用 request 保存,没起作用)
@IocBean
@At("/application/dp/stuscore")
@Filters({@By(type = GlobalsFilter.class)})
public class StudscoreModule extends BaseModule {
@Inject
protected Dao dao;
@At
@Ok(">>:/private/sys/chart/static")
public void draw(HttpServletRequest req) {
StudentScore score = new StudentScore();
score.setName("jerry");
score.setScore(100);
System.out.println("name ... ...\t"+score.getName());
//return score;
req.setAttribute("score", score);
}
}
3 回复
web.xml没写好
<filter>
<filter-name>nutz</filter-name>
<filter-class>org.nutz.mvc.NutFilter</filter-class>
<init-param>
<param-name>modules</param-name>
<param-value>net.wendal.nutzbook.MainModule</param-value>
</init-param>
<init-param>
<param-name>exclusions</param-name>
<param-value>/rs/*,/druid/*,/api2/*</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>nutz</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher> <!-- 这是关键 -->
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
添加回复
请先登陆