Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4D27B200497 for ; Wed, 23 Aug 2017 13:17:36 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4B622167584; Wed, 23 Aug 2017 11:17:36 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 97174162FBA for ; Wed, 23 Aug 2017 13:17:34 +0200 (CEST) Received: (qmail 13186 invoked by uid 500); 23 Aug 2017 11:17:32 -0000 Mailing-List: contact commits-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list commits@struts.apache.org Received: (qmail 13177 invoked by uid 99); 23 Aug 2017 11:17:32 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Aug 2017 11:17:32 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 22D7AE088D; Wed, 23 Aug 2017 11:17:32 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: git-site-role@apache.org To: commits@struts.apache.org Message-Id: <074bfa70127f4bf581f0ae1a35e58fdd@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: struts-site git commit: Updates production by Jenkins Date: Wed, 23 Aug 2017 11:17:32 +0000 (UTC) archived-at: Wed, 23 Aug 2017 11:17:36 -0000 Repository: struts-site Updated Branches: refs/heads/asf-site 40d302a8b -> 1b9b67fae Updates production by Jenkins Project: http://git-wip-us.apache.org/repos/asf/struts-site/repo Commit: http://git-wip-us.apache.org/repos/asf/struts-site/commit/1b9b67fa Tree: http://git-wip-us.apache.org/repos/asf/struts-site/tree/1b9b67fa Diff: http://git-wip-us.apache.org/repos/asf/struts-site/diff/1b9b67fa Branch: refs/heads/asf-site Commit: 1b9b67faea53d30d5eec096baa1449ae8fb2e3dd Parents: 40d302a Author: jenkins Authored: Wed Aug 23 11:17:30 2017 +0000 Committer: jenkins Committed: Wed Aug 23 11:17:30 2017 +0000 ---------------------------------------------------------------------- .../core-developers/configuration-files.html | 49 +-- content/core-developers/default-properties.html | 422 +++++++++++++++++++ content/core-developers/struts-xml.html | 33 +- content/core-developers/web-xml.html | 252 +++++------ 4 files changed, 544 insertions(+), 212 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/struts-site/blob/1b9b67fa/content/core-developers/configuration-files.html ---------------------------------------------------------------------- diff --git a/content/core-developers/configuration-files.html b/content/core-developers/configuration-files.html index f6d8082..2b6d14e 100644 --- a/content/core-developers/configuration-files.html +++ b/content/core-developers/configuration-files.html @@ -127,19 +127,14 @@ Edit on GitHub

Configuration Files

-

From a Struts developer point of view, the one required configuration file used by the framework is

+

From a Struts developer point of view, the one required configuration file used by the framework is web.xml.
+From here, you have full control over how Struts configures both itself and your application. By default, Struts will +load a set of internal configuration files to configure itself, then another set to configure your application, however +it is possible to build an entire Struts application without writing a single configuration file other than web.xml.

-
web.xml
-
-
-

. From here, you have full control over how Struts configures both itself and your application. By default, Struts will load a set of internal configuration files to configure itself, then another set to configure your application, however it is possible to build an entire Struts application without writing a single configuration file other than

- -
web.xml
-
-
-

.

- -

The table lists the files that you can use to configure the framework for your application. Some configuration files can be reloaded dynamically. Dynamic reloading makes interactive development possible. See Reloading configuration for more.

+

The table lists the files that you can use to configure the framework for your application. Some configuration files +can be reloaded dynamically. Dynamic reloading makes interactive development possible. +See Reloading configuration for more.

@@ -191,7 +186,7 @@ - + @@ -202,32 +197,22 @@
struts-plugin.xml yes At the root of a plugin JAROptional configuration files for Plugins in the same format as struts.xml.Optional configuration files for Plugins in the same format as struts.xml.
velocity.properties
-

####Static Content####

- -

Common static content that is needed by the framework (JavaScript and CSS files, etc.) is served automatically by the FilterDispatcher filter. Any request starting with “

- -
/struts/
-
-
-

” denotes that static content is required, and then mapping the value after “

+

Static Content

-
/struts/
-
-
-

” to common packages in the framework and, optionally in the application’s class path.

+

Common static content that is needed by the framework (JavaScript and CSS files, etc.) is served automatically by +the FilterDispatcher filter. 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.

By default, the following packages are searched:

    -
  • -

    org.apache.struts2.static

    -
  • -
  • -

    template

    -
  • +
  • org.apache.struts2.static
  • +
  • template
-

Additional packages can be specified by providing a comma separated list to the configuration parameter named “packages” (configured in web.xml for the FilterDispatcher filter). When specifying additional static content, you should be careful not to expose sensitive configuration information (such as the password to a database).

+

Additional packages can be specified by providing a comma separated list to the configuration parameter named “packages” +(configured in web.xml for the FilterDispatcher filter). When specifying additional static content, you should +be careful not to expose sensitive configuration information (such as the password to a database).

