[Struts2官方指南的个人学习和翻译] Struts2的配置文件

实战指南:在UE5中高效集成Entt(ECS)框架 本文提供了一份在虚幻引擎5中高效集成Entt ECS框架的实战指南。针对UE5项目在处理大规模动态实体时的性能瓶颈,详细讲解了如何通过数据驱动的ECS架构进行优化。内容包括前期环境准备、核心构建步骤、创建首个ECS子系统以及与UE原生系统的数据同步技巧,旨在帮助开发者快速掌握集成方法,提升游戏逻辑的执行效率。 阅读详情

从一个struts开发者的角度来看, 必须要关注的一个配置文件是 web.xml。 在这里,你可以控制整个struts框架和你的应用的配置. 默认的情况下, Struts 会加载一些内置的配置文件来配置自己, 然后用另外的配置文件来配置你的应用,尽管可能不需要编写除了web.xml以外的配置文件就可以开发一个struts应用。

你可以使用下列表格中的配置文件来配置你的struts应用. 有些配置文件可以被动态的加载. See Reloading configuration for more.

File

Optional

Location (relative to webapp)

Purpose

web.xml

no

/WEB-INF/

Web deployment descriptor to include all necessary framework components

包含了所有框架需要的组件的web配置文件

struts.xml

yes

/WEB-INF/classes/

Main configuration, contains result/view types, action mappings, interceptors, and so forth 

主配置文件,包含了 result/view types, action mappings, interceptors等

struts.properties

yes

/WEB-INF/classes/

Framework properties

框架的参数

struts-default.xml

yes

/WEB-INF/lib/struts2-core.jar

Default configuration provided by Struts

Struts提供的默认配置文件

struts-default.vm

yes

/WEB-INF/classes/

Default macros referenced by velocity.properties

struts-plugin.xml

yes

At the root of a plugin JAR

Optional configuration files for Plugins in the same format as struts.xml.

可选的插件配置文件,格式如同struts.xml

velocity.properties

yes

/WEB-INF/classes/

Override the default Velocity configuration

Static Content

框架需要一些常用的静态组件 (JavaScript ,CSS 等等) 来为FilterDispatcher 过滤器服务. Any request starting with "/struts/" denotes that static content is required, and then mapping the value after "/struts/" to common packages in the framework and, optionally in the application's class path.

默认的, 将在下列的包中寻找:

  • org.apache.struts2.static
  • template

额外的包可以在配置文件中名为"packages"的参数列表中添加 (在 web.xml 为 FilterDispatcher 过滤器配置). 当添加额外的静态组件时, 要注意不要暴露了敏感的配置信息 (如数据库的密码).


Web.xml配置文件是Java Web应用的核心, 所以同样也是struts框架的核心.在web.xml中, Struts 定义了自己的过滤器 FilterDispatcher,这个Servlet Filter 类用来初始化Struts框架和处理所有请求. 这个过滤器可以包含一些初始化参数,来表明哪些额外的配置文件需要被加载,框架该有哪些行为等等。

除了FilterDispatcher, Struts 还提供了一个ActionContextCleanUp 类,当其他过滤器(如那些Sitemesh所使用的)需要访问一个已经初始化的struts框架时候,用来执行特殊的清理任务。

