常用的constant常量设置

本文详细介绍了Struts2框架中常用的常量配置项,包括编码格式、开发模式、热加载、动态方法调用、国际化资源文件配置等,帮助开发者理解和调整Struts2的行为。
  1.                       常用的constant常量设置

<struts>

    <!-- 编码格式-->

    <constant name="struts.i18n.encoding" value="UTF-8" />

    <!-- 把它设置为开发模式,发布时要设置为false -->

    <constant name="struts.devMode" value="true" />

    <!-- 设置在class被修改时是否热加载,发布时要设置为false -->

    <constant name="struts.convention.classes.reload" value="true"/>

    <!-- 自动动态方法的调用,使用这个设置后可以这样调用:action!method -->

    <constant name="struts.enable.DynamicMethodInvocation" value="true" />

    <!-- 指定jsp文件所在的目录地址 -->

    <constant name="struts.convention.result.path" value="/WEB-INF/content/" />

    <!-- 使用struts-default默认的转换器,如果是rest的使用:rest-default,rest需要rest的jar插件 -->

    <constant name="struts.convention.default.parent.package" value="struts-default"/>

    <!-- 用于配置包名后缀。默认为action、actions、struts-->

    <constant name="struts.convention.package.locators" value="actions" />

    <!-- 用于配置类名后缀,默认为Action,设置后,Struts2只会去找这种后缀名的类做映射 -->

    <constant name="struts.convention.action.suffix" value="Action"/>

    <!-- 设置即使没有@Action注释,依然创建Action映射。默认值是false。因为Convention-Plugin是约定优于配置的风格,可以不通过注解根据预先的定义就能访问相应Action中的方法 -->

    <constant name="struts.convention.action.mapAllMatches" value="true"/>

    <!-- 自定义jsp文件命名的分隔符 -->

<constant name="struts.convention.action.name.separator" value="-" />

 

    <!-- 国际化资源文件名称 -->

    <constant name="struts.custom.i18n.resources" value="i18n" />

    <!-- 是否自动加载国际化资源文件  -->

    <constant name="struts.i18n.reload" value="true" />

    <!-- 浏览器是否缓存静态内容 -->

    <constant name="struts.serve.static.browserCache" value="false" />

     <!-- 上传文件大小限制设置 -->

    <constant name="struts.multipart.maxSize" value="-1" />

    <!-- 主题,将值设置为simple,即不使用UI模板。这将不会生成额外的html标签 -->

    <constant name="struts.ui.theme" value="simple" />

</struts>

restful restful所需要的jar包 ========================================= Restlet, a RESTful Web framework for Java ========================================= http://www.restlet.org ----------------------------------------- Native REST support * Core REST concepts have equivalent Java classes (UniformInterface, Resource, Representation, Connector for example). * Suitable for both client-side and server-side web applications. The innovation is that that it uses the same API, reducing the learning curve and the software footprint. * Restlet-GWT module available, letting you leverage the Restlet API from within any Web browser, without plugins. * Concept of "URIs as UI" supported based on the URI Templates standard. This results in a very flexible yet simple routing with automatic extraction of URI variables into request attributes. * Tunneling service lets browsers issue any HTTP method (PUT, DELETE, MOVE, etc.) through a simple HTTP POST. This service is transparent for Restlet applications. Complete Web Server * Static file serving similar to Apache HTTP Server, with metadata association based on file extensions. * Transparent content negotiation based on client preferences. * Conditional requests automatically supported for resources. * Remote edition of files based on PUT and DELETE methods (aka mini-WebDAV mode). * Decoder service transparently decodes compressed or encoded input representations. This service is transparent for Restlet applications. * Log service writes all accesses to your applications in a standard Web log file. The log format follows the W3C Extended Log File Format and is fully customizable. * Powerful URI based redirection support similar to Apache Rewrite module. Available Connectors * Multiple server HTTP connectors available, based on either Mortbay's Jetty or the Simple framework or Grizzly NIO framework. * AJP server connector available to let you plug behind an Apache HTT
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值