Compare commits

..

130 Commits

Author SHA1 Message Date
Lukasz Lenart e5009a3420 [maven-release-plugin] copy for tag STRUTS_2_3_1
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1@1212122 13f79535-47bb-0310-9956-ffa450edef68
2011-12-08 21:07:36 +00:00
Johannes Geppert 19391d3b7f WW-2357: doubleEmptyOption, doubleHeaderKey and doubleHeaderValue ignored in doubleselect tag
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1211074 13f79535-47bb-0310-9956-ffa450edef68
2011-12-06 19:57:35 +00:00
Wesley Wannemacher b178a6a6d4 WW-3712
- added css.ftl to the radiomap.ftl template
- added s:radio to showcase to make it easier to test s:radio

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1211023 13f79535-47bb-0310-9956-ffa450edef68
2011-12-06 17:01:50 +00:00
Lukasz Lenart bbfd03dfb5 WW-3687 adds Context Path to the error message
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1210360 13f79535-47bb-0310-9956-ffa450edef68
2011-12-05 08:31:39 +00:00
Lukasz Lenart 61478a9537 WW-3713 allows to return content not only for GET method - correct misspelled word
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1207859 13f79535-47bb-0310-9956-ffa450edef68
2011-11-29 13:09:27 +00:00
Lukasz Lenart 6908bc8d0f WW-3713 allows to return content not only for GET method
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1207576 13f79535-47bb-0310-9956-ffa450edef68
2011-11-28 20:34:18 +00:00
Lukasz Lenart a15e99c68e WW-3611 - solves wrong prefix used in examples
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1207014 13f79535-47bb-0310-9956-ffa450edef68
2011-11-28 08:21:52 +00:00
Lukasz Lenart 0d5ae3294c Adds filtering for poms built with archetypes
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1204910 13f79535-47bb-0310-9956-ffa450edef68
2011-11-22 10:49:29 +00:00
Maurizio Cucchiara e6738c5e75 Removed useless cast
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1204408 13f79535-47bb-0310-9956-ffa450edef68
2011-11-21 09:13:25 +00:00
Johannes Geppert 077bea8a6f WW-3629: Provide a JSON Content Handler based on Jackson Lib
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1203772 13f79535-47bb-0310-9956-ffa450edef68
2011-11-18 18:02:03 +00:00
Johannes Geppert 380b6df4f7 WW-3708: <s:checkboxlist> UI tag ignores CSS related parameters
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1202798 13f79535-47bb-0310-9956-ffa450edef68
2011-11-16 17:29:03 +00:00
Johannes Geppert 6c004040ea WW-3707: Extend the Portlet Showcase with an Portlet Event Example
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1201876 13f79535-47bb-0310-9956-ffa450edef68
2011-11-14 20:24:57 +00:00
Maurizio Cucchiara d0bdf09e7d WW-3701 - Wrong parsing of number with exponents
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1200422 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 16:51:46 +00:00
Maurizio Cucchiara eb17fbb3a0 Reverted redundant cast (tests failed)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1200412 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 16:24:27 +00:00
Maurizio Cucchiara 6aa0509b33 Removed redundant cast and unnecessary boxing
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1200405 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 16:18:27 +00:00
Maurizio Cucchiara 63e704201a WW-3699 - from now, buildValidatorKey includes the package name
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1199696 13f79535-47bb-0310-9956-ffa450edef68
2011-11-09 11:03:35 +00:00
Maurizio Cucchiara 04aa19c9e7 WW-3696 - Work-Core JUnit Test Failure: com.opensymphony.xwork2.validator.DefaultValidatorFileParserTest.testParserWithBadXML2( ) (contributed by Jeff Black)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1196325 13f79535-47bb-0310-9956-ffa450edef68
2011-11-01 22:17:33 +00:00
Maurizio Cucchiara 29aae5eb81 WW-3694 - JSONResult - buildSMDObject method is never called internally
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1189257 13f79535-47bb-0310-9956-ffa450edef68
2011-10-26 15:06:17 +00:00
Maurizio Cucchiara d5cbcfeedc Inline variable assignment
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1188968 13f79535-47bb-0310-9956-ffa450edef68
2011-10-25 23:24:56 +00:00
Maurizio Cucchiara a51b4eacb7 Removed unused private Log, avoid explicit array creation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1188966 13f79535-47bb-0310-9956-ffa450edef68
2011-10-25 23:21:21 +00:00
Maurizio Cucchiara bdc84d2fb1 Code optimization
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1188965 13f79535-47bb-0310-9956-ffa450edef68
2011-10-25 23:19:48 +00:00
Maurizio Cucchiara d34eb7adcb WW-3652 - Add example for "anchor" (aka "hash" or "fragment") to RedirectActionResult docs (patch submitted by Jeff Black)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1188963 13f79535-47bb-0310-9956-ffa450edef68
2011-10-25 23:14:09 +00:00
Maurizio Cucchiara 2f3a55d0d5 Changed return type to checked conversion
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1188962 13f79535-47bb-0310-9956-ffa450edef68
2011-10-25 23:12:56 +00:00
Maurizio Cucchiara bdb24d4eff Replaced while loop with foreach
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1188961 13f79535-47bb-0310-9956-ffa450edef68
2011-10-25 23:09:53 +00:00
Maurizio Cucchiara 1253cb074b WW-3693 - Javatemplate engine ignores escape parameter of action message tag
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1183256 13f79535-47bb-0310-9956-ffa450edef68
2011-10-14 09:24:28 +00:00
Maurizio Cucchiara 9897d8ff19 Upgraded freemarker version
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1181791 13f79535-47bb-0310-9956-ffa450edef68
2011-10-11 14:03:54 +00:00
Lukasz Lenart cf34593a8a WW-3692 - uses containsBean() method instead of containsBeanDefinition() to resolve aliases of a bean to find
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1181629 13f79535-47bb-0310-9956-ffa450edef68
2011-10-11 06:00:56 +00:00
Lukasz Lenart 83b281811d WW-3047 - adds js_script to escape the option label and value
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1181085 13f79535-47bb-0310-9956-ffa450edef68
2011-10-10 17:31:07 +00:00
Lukasz Lenart fe190f950f WW-3580 - upgrades OGNL to version 3.0.3 to improve performance
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1180998 13f79535-47bb-0310-9956-ffa450edef68
2011-10-10 14:37:28 +00:00
Maurizio Cucchiara 7ddfe6bbda WW-3688 JavaScript URL validator in the FreeMarker template fails many valid URLs
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1178333 13f79535-47bb-0310-9956-ffa450edef68
2011-10-03 08:35:31 +00:00
Maurizio Cucchiara c4d253688f WW-3682 - replaced deprecaded api calls with direct replacements
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1173248 13f79535-47bb-0310-9956-ffa450edef68
2011-09-20 16:51:00 +00:00
Maurizio Cucchiara e1dcdf5a34 Removed needless jdk check
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1173233 13f79535-47bb-0310-9956-ffa450edef68
2011-09-20 16:36:15 +00:00
Maurizio Cucchiara 9085922cb7 Removed redundant escape sequence
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1173232 13f79535-47bb-0310-9956-ffa450edef68
2011-09-20 16:34:47 +00:00
Maurizio Cucchiara 07031875ea Removed redundant escape sequence
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1173231 13f79535-47bb-0310-9956-ffa450edef68
2011-09-20 16:34:20 +00:00
Maurizio Cucchiara 9c139c9288 Removed redundant escape sequence
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1173229 13f79535-47bb-0310-9956-ffa450edef68
2011-09-20 16:30:35 +00:00
Maurizio Cucchiara 74085f630e Removed redundant escape sequence
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1173228 13f79535-47bb-0310-9956-ffa450edef68
2011-09-20 16:30:13 +00:00
Maurizio Cucchiara 1dbe1093c2 Partial upgrade to java 5
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1173226 13f79535-47bb-0310-9956-ffa450edef68
2011-09-20 16:29:37 +00:00
Maurizio Cucchiara c36dfd6a26 Partial upgrade to java 5
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1173225 13f79535-47bb-0310-9956-ffa450edef68
2011-09-20 16:26:44 +00:00
Maurizio Cucchiara dcfae203cc Partial upgrade to java 5
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1173223 13f79535-47bb-0310-9956-ffa450edef68
2011-09-20 16:25:07 +00:00
Maurizio Cucchiara 6f3fa76e3f WW-3681 - testWebFlow(org.apache.struts2.sitegraph.SiteGraphTest) test fails on paths with spaces
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1173210 13f79535-47bb-0310-9956-ffa450edef68
2011-09-20 15:58:37 +00:00
Lukasz Lenart 75b31dc959 Cleanups poms
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1173125 13f79535-47bb-0310-9956-ffa450edef68
2011-09-20 12:58:53 +00:00
Lukasz Lenart ef40344fd1 WW-3633 - better way to timestamps file used in tests
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1172980 13f79535-47bb-0310-9956-ffa450edef68
2011-09-20 05:45:30 +00:00
Lukasz Lenart 54c3d64d81 WW-3617 - Adds missing dependency for commons-logging
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1172531 13f79535-47bb-0310-9956-ffa450edef68
2011-09-19 09:15:15 +00:00
Lukasz Lenart 3acbfc584d WW-3617 - Updates poms to include CDI plugin in the trunk
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1172492 13f79535-47bb-0310-9956-ffa450edef68
2011-09-19 07:02:17 +00:00
Lukasz Lenart 08462f2c15 Move CDI plugin into trunk
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1172467 13f79535-47bb-0310-9956-ffa450edef68
2011-09-19 05:49:16 +00:00
Johannes Geppert bdf0f0da81 WW-3670: JSONWriter cannot load CGLIB classes if its JAR is in SharedLib
Patch provided by Bruno Borges

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1161630 13f79535-47bb-0310-9956-ffa450edef68
2011-08-25 16:30:49 +00:00
Johannes Geppert 465d599054 WW-3672: Wrong mime-type for csv media
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1161628 13f79535-47bb-0310-9956-ffa450edef68
2011-08-25 16:23:45 +00:00
Maurizio Cucchiara ad3aae6eba WW-3522 - Template Overriding not work
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1159335 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 18:11:06 +00:00
Maurizio Cucchiara 7e1b849155 Added doc.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1158319 13f79535-47bb-0310-9956-ffa450edef68
2011-08-16 15:12:18 +00:00
Maurizio Cucchiara c035f4cb4a * Exposed getConfigPath method in order to use custom struts.xml file.
* Renamed JUnitTestAction

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1157925 13f79535-47bb-0310-9956-ffa450edef68
2011-08-15 17:48:07 +00:00
Maurizio Cucchiara 3343161e12 WW-3671 - Two TestAction classes confuse eclipse (sometimes)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1157665 13f79535-47bb-0310-9956-ffa450edef68
2011-08-14 20:57:58 +00:00
Maurizio Cucchiara 90f9e3a846 WW-3669 - TestCase for StrutsJUnit4TestCase
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1157396 13f79535-47bb-0310-9956-ffa450edef68
2011-08-13 17:41:59 +00:00
Maurizio Cucchiara f410fc0cbe * small improvements
* removed duplicate code

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1157393 13f79535-47bb-0310-9956-ffa450edef68
2011-08-13 16:58:39 +00:00
Maurizio Cucchiara 127ed05ed6 * small optimizations
* removed duplicate code

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1157359 13f79535-47bb-0310-9956-ffa450edef68
2011-08-13 09:27:10 +00:00
Maurizio Cucchiara 8a9fa85766 dynamic attributes became again a map of String (see http://s.apache.org/dyn)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1157353 13f79535-47bb-0310-9956-ffa450edef68
2011-08-13 09:04:19 +00:00
Maurizio Cucchiara b4265d369d WW-3668 - Vulnerability: User input is evaluated as an OGNL expression when there's a conversion error
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1157009 13f79535-47bb-0310-9956-ffa450edef68
2011-08-12 08:38:39 +00:00
Maurizio Cucchiara 6137ac2293 Small simplification
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1156296 13f79535-47bb-0310-9956-ffa450edef68
2011-08-10 18:29:46 +00:00
Maurizio Cucchiara 5f54b8d087 WW-3668 - Vulnerability: User input is evaluated as an OGNL expression when there's a conversion error (a demonstrative patch).
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1156279 13f79535-47bb-0310-9956-ffa450edef68
2011-08-10 17:59:54 +00:00
Lukasz Lenart 481ef2feaf Removes duplicated properties
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1155247 13f79535-47bb-0310-9956-ffa450edef68
2011-08-09 07:58:32 +00:00
Lukasz Lenart 4621a4c1a5 Defines property to be used for tlibVersion as it must be valid decimal value
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1155241 13f79535-47bb-0310-9956-ffa450edef68
2011-08-09 07:33:52 +00:00
Lukasz Lenart 1e0527777a Adjusts Showcase application after moving JSONValidationInterceptor into JSON plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1155236 13f79535-47bb-0310-9956-ffa450edef68
2011-08-09 07:20:09 +00:00
Maurizio Cucchiara ac0679e3ed Made StrutsJunit4 classes abstract
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1153918 13f79535-47bb-0310-9956-ffa450edef68
2011-08-04 16:12:15 +00:00
Maurizio Cucchiara f219d9e468 WW-3667 - StrutsJUnit4TestCase does not provide the executeAction method
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1153904 13f79535-47bb-0310-9956-ffa450edef68
2011-08-04 15:12:44 +00:00
Johannes Geppert 9e4347d896 WW-3661: node 'tlib-version' syntax error in struts-dojo-tags.tld
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1148449 13f79535-47bb-0310-9956-ffa450edef68
2011-07-19 17:10:11 +00:00
Lukasz Lenart 4e06167fdb Moves JSONValidationInterceptor into JSON plugin to keep core consistent
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1145897 13f79535-47bb-0310-9956-ffa450edef68
2011-07-13 07:52:54 +00:00
Lukasz Lenart efa15d578f WW-3558 - adds support for JBoss VFS protocol
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1144261 13f79535-47bb-0310-9956-ffa450edef68
2011-07-08 11:13:50 +00:00
Lukasz Lenart 9842ae0cd9 WW-3545 - remove comments for JSON output
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1144259 13f79535-47bb-0310-9956-ffa450edef68
2011-07-08 11:12:52 +00:00
Lukasz Lenart b6cd7e4fde Adds <#rt/> directive to remove empty spaces
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1144250 13f79535-47bb-0310-9956-ffa450edef68
2011-07-08 10:54:01 +00:00
Lukasz Lenart be5efd99b6 Adds <#rt/> directive to remove empty spaces
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1142487 13f79535-47bb-0310-9956-ffa450edef68
2011-07-03 19:32:59 +00:00
Johannes Geppert ce7c1c9144 WW-3632: /struts/struts2/trunk/apps/showcase/src/main/webapp/person/index.jsp should use struts tag <s:a> instead of <a>
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1140218 13f79535-47bb-0310-9956-ffa450edef68
2011-06-27 15:59:19 +00:00
Johannes Geppert 48c14f46c8 WW-3620: Bring Portlet 2.0 (JSR286) plugin from sandbox to trunk
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1139753 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 09:53:13 +00:00
Johannes Geppert 664378b744 WW-3620: Bring Portlet 2.0 (JSR286) plugin from sandbox to trunk
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1139740 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 08:45:11 +00:00
Johannes Geppert 16cbf6299e WW-3620: Bring Portlet 2.0 (JSR286) plugin from sandbox to trunk
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1139736 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 08:38:59 +00:00
Johannes Geppert 191dc8589e WW-3620: Bring Portlet 2.0 (JSR286) plugin from sandbox to trunk
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1139734 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 08:36:56 +00:00
Johannes Geppert 19aa2c1ba6 Rollback changes for WW-3620 because lost of SVN History.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1139729 13f79535-47bb-0310-9956-ffa450edef68
2011-06-26 08:30:00 +00:00
Johannes Geppert 2462d93e6e WW-3620: Bring Portlet 2.0 (JSR286) plugin from sandbox to trunk
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1139182 13f79535-47bb-0310-9956-ffa450edef68
2011-06-24 07:32:13 +00:00
Johannes Geppert 1e1705bb41 WW-3620: Bring Portlet 2.0 (JSR286) plugin from sandbox to trunk
Remove unnecessary Tests

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1139078 13f79535-47bb-0310-9956-ffa450edef68
2011-06-23 21:19:00 +00:00
Johannes Geppert a534481cf7 WW-3620: Bring Portlet 2.0 (JSR286) plugin from sandbox to trunk
Adopt Portlet Plugin Changes to the Archetypes

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1139070 13f79535-47bb-0310-9956-ffa450edef68
2011-06-23 20:59:11 +00:00
Johannes Geppert 26f25f1d5a WW-3620: Bring Portlet 2.0 (JSR286) plugin from sandbox to trunk
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1139066 13f79535-47bb-0310-9956-ffa450edef68
2011-06-23 20:28:45 +00:00
Maurizio Cucchiara a4772afb3c WW-3653 - Struts2 should base on JDK5 and all tests must passing
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1138699 13f79535-47bb-0310-9956-ffa450edef68
2011-06-23 00:24:55 +00:00
Lukasz Lenart 0b7e3768ac Removes snapshots repositories
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1138568 13f79535-47bb-0310-9956-ffa450edef68
2011-06-22 17:53:32 +00:00
Lukasz Lenart ea2c03bd71 WW-3653 - reverts to previous Ognl groupId / artifactId
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1138566 13f79535-47bb-0310-9956-ffa450edef68
2011-06-22 17:47:46 +00:00
Lukasz Lenart 294d91b989 WW-3653 - uses the latest OGNL version to allow passing tests on JDK5
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1138558 13f79535-47bb-0310-9956-ffa450edef68
2011-06-22 17:23:46 +00:00
Johannes Geppert 36d14eb401 WW-3646: Upgrade Spring Dependencies to 3.0.x
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1134395 13f79535-47bb-0310-9956-ffa450edef68
2011-06-10 17:47:55 +00:00
John Lindal 1d962f9472 WW-3264 revert change to root pom
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1133949 13f79535-47bb-0310-9956-ffa450edef68
2011-06-09 15:43:58 +00:00
John Lindal f54afdc3f4 WW-3264 add allowed-methods configuration for action
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1133947 13f79535-47bb-0310-9956-ffa450edef68
2011-06-09 15:43:04 +00:00
Lukasz Lenart 4227062548 WW-3644 - check if evaluated expression is not null
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1133658 13f79535-47bb-0310-9956-ffa450edef68
2011-06-09 05:29:38 +00:00
John Lindal 8f4707d3be WW-3518 remove duplicated code from RestActionInvocation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1133590 13f79535-47bb-0310-9956-ffa450edef68
2011-06-08 22:40:33 +00:00
Lukasz Lenart e5fcc7b33e WW-3645 - uses EnumerationIterator to simplify logic
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1133045 13f79535-47bb-0310-9956-ffa450edef68
2011-06-07 15:24:31 +00:00
Lukasz Lenart 5e8080abe3 WW-3644 - adds support for expression evaluation in dynamic attributes
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1133044 13f79535-47bb-0310-9956-ffa450edef68
2011-06-07 15:18:58 +00:00
Lukasz Lenart c10a8b7f43 WW-3642 - Improves documentation about empty action's extension
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1132110 13f79535-47bb-0310-9956-ffa450edef68
2011-06-05 08:45:32 +00:00
Maurizio Cucchiara 4d17f3c7ba WW-3643 - regression for java 1.5 (@Override annotation)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1131592 13f79535-47bb-0310-9956-ffa450edef68
2011-06-05 03:27:14 +00:00
Maurizio Cucchiara 36b92cea4a WW-3585 - moved the debug interceptor to the bottom of the stack
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1131412 13f79535-47bb-0310-9956-ffa450edef68
2011-06-04 15:04:30 +00:00
Maurizio Cucchiara 86bade8b22 WW-3637 - Auto reload of properties slowing down application (Check null)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1131408 13f79535-47bb-0310-9956-ffa450edef68
2011-06-04 14:16:01 +00:00
Maurizio Cucchiara b1f6671c28 Updated licence header
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1131339 13f79535-47bb-0310-9956-ffa450edef68
2011-06-04 07:09:22 +00:00
Maurizio Cucchiara 9972ef89ab WW-3637 - Auto reload of properties slowing down application
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1131338 13f79535-47bb-0310-9956-ffa450edef68
2011-06-04 07:05:20 +00:00
Maurizio Cucchiara f3fdaa82dd Renamed in more appropriate way the mail reader webapp
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1131323 13f79535-47bb-0310-9956-ffa450edef68
2011-06-04 06:21:39 +00:00
Maurizio Cucchiara 9e35546504 Removed needless double check in log
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1131315 13f79535-47bb-0310-9956-ffa450edef68
2011-06-04 05:16:30 +00:00
Maurizio Cucchiara dcd9409764 Corrected field errors setter
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1131313 13f79535-47bb-0310-9956-ffa450edef68
2011-06-04 04:57:23 +00:00
John Lindal 511c943ed3 WW-3640 extend AbstractInterceptor
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1130878 13f79535-47bb-0310-9956-ffa450edef68
2011-06-03 00:17:27 +00:00
Lukasz Lenart 1337311088 WW-3639 - Solves problem with not accessible DTDs from OpenSymphony site - the site is closed donw
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1130762 13f79535-47bb-0310-9956-ffa450edef68
2011-06-02 19:31:49 +00:00
Lukasz Lenart 05c581f530 Adds url to Apache's Reviewboard
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1130536 13f79535-47bb-0310-9956-ffa450edef68
2011-06-02 13:20:56 +00:00
John Lindal 62bc93b987 XW-386 allow x['y'] as well as x.y
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1129979 13f79535-47bb-0310-9956-ffa450edef68
2011-06-01 00:30:25 +00:00
John Lindal cfa0c91b19 WW-3489 if excludeNullProperties, ignore nulls in maps
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1129976 13f79535-47bb-0310-9956-ffa450edef68
2011-06-01 00:06:22 +00:00
John Lindal 3d1120a607 WW-3635 return application/json instead of application/json-rpc
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1129873 13f79535-47bb-0310-9956-ffa450edef68
2011-05-31 19:36:53 +00:00
John Lindal 0f2a57f94b WW-3638 additional unit test for multi-level array in includeProperties
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1129864 13f79535-47bb-0310-9956-ffa450edef68
2011-05-31 19:24:27 +00:00
Lukasz Lenart b40ef08d31 WW-2776 - Uses JRRewindableDataSource for JasperReports
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1127396 13f79535-47bb-0310-9956-ffa450edef68
2011-05-25 06:35:44 +00:00
Maurizio Cucchiara bc0ac267f6 WW-3626 Corrected URLUtil#normalizeToFileProtocol in order to allow the word jar along the path
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1127142 13f79535-47bb-0310-9956-ffa450edef68
2011-05-24 16:53:44 +00:00
Lukasz Lenart bb5e30d47a WW-3601 - switches to /struts/ and /static/ patterns instead of /struts and /static to handle static content
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1126877 13f79535-47bb-0310-9956-ffa450edef68
2011-05-24 05:49:01 +00:00
Lukasz Lenart f2df9bbff6 WW-3634 - Solves problem with code snippet
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1126873 13f79535-47bb-0310-9956-ffa450edef68
2011-05-24 05:25:21 +00:00
Johannes Geppert 21f731531a WW-3628 : Regression in s:url tag action's method is no longer being included in the resultant url
Patch by Jason Pyeron

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1126101 13f79535-47bb-0310-9956-ffa450edef68
2011-05-22 17:15:55 +00:00
Lukasz Lenart b5d9530ee4 Adds CI management section
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1103618 13f79535-47bb-0310-9956-ffa450edef68
2011-05-16 06:19:33 +00:00
Johannes Geppert db3cb1f3af WW-3564: Unable to find a result type for extension
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1099705 13f79535-47bb-0310-9956-ffa450edef68
2011-05-05 07:17:33 +00:00
Johannes Geppert 1219e49516 WW-3619: Check LogLevel for all debug, info and warning messages
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1099157 13f79535-47bb-0310-9956-ffa450edef68
2011-05-03 17:53:55 +00:00
Johannes Geppert 1492f4f579 WW-3469: convention plugin does not apply interceptors unless there is an Action
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1097569 13f79535-47bb-0310-9956-ffa450edef68
2011-04-28 18:28:25 +00:00
Maurizio Cucchiara 7aa552ff78 WW-3616 - Error in the detail view of the REST Showcase
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1097499 13f79535-47bb-0310-9956-ffa450edef68
2011-04-28 15:15:49 +00:00
Maurizio Cucchiara eaa0a9ca6d WW-3615 - Dead code in PlainTextResult
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1097343 13f79535-47bb-0310-9956-ffa450edef68
2011-04-28 07:51:45 +00:00
Lukasz Lenart 3650863e0d Solves WW-3542 - adds missing onReset attribute to populateParams() method
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1097319 13f79535-47bb-0310-9956-ffa450edef68
2011-04-28 04:42:21 +00:00
Johannes Geppert 19f61519f9 WW-3614: Incorrect Content-Type in REST Plugin JSON Content Handler
WW-3536: Specify UTF-8 content type in JsonLibHandler

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1097172 13f79535-47bb-0310-9956-ffa450edef68
2011-04-27 16:36:54 +00:00
Johannes Geppert 524aee3131 WW-3241: ShowCase demo application still uses the CodeBehind plugin.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1096885 13f79535-47bb-0310-9956-ffa450edef68
2011-04-26 20:18:52 +00:00
Johannes Geppert 83d57e75c0 WW-3450: supressEmptyParameters option is misspelled
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1096838 13f79535-47bb-0310-9956-ffa450edef68
2011-04-26 18:28:38 +00:00
Johannes Geppert 009e65e94f WW-3349: Extension .jspf not recognized as JSP result-type
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1096834 13f79535-47bb-0310-9956-ffa450edef68
2011-04-26 18:18:08 +00:00
René Gielen 535bc0163d code cleanup
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1096118 13f79535-47bb-0310-9956-ffa450edef68
2011-04-23 07:46:43 +00:00
René Gielen 9e452375bf WW-3612:
Fixed missing handling of file encoding for JSP includes, e.g. for Component tag

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1095964 13f79535-47bb-0310-9956-ffa450edef68
2011-04-22 17:13:41 +00:00
Maurizio Cucchiara 84c11ed257 WW-3607 - Removed extra white space in the checkbox tag template for the simple theme
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1095111 13f79535-47bb-0310-9956-ffa450edef68
2011-04-19 15:20:39 +00:00
Lukasz Lenart 72f8865629 [maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1090136 13f79535-47bb-0310-9956-ffa450edef68
2011-04-08 06:39:51 +00:00
Lukasz Lenart 5dad35e0a0 [maven-release-plugin] prepare release STRUTS_2_2_3
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1090129 13f79535-47bb-0310-9956-ffa450edef68
2011-04-08 06:27:42 +00:00
Lukasz Lenart cb9838871b Solves WW-3602 - clears bundle map on resource reloading
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1088493 13f79535-47bb-0310-9956-ffa450edef68
2011-04-04 07:55:54 +00:00
Lukasz Lenart 786f6af96f Changes namespace to be optional parameter
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1086842 13f79535-47bb-0310-9956-ffa450edef68
2011-03-30 05:27:52 +00:00
Lukasz Lenart d915dfc33e [maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1085708 13f79535-47bb-0310-9956-ffa450edef68
2011-03-26 12:08:01 +00:00
482 changed files with 13806 additions and 10719 deletions
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.2.2</version>
<version>2.3.1</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-blank</artifactId>
@@ -34,9 +34,9 @@
<name>Blank Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/apps/blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/apps/blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_2_2/apps/blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/apps/blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/apps/blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_1/apps/blank</url>
</scm>
<dependencies>
@@ -1,6 +1,6 @@
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
"-//Apache Struts//XWork Validator 1.0.2//EN"
"http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
<field name="username">
@@ -26,12 +26,11 @@ import com.opensymphony.xwork2.config.RuntimeConfiguration;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.config.entities.ResultConfig;
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
import java.util.Map;
import java.util.List;
import org.apache.struts2.StrutsTestCase;
import java.util.List;
import java.util.Map;
public class ConfigTest extends StrutsTestCase {
protected void assertSuccess(String result) throws Exception {
@@ -62,7 +61,7 @@ public class ConfigTest extends StrutsTestCase {
protected void setUp() throws Exception {
super.setUp();
XmlConfigurationProvider c = new XmlConfigurationProvider("struts.xml");
configurationManager.addConfigurationProvider(c);
configurationManager.addContainerProvider(c);
configurationManager.reload();
}
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.2.2</version>
<version>2.3.1</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jboss-blank</artifactId>
@@ -34,9 +34,9 @@
<name>JBoss Blank Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/apps/jboss-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/apps/jboss-blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_2_2/apps/jboss-blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/apps/jboss-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/apps/jboss-blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_1/apps/jboss-blank</url>
</scm>
<dependencies>
@@ -1,6 +1,6 @@
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
"-//Apache Struts//XWork Validator 1.0.2//EN"
"http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
<field name="username">
@@ -26,12 +26,11 @@ import com.opensymphony.xwork2.config.RuntimeConfiguration;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.config.entities.ResultConfig;
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
import java.util.Map;
import java.util.List;
import org.apache.struts2.StrutsTestCase;
import java.util.List;
import java.util.Map;
public class ConfigTest extends StrutsTestCase {
protected void assertSuccess(String result) throws Exception {
@@ -62,7 +61,7 @@ public class ConfigTest extends StrutsTestCase {
protected void setUp() throws Exception {
super.setUp();
XmlConfigurationProvider c = new XmlConfigurationProvider("struts.xml");
configurationManager.addConfigurationProvider(c);
configurationManager.addContainerProvider(c);
configurationManager.reload();
}
+5 -5
View File
@@ -26,17 +26,17 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.2.2</version>
<version>2.3.1</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-mailreader</artifactId>
<packaging>war</packaging>
<name>Starter Webapp</name>
<name>Mail Reader Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/apps/mailreader</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/apps/mailreader</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_2_2/apps/mailreader</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/apps/mailreader</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/apps/mailreader</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_1/apps/mailreader</url>
</scm>
<dependencies>
@@ -1,4 +1,4 @@
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
<field name="username">
@@ -1,4 +1,4 @@
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
@@ -1,4 +1,4 @@
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
@@ -1,4 +1,4 @@
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
@@ -1,4 +1,4 @@
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.2.2</version>
<version>2.3.1</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
@@ -42,9 +42,9 @@
</modules>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/apps</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/apps</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_2_2/apps</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/apps</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/apps</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_1/apps</url>
</scm>
<profiles>
+6 -6
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.2.2</version>
<version>2.3.1</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-portlet</artifactId>
@@ -34,9 +34,9 @@
<name>Portlet Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/apps/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/apps/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_2_2/apps/portlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/apps/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/apps/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_1/apps/portlet</url>
</scm>
<profiles>
@@ -93,8 +93,8 @@
<dependencies>
<dependency>
<groupId>portlet-api</groupId>
<artifactId>portlet-api</artifactId>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
@@ -0,0 +1,61 @@
/*
* 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.
*/
package org.apache.struts2.portlet.example.eventing;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.portlet.interceptor.PortletRequestAware;
import org.apache.struts2.portlet.interceptor.PortletResponseAware;
import javax.portlet.EventRequest;
import javax.portlet.EventResponse;
import javax.portlet.PortletRequest;
import javax.portlet.PortletResponse;
public class ProcessAction extends ActionSupport implements PortletRequestAware, PortletResponseAware {
private PortletRequest request;
private PortletResponse response;
private String name;
public String execute() throws Exception {
if (request instanceof EventRequest) {
EventRequest req = (EventRequest) request;
EventResponse res = (EventResponse) response;
res.setRenderParameter("eventName", (String) req.getEvent().getValue());
return "forward";
} else {
name = request.getParameter("eventName");
}
return SUCCESS;
}
public void setPortletRequest(PortletRequest request) {
this.request = request;
}
public void setPortletResponse(PortletResponse response) {
this.response = response;
}
public String getName() {
return this.name;
}
}
@@ -0,0 +1,52 @@
/*
* 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.
*/
package org.apache.struts2.portlet.example.eventing;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.portlet.interceptor.PortletResponseAware;
import javax.portlet.ActionResponse;
import javax.portlet.PortletResponse;
import javax.xml.namespace.QName;
public class PublishAction extends ActionSupport implements PortletResponseAware {
private PortletResponse response;
private String name;
public String execute() throws Exception {
if (name != null) {
((ActionResponse) response).setEvent(new QName("http://org.apache.struts2.portlets/events", "name"), name);
addActionMessage("Publishing Event with Parameter name : " + name);
}
return SUCCESS;
}
public void setPortletResponse(PortletResponse response) {
this.response = response;
}
public void setName(String name) {
this.name = name;
}
}
@@ -1,4 +1,4 @@
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
<field name="firstName">
<field-validator type="requiredstring">
@@ -1,4 +1,4 @@
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
<field name="firstName">
<field-validator type="requiredstring">
@@ -0,0 +1,21 @@
<?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>
<package name="eventing" extends="struts-portlet-default" namespace="/eventing">
<action name="publish" class="org.apache.struts2.portlet.example.eventing.PublishAction">
<result name="success">/WEB-INF/eventing/index.jsp</result>
</action>
<action name="process" class="org.apache.struts2.portlet.example.eventing.ProcessAction">
<result name="success">/WEB-INF/eventing/process.jsp</result>
<result name="forward" type="redirectAction">
<param name="actionName">process</param>
<param name="namespace">/eventing</param>
</result>
</action>
</package>
</struts>
+6 -5
View File
@@ -1,10 +1,11 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="struts-view.xml"/>
<include file="struts-edit.xml"/>
<include file="struts-help.xml"/>
<include file="struts-view.xml"/>
<include file="struts-edit.xml"/>
<include file="struts-help.xml"/>
<include file="struts-eventing.xml"/>
</struts>
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator Config 1.0//EN"
"http://www.opensymphony.com/xwork/xwork-validator-config-1.0.dtd">
"-//Apache Struts//XWork Validator Config 1.0//EN"
"http://struts.apache.org/dtds/xwork-validator-config-1.0.dtd">
<validators>
<validator name="required" class="com.opensymphony.xwork2.validator.validators.RequiredFieldValidator"/>
<validator name="requiredstring" class="com.opensymphony.xwork2.validator.validators.RequiredStringValidator"/>
@@ -0,0 +1,11 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<h2>Input your name</h2>
<s:actionmessage/>
<s:form action="publish" method="POST">
<s:textfield label="Please enter your name" name="name" value="%{name}"/>
<s:submit value="Submit the form"/>
</s:form>
@@ -0,0 +1,12 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<s:if test="%{name != null}">
<h2>Welcome <s:property value="name"/></h2>
</s:if>
<s:else>
<h2>Please insert a Name in the Publish Portlet Form</h2>
</s:else>
<s:actionmessage/>
+150 -67
View File
@@ -1,78 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<portlet-app
version="1.0"
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
id="struts-portlet">
id="struts-portlet"
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="2.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
>
<portlet id="StrutsPortlet">
<description xml:lang="EN">Struts Test Portlet</description>
<portlet-name>StrutsPortlet</portlet-name>
<display-name xml:lang="EN">Struts Test Portlet</display-name>
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class>
<!-- The view mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>viewNamespace</name>
<value>/view</value>
</init-param>
<!-- The default action to invoke in view mode. -->
<init-param>
<name>defaultViewAction</name>
<value>index</value>
</init-param>
<!-- The edit mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>editNamespace</name>
<value>/edit</value>
</init-param>
<!-- The default action to invoke in edit mode. -->
<init-param>
<name>defaultEditAction</name>
<value>index</value>
</init-param>
<!-- The help mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>helpNamespace</name>
<value>/help</value>
</init-param>
<!-- The default action to invoke in help mode. -->
<init-param>
<name>defaultHelpAction</name>
<value>index</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
<portlet-mode>edit</portlet-mode>
<portlet-mode>help</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<portlet-info>
<title>My StrutsPortlet portlet</title>
<short-title>SP</short-title>
<keywords>struts,portlet</keywords>
</portlet-info>
</portlet>
<portlet id="StrutsPortlet2">
<description xml:lang="EN">Struts Test Portlet2</description>
<portlet-name>StrutsPortlet2</portlet-name>
<display-name xml:lang="EN">Struts Test Portlet2</display-name>
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class>
<!-- The view mode namespace. Maps to a namespace in the Struts 2 config file. -->
@@ -115,6 +55,7 @@
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
<portlet-mode>edit</portlet-mode>
<portlet-mode>help</portlet-mode>
</supports>
@@ -122,10 +63,152 @@
<supported-locale>en</supported-locale>
<portlet-info>
<title>My StrutsPortlet portlet2</title>
<title>My Struts2 Portlet</title>
<short-title>SP2</short-title>
<keywords>struts,portlet</keywords>
</portlet-info>
</portlet>
<portlet id="StrutsPortlet2">
<description xml:lang="EN">Struts Test Portlet with JSR 286 Dispatcher</description>
<portlet-name>StrutsPortlet2</portlet-name>
<display-name xml:lang="EN">Struts Test Portlet with JSR 286 Dispatcher</display-name>
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr286Dispatcher</portlet-class>
<!-- The view mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>viewNamespace</name>
<value>/view</value>
</init-param>
<!-- The default action to invoke in view mode. -->
<init-param>
<name>defaultViewAction</name>
<value>index</value>
</init-param>
<!-- The edit mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>editNamespace</name>
<value>/edit</value>
</init-param>
<!-- The default action to invoke in edit mode. -->
<init-param>
<name>defaultEditAction</name>
<value>index</value>
</init-param>
<!-- The help mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>helpNamespace</name>
<value>/help</value>
</init-param>
<!-- The default action to invoke in help mode. -->
<init-param>
<name>defaultHelpAction</name>
<value>index</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>edit</portlet-mode>
<portlet-mode>help</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<portlet-info>
<title>My Struts2 Portlet with JSR 286 Dispatcher</title>
<short-title>SP2JSR286</short-title>
<keywords>struts,portlet</keywords>
</portlet-info>
</portlet>
<portlet id="Struts2PublishPortlet">
<description xml:lang="EN">Struts2 Publish Portlet</description>
<portlet-name>Struts2PublishPortlet</portlet-name>
<display-name xml:lang="EN">Struts2 Publish Portlet</display-name>
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr286Dispatcher</portlet-class>
<!-- The view mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>viewNamespace</name>
<value>/eventing</value>
</init-param>
<!-- The default action to invoke in view mode. -->
<init-param>
<name>defaultViewAction</name>
<value>publish</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<supported-locale>en</supported-locale>
<portlet-info>
<title>Struts2 Publish Portlet</title>
<short-title>S2PUB</short-title>
<keywords>struts,publish,portlet</keywords>
</portlet-info>
<supported-publishing-event xmlns:x="http://org.apache.struts2.portlets/events">
<qname>x:name</qname>
</supported-publishing-event>
</portlet>
<portlet id="Struts2ProcessPortlet">
<description xml:lang="EN">Struts2 Process Portlet</description>
<portlet-name>Struts2ProcessPortlet</portlet-name>
<display-name xml:lang="EN">Struts2 Process Portlet</display-name>
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr286Dispatcher</portlet-class>
<!-- The view mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>viewNamespace</name>
<value>/eventing</value>
</init-param>
<!-- The default action to invoke in view mode. -->
<init-param>
<name>defaultViewAction</name>
<value>process</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<supported-locale>en</supported-locale>
<portlet-info>
<title>Struts2 Process Portlet</title>
<short-title>S2PRO</short-title>
<keywords>struts,process,portlet</keywords>
</portlet-info>
<supported-processing-event xmlns:x="http://org.apache.struts2.portlets/events">
<qname>x:name</qname>
</supported-processing-event>
</portlet>
<event-definition>
<qname xmlns:x="http://org.apache.struts2.portlets/events">x:name</qname>
<value-type>java.lang.String</value-type>
</event-definition>
</portlet-app>
+3 -6
View File
@@ -8,11 +8,8 @@
/WEB-INF/applicationContext*.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- Uncomment to use the dispatcher servlet -->
<!--<servlet id="Struts2PortletDispatcherServlet">
<servlet-name>Struts2PortletDispatcherServlet</servlet-name>
<servlet-class>org.apache.struts2.portlet.dispatcher.DispatcherServlet</servlet-class>
</servlet>-->
</web-app>
+2 -2
View File
@@ -26,13 +26,13 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.2.2</version>
<version>2.3.1</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-rest-showcase</artifactId>
<packaging>war</packaging>
<version>2.2.2</version>
<version>2.3.1</version>
<name>Struts 2 Rest Showcase Example</name>
<description>Struts 2 Rest Showcase Example</description>
+11 -5
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.2.2</version>
<version>2.3.1</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-showcase</artifactId>
@@ -34,9 +34,9 @@
<name>Showcase Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/apps/showcase</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/apps/showcase</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_2_2/apps/showcase</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/apps/showcase</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/apps/showcase</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_1/apps/showcase</url>
</scm>
@@ -95,6 +95,12 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-json-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
@@ -103,7 +109,7 @@
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-codebehind-plugin</artifactId>
<artifactId>struts2-convention-plugin</artifactId>
<version>${project.version}</version>
</dependency>
@@ -20,6 +20,11 @@
*/
package org.apache.struts2.showcase;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Validateable;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.ServletActionContext;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
@@ -28,12 +33,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Validateable;
import com.opensymphony.xwork2.util.ValueStack;
/**
*/
public class UITagExample extends ActionSupport implements Validateable {
@@ -47,6 +46,7 @@ public class UITagExample extends ActionSupport implements Validateable {
String bio;
String favouriteColor;
List friends;
String bestFriend;
boolean legalAge;
String state;
String region;
@@ -185,6 +185,14 @@ public class UITagExample extends ActionSupport implements Validateable {
this.friends = friends;
}
public String getBestFriend() {
return bestFriend;
}
public void setBestFriend(String bestFriend) {
this.bestFriend = bestFriend;
}
public boolean isLegalAge() {
return legalAge;
}
@@ -24,17 +24,20 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.apache.struts2.config.Result;
import org.apache.struts2.config.Results;
import org.apache.struts2.dispatcher.ServletRedirectResult;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.convention.annotation.Results;
/**
* <code>EditPerson</code>
*
*/
@Result(name="list", value="listPeople.action", type=ServletRedirectResult.class)
@Results({
@Result(name="list", location="list-people.action", type="redirect"),
@Result(name="input", location="new-person.ftl", type="freemarker")
})
public class EditPersonAction extends ActionSupport {
private static final long serialVersionUID = 7699491775215130850L;
@@ -23,11 +23,11 @@ package org.apache.struts2.showcase.person;
import java.util.ArrayList;
import java.util.List;
import org.apache.struts2.config.Result;
import org.apache.struts2.views.freemarker.FreemarkerResult;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
@Result(location="list-people.ftl", type="freemarker")
public class ListPeopleAction extends ActionSupport {
private static final long serialVersionUID = 3608017189783645371L;
@@ -20,16 +20,13 @@
*/
package org.apache.struts2.showcase.person;
import org.apache.struts2.config.ParentPackage;
import org.apache.struts2.config.Result;
import org.apache.struts2.config.Results;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.views.freemarker.FreemarkerResult;
import com.opensymphony.xwork2.ActionSupport;
/**
*/
@ParentPackage("person")
@Result(name="input", location="new-person.ftl", type="freemarker")
public class NewPersonAction extends ActionSupport {
private static final long serialVersionUID = 200410824352645515L;
@@ -0,0 +1,7 @@
@ParentPackage("person")
@Namespace("/person")
package org.apache.struts2.showcase.person;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
@@ -1,6 +1,6 @@
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
"-//Apache Struts//XWork Validator 1.0.2//EN"
"http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
<field name="description1">
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.dtd">
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.dtd">
<validators>
<!-- Field-Validator Syntax -->
<field name="currentEmployee.empId">
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.dtd">
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.dtd">
<validators>
<!-- Field-Validator Syntax -->
<field name="currentSkill.name">
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
"-//Apache Struts//XWork Validator 1.0//EN"
"http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
<field name="name">
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
"-//Apache Struts//XWork Validator 1.0.2//EN"
"http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
<field name="name">
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
"-//Apache Struts//XWork Validator 1.0.2//EN"
"http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
<field name="name">
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
"-//Apache Struts//XWork Validator 1.0.2//EN"
"http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
<field name="message">
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
"-//Apache Struts//XWork Validator 1.0.2//EN"
"http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
<field name="upload">
@@ -1,4 +1,4 @@
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.dtd">
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.dtd">
<validators>
<field name="person">
<field-validator type="visitor">
@@ -1,4 +1,4 @@
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.dtd">
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.dtd">
<validators>
<field name="name">
<field-validator type="requiredstring">
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
"-//Apache Struts//XWork Validator 1.0.2//EN"
"http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
<field name="value">
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
"-//Apache Struts//XWork Validator 1.0//EN"
"http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<!-- START SNIPPET: fieldValidatorsExample -->
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
"-//Apache Struts//XWork Validator 1.0//EN"
"http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<!-- START SNIPPET: fieldValidatorsExample -->
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
"-//Apache Struts//XWork Validator 1.0//EN"
"http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<!-- START SNIPPET: nonFieldValidatorsExample -->
@@ -1,9 +1,9 @@
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<!-- START SNIPPET: quizValidators -->
<!--
Add the following DOCTYPE declaration as first line of your XXX-validation.xml file:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
-->
<validators>
<field name="name">
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
"-//Apache Struts//XWork Validator 1.0//EN"
"http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
<field name="name">
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
"-//Apache Struts//XWork Validator 1.0//EN"
"http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
<field name="name">
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
"-//Apache Struts//XWork Validator 1.0//EN"
"http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<!-- START SNIPPET: visitorValidatorsExample -->
@@ -54,7 +54,7 @@
</action>
</package>
<package name="ajaxNoDecorate" namespace="/nodecorate" extends="struts-default">
<package name="ajaxNoDecorate" namespace="/nodecorate" extends="json-default">
<!-- example 4 -->
<action name="panel1" class="org.apache.struts2.showcase.ajax.Example4ShowPanelAction" method="panel1">
<result type="freemarker">/ajax/tabbedpanel/nodecorate/panel1.ftl</result>
@@ -3,7 +3,7 @@
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="validation" extends="struts-default" namespace="/validation">
<package name="validation" extends="json-default" namespace="/validation">
<action name="quizBasic" class="org.apache.struts2.showcase.validation.QuizAction">
<result name="input">quiz-basic.jsp</result>
<result>quiz-success.jsp</result>
+3 -3
View File
@@ -14,13 +14,13 @@
<constant name="struts.custom.i18n.resources" value="globalMessages" />
<constant name="struts.action.extension" value="action,," />
<constant name="struts.codebehind.defaultPackage" value="person" />
<constant name="struts.convention.package.locators.basePackage" value="org.apache.struts2.showcase.person" />
<constant name="struts.convention.result.path" value="/" />
<constant name="struts.freemarker.manager.classname" value="customFreemarkerManager" />
<constant name="struts.serve.static" value="true" />
<constant name="struts.serve.static.browserCache" value="false" />
<constant name="actionPackages" value="org.apache.struts2.showcase.person"/>
<include file="struts-chat.xml" />
<include file="struts-interactive.xml" />
@@ -9,10 +9,6 @@
<filter>
<filter-name>struts-prepare</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
<init-param>
<param-name>actionPackages</param-name>
<param-value>org.apache.struts2.showcase.person</param-value>
</init-param>
</filter>
<filter>
@@ -6,7 +6,7 @@
</head>
<body>
<s:form action="editPerson" theme="simple" validate="false">
<s:form action="edit-person" theme="simple" validate="false">
<table>
<tr>
@@ -33,8 +33,10 @@
</s:form>
<ul>
<li><a href="newPerson!input.action">Create</a> a new person</li>
<li><a href="listPeople.action">List</a> all people</li>
<s:url id="newpersonurl" action="new-person" method="input" />
<li><s:a href="%{newpersonurl}">Create</s:a> a new person</li>
<s:url id="listpeopleurl" action="list-people" />
<li><s:a href="%{listpeopleurl}">List</s:a> all people</li>
</ul>
</body>
@@ -1,3 +1,5 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Acme Corp</title>
@@ -5,8 +7,10 @@
<body>
<ul>
<li><a href="newPerson!input.action">Create</a> a new person</li>
<li><a href="listPeople.action">List</a> all people</li>
<s:url id="newpersonurl" action="new-person" method="input" />
<li><s:a href="%{newpersonurl}">Create</s:a> a new person</li>
<s:url id="listpeopleurl" action="list-people" />
<li><s:a href="%{listpeopleurl}">List</s:a> all people</li>
</ul>
</body>
</html>
@@ -21,8 +21,10 @@ There are ${peopleCount} people...
</table>
<ul>
<li><a href="editPerson.action">Edit people</a></li>
<li><a href="newPerson!input.action">Create</a> a new person</li>
<@s.url id="editpersonurl" action="edit-person" />
<li><@s.a href="%{editpersonurl}">Edit people</@s.a></li>
<@s.url id="newpersonurl" action="new-person" method="input" />
<li><@s.a href="%{newpersonurl}">Create</@s.a> a new person</li>
</ul>
</body>
</html>
@@ -0,0 +1,21 @@
<html>
<head>
<title>New Person</title>
</head>
<body>
<@s.form action="new-person">
<@s.textfield label="First Name" name="person.name"/>
<@s.textfield label="Last Name" name="person.lastName"/>
<@s.submit value="Create person"/>
</@s.form>
<ul>
<@s.url id="editpersonurl" action="edit-person" />
<li><@s.a href="%{editpersonurl}">Edit people</@s.a></li>
<@s.url id="listpeopleurl" action="list-people" />
<li><@s.a href="%{listpeopleurl}">List</@s.a> all people</li>
</ul>
</body>
</html>
@@ -1,19 +0,0 @@
<html>
<head>
<title>New Person</title>
</head>
<body>
<@s.form action="newPerson">
<@s.textfield label="First Name" name="person.name"/>
<@s.textfield label="Last Name" name="person.lastName"/>
<@s.submit value="Create person"/>
</@s.form>
<ul>
<li><a href="editPerson.action">Edit people</a></li>
<li><a href="listPeople.action">List</a> all people</li>
</ul>
</body>
</html>
@@ -62,9 +62,16 @@
<s:checkboxlist
tooltip="Choose your Friends"
label="Friends"
list="{'Patrick', 'Jason', 'Jay', 'Toby', 'Rene'}"
list="{'Wes', 'Patrick', 'Jason', 'Jay', 'Toby', 'Rene'}"
name="friends"/>
<s:radio
tooltip="Choose your Best Friend"
label="Best Friend"
list="{'Wes', 'Patrick', 'Jason', 'Jay', 'Toby', 'Rene'}"
name="bestFriend"
cssErrorClass="foo" />
<s:checkbox
tooltip="Confirmed that your are Over 18"
label="Age 18+"
@@ -18,7 +18,8 @@
</tr>
<s:label label="Biography" name="bio" />
<s:label label="Favourite Color" name="favouriteColor" />
<s:label label="Friends" name="friends" />
<s:label label="Friends" name="friends" />
<s:label label="Best Friend" name="bestFriend" />
<s:label label="Legal Age" name="legalAge" />
<s:label label="Region" name="region" />
<s:label label="State" name="state" />
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.2.2</version>
<version>2.3.1</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Maven Archetypes</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/archetypes</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/archetypes</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/archetypes</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/archetypes</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/archetypes</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/archetypes</url>
</scm>
<modules>
+17 -5
View File
@@ -3,24 +3,36 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.2.2</version>
<version>2.3.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-blank</artifactId>
<version>2.2.2</version>
<version>2.3.1</version>
<name>Struts 2 Archetypes - Blank</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/archetypes/struts2-archetype-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/archetypes/struts2-archetype-blank</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/archetypes/struts2-archetype-blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/archetypes/struts2-archetype-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/archetypes/struts2-archetype-blank</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/archetypes/struts2-archetype-blank</url>
</scm>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/pom.xml</include>
</includes>
</resource>
</resources>
</build>
<profiles>
<profile>
<id>release</id>
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
"-//Apache Struts//XWork Validator 1.0.2//EN"
"http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
<field name="username">
<field-validator type="requiredstring">
@@ -2,24 +2,36 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.2.2</version>
<version>2.3.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-convention</artifactId>
<version>2.2.2</version>
<version>2.3.1</version>
<name>Struts 2 Archetypes - Blank Convention</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/archetypes/struts2-archetype-convention</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/archetypes/struts2-archetype-convention</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/archetypes/struts2-archetype-convention</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/archetypes/struts2-archetype-convention</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/archetypes/struts2-archetype-convention</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/archetypes/struts2-archetype-convention</url>
</scm>
<properties>
<maven.test.skip>true</maven.test.skip>
<maven.test.skip>true</maven.test.skip>
</properties>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/pom.xml</include>
</includes>
</resource>
</resources>
</build>
<profiles>
<profile>
<id>release</id>
+21 -9
View File
@@ -1,25 +1,37 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.2.2</version>
</parent>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-dbportlet</artifactId>
<version>2.2.2</version>
<version>2.3.1</version>
<name>Struts 2 Archetypes - Database Portlet</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/archetypes/struts2-archetype-dbportlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/archetypes/struts2-archetype-dbportlet</developerConnection>
<url>svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/archetypes/struts2-archetype-dbportlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/archetypes/struts2-archetype-dbportlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/archetypes/struts2-archetype-dbportlet</developerConnection>
<url>svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/archetypes/struts2-archetype-dbportlet</url>
</scm>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/pom.xml</include>
</includes>
</resource>
</resources>
</build>
<profiles>
<profile>
<id>release</id>
@@ -59,7 +59,7 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>2.5.6</version>
<version>3.0.5.RELEASE</version>
</dependency>
<!-- Database driver (change for your specific database) -->
@@ -85,9 +85,9 @@
</dependency>
<dependency>
<groupId>portlet-api</groupId>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<version>1.0</version>
<version>2.0</version>
<scope>provided</scope>
</dependency>
@@ -117,9 +117,9 @@
</configuration>
<dependencies>
<dependency>
<groupId>portlet-api</groupId>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<version>1.0</version>
<version>2.0</version>
</dependency>
</dependencies>
</plugin>
@@ -6,7 +6,7 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http:
<portlet-name>StrutsDBPortlet</portlet-name>
<display-name xml:lang="EN">Struts Database Portlet</display-name>
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class>
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr286Dispatcher</portlet-class>
<init-param>
<name>actionPackages</name>
+47 -35
View File
@@ -1,46 +1,58 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.2.2</version>
</parent>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-plugin</artifactId>
<version>2.2.2</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Plugin</name>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-plugin</artifactId>
<version>2.3.1</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/archetypes/struts2-archetype-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/archetypes/struts2-archetype-plugin</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/archetypes/struts2-archetype-plugin</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/archetypes/struts2-archetype-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/archetypes/struts2-archetype-plugin</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/archetypes/struts2-archetype-plugin</url>
</scm>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/pom.xml</include>
</includes>
</resource>
</resources>
</build>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
+17 -5
View File
@@ -2,25 +2,37 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.2.2</version>
<version>2.3.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-portlet</artifactId>
<version>2.2.2</version>
<version>2.3.1</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Portlet</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/archetypes/struts2-archetype-portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/archetypes/struts2-archetype-portlet</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/archetypes/struts2-archetype-portlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/archetypes/struts2-archetype-portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/archetypes/struts2-archetype-portlet</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/archetypes/struts2-archetype-portlet</url>
</scm>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/pom.xml</include>
</includes>
</resource>
</resources>
</build>
<profiles>
<profile>
<id>release</id>
@@ -37,7 +37,7 @@
<dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<version>1.0</version>
<version>2.0</version>
<scope>provided</scope>
</dependency>
@@ -12,7 +12,7 @@
<portlet-name>HelloPortlet</portlet-name>
<display-name xml:lang="EN">${artifactId}</display-name>
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class>
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr286Dispatcher</portlet-class>
<!-- The namespace for the actions configured for view mode -->
<init-param>
+47 -35
View File
@@ -1,49 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.2.2</version>
</parent>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-starter</artifactId>
<version>2.2.2</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Starter</name>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-starter</artifactId>
<version>2.3.1</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Starter</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/archetypes/struts2-archetype-starter</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/archetypes/struts2-archetype-starter</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/archetypes/struts2-archetype-starter</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/archetypes/struts2-archetype-starter</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/archetypes/struts2-archetype-starter</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/archetypes/struts2-archetype-starter</url>
</scm>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/pom.xml</include>
</includes>
</resource>
</resources>
</build>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
+4 -4
View File
@@ -11,13 +11,13 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.2.2</version>
<version>2.3.1</version>
</parent>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/assembly</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/assembly</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_2_2/assembly</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/assembly</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/assembly</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_1/assembly</url>
</scm>
<profiles>
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
<version>2.2.2</version>
<version>2.3.1</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-admin-bundle</artifactId>
@@ -12,9 +12,9 @@
<name>Struts 2 OSGi Admin Bundle</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/bundles/admin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/bundles/admin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_2_2/bundles/admin</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/bundles/admin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/bundles/admin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_1/bundles/admin</url>
</scm>
<dependencies>
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
<version>2.2.2</version>
<version>2.3.1</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-demo-bundle</artifactId>
@@ -12,9 +12,9 @@
<name>Struts 2 OSGi Demo Bundle</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/bundles/demo</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/bundles/demo</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_2_2/bundles/demo</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/bundles/demo</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/bundles/demo</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_1/bundles/demo</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.2.2</version>
<version>2.3.1</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
@@ -34,9 +34,9 @@
<name>Struts OSGi Bundles</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/bundles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/bundles</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/bundles</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/bundles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/bundles</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/bundles</url>
</scm>
<modules>
+5 -5
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.2.2</version>
<version>2.3.1</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Core</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_2_2/core</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_2_2/core</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_1/core</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_1/core</url>
</scm>
<properties>
@@ -315,7 +315,7 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<artifactId>spring-core</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
@@ -167,7 +167,9 @@ public class ActionComponent extends ContextBean {
try {
writer.flush();
} catch (IOException e) {
LOG.warn("error while trying to flush writer ", e);
if (LOG.isWarnEnabled()) {
LOG.warn("error while trying to flush writer ", e);
}
}
}
executeAction();
@@ -141,7 +141,9 @@ public class AppendIterator extends ContextBean implements UnnamedParametric {
Object iteratorEntryObj = paramEntries.next();
if (! MakeIterator.isIterable(iteratorEntryObj)) {
LOG.warn("param with value resolved as "+iteratorEntryObj+" cannot be make as iterator, it will be ignored and hence will not appear in the merged iterator");
if (LOG.isWarnEnabled()) {
LOG.warn("param with value resolved as "+iteratorEntryObj+" cannot be make as iterator, it will be ignored and hence will not appear in the merged iterator");
}
continue;
}
appendIteratorFilter.setSource(MakeIterator.convert(iteratorEntryObj));
@@ -75,13 +75,17 @@ public class File extends UIBean {
String encType = (String) form.getParameters().get("enctype");
if (!"multipart/form-data".equals(encType)) {
// uh oh, this isn't good! Let's warn the developer
LOG.warn("Struts has detected a file upload UI tag (s:file) being used without a form set to enctype 'multipart/form-data'. This is probably an error!");
if (LOG.isWarnEnabled()) {
LOG.warn("Struts has detected a file upload UI tag (s:file) being used without a form set to enctype 'multipart/form-data'. This is probably an error!");
}
}
String method = (String) form.getParameters().get("method");
if (!"post".equalsIgnoreCase(method)) {
// uh oh, this isn't good! Let's warn the developer
LOG.warn("Struts has detected a file upload UI tag (s:file) being used without a form set to method 'POST'. This is probably an error!");
if (LOG.isWarnEnabled()) {
LOG.warn("Struts has detected a file upload UI tag (s:file) being used without a form set to method 'POST'. This is probably an error!");
}
}
}
@@ -57,7 +57,7 @@ import com.opensymphony.xwork2.util.logging.LoggerFactory;
* <p>Include a servlet's output (result of servlet or a JSP page).</p>
* <p>Note: Any additional params supplied to the included page are <b>not</b>
* accessible within the rendered page through the &lt;s:property...&gt; tag
* since no valuestack will be created. You can, however, access them in a
* since no valuestack will be created. You can, however, access them in a
* servlet via the HttpServletRequest object or from a JSP page via
* a scriptlet.</p>
* <!-- END SNIPPET: javadoc -->
@@ -103,8 +103,7 @@ public class Include extends Component {
private static final Logger LOG = LoggerFactory.getLogger(Include.class);
private static String encoding;
private static boolean encodingDefined = true;
private static String systemEncoding = System.getProperty("file.encoding");
protected String value;
private HttpServletRequest req;
@@ -151,7 +150,9 @@ public class Include extends Component {
try {
urlBuf.append(URLEncoder.encode(values.get(i).toString(), "UTF-8"));
} catch (Exception e) {
LOG.warn("unable to url-encode "+values.get(i).toString()+", it will be ignored");
if (LOG.isWarnEnabled()) {
LOG.warn("unable to url-encode "+values.get(i).toString()+", it will be ignored");
}
}
concat = "&";
@@ -163,9 +164,11 @@ public class Include extends Component {
// Include
try {
include(result, writer, req, res);
include(result, writer, req, res, defaultEncoding);
} catch (Exception e) {
LOG.warn("Exception thrown during include of " + result, e);
if (LOG.isWarnEnabled()) {
LOG.warn("Exception thrown during include of " + result, e);
}
}
return super.end(writer, body);
@@ -240,8 +243,32 @@ public class Include extends Component {
}
}
public static void include(String aResult, Writer writer, ServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String resourcePath = getContextRelativePath(request, aResult);
/**
* @deprecated use {@link #include(String, java.io.Writer, javax.servlet.ServletRequest,
* javax.servlet.http.HttpServletResponse, String)} instead with correct encoding specified
*/
public static void include( String relativePath, Writer writer, ServletRequest request,
HttpServletResponse response ) throws ServletException, IOException {
include(relativePath, writer, request, response, null);
}
/**
* Include a resource in a response.
*
* @param relativePath the relative path of the resource to include; resolves to {@link #getContextRelativePath(javax.servlet.ServletRequest,
* String)}
* @param writer the Writer to write output to
* @param request the current request
* @param response the response to write to
* @param encoding the file encoding to use for including the resource; if <tt>null</tt>, it will default to the
* platform encoding
*
* @throws ServletException
* @throws IOException
*/
public static void include( String relativePath, Writer writer, ServletRequest request,
HttpServletResponse response, String encoding ) throws ServletException, IOException {
String resourcePath = getContextRelativePath(request, relativePath);
RequestDispatcher rd = request.getRequestDispatcher(resourcePath);
if (rd == null) {
@@ -251,50 +278,17 @@ public class Include extends Component {
PageResponse pageResponse = new PageResponse(response);
// Include the resource
rd.include((HttpServletRequest) request, pageResponse);
//write the response back to the JspWriter, using the correct encoding.
String encoding = getEncoding();
rd.include(request, pageResponse);
if (encoding != null) {
//use the encoding specified in the property file
// Use given encoding
pageResponse.getContent().writeTo(writer, encoding);
} else {
//use the platform specific encoding
pageResponse.getContent().writeTo(writer, null);
pageResponse.getContent().writeTo(writer, systemEncoding);
}
}
/**
* Get the encoding specified by the property 'struts.i18n.encoding' in struts.properties,
* or return the default platform encoding if not specified.
* <p/>
* Note that if the property is not initially defined, this will return the system default,
* even if the property is later defined. This is mainly for performance reasons. Undefined
* properties throw exceptions, which are a costly operation.
* <p/>
* If the property is initially defined, it is read every time, until is is undefined, and then
* the system default is used.
* <p/>
* Why not cache it completely? Some applications will wish to be able to dynamically set the
* encoding at runtime.
*
* @return The encoding to be used.
*/
private static String getEncoding() {
if (encodingDefined) {
try {
encoding = defaultEncoding;
} catch (IllegalArgumentException e) {
encoding = System.getProperty("file.encoding");
encodingDefined = false;
}
}
return encoding;
}
/**
* Implementation of ServletOutputStream that stores all data written
* to it in a temporary buffer accessible from {@link #getBuffer()} .
@@ -201,7 +201,9 @@ public class InputTransferSelect extends ListUIBean {
}
else {
LOG.warn("form enclosing inputtransferselect "+this+" not found, auto select upon form submit of inputtransferselect will not work");
if (LOG.isWarnEnabled()) {
LOG.warn("form enclosing inputtransferselect "+this+" not found, auto select upon form submit of inputtransferselect will not work");
}
}
}
@@ -155,7 +155,9 @@ public class MergeIterator extends ContextBean implements UnnamedParametric {
for (Iterator parametersIterator = _parameters.iterator(); parametersIterator.hasNext(); ) {
Object iteratorEntryObj = parametersIterator.next();
if (! MakeIterator.isIterable(iteratorEntryObj)) {
LOG.warn("param with value resolved as "+iteratorEntryObj+" cannot be make as iterator, it will be ignored and hence will not appear in the merged iterator");
if (LOG.isWarnEnabled()) {
LOG.warn("param with value resolved as "+iteratorEntryObj+" cannot be make as iterator, it will be ignored and hence will not appear in the merged iterator");
}
continue;
}
mergeIteratorFilter.setSource(MakeIterator.convert(iteratorEntryObj));
@@ -332,7 +332,9 @@ public class OptionTransferSelect extends DoubleListUIBean {
}
else {
LOG.warn("form enclosing optiontransferselect "+this+" not found, auto select upon form submit of optiontransferselect will not work");
if (LOG.isWarnEnabled()) {
LOG.warn("form enclosing optiontransferselect "+this+" not found, auto select upon form submit of optiontransferselect will not work");
}
}
}
@@ -165,7 +165,9 @@ public class Property extends Component {
writer.write(prepare(defaultValue));
}
} catch (IOException e) {
LOG.info("Could not print out value '" + value + "'", e);
if (LOG.isInfoEnabled()) {
LOG.info("Could not print out value '" + value + "'", e);
}
}
return result;
@@ -77,7 +77,8 @@ public class ServletUrlRenderer implements UrlRenderer {
final String action = ai.getProxy().getActionName();
final String namespace = ai.getProxy().getNamespace();
result = urlComponent.determineActionURL(action, namespace, urlComponent.getMethod(),urlComponent.getHttpServletRequest(), urlComponent.getHttpServletResponse(), urlComponent.getParameters(), scheme, urlComponent.isIncludeContext(), urlComponent.isEncode(), urlComponent.isForceAddSchemeHostAndPort(), urlComponent.isEscapeAmp());
final String method = urlComponent.getMethod() != null || !ai.getProxy().isMethodSpecified() ? urlComponent.getMethod() : ai.getProxy().getMethod();
result = urlComponent.determineActionURL(action, namespace, method, urlComponent.getHttpServletRequest(), urlComponent.getHttpServletResponse(), urlComponent.getParameters(), scheme, urlComponent.isIncludeContext(), urlComponent.isEncode(), urlComponent.isForceAddSchemeHostAndPort(), urlComponent.isEscapeAmp());
} else {
String _value = urlComponent.getValue();
@@ -182,7 +183,7 @@ public class ServletUrlRenderer implements UrlRenderer {
// Warn user that the specified namespace/action combo
// was not found in the configuration.
if (namespace != null) {
if (namespace != null && LOG.isWarnEnabled()) {
LOG.warn("No configuration found for the specified action: '" + actionName + "' in namespace: '" + namespace + "'. Form action defaulting to 'action' attribute's literal value.");
}
@@ -246,10 +247,14 @@ public class ServletUrlRenderer implements UrlRenderer {
includeGetParameters(urlComponent);
includeExtraParameters(urlComponent);
} else if (includeParams != null) {
LOG.warn("Unknown value for includeParams parameter to URL tag: " + includeParams);
if (LOG.isWarnEnabled()) {
LOG.warn("Unknown value for includeParams parameter to URL tag: " + includeParams);
}
}
} catch (Exception e) {
LOG.warn("Unable to put request parameters (" + urlComponent.getHttpServletRequest().getQueryString() + ") into parameter map.", e);
if (LOG.isWarnEnabled()) {
LOG.warn("Unable to put request parameters (" + urlComponent.getHttpServletRequest().getQueryString() + ") into parameter map.", e);
}
}
@@ -817,7 +817,9 @@ public abstract class UIBean extends Component {
}
}
else {
LOG.warn("No ancestor Form found, javascript based tooltip will not work, however standard HTML tooltip using alt and title attribute will still work ");
if (LOG.isWarnEnabled()) {
LOG.warn("No ancestor Form found, javascript based tooltip will not work, however standard HTML tooltip using alt and title attribute will still work ");
}
}
//TODO: this is to keep backward compatibility, remove once when tooltipConfig is dropped
@@ -902,7 +904,9 @@ public abstract class UIBean extends Component {
if (form != null) {
form.addParameter("customOnsubmitEnabled", Boolean.TRUE);
} else {
LOG.warn("Cannot find an Ancestor form, custom onsubmit is NOT enabled");
if (LOG.isWarnEnabled()) {
LOG.warn("Cannot find an Ancestor form, custom onsubmit is NOT enabled");
}
}
}
@@ -932,7 +936,9 @@ public abstract class UIBean extends Component {
tooltipConfig.put(key, value);
}
else {
LOG.warn("component "+component+" tooltip config param "+key+" has no value defined, skipped");
if (LOG.isWarnEnabled()) {
LOG.warn("component "+component+" tooltip config param "+key+" has no value defined, skipped");
}
}
}
}
@@ -156,7 +156,9 @@ public class UpDownSelect extends Select {
ancestorForm.getParameters().put("updownselectIds", m);
}
else {
LOG.warn("no ancestor form found for updownselect "+this+", therefore autoselect of all elements upon form submission will not work ");
if (LOG.isWarnEnabled()) {
LOG.warn("no ancestor form found for updownselect "+this+", therefore autoselect of all elements upon form submission will not work ");
}
}
}
@@ -102,7 +102,9 @@ public abstract class BaseTemplateEngine implements TemplateEngine {
try {
is.close();
} catch (IOException io) {
LOG.warn("Unable to close input stream", io);
if (LOG.isWarnEnabled()) {
LOG.warn("Unable to close input stream", io);
}
}
}
@@ -122,7 +124,9 @@ public abstract class BaseTemplateEngine implements TemplateEngine {
try {
return createFileInputStream(propFile);
} catch (FileNotFoundException e) {
LOG.warn("Unable to find file in filesystem [" + propFile.getAbsolutePath() + "]");
if (LOG.isWarnEnabled()) {
LOG.warn("Unable to find file in filesystem [" + propFile.getAbsolutePath() + "]");
}
return null;
}
}
@@ -23,10 +23,13 @@ package org.apache.struts2.components.template;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.PageContext;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.components.Include;
import org.apache.struts2.components.UIBean;
@@ -40,6 +43,13 @@ import com.opensymphony.xwork2.util.logging.LoggerFactory;
public class JspTemplateEngine extends BaseTemplateEngine {
private static final Logger LOG = LoggerFactory.getLogger(JspTemplateEngine.class);
String encoding;
@Inject(StrutsConstants.STRUTS_I18N_ENCODING)
public void setEncoding(String encoding) {
this.encoding = encoding;
}
public void renderTemplate(TemplateRenderingContext templateContext) throws Exception {
Template template = templateContext.getTemplate();
@@ -56,7 +66,7 @@ public class JspTemplateEngine extends BaseTemplateEngine {
for (Template t : templates) {
try {
Include.include(getFinalTemplateName(t), pageContext.getOut(),
pageContext.getRequest(), (HttpServletResponse) pageContext.getResponse());
pageContext.getRequest(), (HttpServletResponse) pageContext.getResponse(), encoding);
success = true;
break;
} catch (Exception e) {
@@ -251,7 +251,9 @@ public class BeanSelectionProvider implements ConfigurationProvider {
while (customBundles.hasMoreTokens()) {
String name = customBundles.nextToken();
try {
LOG.info("Loading global messages from " + name);
if (LOG.isInfoEnabled()) {
LOG.info("Loading global messages from " + name);
}
LocalizedTextUtil.addDefaultResourceBundle(name);
} catch (Exception e) {
LOG.error("Could not find messages file " + name + ".properties. Skipping");
@@ -268,7 +270,7 @@ public class BeanSelectionProvider implements ConfigurationProvider {
if (!builder.contains(type)) {
String foundName = props.getProperty(key, DEFAULT_BEAN_NAME);
if (builder.contains(type, foundName)) {
if (LOG.isDebugEnabled()) {
if (LOG.isInfoEnabled()) {
LOG.info("Choosing bean ("+foundName+") for "+type);
}
builder.alias(type, foundName, Container.DEFAULT_NAME);
@@ -296,7 +298,9 @@ public class BeanSelectionProvider implements ConfigurationProvider {
}
}
} else {
LOG.warn("Unable to alias bean type "+type+", default mapping already assigned.");
if (LOG.isWarnEnabled()) {
LOG.warn("Unable to alias bean type "+type+", default mapping already assigned.");
}
}
}
@@ -89,7 +89,9 @@ public class LegacyPropertiesConfigurationProvider implements ConfigurationProvi
}
locale = new Locale(lang, country);
} else {
LOG.info("No locale define, substituting the default VM locale");
if (LOG.isInfoEnabled()) {
LOG.info("No locale define, substituting the default VM locale");
}
locale = Locale.getDefault();
}
}
@@ -57,7 +57,9 @@ class PropertiesSettings extends Settings {
URL settingsUrl = ClassLoaderUtils.getResource(name + ".properties", getClass());
if (settingsUrl == null) {
LOG.debug(name + ".properties missing");
if (LOG.isDebugEnabled()) {
LOG.debug(name + ".properties missing");
}
settings = new LocatableProperties();
return;
}
@@ -76,7 +78,9 @@ class PropertiesSettings extends Settings {
try {
in.close();
} catch(IOException io) {
LOG.warn("Unable to close input stream", io);
if (LOG.isWarnEnabled()) {
LOG.warn("Unable to close input stream", io);
}
}
}
}
@@ -79,6 +79,7 @@ public class StrutsXmlConfigurationProvider extends XmlConfigurationProvider {
dtdMappings.put("-//Apache Software Foundation//DTD Struts Configuration 2.0//EN", "struts-2.0.dtd");
dtdMappings.put("-//Apache Software Foundation//DTD Struts Configuration 2.1//EN", "struts-2.1.dtd");
dtdMappings.put("-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN", "struts-2.1.7.dtd");
dtdMappings.put("-//Apache Software Foundation//DTD Struts Configuration 2.3//EN", "struts-2.3.dtd");
setDtdMappings(dtdMappings);
File file = new File(filename);
if (file.getParent() != null) {
@@ -20,6 +20,16 @@
*/
package org.apache.struts2.dispatcher;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.dispatcher.ng.HostConfig;
import org.apache.struts2.util.ClassLoaderUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -31,18 +41,6 @@ import java.util.Calendar;
import java.util.List;
import java.util.StringTokenizer;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.dispatcher.ng.HostConfig;
import org.apache.struts2.util.ClassLoaderUtils;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
public class DefaultStaticContentLoader implements StaticContentLoader {
/**
* Provide a logging instance.
@@ -342,7 +340,7 @@ public class DefaultStaticContentLoader implements StaticContentLoader {
}
public boolean canHandle(String resourcePath) {
return serveStatic && (resourcePath.startsWith("/struts") || resourcePath.startsWith("/static"));
return serveStatic && (resourcePath.startsWith("/struts/") || resourcePath.startsWith("/static/"));
}
/**
@@ -258,14 +258,16 @@ public class Dispatcher {
// clean up ObjectFactory
ObjectFactory objectFactory = getContainer().getInstance(ObjectFactory.class);
if (objectFactory == null) {
LOG.warn("Object Factory is null, something is seriously wrong, no clean up will be performed");
if (LOG.isWarnEnabled()) {
LOG.warn("Object Factory is null, something is seriously wrong, no clean up will be performed");
}
}
if (objectFactory instanceof ObjectFactoryDestroyable) {
try {
((ObjectFactoryDestroyable)objectFactory).destroy();
}
catch(Exception e) {
// catch any exception that may occured during destroy() and log it
// catch any exception that may occurred during destroy() and log it
LOG.error("exception occurred while destroying ObjectFactory ["+objectFactory+"]", e);
}
}
@@ -305,11 +307,11 @@ public class Dispatcher {
}
private void init_DefaultProperties() {
configurationManager.addConfigurationProvider(new DefaultPropertiesProvider());
configurationManager.addContainerProvider(new DefaultPropertiesProvider());
}
private void init_LegacyStrutsProperties() {
configurationManager.addConfigurationProvider(new LegacyPropertiesConfigurationProvider());
configurationManager.addContainerProvider(new LegacyPropertiesConfigurationProvider());
}
private void init_TraditionalXmlConfigurations() {
@@ -321,9 +323,9 @@ public class Dispatcher {
for (String file : files) {
if (file.endsWith(".xml")) {
if ("xwork.xml".equals(file)) {
configurationManager.addConfigurationProvider(createXmlConfigurationProvider(file, false));
configurationManager.addContainerProvider(createXmlConfigurationProvider(file, false));
} else {
configurationManager.addConfigurationProvider(createStrutsXmlConfigurationProvider(file, false, servletContext));
configurationManager.addContainerProvider(createStrutsXmlConfigurationProvider(file, false, servletContext));
}
} else {
throw new IllegalArgumentException("Invalid configuration file name");
@@ -347,7 +349,7 @@ public class Dispatcher {
try {
Class cls = ClassLoaderUtils.loadClass(cname, this.getClass());
ConfigurationProvider prov = (ConfigurationProvider)cls.newInstance();
configurationManager.addConfigurationProvider(prov);
configurationManager.addContainerProvider(prov);
} catch (InstantiationException e) {
throw new ConfigurationException("Unable to instantiate provider: "+cname, e);
} catch (IllegalAccessException e) {
@@ -360,11 +362,19 @@ public class Dispatcher {
}
private void init_FilterInitParameters() {
configurationManager.addConfigurationProvider(new ConfigurationProvider() {
public void destroy() {}
public void init(Configuration configuration) throws ConfigurationException {}
public void loadPackages() throws ConfigurationException {}
public boolean needsReload() { return false; }
configurationManager.addContainerProvider(new ConfigurationProvider() {
public void destroy() {
}
public void init(Configuration configuration) throws ConfigurationException {
}
public void loadPackages() throws ConfigurationException {
}
public boolean needsReload() {
return false;
}
public void register(ContainerBuilder builder, LocatableProperties props) throws ConfigurationException {
props.putAll(initParams);
@@ -373,7 +383,7 @@ public class Dispatcher {
}
private void init_AliasStandardObjects() {
configurationManager.addConfigurationProvider(new BeanSelectionProvider());
configurationManager.addContainerProvider(new BeanSelectionProvider());
}
private Container init_PreloadConfiguration() {
@@ -394,8 +404,10 @@ public class Dispatcher {
private void init_CheckWebLogicWorkaround(Container container) {
// test whether param-access workaround needs to be enabled
if (servletContext != null && servletContext.getServerInfo() != null
&& servletContext.getServerInfo().indexOf("WebLogic") >= 0) {
LOG.info("WebLogic server detected. Enabling Struts parameter access work-around.");
&& servletContext.getServerInfo().contains("WebLogic")) {
if (LOG.isInfoEnabled()) {
LOG.info("WebLogic server detected. Enabling Struts parameter access work-around.");
}
paramsWorkaroundEnabled = true;
} else {
paramsWorkaroundEnabled = "true".equals(container.getInstance(String.class,
@@ -512,7 +524,9 @@ public class Dispatcher {
LOG.error("Could not find action or result\n" + reqStr, e);
}
else {
if (LOG.isWarnEnabled()) {
LOG.warn("Could not find action or result", e);
}
}
sendError(request, response, context, HttpServletResponse.SC_NOT_FOUND, e);
} catch (Exception e) {
@@ -616,7 +630,9 @@ public class Dispatcher {
if (saveDir.equals("")) {
File tempdir = (File) servletContext.getAttribute("javax.servlet.context.tempdir");
LOG.info("Unable to find 'struts.multipart.saveDir' property setting. Defaulting to javax.servlet.context.tempdir");
if (LOG.isInfoEnabled()) {
LOG.info("Unable to find 'struts.multipart.saveDir' property setting. Defaulting to javax.servlet.context.tempdir");
}
if (tempdir != null) {
saveDir = tempdir.toString();
@@ -626,7 +642,7 @@ public class Dispatcher {
File multipartSaveDir = new File(saveDir);
if (!multipartSaveDir.exists()) {
if (multipartSaveDir.mkdir() == false) {
if (!multipartSaveDir.mkdir()) {
String logMessage;
try {
logMessage = "Could not find create multipart save directory '"+multipartSaveDir.getCanonicalPath()+"'.";
@@ -637,7 +653,9 @@ public class Dispatcher {
LOG.error(logMessage);
}
else {
LOG.warn(logMessage);
if (LOG.isWarnEnabled()) {
LOG.warn(logMessage);
}
}
}
}
@@ -705,7 +723,7 @@ public class Dispatcher {
}
String content_type = request.getContentType();
if (content_type != null && content_type.indexOf("multipart/form-data") != -1) {
if (content_type != null && content_type.contains("multipart/form-data")) {
MultiPartRequest mpr = null;
//check for alternate implementations of MultiPartRequest
Set<String> multiNames = getContainer().getInstanceNames(MultiPartRequest.class);
@@ -754,7 +772,9 @@ public class Dispatcher {
if ((currentFile != null) && currentFile.isFile()) {
if (!currentFile.delete()) {
LOG.warn("Resource Leaking: Could not remove uploaded file '" + currentFile.getCanonicalPath() + "'.");
if (LOG.isWarnEnabled()) {
LOG.warn("Resource Leaking: Could not remove uploaded file '" + currentFile.getCanonicalPath() + "'.");
}
}
}
}
@@ -773,7 +793,7 @@ public class Dispatcher {
public void sendError(HttpServletRequest request, HttpServletResponse response,
ServletContext ctx, int code, Exception e) {
Boolean devModeOverride = FilterDispatcher.getDevModeOverride();
if (devModeOverride != null ? devModeOverride.booleanValue() : devMode) {
if (devModeOverride != null ? devModeOverride : devMode) {
response.setContentType("text/html");
try {
@@ -21,17 +21,17 @@
package org.apache.struts2.dispatcher;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.nio.charset.Charset;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletResponse;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.nio.charset.Charset;
/**
* <!-- START SNIPPET: description -->
*
@@ -120,7 +120,9 @@ public class PlainTextResult extends StrutsResultSupport {
charset = Charset.forName(charSet);
}
else {
LOG.warn("charset ["+charSet+"] is not recognized ");
if (LOG.isWarnEnabled()) {
LOG.warn("charset ["+charSet+"] is not recognized ");
}
charset = null;
}
}
@@ -141,24 +143,24 @@ public class PlainTextResult extends StrutsResultSupport {
PrintWriter writer = response.getWriter();
InputStreamReader reader = null;
try {
InputStream resourceAsStream = servletContext.getResourceAsStream(finalLocation);
if (charset != null) {
reader = new InputStreamReader(servletContext.getResourceAsStream(finalLocation), charset);
reader = new InputStreamReader(resourceAsStream, charset);
} else {
reader = new InputStreamReader(resourceAsStream);
}
else {
reader = new InputStreamReader(servletContext.getResourceAsStream(finalLocation));
}
if (reader == null) {
LOG.warn("resource at location ["+finalLocation+"] cannot be obtained (return null) from ServletContext !!! ");
}
else {
if (resourceAsStream == null) {
if (LOG.isWarnEnabled()) {
LOG.warn("resource at location ["+finalLocation+"] cannot be obtained (return null) from ServletContext !!! ");
}
} else {
char[] buffer = new char[BUFFER_SIZE];
int charRead = 0;
int charRead;
while((charRead = reader.read(buffer)) != -1) {
writer.write(buffer, 0, charRead);
}
}
}
finally {
} finally {
if (reader != null)
reader.close();
if (writer != null) {
@@ -21,51 +21,65 @@
package org.apache.struts2.dispatcher;
import java.util.Arrays;
import java.util.List;
import org.apache.struts2.dispatcher.mapper.ActionMapper;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import com.opensymphony.xwork2.util.reflection.ReflectionExceptionHandler;
import org.apache.struts2.dispatcher.mapper.ActionMapper;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import java.util.Arrays;
import java.util.List;
/**
* <!-- START SNIPPET: description -->
*
* This result uses the {@link ActionMapper} provided by the {@link ActionMapperFactory} to redirect the browser to a
* URL that invokes the specified action and (optional) namespace. This is better than the {@link ServletRedirectResult}
* because it does not require you to encode the URL patterns processed by the {@link ActionMapper} in to your struts.xml
* configuration files. This means you can change your URL patterns at any point and your application will still work.
* It is strongly recommended that if you are redirecting to another action, you use this result rather than the
*
* This result uses the {@link ActionMapper} provided by the
* {@link ActionMapperFactory} to redirect the browser to a URL that invokes the
* specified action and (optional) namespace. This is better than the
* {@link ServletRedirectResult} because it does not require you to encode the
* URL patterns processed by the {@link ActionMapper} in to your struts.xml
* configuration files. This means you can change your URL patterns at any point
* and your application will still work. It is strongly recommended that if you
* are redirecting to another action, you use this result rather than the
* standard redirect result.
*
* See examples below for an example of how request parameters could be passed in.
*
*
* See examples below for an example of how request parameters could be passed
* in.
*
* <!-- END SNIPPET: description -->
*
*
* <b>This result type takes the following parameters:</b>
*
*
* <!-- START SNIPPET: params -->
*
*
* <ul>
*
* <li><b>actionName (default)</b> - The name of the action that will be
* redirected to.</li>
*
* <li><b>namespace</b> - Used to determine which namespace the action is in
* that we're redirecting to. If namespace is null, the default will be the
* current namespace.</li>
*
* <li><b>suppressEmptyParameters</b> - Optional boolean (defaults to false) that
* can prevent parameters with no values from being included in the redirect
* URL.</li>
*
* <li><b>actionName (default)</b> - the name of the action that will be redirect to</li>
*
* <li><b>namespace</b> - used to determine which namespace the action is in that we're redirecting to . If namespace is
* null, this defaults to the current namespace</li>
*
* <li><b>supressEmptyParameters</b> - optional boolean (defaults to false) that can prevent parameters with no values
* from being included in the redirect URL.</li>
* <li><b>parse</b> - Boolean, true by default. If set to false, the actionName
* param will not be parsed for Ognl expressions.</li>
*
* <li><b>anchor</b> - Optional. Also known as "fragment" or colloquially as
* "hash". You can specify an anchor for a result.</li>
* </ul>
*
*
* <!-- END SNIPPET: params -->
*
*
* <b>Example:</b>
*
* <pre><!-- START SNIPPET: example -->
*
* <pre>
* <!-- START SNIPPET: example -->
* &lt;package name="public" extends="struts-default"&gt;
* &lt;action name="login" class="..."&gt;
* &lt;!-- Redirect to another namespace --&gt;
@@ -75,24 +89,24 @@ import java.util.List;
* &lt;/result&gt;
* &lt;/action&gt;
* &lt;/package&gt;
*
*
* &lt;package name="secure" extends="struts-default" namespace="/secure"&gt;
* &lt;-- Redirect to an action in the same namespace --&gt;
* &lt;action name="dashboard" class="..."&gt;
* &lt;result&gt;dashboard.jsp&lt;/result&gt;
* &lt;result name="error" type="redirectAction"&gt;error&lt;/result&gt;
* &lt;/action&gt;
*
*
* &lt;action name="error" class="..."&gt;
* &lt;result&gt;error.jsp&lt;/result&gt;
* &lt;/action&gt;
* &lt;/package&gt;
*
*
* &lt;package name="passingRequestParameters" extends="struts-default" namespace="/passingRequestParameters"&gt;
* &lt;-- Pass parameters (reportType, width and height) --&gt;
* &lt;!-- Pass parameters (reportType, width and height) --&gt;
* &lt;!--
* The redirectAction url generated will be :
* /genReport/generateReport.action?reportType=pie&width=100&height=100
* /genReport/generateReport.action?reportType=pie&width=100&height=100#summary
* --&gt;
* &lt;action name="gatherReportInfo" class="..."&gt;
* &lt;result name="showReportResult" type="redirectAction"&gt;
@@ -102,14 +116,16 @@ import java.util.List;
* &lt;param name="width"&gt;100&lt;/param&gt;
* &lt;param name="height"&gt;100&lt;/param&gt;
* &lt;param name="empty"&gt;&lt;/param&gt;
* &lt;param name="supressEmptyParameters"&gt;true&lt;/param&gt;
* &lt;param name="suppressEmptyParameters"&gt;true&lt;/param&gt;
* &lt;param name="anchor"&gt;summary&lt;/param&gt;
* &lt;/result&gt;
* &lt;/action&gt;
* &lt;/package&gt;
*
*
* <!-- END SNIPPET: example --></pre>
*
*
*
* <!-- END SNIPPET: example -->
* </pre>
*
* @see ActionMapper
*/
public class ServletActionRedirectResult extends ServletRedirectResult implements ReflectionExceptionHandler {
@@ -119,8 +135,6 @@ public class ServletActionRedirectResult extends ServletRedirectResult implement
/** The default parameter */
public static final String DEFAULT_PARAM = "actionName";
private static final Logger LOG = LoggerFactory.getLogger(ServletActionRedirectResult.class);
protected String actionName;
protected String namespace;
protected String method;
@@ -137,7 +151,6 @@ public class ServletActionRedirectResult extends ServletRedirectResult implement
this(null, actionName, method, null);
}
public ServletActionRedirectResult(String namespace, String actionName, String method) {
this(namespace, actionName, method, null);
}
@@ -149,21 +162,26 @@ public class ServletActionRedirectResult extends ServletRedirectResult implement
this.method = method;
}
/**
* @see com.opensymphony.xwork2.Result#execute(com.opensymphony.xwork2.ActionInvocation)
*/
public void execute(ActionInvocation invocation) throws Exception {
public void execute(ActionInvocation invocation) throws Exception
{
actionName = conditionalParse(actionName, invocation);
if (namespace == null) {
if (namespace == null)
{
namespace = invocation.getProxy().getNamespace();
} else {
}
else
{
namespace = conditionalParse(namespace, invocation);
}
if (method == null) {
if (method == null)
{
method = "";
}
else {
else
{
method = conditionalParse(method, invocation);
}
@@ -176,34 +194,39 @@ public class ServletActionRedirectResult extends ServletRedirectResult implement
/**
* Sets the action name
*
* @param actionName The name
*
* @param actionName
* The name
*/
public void setActionName(String actionName) {
public void setActionName(String actionName)
{
this.actionName = actionName;
}
/**
* Sets the namespace
*
* @param namespace The namespace
*
* @param namespace
* The namespace
*/
public void setNamespace(String namespace) {
public void setNamespace(String namespace)
{
this.namespace = namespace;
}
/**
* Sets the method
*
* @param method The method
*
* @param method
* The method
*/
public void setMethod(String method) {
public void setMethod(String method)
{
this.method = method;
}
protected List<String> getProhibitedResultParams() {
return Arrays.asList(new String[]{
DEFAULT_PARAM, "namespace", "method", "encode", "parse", "location",
"prependServletContext", "supressEmptyParameters", "anchor"});
protected List<String> getProhibitedResultParams()
{
return Arrays.asList(DEFAULT_PARAM, "namespace", "method", "encode", "parse", "location", "prependServletContext", "suppressEmptyParameters", "anchor");
}
}
@@ -37,18 +37,13 @@ import org.apache.struts2.views.util.UrlHelper;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import static javax.servlet.http.HttpServletResponse.SC_FOUND;
/**
* <!-- START SNIPPET: description -->
*
*
* Calls the {@link HttpServletResponse#sendRedirect(String) sendRedirect}
* method to the location specified. The response is told to redirect the
* browser to the specified location (a new request from the client). The
@@ -57,40 +52,46 @@ import static javax.servlet.http.HttpServletResponse.SC_FOUND;
* available. This is because actions are built on a single-thread model. The
* only way to pass data is through the session or with web parameters
* (url?name=value) which can be OGNL expressions.
*
*
* <!-- END SNIPPET: description -->
* <p/>
* <b>This result type takes the following parameters:</b>
*
*
* <!-- START SNIPPET: params -->
*
*
* <ul>
*
*
* <li><b>location (default)</b> - the location to go to after execution.</li>
*
*
* <li><b>parse</b> - true by default. If set to false, the location param will
* not be parsed for Ognl expressions.</li>
*
* <li><b>anchor</b> - optional, you can specify an anchor for result.</li>
*
*
* <li><b>anchor</b> - Optional. Also known as "fragment" or colloquially as
* "hash". You can specify an anchor for a result.</li>
* </ul>
*
*
* <p>
* This result follows the same rules from {@link StrutsResultSupport}.
* </p>
*
*
* <!-- END SNIPPET: params -->
*
*
* <b>Example:</b>
*
* <pre><!-- START SNIPPET: example -->
*
* <pre>
* <!-- START SNIPPET: example -->
* &lt;!--
* The redirect URL generated will be:
* /foo.jsp#FRAGMENT
* --&gt;
* &lt;result name="success" type="redirect"&gt;
* &lt;param name="location"&gt;foo.jsp&lt;/param&gt;
* &lt;param name="parse"&gt;false&lt;/param&gt;
* &lt;param name="anchor"&gt;FRAGMENT&lt;/param&gt;
* &lt;/result&gt;
* <!-- END SNIPPET: example --></pre>
*
* <!-- END SNIPPET: example -->
* </pre>
*
*/
public class ServletRedirectResult extends StrutsResultSupport implements ReflectionExceptionHandler {
@@ -104,10 +105,10 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
protected int statusCode = SC_FOUND;
protected boolean supressEmptyParameters = false;
protected boolean suppressEmptyParameters = false;
protected Map<String, String> requestParameters = new LinkedHashMap<String, String>();
protected String anchor;
public ServletRedirectResult() {
@@ -117,41 +118,50 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
public ServletRedirectResult(String location) {
this(location, null);
}
public ServletRedirectResult(String location, String anchor) {
super(location);
this.anchor = anchor;
}
@Inject
public void setActionMapper(ActionMapper mapper) {
public void setActionMapper(ActionMapper mapper)
{
this.actionMapper = mapper;
}
public void setStatusCode(int code) {
public void setStatusCode(int code)
{
this.statusCode = code;
}
/**
* Set the optional anchor value.
*
* @param anchor
*/
public void setAnchor(String anchor) {
public void setAnchor(String anchor)
{
this.anchor = anchor;
}
/**
* Sets whether or not to prepend the servlet context path to the redirected URL.
*
* @param prependServletContext <tt>true</tt> to prepend the location with the servlet context path,
* <tt>false</tt> otherwise.
* Sets whether or not to prepend the servlet context path to the redirected
* URL.
*
* @param prependServletContext
* <tt>true</tt> to prepend the location with the servlet context
* path, <tt>false</tt> otherwise.
*/
public void setPrependServletContext(boolean prependServletContext) {
public void setPrependServletContext(boolean prependServletContext)
{
this.prependServletContext = prependServletContext;
}
public void execute(ActionInvocation invocation) throws Exception {
if (anchor != null) {
public void execute(ActionInvocation invocation) throws Exception
{
if (anchor != null)
{
anchor = conditionalParse(anchor, invocation);
}
@@ -159,48 +169,62 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
}
/**
* Redirects to the location specified by calling {@link HttpServletResponse#sendRedirect(String)}.
*
* @param finalLocation the location to redirect to.
* @param invocation an encapsulation of the action execution state.
* @throws Exception if an error occurs when redirecting.
* Redirects to the location specified by calling
* {@link HttpServletResponse#sendRedirect(String)}.
*
* @param finalLocation
* the location to redirect to.
* @param invocation
* an encapsulation of the action execution state.
* @throws Exception
* if an error occurs when redirecting.
*/
protected void doExecute(String finalLocation, ActionInvocation invocation) throws Exception {
protected void doExecute(String finalLocation, ActionInvocation invocation) throws Exception
{
ActionContext ctx = invocation.getInvocationContext();
HttpServletRequest request = (HttpServletRequest) ctx.get(ServletActionContext.HTTP_REQUEST);
HttpServletResponse response = (HttpServletResponse) ctx.get(ServletActionContext.HTTP_RESPONSE);
if (isPathUrl(finalLocation)) {
if (!finalLocation.startsWith("/")) {
ActionMapping mapping = actionMapper.getMapping(
request, Dispatcher.getInstance().getConfigurationManager());
if (isPathUrl(finalLocation))
{
if (!finalLocation.startsWith("/"))
{
ActionMapping mapping = actionMapper.getMapping(request, Dispatcher.getInstance().getConfigurationManager());
String namespace = null;
if (mapping != null) {
if (mapping != null)
{
namespace = mapping.getNamespace();
}
if ((namespace != null) && (namespace.length() > 0) && (!"/".equals(namespace))) {
if ((namespace != null) && (namespace.length() > 0) && (!"/".equals(namespace)))
{
finalLocation = namespace + "/" + finalLocation;
} else {
}
else
{
finalLocation = "/" + finalLocation;
}
}
// if the URL's are relative to the servlet context, append the servlet context path
if (prependServletContext && (request.getContextPath() != null) && (request.getContextPath().length() > 0)) {
if (prependServletContext && (request.getContextPath() != null) && (request.getContextPath().length() > 0))
{
finalLocation = request.getContextPath() + finalLocation;
}
ResultConfig resultConfig = invocation.getProxy().getConfig().getResults().get(invocation.getResultCode());
if (resultConfig != null ) {
Map resultConfigParams = resultConfig.getParams();
for (Iterator i = resultConfigParams.entrySet().iterator(); i.hasNext();) {
Map.Entry e = (Map.Entry) i.next();
if (resultConfig != null)
{
Map<String, String> resultConfigParams = resultConfig.getParams();
if (!getProhibitedResultParams().contains(e.getKey())) {
String potentialValue = e.getValue() == null ? "" : conditionalParse(e.getValue().toString(), invocation);
if (!supressEmptyParameters || ((potentialValue != null) && (potentialValue.length() > 0))) {
requestParameters.put(e.getKey().toString(), potentialValue);
for (Map.Entry<String, String> e : resultConfigParams.entrySet())
{
if (!getProhibitedResultParams().contains(e.getKey()))
{
String potentialValue = e.getValue() == null ? "" : conditionalParse(e.getValue(), invocation);
if (!suppressEmptyParameters || ((potentialValue != null) && (potentialValue.length() > 0)))
{
requestParameters.put(e.getKey(), potentialValue);
}
}
}
@@ -210,39 +234,45 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
UrlHelper.buildParametersString(requestParameters, tmpLocation, "&");
// add the anchor
if (anchor != null) {
if (anchor != null)
{
tmpLocation.append('#').append(anchor);
}
finalLocation = response.encodeRedirectURL(tmpLocation.toString());
}
if (LOG.isDebugEnabled()) {
if (LOG.isDebugEnabled())
{
LOG.debug("Redirecting to finalLocation " + finalLocation);
}
sendRedirect(response, finalLocation);
}
protected List<String> getProhibitedResultParams() {
return Arrays.asList(new String[]{
DEFAULT_PARAM, "namespace", "method", "encode", "parse", "location",
"prependServletContext", "supressEmptyParameters", "anchor"});
protected List<String> getProhibitedResultParams()
{
return Arrays.asList(DEFAULT_PARAM, "namespace", "method", "encode", "parse", "location", "prependServletContext", "suppressEmptyParameters", "anchor");
}
/**
* Sends the redirection. Can be overridden to customize how the redirect is handled (i.e. to use a different
* status code)
*
* @param response The response
* @param finalLocation The location URI
* Sends the redirection. Can be overridden to customize how the redirect is
* handled (i.e. to use a different status code)
*
* @param response
* The response
* @param finalLocation
* The location URI
* @throws IOException
*/
protected void sendRedirect(HttpServletResponse response, String finalLocation) throws IOException {
if (SC_FOUND == statusCode) {
protected void sendRedirect(HttpServletResponse response, String finalLocation) throws IOException
{
if (SC_FOUND == statusCode)
{
response.sendRedirect(finalLocation);
} else {
}
else
{
response.setStatus(statusCode);
response.setHeader("Location", finalLocation);
response.getWriter().write(finalLocation);
@@ -251,7 +281,8 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
}
private static boolean isPathUrl(String url) {
private static boolean isPathUrl(String url)
{
// filter out "http:", "https:", "mailto:", "file:", "ftp:"
// since the only valid places for : in URL's is before the path specification
// either before the port, or after the protocol
@@ -259,26 +290,32 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
}
/**
* Sets the supressEmptyParameters option
*
* @param supressEmptyParameters The new value for this option
* Sets the suppressEmptyParameters option
*
* @param suppressEmptyParameters
* The new value for this option
*/
public void setSupressEmptyParameters(boolean supressEmptyParameters) {
this.supressEmptyParameters = supressEmptyParameters;
public void setSuppressEmptyParameters(boolean suppressEmptyParameters)
{
this.suppressEmptyParameters = suppressEmptyParameters;
}
/**
* Adds a request parameter to be added to the redirect url
*
* @param key The parameter name
* @param value The parameter value
*
* @param key
* The parameter name
* @param value
* The parameter value
*/
public ServletRedirectResult addParameter(String key, Object value) {
public ServletRedirectResult addParameter(String key, Object value)
{
requestParameters.put(key, String.valueOf(value));
return this;
}
public void handle(ReflectionException ex) {
public void handle(ReflectionException ex)
{
// Only log as debug as they are probably parameters to be appended to the url
LOG.debug(ex.getMessage(), ex);
}

Some files were not shown because too many files have changed in this diff Show More