http://git-wip-us.apache.org/repos/asf/struts-site/blob/1b9b67fa/content/core-developers/default-properties.html ---------------------------------------------------------------------- diff --git a/content/core-developers/default-properties.html b/content/core-developers/default-properties.html new file mode 100644 index 0000000..ad14a3c --- /dev/null +++ b/content/core-developers/default-properties.html @@ -0,0 +1,422 @@ + + + + + + + + + + default.properties + + + + + + + + + + + + + + + Fork me on GitHub + + +
+ +
+ + +
+
+ << back to Core Developers Guide + Edit on GitHub +

default.properties

+ +
+

All properties can also be set using Constant Configuration in an XML configuration file.

+
+ +

The framework uses a number of properties that can be changed to fit your needs. To change any of these properties, +specify the property key and value in an default.properties file. The properties file can be locate anywhere +on the classpath, but it is typically found under /WEB-INF/classes.

+ +

The list of properties can be found in default.properties (inside struts2-core.jar).

+ +

default.properties

+ +
#
+# $Id$
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+### START SNIPPET: complete_file
+
+### 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
+### See https://issues.apache.org/jira/browse/WW-4110
+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
+### END SNIPPET: complete_file
+ + +
+
+ + +
+
+ Copyright © 2000-2016 The Apache Software Foundation . + All Rights Reserved. +
+
+ Apache Struts, Struts, Apache, the Apache feather logo, and the Apache Struts project logos are + trademarks of The Apache Software Foundation. +
+
Logo and website design donated by SoftwareMill.
+
+ + + + +
+ + + + + + + + http://git-wip-us.apache.org/repos/asf/struts-site/blob/1b9b67fa/content/core-developers/struts-xml.html ---------------------------------------------------------------------- diff --git a/content/core-developers/struts-xml.html b/content/core-developers/struts-xml.html index 1f5e76d..b6086e1 100644 --- a/content/core-developers/struts-xml.html +++ b/content/core-developers/struts-xml.html @@ -127,34 +127,15 @@ Edit on GitHub

struts.xml

-

The core configuration file for the framework is the default (

- -
struts.xml
-
-
-

) file and should reside on the classpath of the webapp (generally

- -
/WEB-INF/classes
-
-
-

).

- -
    -
  • -

    The default file may include other configuration files as needed.

    -
  • -
  • -

    A

    -
  • -
- -
struts-plugin.xml
-
-
-

file can be placed in a JAR and automatically plugged into an application, so that modules can be self-contained and automatically configured.

+

The core configuration file for the framework is the default (struts.xml) file and should reside on the classpath +of the webapp (generally /WEB-INF/classes).

    -
  • In the case of Freemarker and Velocity modules, the templates can also be loaded from the classpath, so the entire module can be plugged in as a single JAR.
  • +
  • The default file may include other configuration files as needed.
  • +
  • A struts-plugin.xml file can be placed in a JAR and automatically plugged into an application, so that modules +can be self-contained and automatically configured.
  • +
  • In the case of Freemarker and Velocity modules, the templates can also be loaded from the classpath, so the entire +module can be plugged in as a single JAR.
http://git-wip-us.apache.org/repos/asf/struts-site/blob/1b9b67fa/content/core-developers/web-xml.html ---------------------------------------------------------------------- diff --git a/content/core-developers/web-xml.html b/content/core-developers/web-xml.html index 51e7b3f..989eaf0 100644 --- a/content/core-developers/web-xml.html +++ b/content/core-developers/web-xml.html @@ -127,221 +127,165 @@ Edit on GitHub

web.xml

-

The

+

The web.xml web application descriptor file represents the core of the Java web application, so it is appropriate +that it is also part of the core of the Struts framework. In the web.xml file, Struts defines its FilterDispatcher, +the Servlet Filter class that initializes the Struts framework and handles all requests. This filter can contain +initialization parameters that affect what, if any, additional configuration files are loaded and how the framework +should behave.

-
web.xml
-
-
-

web application descriptor file represents the core of the Java web application, so it is appropriate that it is also part of the core of the Struts framework. In the

- -
web.xml
-
-
-

file, Struts defines its FilterDispatcher, the Servlet Filter class that initializes the Struts framework and handles all requests. This filter can contain initialization parameters that affect what, if any, additional configuration files are loaded and how the framework should behave.

- -

####Simple Example####

+

Simple Example

-

Configuring

- -
web.xml
-
-
-

for the framework is a matter of adding a filter and filter-mapping.

+

Configuring web.xml for the framework is a matter of adding a filter and filter-mapping.

Filter Example (web.xml)

-
<web-app id="MyStrutsApp" version="2.4" 
-	xmlns="http://java.sun.com/xml/ns/j2ee" 
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
<web-app id="MyStrutsApp" version="2.4" 
+	xmlns="http://java.sun.com/xml/ns/j2ee" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
 
-    <filter>
-        <filter-name>struts2</filter-name>
-        <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
-    </filter>
+    <filter>
+        <filter-name>struts2</filter-name>
+        <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
+    </filter>
 
