ActionSupport类和Struts2 请求的扩展名问题

来源:互联网 发布:全民超神刷钻石软件 编辑:程序博客网 时间:2024/05/22 00:25
 面向对象面向君,不负代码不负卿。 *^o^*

一、ActionSupport

*1). ActionSupport 是默认的 Action 类: 若某个 action 节点没有配置 class 属性, 则 ActionSupport 即为
待执行的 Action 类. 而 execute 方法即为要默认执行的 action 方法*

<action name="testActionSupport">    <result>/testActionSupport.jsp</result></action>

等同于

<action name="testActionSupport"    class="com.opensymphony.xwork2.ActionSupport"    method="execute">    <result>/testActionSupport.jsp</result></action>

2). 在手工完成字段验证, 显示错误消息, 国际化等情况下, 推荐继承 ActionSupport.

二、关于 Struts2 请求的扩展名问题

*1). org.apache.struts2 包下的 default.properties 中配置了 Struts2 应用个的一些常量
2). struts.action.extension 定义了当前 Struts2 应用可以接受的请求的扩展名.
3). 可以在 struts.xml 文件中以常量配置的方式修改 default.properties 所配置的常量.*

<constant name="struts.action.extension" value="action,do,"></constant>
   大牛,别默默看了。快登陆帮我评论吧! *^o^*
原创粉丝点击