Struts2中有关struts-default.xml,struts.xml,struts.properties文件详解
1) struts-default.xml
这个文件是struts2框架默认加载的配置文件。它定义struts2一些核心的bean和拦截器。
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<!--struts2中工厂bean的定义-->
<bean class="com.opensymphony.xwork2.ObjectFactory" name="xwork" />
<bean type="com.opensymphony.xwork2.ObjectFactory" name="struts" class="org.apache.struts2.impl.StrutsObjectFactory" />
<bean type="com.opensymphony.xwork2.ActionProxyFactory" name="xwork" class="com.opensymphony.xwork2.DefaultActionProxyFactory"/>
<bean type="com.opensymphony.xwork2.ActionProxyFactory" name="struts" class="org.apache.struts2.impl.StrutsActionProxyFactory"/>
<!--类型检测bean的定义-->
<bean type="com.opensymphony.xwork2.util.ObjectTypeDeterminer" name="tiger" class="com.opensymphony.xwork2.util.GenericsObjectTypeDeterminer"/>
<bean type="com.opensymphony.xwork2.util.ObjectTypeDeterminer" name="notiger" class="com.opensymphony.xwork2.util.DefaultObjectTypeDeterminer"/>
<bean type="com.opensymphony.xwork2.util.ObjectTypeDeterminer" name="struts" class="com.opensymphony.xwork2.util.DefaultObjectTypeDeterminer"/>
<!--文件上传bean的定义-->
<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="struts" class="org.apache.struts2.dispatcher.mapper.DefaultActionMapper" />
<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="composite" class="org.apache.struts2.dispatcher.mapper.CompositeActionMapper" />
<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="restful" class="org.apache.struts2.dispatcher.mapper.RestfulActionMapper" />
<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="restful2" class="org.apache.struts2.dispatcher.mapper.Restful2ActionMapper" />
<bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest" name="struts" class="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest" scope="default" optional="true"/>
<bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest" name="jakarta" class="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest" scope="default" optional="true" />
<!--标签库bean的定义-->
<bean type="org.apache.struts2.views.TagLibrary" name="s" class="org.apache.struts2.views.DefaultTagLibrary" />
<!--一些常用视图bean的定义-->
<bean class="org.apache.struts2.views.freemarker.FreemarkerManager" name="struts" optional="true"/>
<bean class="org.apache.struts2.views.velocity.VelocityManager" name="struts" optional="true" />
<bean class="org.apache.struts2.components.template.TemplateEngineManager" />
<bean type="org.apache.struts2.components.template.TemplateEngine" name="ftl" class="org.apache.struts2.components.template.FreemarkerTemplateEngine" />
<bean type="org.apache.struts2.components.template.TemplateEngine" name="vm" class="org.apache.struts2.components.template.VelocityTemplateEngine" />
<bean type="org.apache.struts2.components.template.TemplateEngine" name="jsp" class="org.apache.struts2.components.template.JspTemplateEngine" />
<!--类型转换bean的定义-->
<bean type="com.opensymphony.xwork2.util.XWorkConverter" name="xwork1" class="com.opensymphony.xwork2.util.XWorkConverter" />
<bean type="com.opensymphony.xwork2.util.XWorkConverter" name="struts" class="com.opensymphony.xwork2.util.AnnotationXWorkConverter" />
<bean type="com.opensymphony.xwork2.TextProvider" name="xwork1" class="com.opensymphony.xwork2.TextProviderSupport" />
<bean type="com.opensymphony.xwork2.TextProvider" name="struts" class="com.opensymphony.xwork2.TextProviderSupport" />
<!-- Struts2中一些可以静态注入的bean,也就是不需要实例化的 -->
<bean class="com.opensymphony.xwork2.ObjectFactory" static="true" />
<bean class="com.opensymphony.xwork2.util.XWorkConverter" static="true" />
<bean class="com.opensymphony.xwork2.util.OgnlValueStack" static="true" />
<bean class="org.apache.struts2.dispatcher.Dispatcher" static="true" />
<bean class="org.apache.struts2.components.Include" static="true" />
<bean class="org.apache.struts2.dispatcher.FilterDispatcher" static="true" />
<bean class="org.apache.struts2.views.util.ContextUtil" static="true" />
<bean class="org.apache.struts2.views.util.UrlHelper" static="true" />
<!-- 定义Struts2默认包-->
<package name="struts-default" abstract="true">
<!-- 结果类型的种类-->
<result-types>
<result-type name="chain" class="com.opensymphony.xwork2.ActionChainResult"/>
<result-type name="dispatcher" class="org.apache.struts2.dispatcher.ServletDispatcherResult" default="true"/>
<result-type name="freemarker" class="org.apache.struts2.views.freemarker.FreemarkerResult"/>
<result-type name="httpheader" class="org.apache.struts2.dispatcher.HttpHeaderResult"/>
<result-type name="redirect" class="org.apache.struts2.dispatcher.ServletRedirectResult"/>
<result-type name="redirectAction" class="org.apache.struts2.dispatcher.ServletActionRedirectResult"/>
<result-type name="stream" class="org.apache.struts2.dispatcher.StreamResult"/>
<result-type name="velocity" class="org.apache.struts2.dispatcher.VelocityResult"/>
<result-type name="xslt" class="org.apache.struts2.views.xslt.XSLTResult"/>
<result-type name="plainText" class="org.apache.struts2.dispatcher.PlainTextResult" />
<result-type name="redirect-action" class="org.apache.struts2.dispatcher.ServletActionRedirectResult"/>
<result-type name="plaintext" class="org.apache.struts2.dispatcher.PlainTextResult" />
</result-types>
<!--struts2中拦截器的定义-->
<interceptors>
<!--实现在不同请求中相似参数别名的准换-->
<interceptor name="alias" class="com.opensymphony.xwork2.interceptor.AliasInterceptor"/>
<!--与Spring整合时自动装配的拦截器-->
<interceptor name="autowiring" class="com.opensymphony.xwork2.spring.interceptor.ActionAutowiringInterceptor"/>
<!--构建一个action链,使当前action可以访问前一个action,与<result-type="chain"
/>配合使用-->
<interceptor name="chain" class="com.opensymphony.xwork2.interceptor.ChainingInterceptor"/>
<!--负责类型转换的拦截器-->
<interceptor name="conversionError" class="org.apache.struts2.interceptor.StrutsConversionErrorInterceptor"/>
<!--使用配置的name,value来是指cookies -->
<interceptor name="cookie" class="org.apache.struts2.interceptor.CookieInterceptor"/>
<!--负责创建httpSession-->
<interceptor name="createSession" class="org.apache.struts2.interceptor.CreateSessionInterceptor" />
<!--输出调试信息-->
<interceptor name="debugging" class="org.apache.struts2.interceptor.debugging.DebuggingInterceptor" />
<!--扩展引用-->
<interceptor name="externalRef" class="com.opensymphony.xwork2.interceptor.ExternalReferencesInterceptor"/>
<!--后台执行action负责发送等待画面给用户-->
<interceptor name="execAndWait" class="org.apache.struts2.interceptor.ExecuteAndWaitInterceptor"/>
<!--异常处理-->
<interceptor name="exception" class="com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor"/>
<!--文件上传,解析表单域的内容-->
<interceptor name="fileUpload" class="org.apache.struts2.interceptor.FileUploadInterceptor"/>
<!--支持国际化-->
<interceptor name="i18n" class="com.opensymphony.xwork2.interceptor.I18nInterceptor"/>
<!--日志记录-->
<interceptor name="logger" class="com.opensymphony.xwork2.interceptor.LoggingInterceptor"/>
<!--模型拦截器,当action实现了ModelDriven接口时,负责把getModel的结果放入valueStack中-->
<interceptor name="modelDriven" class="com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor"/>
<!--有生命周期的ModelDriven-->
<interceptor name="scopedModelDriven" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor"/>
<!--负责解析请求中的参数,并赋值给action中对应的属性-->
<interceptor name="params" class="com.opensymphony.xwork2.interceptor.ParametersInterceptor"/>
<!--实现该Preparable接口的action,会调用拦截器的prepare方法-->
<interceptor name="prepare" class="com.opensymphony.xwork2.interceptor.PrepareInterceptor"/>
<!--负责将action 标签下的param参数值传递给action实例-->
<interceptor name="staticParams" class="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor"/>
<!--范围转换-->
<interceptor name="scope" class="org.apache.struts2.interceptor.ScopeInterceptor"/>
<!--用于访问Servlet API-->
<interceptor name="servletConfig" class="org.apache.struts2.interceptor.ServletConfigInterceptor"/>
<interceptor name="sessionAutowiring" class="org.apache.struts2.spring.interceptor.SessionContextAutowiringInterceptor"/>
<!--输出action执行时间-->
<interceptor name="timer" class="com.opensymphony.xwork2.interceptor.TimerInterceptor"/>
<!--防止表单重复提交-->
<interceptor name="token" class="org.apache.struts2.interceptor.TokenInterceptor"/>
<!--与token拦截器相似,只是把token保存到HttpSession-->
<interceptor name="tokenSession" class="org.apache.struts2.interceptor.TokenSessionStoreInterceptor"/>
<!--负责表单字段的验证 *-validation.xml-->
<interceptor name="validation" class="org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor"/>
<!--负责执行action的validate()-->
<interceptor name="workflow" class="com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor"/>
<!--存储和重新获取Action 消息/错误/字段错误为Action,实现ValidationAware接口到seesion-->
<interceptor name="store" class="org.apache.struts2.interceptor.MessageStoreInterceptor" />
<!--添加自动checkbox处理代码,这样检探测checkbox和添加它作为一个参数使用默认值(通常’false’).使用一个指定名字隐藏字段探测没提交的checkbox-->
<interceptor name="checkbox" class="org.apache.struts2.interceptor.CheckboxInterceptor" />
<interceptor name="profiling" class="org.apache.struts2.interceptor.ProfilingActivationInterceptor" />
<!--JAAS服务拦截器-->
<interceptor name="roles" class="org.apache.struts2.interceptor.RolesInterceptor" />
<!-- 一个基本的拦截器栈 -->
<interceptor-stack name="basicStack">
<interceptor-ref name="exception"/>
<interceptor-ref name="servletConfig"/>
<interceptor-ref name="prepare"/>
<interceptor-ref name="checkbox"/>
<interceptor-ref name="params"/>
<interceptor-ref name="conversionError"/>
</interceptor-stack>
<!-- 简单的validtion和webflow栈 -->
<interceptor-stack name="validationWorkflowStack">
<interceptor-ref name="basicStack"/>
<interceptor-ref name="validation"/>
<interceptor-ref name="workflow"/>
</interceptor-stack>
<!-- 文件上传的拦截器栈 -->
<interceptor-stack name="fileUploadStack">
<interceptor-ref name="fileUpload"/>
<interceptor-ref name="basicStack"/>
</interceptor-stack>
<!-- model-driven 栈 -->
<interceptor-stack name="modelDrivenStack">
<interceptor-ref name="modelDriven"/>
<interceptor-ref name="basicStack"/>
</interceptor-stack>
<!-- action链的拦截器栈 -->
<interceptor-stack name="chainStack">
<interceptor-ref name="chain"/>
<interceptor-ref name="basicStack"/>
</interceptor-stack>
<!-- i18n 拦截器栈 -->
<interceptor-stack name="i18nStack">
<interceptor-ref name="i18n"/>
<interceptor-ref name="basicStack"/>
</interceptor-stack>
<!-- 结合preparable和ModenDriven拦截器-->
<interceptor-stack name="paramsPrepareParamsStack">
<interceptor-ref name="exception"/>
<interceptor-ref name="alias"/>
<interceptor-ref name="params"/>
<interceptor-ref name="servletConfig"/>
<interceptor-ref name="prepare"/>
<interceptor-ref name="i18n"/>
<interceptor-ref name="chain"/>
<interceptor-ref name="modelDriven"/>
<interceptor-ref name="fileUpload"/>
<interceptor-ref name="checkbox"/>
<interceptor-ref name="staticParams"/>
<interceptor-ref name="params"/>
<interceptor-ref name="conversionError"/>
<interceptor-ref name="validation">
<param name="excludeMethods">input,back,cancel</param>
</interceptor-ref>
<interceptor-ref name="workflow">
<param name="excludeMethods">input,back,cancel</param>
</interceptor-ref>
</interceptor-stack>
<!--定义默认的拦截器栈 -->
<interceptor-stack name="defaultStack">
<interceptor-ref name="exception"/>
<interceptor-ref name="alias"/>
<interceptor-ref name="servletConfig"/>
<interceptor-ref name="prepare"/>
<interceptor-ref name="i18n"/>
<interceptor-ref name="chain"/>
<interceptor-ref name="debugging"/>
<interceptor-ref name="profiling"/>
<interceptor-ref name="scopedModelDriven"/>
<interceptor-ref name="modelDriven"/>
<interceptor-ref name="fileUpload"/>
<interceptor-ref name="checkbox"/>
<interceptor-ref name="staticParams"/>
<interceptor-ref name="params">
<param name="excludeParams">dojo/..*</param>
</interceptor-ref>
<interceptor-ref name="conversionError"/>
<interceptor-ref name="validation">
<param name="excludeMethods">input,back,cancel,browse</param>
</interceptor-ref>
<interceptor-ref name="workflow">
<param name="excludeMethods">input,back,cancel,browse</param>
</interceptor-ref>
</interceptor-stack>
<interceptor-stack name="completeStack">
<interceptor-ref name="defaultStack"/>
</interceptor-stack>
<interceptor-stack name="executeAndWaitStack">
<interceptor-ref name="execAndWait">
<param name="excludeMethods">input,back,cancel</param>
</interceptor-ref>
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="execAndWait">
<param name="excludeMethods">input,back,cancel</param>
</interceptor-ref>
</interceptor-stack>
<interceptor name="external-ref" class="com.opensymphony.xwork2.interceptor.ExternalReferencesInterceptor"/>
<interceptor name="model-driven" class="com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor"/>
<interceptor name="static-params" class="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor"/>
<interceptor name="scoped-model-driven" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor"/>
<interceptor name="servlet-config" class="org.apache.struts2.interceptor.ServletConfigInterceptor"/>
<interceptor name="token-session" class="org.apache.struts2.interceptor.TokenSessionStoreInterceptor"/>
</interceptors>
<!--定义默认拦截器为"defaultStack"-->
<default-interceptor-ref name="defaultStack"/>
</package>
</struts>
2) struts.xml
该文件也是struts2框架自动加载的文件,在这个文件中可以定义一些自己的action,interceptor,package等,该文件的package 通常继承struts-default包。下面是这个文件的格式。
struts.properties文件
<?xml version="1.0" encoding="GBK"?>
<!-- 下面指定Struts 2配置文件的DTD信息 -->
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<!-- struts是Struts 2配置文件的根元素 -->
<struts>
<!-- 下面元素可以出现0次,也可以无限多次 -->
<constant name="" value="" />
<!-- 下面元素可以出现0次,也可以无限多次 -->
<bean type="" name="" class="" scope="" static="" optional="" />
<!-- 下面元素可以出现0次,也可以无限多次 -->
<include file="" />
<!-- package元素是Struts配置文件的核心,该元素可以出现0次,或者无限多次 -->
<package name="必填的包名" extends="" namespace="" abstract=""
externalReferenceResolver>
<!-- 该元素可以出现,也可以不出现,最多出现一次 -->
<result-types>
<!-- 该元素必须出现,可以出现无限多次-->
<result-type name="" class="" default="true|false">
<!-- 下面元素可以出现0次,也可以无限多次 -->
<param name="参数名">参数值</param>*
</result-type>
</result-types>
<!-- 该元素可以出现,也可以不出现,最多出现一次 -->
<interceptors>
<!-- 该元素的interceptor元素和interceptor-stack至少出现其中之一,
也可以二者都出现 -->
<!-- 下面元素可以出现0次,也可以无限多次 -->
<interceptor name="" class="">
<!-- 下面元素可以出现0次,也可以无限多次 -->
<param name="参数名">参数值</param>*
</interceptor>
<!-- 下面元素可以出现0次,也可以无限多次 -->
<interceptor-stack name="">
<!-- 该元素必须出现,可以出现无限多次-->
<interceptor-ref name="">
<!-- 下面元素可以出现0次,也可以无限多次 -->
<param name="参数名">参数值</param>*
</interceptor-ref>
</interceptor-stack>
</interceptors>
<!-- 下面元素可以出现0次,也可以无限多次 -->
<default-interceptor-ref name="">
<!-- 下面元素可以出现0次,也可以无限多次 -->
<param name="参数名">参数值</param>
</default-interceptor-ref>
<!-- 下面元素可以出现0次,也可以无限多次 -->
<default-action-ref name="">
<!-- 下面元素可以出现0次,也可以无限多次 -->
<param name="参数名">参数值</param>*
</default-action-ref>?
<!-- 下面元素可以出现0次,也可以无限多次 -->
<global-results>
<!-- 该元素必须出现,可以出现无限多次-->
<result name="" type="">
<!-- 该字符串内容可以出现0次或多次 -->
映射资源
<!-- 下面元素可以出现0次,也可以无限多次 -->
<param name="参数名">参数值</param>*
</result>
</global-results>
<!-- 下面元素可以出现0次,也可以无限多次 -->
<global-exception-mappings>
<!-- 该元素必须出现,可以出现无限多次-->
<exception-mapping name="" exception="" result="">
异常处理资源
<!-- 下面元素可以出现0次,也可以无限多次 -->
<param name="参数名">参数值</param>*
</exception-mapping>
</global-exception-mappings>
<action name="" class="" method="" converter="">
<!-- 下面元素可以出现0次,也可以无限多次 -->
<param name="参数名">参数值</param>*
<!-- 下面元素可以出现0次,也可以无限多次 -->
<result name="" type="">
映射资源
<!-- 下面元素可以出现0次,也可以无限多次 -->
<param name="参数名">参数值</param>*
</result>
<!-- 下面元素可以出现0次,也可以无限多次 -->
<interceptor-ref name="">
<!-- 下面元素可以出现0次,也可以无限多次 -->
<param name="参数名">参数值</param>*
</interceptor-ref>
<!-- 下面元素可以出现0次,也可以无限多次 -->
<exception-mapping name="" exception="" result="">
异常处理资源
<!-- 下面元素可以出现0次,也可以无限多次 -->
<param name="参数名">参数值</param>*
</exception-mapping>
</action>
</package>*
<struts>

