零散知识收集

来源:互联网 发布:mac卡了怎么强制关机 编辑:程序博客网 时间:2024/05/01 21:07

    SUCCESS在接口com.opensymphony.xwork2.Action中定义,另外同时定义的还有ERROR, INPUT, LOGIN, NONE。

 

    值得一提的是Struts 2.0中的result不仅仅是Struts 1.x中forward的别名,它可以实现除forward外的很激动人心的功能,如将Action输出到FreeMaker模板、Velocity模板、JasperReports和使用XSL转换等。这些都过result里的type(类型)属性(Attribute)定义的。

 

   在STRUTS2中获得其他对象:

HttpServletRequest request = ServletActionContext.getRequest();
HttpServletResponse response = ServletActionContext.getResponse();
HttpSession session = request.getSession();

   devMode模式是开发模式,开启它则默认开启了i18n.reload、configuration.xml.reload。
   下面是4个开发模式常用配置的简介---
    <!-- 开启使用开发模式,详细错误提示 -->
    <!-- <constant name="struts.devMode" value="true"/>-->
    <!-- 指定每次请求到达,重新加载资源文件 -->
    <!-- <constant name="struts.i18n.reload" value="true"/>-->
    <!-- 指定每次配置文件更改后,自动重新加载 -->
    <!-- <constant name="struts.configuration.xml.reload" value="true"/>-->
    <!-- 指定XSLT Result使用样式表缓存 -->
    <!-- <constant name="struts.xslt.nocache" value="true"/>-->

原创粉丝点击