Key Initialization Parameters

    • config -  一个用逗号隔开的列表表示需要被加载的xml文件

    • actionPackages - 一个用逗号隔开的列表表示action需要用到的java包.

    • configProviders - 一个用逗号隔开的列表表示实现了ConfigurationProvider 接口的java类,that should be used for building the Configuration.

    • loggerFactory    -  实现LoggerFactory接口的类的名字.

    • * - 其他表示框架的常量的参数.

    Simple Example

    为struts配置为web.xml中关键的一点是添加一个过滤器和其映射关系。

    FilterDispatcher Example (web.xml)
    < web-app id="WebApp_9" version="2.4"
     
         < filter >
             < filter-name >struts2</ filter-name >
             < filter-class >org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</ filter-class >
             < init-param >
                 < param-name >actionPackages</ param-name >
                 < param-value >com.mycompany.myapp.actions</ param-value >
             </ init-param >
         </ filter >
     
         < filter-mapping >
             < filter-name >struts2</ filter-name >
             < url-pattern >/*</ url-pattern >
         </ filter-mapping >
     
         <!-- ... -->
     
    </ web-app >

    Changed Filter Structure in Struts >= 2.1.3

    Icon

    为了划分dispatcher阶段,FilterDispatcher 在Struts 2.1.3版本后就不再使用了. 如果你使用的是版本,应该这样使用:

    ...
    < filter >
         < filter-name >struts2</ filter-name >
         < filter-class >org.apache.struts2.dispatcher.FilterDispatcher</ filter-class >
    ...

    See SiteMesh Plugin for an example on when to use seperate Filters for prepare and execution phase

    Why the Filter is mapped with /* and how to configure explicit exclusions (since 2.1.7)

    Icon

    在上例中,我们为Struts 2 dispatcher映射为” /*", 则 Struts 2 会处理所有请求. 这是因为Struts 2 使用自己的jar包来提供静态组件服务, 包括 Dojo JavaScript 文件 (如果使用S2.0, 或者 S2.1版本之后的Dojo插件) 和 FreeMarker 模块为struts2标签生成html文件。

    如果将过滤器的映射改为其他如 /*.html, we must take this in to account and extract the content that would normally be served from the Struts 2 jar files, or some other solution.

    Since Struts 2.1.7, you are able to provide a comma seperated list of patterns for which when matching against the
    request URL the Filter will just pass by. This is done via the configuration option struts.action.excludePattern, for example in your struts.xml

    < struts >
         < constant name="struts.action.excludePattern" value=".*unfiltered.*,.*\\.nofilter"/>
         ...
     
    </ struts >

    Taglib Example

    通常情况下,不需要也不推荐配置一个标签库. 标签库已经被包含在 struts-core.jar中, 容器将会自动寻找到它.

    (tick) 如果因为一些原因需要在web.xml中配置一个标签库, 将TLD文件从META-INF文件中的 struts-core.jar 中提取出来, 然后在web.xml文件中添加一个taglib标记

         <!-- ... -->
         </ welcome-file-list >
     
         < taglib >
            < taglib-uri >/s</ taglib-uri >
            < taglib-location >/WEB-INF/struts-tags.tld</ taglib-location >
         </ taglib >
    </ web-app >

    Custom FileManager and FileManagerFactory implementations

    如果需要支持应用服务器中的特殊文件系统(如 JBoss中的VFS), 你使用自己的FileManager接口的实现类. 但必须在整个框架初始化前配置它。

    使用 <init-param/>标记来使用自己的FileManager接口的实现类,如下:

    < filter >
          < filter-name >struts2</ filter-name >
          < filter-class >org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</ filter-class >
          < init-param >
              < param-name >struts.fileManager</ param-name >
              < param-value >com.company.MyFileManager</ param-value >
          </ init-param >
    </ filter >

    使用 <init-param/>标记来使用自己的FileManagerFactory实现类, 如:

    < filter >
          < filter-name >struts2</ filter-name >
          < filter-class >org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</ filter-class >
          < init-param >
              < param-name >struts.fileManagerFactory</ param-name >
              < param-value >com.company.MyFileManagerFactory</ param-value >
          </ init-param >
    </ filter >

    去看看默认的实现类 - DefaultFileManager.java 和 DefaultFileManagerFactory.java 来了解更多。


    Struts框架的核心配置文件是默认的 struts.xml文件,应该将它放在web项目的class路径之下 (通常为 /WEB-INF/classes).

    • 默认的配置文件会包含其它需要的配置文件。
    •  struts-plugin.xml 文件可以放置在一个JAR文件中,应用会自动将其安装。所以一个模块可以是独立的,自动配置的。.
      • I如 Freemarker 和 Velocity 模块, 会自动从classpath中载入,所以一个模块可以独立写成一个JAR包.
      Q:可以将一个struts.xml分成几个模块吗?

      A:可以,有两种方法。

           1.使用<include>标记来引用另外的配置文件,会按先后顺序加载。

           2.使用JAR包。一个模块会被加载至应用里,通过在JAR包里放置一个struts.xml,然后将JAR包放在classpath路径下。


    (tick) 所有的properties文件都可以用XML文件中的<constant>标记来表示.

    Struts使用了一些properties文件,它们可以根据你的需要修改。当修改任何的properties时, 只需要在struts.properties文件中指定他的键和值。properties文件 可以放在classpath里的任意地方,通常放在/WEB-INF/classes之下。


    struts-default.properties
    ### Struts default properties
    ###(can be overridden by a struts.properties file in the root of the classpath)
    ###
     
    ### This can be used to set your default locale and encoding scheme
    # struts.locale=en_US
    struts.i18n.encoding=UTF-8
     
    ### if specified, the default object factory can be overridden here
    ### Note: short-hand notation is supported in some cases, such as "spring"
    ###       Alternatively, you can provide a com.opensymphony.xwork2.ObjectFactory subclass name here
    # struts.objectFactory = spring
     
    ### specifies the autoWiring logic when using the SpringObjectFactory.
    ### valid values are: name, type, auto, and constructor (name is the default)
    struts.objectFactory.spring.autoWire = name
     
    ### indicates to the struts-spring integration if Class instances should be cached
    ### this should, until a future Spring release makes it possible, be left as true
    ### unless you know exactly what you are doing!
    ### valid values are: true, false (true is the default)
    struts.objectFactory.spring.useClassCache = true
     
    ### ensures the autowire strategy is always respected.
    ### valid values are: true, false (false is the default)
    struts.objectFactory.spring.autoWire.alwaysRespect = false
     
    ### By default SpringObjectFactory doesn't support AOP
    ### This flag was added just temporally to check if nothing is broken
    struts.objectFactory.spring.enableAopSupport = false
     
    ....

     Struts2.jar中包含了一个基本的配置文件 struts-default.xml. 它会被自动添加进struts.xml中,来提供标准的配置设置。

    Icon

    To exclude the struts-default.xml or to provide your own version, see the struts.configuration.files setting in struts.properties.

    struts-default.xml 的部分内容:

    <? xml version="1.0" encoding="UTF-8" ?>

    <!DOCTYPE struts PUBLIC
         "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
     
    < struts >
     
         < constant name="struts.excludedClasses"
                   value="
                     java.lang.Object,
                     java.lang.Runtime,
                     java.lang.System,
                     java.lang.Class,
                     java.lang.ClassLoader,
                     java.lang.Shutdown,
                     ognl.OgnlContext,
                     ognl.MemberAccess,
                     ognl.ClassResolver,
                     ognl.TypeConverter,
                     com.opensymphony.xwork2.ActionContext" />
         <!-- this must be valid regex, each '.' in package name must be escaped! -->
         < constant name="struts.excludedPackageNamePatterns" value="^java\.lang\..*,^ognl.*,^(?!javax\.servlet\..+)(javax\..+)" />
     
         < bean class="com.opensymphony.xwork2.ObjectFactory" name="struts"/>
         < bean type="com.opensymphony.xwork2.factory.ResultFactory" name="struts" class="org.apache.struts2.factory.StrutsResultFactory" />
         .
    .
    .
         < bean type="com.opensymphony.xwork2.security.ExcludedPatternsChecker" name="struts" class="com.opensymphony.xwork2.security.DefaultExcludedPatternsChecker" scope="default" />
         < bean type="com.opensymphony.xwork2.security.AcceptedPatternsChecker" name="struts" class="com.opensymphony.xwork2.security.DefaultAcceptedPatternsChecker" scope="default" />
     
         < 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="postback" class="org.apache.struts2.dispatcher.PostbackResult" />
             </ result-types >
     
             < interceptors >
                 < interceptor name="alias" class="com.opensymphony.xwork2.interceptor.AliasInterceptor"/>
                 < interceptor name="autowiring" class="com.opensymphony.xwork2.spring.interceptor.ActionAutowiringInterceptor"/>
                 < interceptor name="chain" class="com.opensymphony.xwork2.interceptor.ChainingInterceptor"/>
                 ....
                 < interceptor name="annotationWorkflow" class="com.opensymphony.xwork2.interceptor.annotations.AnnotationWorkflowInterceptor" />
                 < interceptor name="multiselect" class="org.apache.struts2.interceptor.MultiselectInterceptor" />
                 < interceptor name="deprecation" class="org.apache.struts2.interceptor.DeprecationInterceptor" />
     
                 <!-- Basic stack -->
                 < interceptor-stack name="basicStack">
                     < interceptor-ref name="exception"/>
                     < interceptor-ref name="servletConfig"/>
                     < interceptor-ref name="prepare"/>
                     < interceptor-ref name="checkbox"/>
                     < interceptor-ref name="datetime"/>
                     < interceptor-ref name="multiselect"/>
                     < interceptor-ref name="actionMappingParams"/>
                     < interceptor-ref name="params">
                         < param name="excludeParams">^action:.*,^method:.*</ param >
                     </ interceptor-ref >
                     < interceptor-ref name="conversionError"/>
                     < interceptor-ref name="deprecation"/>
                 </ interceptor-stack >
     
                 <!-- Sample validation and workflow stack -->
                 < interceptor-stack name="validationWorkflowStack">
                     < interceptor-ref name="basicStack"/>
                     < interceptor-ref name="validation"/>
                     < interceptor-ref name="workflow"/>
                 </ interceptor-stack >
     
                ....其他拦截器栈
                 < interceptor-stack name="completeStack">
                     < interceptor-ref name="defaultStack"/>
                 </ interceptor-stack >
     
                 <!-- Sample execute and wait stack.
                      Note: execAndWait should always be the *last* interceptor. -->
                 < 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 >
     
            </ interceptors >
     
             < default-interceptor-ref name="defaultStack"/>
     
             < default-class-ref class="com.opensymphony.xwork2.ActionSupport" />
         </ package >
     
    </ struts >

    文件中定义了所有默认的results 和 interceptors,还有  interceptor stacks 。注意package的name为"struts-default".



    struts-default.properties
    ### Struts default properties
    ###(can be overridden by a struts.properties file in the root of the classpath)
    ###
     
    ### This can be used to set your default locale and encoding scheme
    # struts.locale=en_US
    struts.i18n.encoding=UTF-8
     
    ### if specified, the default object factory can be overridden here
    ### Note: short-hand notation is supported in some cases, such as "spring"
    ###       Alternatively, you can provide a com.opensymphony.xwork2.ObjectFactory subclass name here
    # struts.objectFactory = spring
     
    ### specifies the autoWiring logic when using the SpringObjectFactory.
    ### valid values are: name, type, auto, and constructor (name is the default)
    struts.objectFactory.spring.autoWire = name
     
    ### indicates to the struts-spring integration if Class instances should be cached
    ### this should, until a future Spring release makes it possible, be left as true
    ### unless you know exactly what you are doing!
    ### valid values are: true, false (true is the default)
    struts.objectFactory.spring.useClassCache = true
     
    ### ensures the autowire strategy is always respected.
    ### valid values are: true, false (false is the default)
    struts.objectFactory.spring.autoWire.alwaysRespect = false
     
    ### By default SpringObjectFactory doesn't support AOP
    ### This flag was added just temporally to check if nothing is broken
    struts.objectFactory.spring.enableAopSupport = false
     
    ### if specified, the default object type determiner can be overridden here
    ### Note: short-hand notation is supported in some cases, such as "tiger" or "notiger"
    ###       Alternatively, you can provide a com.opensymphony.xwork2.util.ObjectTypeDeterminer implementation name here
    ### Note: By default, com.opensymphony.xwork2.util.DefaultObjectTypeDeterminer is used which handles type detection
    ###       using generics. com.opensymphony.xwork2.util.GenericsObjectTypeDeterminer was deprecated since XWork 2, it's
    ###       functions are integrated in DefaultObjectTypeDeterminer now.
    ###       To disable tiger support use the "notiger" property value here.
    #struts.objectTypeDeterminer = tiger
    #struts.objectTypeDeterminer = notiger
     
    ........
    struts-default.properties
    ### Struts default properties
    ###(can be overridden by a struts.properties file in the root of the classpath)
    ###
     
    ### This can be used to set your default locale and encoding scheme
    # struts.locale=en_US
    struts.i18n.encoding=UTF-8
     
    ### if specified, the default object factory can be overridden here
    ### Note: short-hand notation is supported in some cases, such as "spring"
    ###       Alternatively, you can provide a com.opensymphony.xwork2.ObjectFactory subclass name here
    # struts.objectFactory = spring
     
    ### specifies the autoWiring logic when using the SpringObjectFactory.
    ### valid values are: name, type, auto, and constructor (name is the default)
    struts.objectFactory.spring.autoWire = name
     
    ### indicates to the struts-spring integration if Class instances should be cached
    ### this should, until a future Spring release makes it possible, be left as true
    ### unless you know exactly what you are doing!
    ### valid values are: true, false (true is the default)
    struts.objectFactory.spring.useClassCache = true
     
    ### ensures the autowire strategy is always respected.
    ### valid values are: true, false (false is the default)
    struts.objectFactory.spring.autoWire.alwaysRespect = false
     
    ### By default SpringObjectFactory doesn't support AOP
    ### This flag was added just temporally to check if nothing is broken
    struts.objectFactory.spring.enableAopSupport = false
     
    ### if specified, the default object type determiner can be overridden here
    ### Note: short-hand notation is supported in some cases, such as "tiger" or "notiger"
    ###       Alternatively, you can provide a com.opensymphony.xwork2.util.ObjectTypeDeterminer implementation name here
    ### Note: By default, com.opensymphony.xwork2.util.DefaultObjectTypeDeterminer is used which handles type detection
    ###       using generics. com.opensymphony.xwork2.util.GenericsObjectTypeDeterminer was deprecated since XWork 2, it's
    ###       functions are integrated in DefaultObjectTypeDeterminer now.
    ###       To disable tiger support use the "notiger" property value here.
    #struts.objectTypeDeterminer = tiger
    #struts.objectTypeDeterminer = notiger
     
    ### Parser to handle HTTP POST requests, encoded using the MIME-type multipart/form-data
    # struts.multipart.parser=cos
    # struts.multipart.parser=pell
    # struts.multipart.parser=jakarta-stream
    struts.multipart.parser=jakarta
    # uses javax.servlet.context.tempdir by default
    struts.multipart.saveDir=
    struts.multipart.maxSize=2097152
     
    ### Load custom property files (does not override struts.properties!)
    # struts.custom.properties=application,org/apache/struts2/extension/custom
     
    ### How request URLs are mapped to and from actions
    #struts.mapper.class=org.apache.struts2.dispatcher.mapper.DefaultActionMapper
     
    ### Used by the DefaultActionMapper
    ### You may provide a comma separated list, e.g. struts.action.extension=action,jnlp,do
    ### The blank extension allows you to match directory listings as well as pure action names
    ### without interfering with static resources, which can be specified as an empty string
    ### prior to a comma e.g. struts.action.extension=, or struts.action.extension=x,y,z,,
    struts.action.extension=action,,
     
    ### Used by FilterDispatcher
    ### If true then Struts serves static content from inside its jar.
    ### If false then the static content must be available at <context_path>/struts
    struts.serve.static=true
     
    ### Used by FilterDispatcher
    ### This is good for development where one wants changes to the static content be
    ### fetch on each request.
    ### NOTE: This will only have effect if struts.serve.static=true
    ### If true -> Struts will write out header for static contents such that they will
    ###             be cached by web browsers (using Date, Cache-Content, Pragma, Expires)
    ###             headers).
    ### If false -> Struts will write out header for static contents such that they are
    ###            NOT to be cached by web browser (using Cache-Content, Pragma, Expires
    ###            headers)
    struts.serve.static.browserCache=true
     
    ### Set this to false if you wish to disable implicit dynamic method invocation
    ### via the URL request. This includes URLs like foo!bar.action, as well as params
    ### like method:bar (but not action:foo).
    ### An alternative to implicit dynamic method invocation is to use wildcard
    ### mappings, such as <action name="*/*" method="{2}" class="actions.{1}">
    struts.enable.DynamicMethodInvocation = false
     
    ### Set this to true if you wish to allow slashes in your action names.  If false,
    ### Actions names cannot have slashes, and will be accessible via any directory
    ### prefix.  This is the traditional behavior expected of WebWork applications.
    ### Setting to true is useful when you want to use wildcards and store values
    ### in the URL, to be extracted by wildcard patterns, such as
    ### <action name="*/*" method="{2}" class="actions.{1}"> to match "/foo/edit" or
    ### "/foo/save".
    struts.enable.SlashesInActionNames = false
     
    ### Disables support for action: prefix
    struts.mapper.action.prefix.enabled = false
     
    ### Blocks access to actions in other namespace than current with action: prefix
    struts.mapper.action.prefix.crossNamespaces = false
     
    ### use alternative syntax that requires %{} in most places
    ### to evaluate expressions for String attributes for tags
    struts.tag.altSyntax=true
     
    ### when set to true, Struts will act much more friendly for developers. This
    ### includes:
    ### - struts.i18n.reload = true
    ### - struts.configuration.xml.reload = true
    ### - raising various debug or ignorable problems to errors
    ###   For example: normally a request to foo.action?someUnknownField=true should
    ###                be ignored (given that any value can come from the web and it
    ###                should not be trusted). However, during development, it may be
    ###                useful to know when these errors are happening and be told of
    ###                them right away.
    struts.devMode = false
     
    ### when set to true, resource bundles will be reloaded on _every_ request.
    ### this is good during development, but should never be used in production
    ### struts.i18n.reload=false
     
    ### Standard UI theme
    ### Change this to reflect which path should be used for JSP control tag templates by default
    struts.ui.theme=xhtml
    struts.ui.templateDir=template
    ### Change this to use a different token to indicate template theme expansion
    struts.ui.theme.expansion.token=~~~
    #sets the default template type. Either ftl, vm, or jsp
    struts.ui.templateSuffix=ftl
     
    ### Configuration reloading
    ### This will cause the configuration to reload struts.xml when it is changed
    ### struts.configuration.xml.reload=false
     
    ### Location of velocity.properties file.  defaults to velocity.properties
    struts.velocity.configfile = velocity.properties
     
    ### Comma separated list of VelocityContext classnames to chain to the StrutsVelocityContext
    struts.velocity.contexts =
     
    ### Location of the velocity toolbox
    struts.velocity.toolboxlocation=
     
    ### used to build URLs, such as the UrlTag
    struts.url.http.port = 80
    struts.url.https.port = 443
    ### possible values are: none, get or all
    struts.url.includeParams = none
     
    ### Load custom default resource bundles
    # struts.custom.i18n.resources=testmessages,testmessages2
     
    ### workaround for some app servers that don't handle HttpServletRequest.getParameterMap()
    ### often used for WebLogic, Orion, and OC4J
    struts.dispatcher.parametersWorkaround = false
     
    ### configure the Freemarker Manager class to be used
    ### Allows user to plug-in customised Freemarker Manager if necessary
    ### MUST extends off org.apache.struts2.views.freemarker.FreemarkerManager
    #struts.freemarker.manager.classname=org.apache.struts2.views.freemarker.FreemarkerManager
     
    ### Enables caching of FreeMarker templates
    ### Has the same effect as copying the templates under WEB_APP/templates
    ### struts.freemarker.templatesCache=false
     
    ### Enables caching of models on the BeanWrapper
    struts.freemarker.beanwrapperCache=false
     
    ### See the StrutsBeanWrapper javadocs for more information
    struts.freemarker.wrapper.altMap=true
     
    ### maxStrongSize for MruCacheStorage for freemarker, when set to 0 SoftCacheStorage which performs better in heavy loaded application
    ### check WW-3766 for more details
    struts.freemarker.mru.max.strong.size=0
     
    ### configure the XSLTResult class to use stylesheet caching.
    ### Set to true for developers and false for production.
    struts.xslt.nocache=false
     
    ### Whether to always select the namespace to be everything before the last slash or not
    struts.mapper.alwaysSelectFullNamespace=false
     
    ### Whether to allow static method access in OGNL expressions or not
    struts.ognl.allowStaticMethodAccess=false
     
    ### Whether to throw a RuntimeException when a property is not found
    ### in an expression, or when the expression evaluation fails
    struts.el.throwExceptionOnFailure=false
     
    ### Logs as Warnings properties that are not found (very verbose)
    struts.ognl.logMissingProperties=false
     
    ### Caches parsed OGNL expressions, but can lead to memory leaks
    ### if the application generates a lot of different expressions
    struts.ognl.enableExpressionCache=true
     
    ### Indicates if Dispatcher should handle unexpected exceptions by calling sendError()
    ### or simply rethrow it as a ServletException to allow future processing by other frameworks like Spring Security
    struts.handle.exception=true
    智能车图像处理21-进阶篇13--正入十字补线2 这篇文章主要的正入十字补线与1基本相同,主要防止图像中双十字的问题。 阅读详情

    相关推荐

    实战STM32G0驱动DRV8870/AT8870:PWM+DMA精准调速与H桥衰减模式详解

    本文详细介绍了如何使用STM32G0单片机结合DRV8870/AT8870电机驱动芯片实现直流有刷电机的精准控制。重点讲解了PWM与DMA结合实现高效调速的硬件配置与软件驱动方法,并深入剖析了H桥快衰减与慢衰减模式的工作原理及应用场景,为嵌入式电机控制项目提供了完整的实战解决方案。

    c7d8e9的博客 610

    Struts2与Spring集成中的自动装配策略

    自动装配即bean之间的依赖关系无需手动配置。 1.    与自动装配有关的配置 【org.apache.struts2.StrutsConstants类】 Ø // Spring应该如何装配。有效值:’name’, ’type’, ’auto’ 和’construtctor’。 STRUTS_OBJECTFACTORY_SPRING_AUTOWIRE Ø // 由S

    java学习开发 1070

    百元DIY手机荧光计:低成本荧光检测平台搭建与实战

    荧光检测是一种基于物质受特定波长光激发后发射更长波长荧光的分析技术,其核心原理在于光与物质的相互作用。通过选择性激发与检测,该技术能实现对痕量物质的高灵敏度、高特异性定量分析,在生物医学、环境监测和食品安全等领域具有重要价值。传统荧光分光光度计虽精度高,但成本昂贵、体积庞大且操作复杂,限制了其在现场快检和普及教育中的应用。本文聚焦于如何利用智能手机的高性能摄像头和处理器,结合低成本光学滤光片和LED光源,构建一个便携、经济的DIY荧光检测平台。该方案通过简化光路设计,采用带通滤光片进行波长选择,并利用图像处

    weixin_34194829的博客 318

    struts constant详解

    struts.serve.static.browserCache 该属性设置浏览器是否缓存静态内容。当应用处于开发阶段时,我们希望每次请求都获得服务器的最新响应,则可设置该属性为false。    其他常量

    asdz1989253jm的专栏 939

    薄膜电容寿命预测全解析:从理论到实践,5步搞定可靠性评估

    本文全面解析薄膜电容寿命预测的理论与实践,提供五步可靠性评估流程,涵盖温度应力、电压应力等关键因素分析,并分享提升寿命的实用技巧。特别适用于新能源、电动汽车等领域的设计工程师,帮助准确预测薄膜电容在实际工况下的使用寿命。

    weixin_33712987的博客 441

    Unity游戏开发实战:手把手教你用C#实现一个简单的反向运动学(IK)控制器

    本文详细介绍了在Unity游戏开发中如何使用C#实现一个简单的反向运动学(IK)控制器。通过建立骨骼层级结构、实现CCD算法和角度限制,开发者可以轻松创建自然的角色动画效果。文章还提供了可视化调试工具和性能优化方案,帮助提升开发效率。

    weixin_42523711的博客 247

    struts.xml配置文件详解

    Struts2框架的核心配置文件是struts.xml文件,该文件主要用来配置Action和请求间的对应关系。 一、&lt;package&gt;的配置 Struts2框架的核心组件是Action和拦截器,它使用包来管理Action和拦截器。每个包就是多个Action、多个拦截器、多个拦截器引用的集合。在struts.xml文件中,package元素用于定义包配置,package元素常用的属性...

    Java学习 6557

    基于AnimeGAN模型生成宫崎骏风格动漫照片

    用于动画风格纹理和线条转换的灰度样式丢失;新颖的颜色重建损失,以保留内容图像的颜色;新的灰度对抗损失防止生成的图像从显示为灰度图像;使用深度可分卷积和反向残块的轻量级生成器,以实现更快的传输。实验表明,AnimeGAN可以对真实世界的照片进行变换场景动画风格的图像与高质量的动画视觉效果和显著优于最先进的风格化方法。# 生成宫崎骏风格图片 model = hub . Module('animegan_v1_hayao_60' , use_gpu = True)images:输入的图片数据。

    CSDN 精品推荐 3636

    struts2设置了excludePattern报could not found action or re.错误

    相信如果找到我这里的时候应该已经看到了那个分析struts.action.excludePattern工作流程的文章 那我再说一次struts2 默认的拦截器是StrutsPrepareAndExecuteFilter执行过滤的是doFilter方法 圈住的区域是请求与白名单进行比对的方法。跳到它的方法处可以看到 和我们设置的正则比对的是getUri方法而这个方法会优先返回javax.ser

    TO TOP CODER 1898

    真题库系列之 CCF GESP 2025年12月认证 Python 1级真题含正确答案与解析

    学生通过计算机基础知识的学习,了解计算机的构成与操作,以及计算机的发 展历程。通过编程基础知识以及语句的掌握,可以独立完成简单功能的顺序结构、 分支结构、循环结构的程序。

    iCloudEnd的博客 335

    11.8 LangGraph生产级AI Agent开发:从节点定义到高并发架构的终极指南

    本文介绍了如何使用 LangGraph 构建生产级 AI Agent,重点解析了 LangGraph 的核心设计、节点与边的实现方法论、生产级实现技巧以及性能优化策略。LangGraph 通过图结构抽象复杂 AI 工作流,核心组件包括节点、边、状态和检查点。节点通过 Python 函数封装原子业务逻辑,边通过条件分支实现动态工作流。生产级实现技巧包括状态管理、多会话控制和错误处理机制。性能优化策略涉及并行执行和缓存机制设计。文章还提供了旅行规划 Agent 的实战案例和常见问题解决方案,帮助开发者构建高效、

    yonggeit的博客 3281

    struts2源码分析——配置

    之前为了解一个问题,把struts2的源码又大致过了一下。上次看源码还是几年签了,这次把它记录下来。               这篇文章先说一下struts2是怎么进行配置的。分两部分,一部分是日志,第二部分是其余配置。 一、日志配置               日志的配置主要流程如下图                  filterHostConfig通过filterCon

    guduyishuai的博客 510

    展锐平台wifi连接性问题解决方案

    对于断开连接的问题,需要从kernel log中确认下,是上 层主动发起的断开(会下发disconnect的命令),还是CP侧上报的断开事件。同学,别退出呀,我可是全网最牛逼的 WIFI/BT/GPS/NFC分析博主,我写了上百篇文章,请点击下面了解本专栏,进入本博主主页看看再走呗,一定不会让你后悔的,记得一定要去看主页置顶文章哦。1、出现wifi连接正常,但无法上网问题,首先确认其他手机是否可以正常上网,排除网络自身问题;3 路由器配置问题,出现过一个案例,恢复出场设置问题就解决了,具体根因。

    手机-手表蓝牙开发工程师的博客 2026

    [Struts2官方指南的个人学习和翻译] Struts2自带例子MailReader的学习

    漫谈 Struts 2 MailReader 应用开发过程   该文章通过讲述一个简单但功能齐全的应用开发过程来指导Struts2的初学者. 文章中包含了使用到的代码段, 但你最好在自己搭建一个服务器来运行MailReader应用.  该教程默认读者有一定的Java,JavaBeans,JSP,web应用开发的基础知识. 想了解底层的实现技术,请浏览 Key Technologies

    x1nyhh的专栏 1308

    汉书HE8,好用的汇编代码编写工具

    汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

    锂电池充电器电路设计 里面有电路

    锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

    struts2学习之道

    转载自:http://struts2.group.iteye.com/group/wiki/1306-struts2-way-of-learning 正确的学习方法不仅能够让你事半功倍,也能够让你更加接近真理。在这一系列的文章之初,我想首先说说学习一个开源框架的途径。这些学习方法,不仅适用于Struts2,我想同样适用于许多其他的开源框架,比如说Spring,Hibernate等

    rengq126的专栏 700

    IMSL CNL 7.0.0 (x86-64)Crack

    IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

    struts2 学习方法

    struts2 学习方法 正确的学习方法不仅能够让你事半功倍,也能够让你更加接近真理。在这一系列的文章之初,我想首先说说学习一个开源框架的途径。这些学习方法,不仅适用于Struts2,我想同样适用于许多其他的开源框架,比如说Spring,Hibernate等等。而这些学习方法,也是我个人的一些心得体会,希望对初学者或者正在为学习开源框架犯愁的朋友带来一些启示。  目

    lj94093的专栏 597

    Struts2-Json-Plugin 的使用(翻译自官方文档)

    原文地址:http://unmi.cc/struts2-json-plugin-guide 在 Struts2 中要使用 Ajax 获得 Json 数据我认为目前还是 struts2-json-plugin 了。当然你你可以用手工用像 XStream、Google Gson、Jackson 这样的工具手工把 Java 对象转换成 Json 字符串再写往 Response 去,要写的代

    王星乐的博客 800

    Struts 2 官方文档中文版

    最近正在学Struts 2 ,咱英文水平不行啊,找到了《Struts 2 官方文档中文版》,虽然翻译的不全,有总比没有强。 地址:https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=30743745 转载于:https://www.cnblogs.com/Xiao-Bing/p/6677653.html...

    Z03128943475的博客 935

    [Struts2官方指南的个人学习和翻译] Struts2的配置元素-请求处理元素

    -Interceptor  Interceptor(拦截器)将在一个action的方法执行之前或之后执行。多个Interceptor可以组成一个Interceptor Stack。 Registering Interceptors interceptors>   interceptor name="security" cla

    x1nyhh的专栏 341

    struts2原文件struts2-blank.war学习

    最近又在学习SSH框架,不间断的学习让自己对各个单独的框架又有了进一步的学习。现在学习的是struts2的源文件,在此和大家一起分享。(其实源文件才是我们学习一手资料呢!) 1.   首先下载struts-2.3.4.1-all.zip ,版本都可以。 2.   解压,打开,我们看到有apps,docs,lib,src四个文件夹,见名知意,我就不翻译了。这里我只看了apps里面的内

    keep innocent 3168

    [Struts2官方指南的个人学习和翻译] Struts2的配置元素-管理元素

    -Bean Strus2在内部使用一个独自的依赖注入容器,初始化时载入了框架的关键对象,使整个框架的任意模块可以被替换、继承、删除通过一个统一的标准方式。特别对于插件,可以利用这个方式来拓展框架,提供对第三方类库的支持。 Attribute Required Description class

    x1nyhh的专栏 414

    Struts2拦截器(翻译自Struts2官方网站)

    本文为本人翻译struts2的官方网站上的关于拦截器的说明文档,官方网站上的说明均是英文的,不方便热爱学习而英语又不太好的朋友。该说明文档地址是http://struts.apache.org/2.0.11/docs/interceptors.html。        许多的Struts2中的Action需要共享一些共用信息或者是模块,有些Action需要对输入进行验证,另外一些Action或许需

    程序人生的博客 5351

    第一个简单的程序——Struts 2 官方文档翻译(Struts 2官方文档中文版)

    这个教程旨在教大家如何如何安装框架和创建一个简单的程序 Struts 2框架用起来很简单,这个教程假设你已经掌握如下J2EE技术: Java Filters, JSP, and Tag Libraries JavaBeans HTML and HTTP Web Containers (such as Tomcat) XML Java需求 Struts 2 需要Serv

    半亩天堂 1586
    上一篇: [Struts2官方指南的个人学习和翻译] Struts2的配置元素-请求处理元素
    下一篇: [Struts2官方指南的个人学习和翻译] Struts2自带例子MailReader的学习
    x1nyhh
    博客等级 码龄12年 0粉丝 0原创
    评论
    成就一亿技术人!
    拼手气红包6.0元
    还能输入1000个字符
     
     条评论被折叠 查看
    添加红包

    请填写红包祝福语或标题

    个

    红包个数最小为10个

    元

    红包金额最低5元

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

    抵扣说明:

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

    余额充值