3) default.properties
这个文件是struts2框架的全局属性文件,也是自动加载的文件。该文件包含了系列的key-value对。该文件完全可以配置在struts.xml文件中,使用constant元素。下面是这个文件中一些常见的配置项及说明。


### 指定加载struts2配置文件管理器,默认为org.apache.struts2.config.DefaultConfiguration
### 开发者可以自定义配置文件管理器,该类要实现Configuration接口,可以自动加载struts2配置文件。
# struts.configuration=org.apache.struts2.config.DefaultConfiguration
### 设置默认的locale和字符编码
# struts.locale=en_US
struts.i18n.encoding=UTF-8

### 指定struts的工厂类
# struts.objectFactory = spring
### 指定spring框架的装配模式
### 装配方式有: name, type, auto, and constructor (name 是默认装配模式)
struts.objectFactory.spring.autoWire = name
### 该属性指定整合spring时,是否对bean进行缓存,值为true or false,默认为true.
struts.objectFactory.spring.useClassCache = true
### 指定类型检查
#struts.objectTypeDeterminer = tiger
#struts.objectTypeDeterminer = notiger
### 该属性指定处理 MIME-type multipart/form-data,文件上传
# struts.multipart.parser=cos
# struts.multipart.parser=pell
struts.multipart.parser=jakarta
# 指定上传文件时的临时目录,默认使用 javax.servlet.context.tempdir
struts.multipart.saveDir=
struts.multipart.maxSize=2097152
### 加载自定义属性文件 (不要改写struts.properties!)
# struts.custom.properties=application,org/apache/struts2/extension/custom
### 指定请求url与action映射器,»˜认为org.apache.struts2.dispatcher.mapper.DefaultActionMapper
#struts.mapper.class=org.apache.struts2.dispatcher.mapper.DefaultActionMapper
### 指定action的后缀,默认为action
struts.action.extension=action
### 被 FilterDispatcher使用
### 如果为 true 则通过jar文件提供静态内容服务.
### 如果为 false 则静态内容必须位于 <context_path>/struts
struts.serve.static=true
### 被 FilterDispatcher使用
### 指定浏览器是否缓存静态内容,测试阶段设置为false,发布阶段设置为true.
struts.serve.static.browserCache=true
### 设置是否支持动态方法调用,true为支持,false不支持.
struts.enable.DynamicMethodInvocation = true
### 设置是否可以在action中使用斜线,默认为false不可以,想使用需设置为true.
struts.enable.SlashesInActionNames = false
### 是否允许使用表达式语法,默认为true.
struts.tag.altSyntax=true

