05_Result

来源:互联网 发布:python怎么开发网站 编辑:程序博客网 时间:2024/06/04 23:21

5.1 自定义Result

5.1.1 实现自定义Result

实现Result接口即可

5.1.2 配置自己的Result

在sturts.xml中声明result-types就可以使用了

5.1.3 运行测试Result


5.2 常用的Result

常用的Result有:Dispatcher,Redirect,Chain,XSL,HttpHeader,Stream,PlainText,Redirect Action,Velocity,FreeMarker,JasperReports等

5.2.1 Dispatcher

相当于dispatcher.forward(request,response);

5.2.2 Redirect

相当于response.sendRedirect();

5.2.3 Chain

相当于以上两者的结合,可以转向其他的Action同事保持http内


5.3 其他的Result


5.4 小结