RSS
热门关键字:  java  Ajax  JSP  JSF  Struts
当前位置 : 首页>Struts>列表

Starting Struts2-Core Components(3)

来源: 作者: 时间:2007-08-14 点击:

 

1<result-types>
2    <result-type name="dispatcher" default="true"
3        class="….dispatcher.ServletDispatcherResult"/>
4    <result-type name="redirect"
5        class="….dispatcher.ServletRedirectResult"/>
6    …
7</result-types>

 

Implementing Result Types

与拦截器相似,它可能创建出你自己的结果类型并将它们配置到你的WEB应用中.一些常用的结果类型已经存在,所以,在你创建自己的之前,你应该先看看你想创建的类型是否已经存在.

为了创建一个新的结果类型,实现Result接口即可.

1public interface Result extends Serializable {
2    public void execute(ActionInvocation invocation) throws Exception;
3}

 

ActionInvocation对象提供了对运行环境的访问,允许一个新的结果类型访问来自刚刚运行的action的信息,也可以访问执行action的上下文.上下文包括了HttpServletRequest对象,可提供对当前请求的输出流的访问.

共4页: 上一页 [1] [2] [3] 4 下一页
最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册
Google Adsense
相关文章