### 设置当struts.xml文件改动时,是否重新加载.
### - struts.configuration.xml.reload = true
### 设置struts是否为开发模式,默认为false,测试阶段一般设为true.
struts.devMode = false
### 设置是否每次请求,都重新加载资源文件,默认值为false.
struts.i18n.reload=false
###标准的UI主题
### 默认的UI主题为xhtml,可以为simple,xhtml或ajax
struts.ui.theme=xhtml
###模板目录
struts.ui.templateDir=template
#设置模板类型. 可以为 ftl, vm, or jsp
struts.ui.templateSuffix=ftl
###定位velocity.properties 文件. 默认 velocity.properties
struts.velocity.configfile = velocity.properties
### 设置velocity的context.
struts.velocity.contexts =
### 定位toolbox.
struts.velocity.toolboxlocation=
### 指定web应用的端口.
struts.url.http.port = 80
### 指定加密端口
struts.url.https.port = 443
### 设置生成url时,是否包含参数.值可以为: none, get or all
struts.url.includeParams = get
### 设置要加载的国际化资源文件,以逗号分隔.
# struts.custom.i18n.resources=testmessages,testmessages2
### 对于一些web应用服务器不能处理HttpServletRequest.getParameterMap()
### 像 WebLogic, Orion, and OC4J等,须设置成true,默认为false.
struts.dispatcher.parametersWorkaround = false
### 指定freemarker管理器
#struts.freemarker.manager.classname=org.apache.struts2.views.freemarker.FreemarkerManager
### 设置是否对freemarker的模板设置缓存
### 效果相当于把template拷贝到 WEB_APP/templates.
struts.freemarker.templatesCache=false
### 通常不需要修改此属性.
struts.freemarker.wrapper.altMap=true
### 指定xslt result是否使用样式表缓存.开发阶段设为true,发布阶段设为false.
struts.xslt.nocache=false
### 设置struts自动加载的文件列表.
struts.configuration.files=struts-default.xml,struts-plugin.xml,struts.xml
### 设定是否一直在最后一个slash之前的任何位置选定namespace.
struts.mapper.alwaysSelectFullNamespace=falseStruts2中有关struts-default.xml,struts.xml,struts.properties文件详解的更多相关文章
- web.xml文件详解
web.xml文件详解 Table of Contents 1 listener. filter.servlet 加载顺序 2 web.xml文件详解 3 相应元素配置 1 listener. f ...
- tomcat 加载顺序 web.xml文件详解
一. 1.启动一个WEB项目的时候,WEB容器会去读取它的配置文件web.xml,读取<listener>和<context-param>两个结点. 2.紧急着,容创建一个Se ...
- 史上最全的maven的pom.xml文件详解(转载)
此文出处:史上最全的maven的pom.xml文件详解——阿豪聊干货 <project xmlns="http://maven.apache.org/POM/4.0.0" x ...
- [转]Maven的pom.xml文件详解
Maven的pom.xml文件详解------Build Settings 2013年10月30日 13:04:01 阅读数:44678 根据POM 4.0.0 XSD,build元素概念性的划分为两 ...
- res文件夹及xml资源文件详解
目录 一.values文件:存放字符串(strings).颜色(colors).尺寸(dimens).数组(arrays).样式(styles类似于CSS文件).类型等资源 二.drawable:存放 ...
- [转]AndroidManifest.xml文件详解
转自:http://www.cnblogs.com/greatverve/archive/2012/05/08/AndroidManifest-xml.html AndroidManifest.xml ...
- Maven pom.xml文件详解
Maven pom.xml文件详解 一.简介 POM全称是Project Object Model,即项目对象模型. pom.xml是maven的项目描述文件,它类似与antx的project.xml ...
- javaweb web.xml文件详解
web.xml文件详解 前言:一般的web工程中都会用到web.xml,web.xml主要用来配置,可以方便的开发web工程.web.xml主要用来配置Filter.Listener.Servlet等 ...
- AndroidManifest.xml文件详解(uses-permission)
语法(SYNTAX): <uses-permissionandroid:name="string"/> 被包含于(CONTAINED IN): <manifest ...
随机推荐
- C#this的五种用法
this的五种用法: 1.使用被掩盖的成员变量: class AA { int a; public void set1(int a) { this.a = a;//right } public voi ...
- hdu 1262寻找素数对
Problem Description 哥德巴赫猜想大家都知道一点吧.我们现在不是想证明这个结论,而是想在程序语言内部能够表示的数集中,任意取出一个偶数,来寻找两个素数,使得其和等于该偶数. 做好了这 ...
- uva1587 Box
Ivan works at a factory that produces heavy machinery. He has a simple job -- he knocks up wooden bo ...
- 微信小程序开发工具 常用快捷键
格式调整 Ctrl+S:保存文件 Ctrl+[, Ctrl+]:代码行缩进 Ctrl+Shift+[, Ctrl+Shift+]:折叠打开代码块 Ctrl+C Ctrl+V:复制粘贴,如果没有选中任何 ...
- 痛并快乐的造轮子之旅:awk访问数据库之旅
俺是一枚悲催的数据统计程序员,从先辈的手里接收了这样的代码: #! /bin/sh alias statdb="mysql -h 192.168.1.1 -u stat -paaa stat ...
- SGU 194 Reactor Cooling
http://acm.sgu.ru/problem.php?contest=0&problem=194 题意:m条有向边,有上下界,求最大流. 思路:原图中有u-v low[i],high[i ...
- LeetCode_Wildcard Matching
Implement wildcard pattern matching with support for '?' and '*'. '?' Matches any single character. ...
- Win8.1 MSDN各版本下载(64位/32位,简体中文,繁体中文,英文),X86&X64,EN,CHS,CHT
英文64位ed2k://|file|en_windows_8_1_x64_dvd_2707217.iso|3899295744|8E604054013D21209B851E41DC19F6F5|/ 英 ...
- 可变参数列表-Java SE5新特性(转)
Java1.5增加了新特性:可变参数:适用于参数个数不确定,类型确定的情况,java把可变参数当做数组处理.注意:可变参数必须位于最后一项.当可变参数个数多于一个时,必将有一个不是最后一项,所以只支持 ...
- bzoj3431 [Usaco2014 Jan]Bessie Slows Down
Description [Brian Dean, 2014] Bessie the cow is competing in a cross-country skiing event at the wi ...