-    <filter-mapping>
-        <filter-name>struts2</filter-name>
-        <url-pattern>/*</url-pattern>
-    </filter-mapping>
+    <filter-mapping>
+        <filter-name>struts2</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
 
-    <!-- ... -->
-
-</web-app>
+    <!-- ... -->
 
+</web-app>
 
-

#####Changed filter package in Struts >= 2.5#####

+

Changed filter package in Struts >= 2.5

-

As from Struts 2.5 all filters were moved to top package, if you are using older version you must use the old package, see example:

+

As from Struts 2.5 all filters were moved to top package, if you are using older version you must use the old package, +see example:

-
<web-app id="WebApp_9" version="2.4" 
-	xmlns="http://java.sun.com/xml/ns/j2ee" 
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
<web-app id="WebApp_9" version="2.4" 
+	xmlns="http://java.sun.com/xml/ns/j2ee" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
 
-    <filter>
-        <filter-name>struts2</filter-name>
-        <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
+    <filter>
+        <filter-name>struts2</filter-name>
+        <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
     ...
 
-

#####Changed Filter Structure in Struts >= 2.1.3#####

+

Changed Filter Structure in Struts >= 2.1.3

-

To split up the the dispatcher phases, FilterDispatcher is deprecated since Struts 2.1.3. If working with older versions, you need to use

+

To split up the the dispatcher phases, FilterDispatcher is deprecated since Struts 2.1.3. If working with older +versions, you need to use

    ...
-    <filter>
-        <filter-name>struts2</filter-name>
-        <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
+    <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

+

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

-

#####Exclude specific URLs#####

+

Exclude specific URLs

-

In the example above we’ve mapped the Struts 2 dispatcher to

+

In the example above we’ve mapped the Struts 2 dispatcher to /*, so Struts 2 has a crack at all incoming requests. +This is because Struts 2 serves static content from its jar files, including Dojo JavaScript files (if using S2.0, +or the Dojo plugin in S2.1+) and FreeMarker templates for the Struts 2 tags that produce HTML.

-
/*
-
-
-

, so Struts 2 has a crack at all incoming requests. This is because Struts 2 serves static content from its jar files, including Dojo JavaScript files (if using S2.0, or the Dojo plugin in S2.1+) and FreeMarker templates for the Struts 2 tags that produce HTML.

- -

If we change the filter mapping to something else, for example

- -
/*.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

+

If we change the filter mapping to something else, for example /*.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 separated 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>
+    <constant name="struts.action.excludePattern" value=".*unfiltered.*,.*\.nofilter"/>
     ...
 
-</struts>
+</struts>
 
-

####Taglib Example####

+

Taglib Example

-

Typically, configuring a taglib is neither required nor recommended. The taglib is included in

+

Typically, configuring a taglib is neither required nor recommended. The taglib is included in struts-core.jar, and +the container will discover it automatically.

-
struts-core.jar
-
-
-

, and the container will discover it automatically.

+
+

If, for some reason, a taglib configuration is needed within web.xml, extract the TLD file from the struts-core.jar +META-INF folder, and add a taglib element to the web.xml.

+
-

(ok) If, for some reason, a taglib configuration is needed within web.xml, extract the TLD file from the

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

folder, and add a

+

Custom FileManager and FileManagerFactory implementations

-
taglib
-
-
-

element to the

- -
web.xml
-
-
-

.

- -
    <!-- ... -->
-    </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####

- -

If there is a need to support an App Server’s specific file system (eg. VFS in JBoss), you can implement your own version of FileManager. But it must be registered at “the beginning” to support bootstrap of the whole framework.

+

If there is a need to support an App Server’s specific file system (eg. VFS in JBoss), you can implement your own +version of FileManager. But it must be registered at “the beginning” to support bootstrap of the whole framework.

-

To register your own FileManger you can do it with <init-param/> as below:

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

To register your own FileManger you can do it with <init-param/> as below:

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

You can as well register your own FileManagerFactory with <init-param/>, see example:

- -
<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>
+

You can as well register your own FileManagerFactory with <init-param/>, see example:

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

Take a look on default implementations - DefaultFileManager.java and DefaultFileManagerFactory.java to understand how and why.

- -

####Custom configuration provider####

+

Take a look on default implementations - DefaultFileManager.java and DefaultFileManagerFactory.java to understand how and why.

-

It is possible to use your custom 

+

Custom configuration provider

-
ConfigurationProvider
-
-
-

to programmatically configure your application. To do this use 

+

It is possible to use your custom ConfigurationProvider to programmatically configure your application. To do this use  +configProviders (it can be a comma-separated list of class names) <init-param/> as below:

-
configProviders
-
-
-

 (it can be a comma-separated list of class names) 

- -
<init-param/>
-
-
-

 as below:

- -
<filter>
-     <filter-name>struts2</filter-name>
-     <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
-     <init-param>
-         <param-name>configProviders</param-name>
-         <param-value>com.company.MyConfigurationProvider</param-value>
-     </init-param>
-</filter>
+
<filter>
+     <filter-name>struts2</filter-name>
+     <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
+     <init-param>
+         <param-name>configProviders</param-name>
+         <param-value>com.company.MyConfigurationProvider</param-value>
+     </init-param>
+</filter>
 

See Configuration Provider & Configuration for more details.

-

 

-