Compare commits

..

140 Commits

Author SHA1 Message Date
Ted Nathan Husted de154978ca WW-1767 Tag r520528 as Struts 2.0.7 (again)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_7@520393 13f79535-47bb-0310-9956-ffa450edef68
2007-03-20 14:01:59 +00:00
Ted Nathan Husted e3a6004b6d WW-1767 Tag r520258 as Struts 2.0.7
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_7@520259 13f79535-47bb-0310-9956-ffa450edef68
2007-03-20 03:40:43 +00:00
Ted Nathan Husted 1e769cc3b3 WW-1767 Update POMs for 2.0.7 build.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@520258 13f79535-47bb-0310-9956-ffa450edef68
2007-03-20 03:38:45 +00:00
Ted Nathan Husted 9285977625 WW-1828 "Login Action validation config file named "Logon-validation.xml" so doesn't validate" - Apply patch submitted by Dave Newton
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@520255 13f79535-47bb-0310-9956-ffa450edef68
2007-03-20 03:27:00 +00:00
Ted Nathan Husted 299579aef2 WW-1828 "Login Action validation config file named "Logon-validation.xml" so doesn't validate" - Apply patch submitted by Dave Newton
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@520254 13f79535-47bb-0310-9956-ffa450edef68
2007-03-20 03:26:25 +00:00
Ted Nathan Husted 5d90132e0c WW-1825 "Anchor tag inserts newline at end of tag" apply patch submitted by Claus Ibsen
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@520251 13f79535-47bb-0310-9956-ffa450edef68
2007-03-20 03:19:36 +00:00
Ted Nathan Husted 85c9e4c171 WW-1825 "Anchor tag inserts newline at end of tag" apply patch submitted by Claus Ibsen
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@520249 13f79535-47bb-0310-9956-ffa450edef68
2007-03-20 03:18:23 +00:00
Ted Nathan Husted 5be8649e19 WW-1814 "Default TypeConverters always created with default ObjectFactory" Reorder statics as suggested by Jasper Rosenberg
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@520243 13f79535-47bb-0310-9956-ffa450edef68
2007-03-20 02:56:32 +00:00
Ted Nathan Husted 6d3cceca00 WW-1814 "Default TypeConverters always created with default ObjectFactory" Reorder statics as suggested by Jasper Rosenberg
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@520241 13f79535-47bb-0310-9956-ffa450edef68
2007-03-20 02:56:03 +00:00
Ted Nathan Husted 9afb07fb3b WW-1799 "StringLength validator is inconsistent client side and server side" submitted by Mads Riise Rasmussen
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@520236 13f79535-47bb-0310-9956-ffa450edef68
2007-03-20 02:45:24 +00:00
Ted Nathan Husted 2154ad8513 WW-1799 "StringLength validator is inconsistent client side and server side" submitted by Mads Riise Rasmussen
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@520235 13f79535-47bb-0310-9956-ffa450edef68
2007-03-20 02:45:07 +00:00
James Mitchell e19616a110 WW-1827 - Added new test for CheckboxInterceptor -- thanks to Claus Ibsen
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@520208 13f79535-47bb-0310-9956-ffa450edef68
2007-03-20 01:31:36 +00:00
James Mitchell 0bd23c2984 WW-1824 Fix list item formatting -- patch provided by Claus Ibsen
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@520205 13f79535-47bb-0310-9956-ffa450edef68
2007-03-20 01:23:31 +00:00
James Mitchell 74b1311272 WW-1767 Fix a few typos and change lingering <a:sometag/> action references
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@520201 13f79535-47bb-0310-9956-ffa450edef68
2007-03-20 01:17:27 +00:00
Ted Nathan Husted 8e7c6db335 WW-1803 "ScopeIntercaptor null references on session serialization" apply patch submitted by Sylvain RIBEYRON.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@520152 13f79535-47bb-0310-9956-ffa450edef68
2007-03-19 22:48:48 +00:00
Ted Nathan Husted fa754949ab WW-1803 "ScopeIntercaptor null references on session serialization" apply patch submitted by Sylvain RIBEYRON.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@520151 13f79535-47bb-0310-9956-ffa450edef68
2007-03-19 22:48:16 +00:00
Ted Nathan Husted 9d71021b14 WW-1767 quickstart is gone, so this should be too!
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@520128 13f79535-47bb-0310-9956-ffa450edef68
2007-03-19 22:27:53 +00:00
Donald J. Brown b6be295074 Improved error handling for invalid package
WW-1826


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@519452 13f79535-47bb-0310-9956-ffa450edef68
2007-03-17 21:50:09 +00:00
Donald J. Brown 74855426e3 Fixed missing import
WW-1826


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@519450 13f79535-47bb-0310-9956-ffa450edef68
2007-03-17 21:46:41 +00:00
Donald J. Brown fd9a15a89d Better handling of invalid package name
WW-1826


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@519447 13f79535-47bb-0310-9956-ffa450edef68
2007-03-17 21:39:17 +00:00
Musachy Barroso e206cf9a75 WW-1607
* Remove usage of deprecated attributes "beforeLoading", "afterLoading", "resultDivId", "preInvokeJS", "onLoadJS"
* Add examples of attributes "beforeNotifyTopics", "afterNotifyTopics", "errorNotifyTopics"

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@519410 13f79535-47bb-0310-9956-ffa450edef68
2007-03-17 18:58:20 +00:00
Musachy Barroso 07ac6bd6d9 WW-1607
* Remove unused files
* Remove deprecated attributes "beforeLoading", "afterLoading", "resultDivId", "preInvokeJS", "onLoadJS"
* Add attributes "beforeNotifyTopics", "afterNotifyTopics", "errorNotifyTopics"

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@519409 13f79535-47bb-0310-9956-ffa450edef68
2007-03-17 18:57:22 +00:00
Musachy Barroso 13e6ae21d4 WW-1710 Fix wrong reference to dojo tooltip
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@519213 13f79535-47bb-0310-9956-ffa450edef68
2007-03-17 02:05:48 +00:00
Musachy Barroso ad3e83375c WW-1823 rename getAutocompleterModel to getAutocompleter in StrutsModels
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@519209 13f79535-47bb-0310-9956-ffa450edef68
2007-03-17 01:48:24 +00:00
Musachy Barroso 1e73567cec WW-1823 rename getAutocompleterModel to getAutocompleter in StrutsModels
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@519207 13f79535-47bb-0310-9956-ffa450edef68
2007-03-17 01:45:04 +00:00
Musachy Barroso 8a7fdfad6e WW-1607
* Restore javascript files to core that were moved to the dojo plugin but were not related to dojo
* Render a tr with cells for the ajaxtags if a "label" is specified
* Fix wrong reference to dojo tooltip


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@519204 13f79535-47bb-0310-9956-ffa450edef68
2007-03-17 01:35:42 +00:00
Musachy Barroso c0095ee4ef WW-1607 Remove dojo-related templates from xhtm and css_xhtml
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@519198 13f79535-47bb-0310-9956-ffa450edef68
2007-03-17 01:15:50 +00:00
René Gielen 8fa480d66b WW-1707:
Re-add deprecated "plaintext" result name for backwards compatibility

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@518921 13f79535-47bb-0310-9956-ffa450edef68
2007-03-16 10:24:19 +00:00
James Mitchell 54d899fac0 WW-1767 Fix references from 'redirect-action' to 'redirectAction'
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@518613 13f79535-47bb-0310-9956-ffa450edef68
2007-03-15 13:00:02 +00:00
James Mitchell da4e814ee2 WW-1767 Remove Struts 2 JSF Plugin's dependency on Struts 1.3.8 -- probably an oversight
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@518612 13f79535-47bb-0310-9956-ffa450edef68
2007-03-15 12:58:12 +00:00
James Mitchell 07eb42c40d WW-1645 add pluto config so you can deploy to pluto -- tested on pluto 1.1.0 -- to build for pluto, run: mvn package -Ppluto
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@518396 13f79535-47bb-0310-9956-ffa450edef68
2007-03-15 00:42:26 +00:00
James Mitchell 280644f5a4 WW-1644 fix a couple of typos
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@518395 13f79535-47bb-0310-9956-ffa450edef68
2007-03-15 00:36:39 +00:00
Patrick Lightbody 529e719f77 quickstart is gone, so this should be too!
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@517972 13f79535-47bb-0310-9956-ffa450edef68
2007-03-14 01:48:28 +00:00
Musachy Barroso 03c7349557 WW-1607 Rename "tabbedPanel" to "tabbedpanel"
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@517969 13f79535-47bb-0310-9956-ffa450edef68
2007-03-14 01:34:54 +00:00
Musachy Barroso a8d76f95f3 WW-1707
* Update action mapping to use "redirectAction" instead of "redirect-action", and "plainText" instead of "plaintext"

WW-1607
* Fix tabbedpanel, datetimepicker, and tree examples to use Dojo plugin

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@517968 13f79535-47bb-0310-9956-ffa450edef68
2007-03-14 01:32:19 +00:00
Musachy Barroso 20affeab23 WW-1707 Update action mapping to use "redirectAction" instead of "redirect-action"
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@517966 13f79535-47bb-0310-9956-ffa450edef68
2007-03-14 01:28:27 +00:00
Musachy Barroso 97f9941ac3 WW-1607
* Add cssStyle to form template
* Add struts-plugin.xml for the Dojo plugin


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@517965 13f79535-47bb-0310-9956-ffa450edef68
2007-03-14 01:26:33 +00:00
Philip Luppens f6284fe86a WW-1797: Fixed bunch of typos.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@517590 13f79535-47bb-0310-9956-ffa450edef68
2007-03-13 08:44:43 +00:00
Donald J. Brown 21b36fb182 Fixed result type renaming
WW-1715


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@517512 13f79535-47bb-0310-9956-ffa450edef68
2007-03-13 03:32:26 +00:00
Ted Nathan Husted c434cf644a WW-18O4 "Showcase - view source throws NumberFormatException". The problem is that config parameter on the URL is empty (config=). It can be fixed by checing if the parameters are not empty instead of just != null in the ViewSourceAction.java. Submitted by Claus Ibsen.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@517511 13f79535-47bb-0310-9956-ffa450edef68
2007-03-13 03:28:08 +00:00
Ted Nathan Husted 8910d90721 WW-18O4 "Showcase - view source throws NumberFormatException". The problem is that config parameter on the URL is empty (config=). It can be fixed by checing if the parameters are not empty instead of just != null in the ViewSourceAction.java. Submitted by Claus Ibsen.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@517510 13f79535-47bb-0310-9956-ffa450edef68
2007-03-13 03:24:41 +00:00
Ted Nathan Husted 54b9de4f1b WW-1526 "Error with handling static resources under WebSphere 6". Flush output after copy to appease WebLogic and possibly other containers. Submitted by Adam Czysciak.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@517506 13f79535-47bb-0310-9956-ffa450edef68
2007-03-13 03:13:07 +00:00
Ted Nathan Husted db2bf7b4e3 WW-1526 "Error with handling static resources under WebSphere 6". Flush output after copy to appease WebLogic and possibly other containers. Submitted by Adam Czysciak.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@517504 13f79535-47bb-0310-9956-ffa450edef68
2007-03-13 03:12:20 +00:00
Ted Nathan Husted 323a7b9074 WW-1787 "Token session interceptor faiing with redirect-action" Apply patch based on WebWork #1404.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@517499 13f79535-47bb-0310-9956-ffa450edef68
2007-03-13 02:31:35 +00:00
Ted Nathan Husted 77cb215263 WW-1787 "Token session interceptor faiing with redirect-action" Apply patch based on WebWork #1404.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@517433 13f79535-47bb-0310-9956-ffa450edef68
2007-03-12 22:34:58 +00:00
Ted Nathan Husted 467f4cdbde WW-1786 "using session-token interceptor generates FreeMarker template error" Apply patch submitted by Tom Schneider. The change synchronizes on the Ognl context so we don't concurrently execute results. The issue was that we were getting concurrency exceptions around the ognl context because the results were being executed concurrently. The change will reduce throughput when using the session-token interceptor, but it avoids the concurrency issues.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@517426 13f79535-47bb-0310-9956-ffa450edef68
2007-03-12 22:22:12 +00:00
Ted Nathan Husted 51d985b3b7 WW-1786 "using session-token interceptor generates FreeMarker template error" Apply patch submitted by Tom Schneider. The change synchronizes on the Ognl context so we don't concurrently execute results. The issue was that we were getting concurrency exceptions around the ognl context because the results were being executed concurrently. The change will reduce throughput when using the session-token interceptor, but it avoids the concurrency issues.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@517424 13f79535-47bb-0310-9956-ffa450edef68
2007-03-12 22:18:44 +00:00
Ted Nathan Husted a8f1031e3c WW-1754 "The current struts-default.xml prevents TypeConverter wiring." Swap ObjectFactory and XWorkConverter load order per suggestion of Nicolas Berthet.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@517412 13f79535-47bb-0310-9956-ffa450edef68
2007-03-12 21:36:16 +00:00
Ted Nathan Husted 3563fe21e7 WW-1754 "The current struts-default.xml prevents TypeConverter wiring." Swap ObjectFactory and XWorkConverter load order per suggestion of Nicolas Berthet.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@517408 13f79535-47bb-0310-9956-ffa450edef68
2007-03-12 21:32:01 +00:00
Ted Nathan Husted 4dd9c2d556 WW-1678 - Port cookie interceptor from WW 2.2.5. Patch submitted by Nate Drake based on code contributed to WebWork2/Open Symphony by Toby Jee and Mathew Payne.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@517380 13f79535-47bb-0310-9956-ffa450edef68
2007-03-12 20:33:53 +00:00
Ted Nathan Husted 8f589c03db WW-1678 - Port cookie interceptor from WW 2.2.5. Patch submitted by Nate Drake based on code contributed to WebWork2/Open Symphony by Toby Jee and Mathew Payne.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@517374 13f79535-47bb-0310-9956-ffa450edef68
2007-03-12 20:25:06 +00:00
Ted Nathan Husted 7edf976bd9 WW-1619 URL component and URLHelper class do not handle multiple request parameters with the same name correctly when includeParams="get". Apply patch submitted by Tom Schneider.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@517364 13f79535-47bb-0310-9956-ffa450edef68
2007-03-12 20:05:24 +00:00
Ted Nathan Husted bb8d0bf28a WW-1619 URL component and URLHelper class do not handle multiple request parameters with the same name correctly when includeParams="get". Apply patch submitted by Tom Schneider.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@517363 13f79535-47bb-0310-9956-ffa450edef68
2007-03-12 20:05:02 +00:00
Ted Nathan Husted 88b946dacc WW-1707 Apply consistent naming for the results in struts-default.xml
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@517343 13f79535-47bb-0310-9956-ffa450edef68
2007-03-12 19:13:34 +00:00
Ted Nathan Husted 09f11dac5c WW-1707 Apply consistent naming for the results in struts-default.xml
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@517341 13f79535-47bb-0310-9956-ffa450edef68
2007-03-12 19:13:13 +00:00
Ted Nathan Husted 55dd8188a3 WW-1707 Apply consistent naming for the interceptors in struts-default.xml
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@517096 13f79535-47bb-0310-9956-ffa450edef68
2007-03-12 04:46:27 +00:00
Ted Nathan Husted 419dc383a0 WW-1548 Remove continuation support from 2.1.x, and move continuations to the sandbox.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@517095 13f79535-47bb-0310-9956-ffa450edef68
2007-03-12 04:31:08 +00:00
Ted Nathan Husted 204af40c4e WW-1801 Remove Spring dependency by copying properties manually.
WW-1707 Update interceptor reference. 


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@517032 13f79535-47bb-0310-9956-ffa450edef68
2007-03-11 22:18:07 +00:00
Ted Nathan Husted fbe7fe226f WW-1801 Remove Spring dependency by copying properties manually.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@517026 13f79535-47bb-0310-9956-ffa450edef68
2007-03-11 21:58:50 +00:00
Wendy Smoak c62e2041b3 Deleted "duplicate" file that was causing problems with svn checkout. tabbedPanel.html remains.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@517020 13f79535-47bb-0310-9956-ffa450edef68
2007-03-11 21:33:54 +00:00
Donald J. Brown 4e78cfce78 Fixed mailreader to use correct version and spring plugin
WW-1767


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@517002 13f79535-47bb-0310-9956-ffa450edef68
2007-03-11 19:53:46 +00:00
Donald J. Brown 004ab6c47c Fixed bad character in file
WW-1767


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@516997 13f79535-47bb-0310-9956-ffa450edef68
2007-03-11 19:40:40 +00:00
Donald J. Brown 3aad67982e Adding spring plugin to mailreader as it seems to be required
WW-1715


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@516991 13f79535-47bb-0310-9956-ffa450edef68
2007-03-11 19:11:15 +00:00
Donald J. Brown 56daf5ce75 Fixed dojo tests
WW-1715


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@516988 13f79535-47bb-0310-9956-ffa450edef68
2007-03-11 19:00:38 +00:00
Donald J. Brown ff13616fe3 Changing tiles plugin to use the latest released version
WW-1715


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@516986 13f79535-47bb-0310-9956-ffa450edef68
2007-03-11 18:49:39 +00:00
Donald J. Brown 4a3270734c Added back text provider config which broke a bunch of tests
WW-1715


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@516983 13f79535-47bb-0310-9956-ffa450edef68
2007-03-11 18:41:02 +00:00
Ted Nathan Husted e8866147d9 WW-1707 Apply consistent naming for the interceptors in struts-default.xml per report by Philip Luppens. Update example applications to use new names.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@516940 13f79535-47bb-0310-9956-ffa450edef68
2007-03-11 15:51:35 +00:00
Ted Nathan Husted ff7144ca42 WW-1707 Apply consistent naming for the interceptors in struts-default.xml per report by Philip Luppens.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@516937 13f79535-47bb-0310-9956-ffa450edef68
2007-03-11 15:50:48 +00:00
Ted Nathan Husted ae053fb669 WW-1781 - Delete redundant struts.properties file.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@516929 13f79535-47bb-0310-9956-ffa450edef68
2007-03-11 15:34:01 +00:00
Ted Nathan Husted cc457eb49f WW-1781 - Set DevMode to false for example applications. Remove other redundant or obsolete settings. Conform indentation n struts-default.xml.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@516928 13f79535-47bb-0310-9956-ffa450edef68
2007-03-11 15:31:14 +00:00
Ted Nathan Husted f621683dc1 WW-1781 - Set DevMode to false for example appliations. Remove other redundant or obsolete settings. Conform indentation n struts-default.xml.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@516927 13f79535-47bb-0310-9956-ffa450edef68
2007-03-11 15:29:54 +00:00
Musachy Barroso 3e77b6934f WW-1607
* Copy head tag to Dojo plugin
* Remove calendar-related attributes and tests from head tag
* Fix tabbedpanel examples in showcase to use the head tag from the Dojo plugin

WW-1757 Rename tabbed panel tag to "tabbedpanel" (from "tabbedPanel")



git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@516804 13f79535-47bb-0310-9956-ffa450edef68
2007-03-10 22:56:58 +00:00
Musachy Barroso 39fec2b7ac WW-1607
* Modify the StrutsTagSkipInheritance annotation so it can be applied to methods
* Overwrite setTheme(String) on the ajax tags to annotate it @StrutsTagSkipInheritance



git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@516779 13f79535-47bb-0310-9956-ffa450edef68
2007-03-10 20:22:34 +00:00
René Gielen 8657e0009a WW-1768:
Applied Oleg Gorobets' patch to make Set tag support JSP body as String value to set. Added also some words of documentation of this new feature.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@516198 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 22:32:52 +00:00
René Gielen 209965eff0 WW-1768:
Applied Oleg Gorobets' patch to make Set tag support JSP body as String value to set. Added also some words of documentation of this new feature.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@516197 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 22:32:20 +00:00
René Gielen 02a6440376 Activate dojo plugin to get full build up and running
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@516187 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 21:36:35 +00:00
René Gielen 3509fa4ded WW-1750:
fixing <script> tags in templates using deprecated language attribute, therefore breaking W3C validation

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@516186 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 21:32:50 +00:00
René Gielen 7d93a7f48e WW-1750:
fixing <script> tags in templates using deprecated language attribute, therefore breaking W3C validation

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@516183 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 21:28:22 +00:00
René Gielen 0a64f616e8 WW-1750:
fixing <script> tags in templates using deprecated language attribute, therefore breaking W3C validation

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@516176 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 21:12:40 +00:00
René Gielen 38c83140a0 WW-1756:
Applied Erik Berg's patch to avoid unchecked reference to name parameter in radio tag freemarker template

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@516165 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 20:08:28 +00:00
René Gielen 6f97753eec WW-1756:
Applied Erik Berg's patch to avoid unchecked reference to name parameter in radio tag freemarker template

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@516164 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 20:08:21 +00:00
René Gielen ce52e8b93f WW-1762:
Applied Erik Berg's patch to beautify anchor tag output

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@516162 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 20:00:58 +00:00
René Gielen 46dd4d4ca6 WW-1762:
Applied Erik Berg's patch to beautify anchor tag output

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@516161 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 19:59:35 +00:00
René Gielen 6467ba408a WW-1748:
Applied Oleg Gorobets patch to support TextProvider to be configured with struts.properties

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@515979 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 09:11:27 +00:00
René Gielen 98d4313537 WW-1748:
Applied Oleg Gorobets patch to support TextProvider to be configured with struts.properties

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@515978 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 09:10:31 +00:00
René Gielen 231e27fd5e WW-1747:
- improved format pattern for fraction digits

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@515885 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 01:49:31 +00:00
René Gielen 68dffd275f WW-1747:
- improved format pattern for fraction digits

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@515884 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 01:49:11 +00:00
René Gielen 08f5faf1af Removed broken character encodings, as indicated by bamboo reports
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@515882 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 01:33:04 +00:00
René Gielen 58982d5624 Removed broken character encodings, as indicated by bamboo reports
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@515880 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 01:32:35 +00:00
Musachy Barroso 80125b513c WW-1607 Fix remote forms example to use dojo plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@515879 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 01:27:40 +00:00
Musachy Barroso c4509dbfbc WW-1607
* Add classes for form tag(just extend the ones on core)
* Copy datetimepicker.ftl from core
* Add common-events to the tags
* Remove dependency on xhtml theme
* Fix autocompleter failing test
* Restore compressed dojo.js (I overwrote it with the uncompressed one by mistake)


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@515878 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 01:26:24 +00:00
René Gielen 1be016ae02 WW-1747:
- updated test to show number formatting issue pointed out by Mike Baroukh
- fixed issue by preventing freemarker from formatting numbers for this template

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@515872 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 01:07:38 +00:00
René Gielen b65a8a7b40 WW-1747:
- updated test to show number formatting issue pointed out by Mike Baroukh
- fixed issue by preventing freemarker from formatting numbers for this template

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@515871 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 01:06:58 +00:00
Musachy Barroso 0a6c72e0c7 Fix form tag failing tests (add type="text/javascript")
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@515839 13f79535-47bb-0310-9956-ffa450edef68
2007-03-07 23:12:45 +00:00
Musachy Barroso 25328211dd Fix form tag failing tests (add type="text/javascript")
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@515832 13f79535-47bb-0310-9956-ffa450edef68
2007-03-07 23:06:46 +00:00
Musachy Barroso dfc8d6502b WW-1607 Fix autocompleter example to use dojo plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@515425 13f79535-47bb-0310-9956-ffa450edef68
2007-03-07 02:22:01 +00:00
Musachy Barroso 0902929dd6 WW-1607
Generate remote and static autocompleter from the same freemarker template
 Fix autocompleter test



git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@515424 13f79535-47bb-0310-9956-ffa450edef68
2007-03-07 02:20:44 +00:00
James Mitchell 57f8125973 Fix simple documentation error.
WW-1794



git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@515063 13f79535-47bb-0310-9956-ffa450edef68
2007-03-06 10:47:05 +00:00
Musachy Barroso 3e283625ef WW-1607 Fix remote link, remote button and remote div examples to use dojo plugin tags
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@514943 13f79535-47bb-0310-9956-ffa450edef68
2007-03-06 01:13:37 +00:00
Musachy Barroso 65131d66a5 Move classes to "dojo" package so they don't conflict with the ones from core
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@514940 13f79535-47bb-0310-9956-ffa450edef68
2007-03-06 01:11:06 +00:00
Musachy Barroso de09c2ca53 WW-1607 Separate dojo-related tags into their own plugin
* Overwrite parent attribute setters so they are added to the TLD

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@514458 13f79535-47bb-0310-9956-ffa450edef68
2007-03-04 18:51:30 +00:00
Musachy Barroso dceee365c0 Add field "name" to autocompleter example
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@514170 13f79535-47bb-0310-9956-ffa450edef68
2007-03-03 15:19:30 +00:00
Musachy Barroso e2f349dca9 WW-1607 Separate dojo-related tags into their own plugin. For prior history see <http://svn.apache.org/viewvc?view=rev&revision=514082>
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@514083 13f79535-47bb-0310-9956-ffa450edef68
2007-03-03 05:48:54 +00:00
Musachy Barroso f111ea4bbb WW-1607 Separate dojo-related tags into their own plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@514082 13f79535-47bb-0310-9956-ffa450edef68
2007-03-03 05:33:30 +00:00
Musachy Barroso 150fec2256 WW-1777 DateTimePicker now supports expressions in the property "displayFormat"
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@512580 13f79535-47bb-0310-9956-ffa450edef68
2007-02-28 02:48:06 +00:00
Musachy Barroso eca621ef35 WW-1777 DateTimePicker now supports expressions in the property "displayFormat"
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@512578 13f79535-47bb-0310-9956-ffa450edef68
2007-02-28 02:44:58 +00:00
Musachy Barroso f829f52b6b WW-1771 Update DateTimePicker tag documentation. Sytax from:
http://www.unicode.org/reports/tr35/tr35-4.html#Date_Format_Patterns

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@512131 13f79535-47bb-0310-9956-ffa450edef68
2007-02-27 04:14:32 +00:00
Musachy Barroso fdcfcb8c15 WW-1771 Update DateTimePicker tag documentation. Sytax from:
http://www.unicode.org/reports/tr35/tr35-4.html#Date_Format_Patterns

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@512130 13f79535-47bb-0310-9956-ffa450edef68
2007-02-27 04:12:59 +00:00
Musachy Barroso 422c84f511 WW-1771 Update DateTimePicker tag documentation. Sytax from:
http://www.unicode.org/reports/tr35/tr35-4.html#Date_Format_Patterns

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@512128 13f79535-47bb-0310-9956-ffa450edef68
2007-02-27 04:10:16 +00:00
Thomas Schneider 92184a6850 WW-1733 Fixed request not being wrapped issue (merged from 2.0.x branch)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@511454 13f79535-47bb-0310-9956-ffa450edef68
2007-02-25 05:35:51 +00:00
Thomas Schneider 16939ed8b1 WW-1733 Fixed request not being wrapped issue
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@511453 13f79535-47bb-0310-9956-ffa450edef68
2007-02-25 05:35:20 +00:00
Musachy Barroso dcad8fbd00 WW-1671 templates don't specify type="text/javascript"; break W3C validation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@511303 13f79535-47bb-0310-9956-ffa450edef68
2007-02-24 16:50:09 +00:00
Musachy Barroso b39e1f24c2 WW-1671 templates don't specify type="text/javascript"; break W3C validation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@511302 13f79535-47bb-0310-9956-ffa450edef68
2007-02-24 16:49:02 +00:00
Musachy Barroso d1c2b3f803 WW-1766 div tag needs the scriptSeparation attribute
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@511300 13f79535-47bb-0310-9956-ffa450edef68
2007-02-24 16:41:38 +00:00
Musachy Barroso a1e9ba6aa4 WW-1766 div tag needs the scriptSeparation attribute
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@511299 13f79535-47bb-0310-9956-ffa450edef68
2007-02-24 16:39:53 +00:00
Musachy Barroso 94c9d4f3d6 WW-1589 Linked autocompleter reset on page reload
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@511297 13f79535-47bb-0310-9956-ffa450edef68
2007-02-24 16:25:27 +00:00
Musachy Barroso 7da5f114b4 WW-1589: Linked autocompleter reset on page reload
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@511295 13f79535-47bb-0310-9956-ffa450edef68
2007-02-24 16:23:00 +00:00
Musachy Barroso 4fd5d2ab15 Add breaklines to javadoc
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@511291 13f79535-47bb-0310-9956-ffa450edef68
2007-02-24 16:12:38 +00:00
Ted Nathan Husted fe3d2c2228 WW-1705 Remove link to "new API".
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@511218 13f79535-47bb-0310-9956-ffa450edef68
2007-02-24 05:38:34 +00:00
Ted Nathan Husted 847bf7dadd WW-1705 Remove link to "new API".
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@511217 13f79535-47bb-0310-9956-ffa450edef68
2007-02-24 05:38:06 +00:00
Ted Nathan Husted e75a5ae946 WW-1705 Update site for 2.0.6 release.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@511178 13f79535-47bb-0310-9956-ffa450edef68
2007-02-24 01:01:11 +00:00
Ted Nathan Husted b826a98256 WW-1705 Update site for 2.0.6 release.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@511177 13f79535-47bb-0310-9956-ffa450edef68
2007-02-24 00:59:36 +00:00
Musachy Barroso a4e91a9581 add images to homepage
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@511016 13f79535-47bb-0310-9956-ffa450edef68
2007-02-23 16:58:03 +00:00
Antonio Petrelli c0d4fe51fb Updated to follow the changes in Tiles API. See TILES-114.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@510959 13f79535-47bb-0310-9956-ffa450edef68
2007-02-23 14:36:25 +00:00
Ted Nathan Husted 5c1593c02e WW-1705 Encode example URL in MailReader tour.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@510919 13f79535-47bb-0310-9956-ffa450edef68
2007-02-23 12:03:36 +00:00
Ted Nathan Husted 6ee6d699f5 WW-1705 Fix Tiles TLD references. Encode example URL in MailReader tour.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@510917 13f79535-47bb-0310-9956-ffa450edef68
2007-02-23 11:58:41 +00:00
Musachy Barroso 37b86d90b2 WW-1763: autocompleter tag isn´t present in the documentation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@510785 13f79535-47bb-0310-9956-ffa450edef68
2007-02-23 03:05:33 +00:00
Musachy Barroso 28a98b5757 WW-1763: autocompleter tag isn´t present in the documentation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@510771 13f79535-47bb-0310-9956-ffa450edef68
2007-02-23 02:43:40 +00:00
Musachy Barroso df14a287d0 WW-1763: autocompleter tag isn´t present in the documentation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@510770 13f79535-47bb-0310-9956-ffa450edef68
2007-02-23 02:40:03 +00:00
Musachy Barroso a39fbdc78b WW-1602: Autocompleter is not rendering label
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@510749 13f79535-47bb-0310-9956-ffa450edef68
2007-02-23 01:21:25 +00:00
Musachy Barroso 60391db64f WW-1602: Autocompleter is not rendering label
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@510748 13f79535-47bb-0310-9956-ffa450edef68
2007-02-23 01:20:37 +00:00
Musachy Barroso 79ee4c3845 WW-1659:
* Update autocompleter to accept JSON generated using the JSON plugin
 * Add "dataFieldName" to identify the field to be used as the data source in the returned JSON string


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@510743 13f79535-47bb-0310-9956-ffa450edef68
2007-02-23 01:06:19 +00:00
Musachy Barroso 6692879894 WW-1659:
* Update autocompleter to accept JSON generated using the JSON plugin
 * Add "dataFieldName" to identify the field to be used as the data source in the returned JSON string


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@510742 13f79535-47bb-0310-9956-ffa450edef68
2007-02-23 01:04:18 +00:00
Musachy Barroso 2a60666d63 WW-1644 DateTimerPicker problems when type="time". Inherit from Dojo's DropDownTimePicker, the name cannot be "TimePicker" or Dojo gets really confused
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@510352 13f79535-47bb-0310-9956-ffa450edef68
2007-02-22 02:34:13 +00:00
Musachy Barroso 9452a5c591 WW-1644 DateTimerPicker problems when type="time". Inherit from Dojo's DropDownTimePicker, the name cannot be "TimePicker" or Dojo gets really confused
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@510351 13f79535-47bb-0310-9956-ffa450edef68
2007-02-22 02:31:23 +00:00
René Gielen a181296a17 WW-1747 / WW-1711:
- applied Stuart Piltch's patch to add an additional string representation comparison in ContainUtil
- removed now unnecessary second check in select freemarker template

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@509959 13f79535-47bb-0310-9956-ffa450edef68
2007-02-21 10:18:24 +00:00
René Gielen b54ee12653 WW-1747 / WW-1711:
- applied Stuart Piltch's patch to add an additional string representation comparison in ContainUtil
- removed now unnecessary second check in select freemarker template

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@509957 13f79535-47bb-0310-9956-ffa450edef68
2007-02-21 10:08:06 +00:00
René Gielen 94d7466015 WW-1747 / WW-1711:
Working with real types rather than String representations as long as possible should fix both issues with select tag.
Additional test added and verified.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@509812 13f79535-47bb-0310-9956-ffa450edef68
2007-02-20 23:37:47 +00:00
René Gielen ba69233017 WW-1747 / WW-1711:
Working with real types rather than String representations as long as possible should fix both issues with select tag.
Additional test added and verified.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@509780 13f79535-47bb-0310-9956-ffa450edef68
2007-02-20 22:35:31 +00:00
Ted Nathan Husted c6c51c6ba4 WW-1705 Update POMs for 2.0.7-SNAPSHOT.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@509055 13f79535-47bb-0310-9956-ffa450edef68
2007-02-19 01:37:38 +00:00
132 changed files with 1506 additions and 514 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.0.6</version>
<version>2.0.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-blank</artifactId>
+1 -1
View File
@@ -6,7 +6,7 @@
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="true" />
<constant name="struts.devMode" value="false" />
<include file="example.xml"/>
+1 -7
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.0.6</version>
<version>2.0.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-mailreader</artifactId>
@@ -31,12 +31,6 @@
<artifactId>struts-mailreader-dao</artifactId>
<version>1.3.5</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
</dependencies>
<build>
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="autodetect">
<!-- add your spring beans here -->
</beans>
@@ -32,8 +32,6 @@ import org.apache.struts.apps.mailreader.dao.User;
import org.apache.struts.apps.mailreader.dao.UserDatabase;
import org.apache.struts.apps.mailreader.dao.impl.memory.MemorySubscription;
import org.apache.struts.apps.mailreader.dao.impl.memory.MemoryUser;
import org.springframework.beans.BeanUtils;
import java.util.Map;
/**
@@ -63,6 +61,28 @@ public class MailreaderSupport extends ActionSupport
return Constants.CANCEL;
}
/**
* Convenience method to copy User properties.
**/
protected void copyUser(User source, User target) {
if ((source==null) || (target==null)) return;
target.setFromAddress(source.getFromAddress());
target.setFullName(source.getFullName());
target.setPassword(source.getPassword());
target.setReplyToAddress(source.getReplyToAddress());
}
/**
* Convenience method to copy Subscription properties.
**/
protected void copySubscription(Subscription source, Subscription target) {
if ((source==null) || (target==null)) return;
target.setAutoConnect(source.getAutoConnect());
target.setPassword(source.getPassword());
target.setType(source.getType());
target.setUsername(source.getUsername());
}
// ---- ApplicationAware ----
@@ -435,7 +455,7 @@ public class MailreaderSupport extends ActionSupport
input.setPassword(_password);
User user = createUser(_username, _password);
if (null != user) {
BeanUtils.copyProperties(input,user);
copyUser(input,user);
setUser(user);
}
}
@@ -532,7 +552,7 @@ public class MailreaderSupport extends ActionSupport
Subscription input = getSubscription();
Subscription sub = createSubscription(host);
if (null != sub) {
BeanUtils.copyProperties(input, sub);
copySubscription(input, sub);
setSubscription(sub);
setHost(sub.getHost());
}
-1
View File
@@ -8,7 +8,6 @@
<constant name="struts.action.extension" value="do" />
<constant name="struts.devMode" value="false" />
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.objectFactory" value="spring" />
<include file="mailreader-default.xml"/>
@@ -4,11 +4,6 @@
<display-name>Struts 2 Mailreader</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext*.xml</param-value>
</context-param>
<filter>
<filter-name>Struts2</filter-name>
<filter-class>
@@ -21,19 +16,13 @@
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<!-- Application Listener for Mailreader database -->
<listener>
<listener-class>
mailreader2.ApplicationListener
</listener-class>
</listener>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
+4 -4
View File
@@ -820,7 +820,7 @@ public class Welcome extends MailreaderSupport {
</p>
<hr/>
<pre><code>&lt;#if (actionErrors?exists && actionErrors?size > 0)>
<pre><code>&lt;#if (actionErrors?exists &amp;&amp; actionErrors?size > 0)>
&lt;ul>
&lt;#list actionErrors as error>
&lt;li>&lt;span class="errorMessage">${error}&lt;/span>&lt;/li>
@@ -837,7 +837,7 @@ public class Welcome extends MailreaderSupport {
</p>
<hr/>
<pre><code>&lt;#if (actionErrors?exists && actionErrors?size > 0)>
<pre><code>&lt;#if (actionErrors?exists &amp;&amp; actionErrors?size > 0)>
<strong>&lt;table></strong>
&lt;#list actionErrors as error>
<strong>&lt;tr>&lt;td></strong>&lt;span class="errorMessage">${error}&lt;/span><strong>&lt;/td>&lt;/tr></strong>
@@ -1064,7 +1064,7 @@ public void setPassword(String password) {
<pre><code>public User <strong>findUser</strong>(String username, String password)
throws <strong>ExpiredPasswordException</strong> {
User user = <strong>getDatabase().findUser(username)</strong>;
if ((user != null) && !user.getPassword().equals(password)) {
if ((user != null) &amp;&amp; !user.getPassword().equals(password)) {
user = null;
}
if (user == null) {
@@ -1427,7 +1427,7 @@ public class <strong>AuthenticationInterceptor</strong> implements Interceptor {
public String <strong>intercept</strong>(ActionInvocation actionInvocation) throws Exception {
Map session = actionInvocation.getInvocationContext().getSession();
User user = (User) session.get(Constants.USER_KEY);
boolean isAuthenticated = (null!=user) && (null!=user.getDatabase());
boolean isAuthenticated = (null!=user) &amp;&amp; (null!=user.getDatabase());
if (<strong>isAuthenticated</strong>) {
return actionInvocation.invoke();
}
+1 -1
View File
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.0.6</version>
<version>2.0.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.0.6</version>
<version>2.0.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-portlet</artifactId>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.0.6</version>
<version>2.0.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-showcase</artifactId>
-66
View File
@@ -1,66 +0,0 @@
<configuration>
<!--
QuickStart can be used to extend other QuickStart configurations.
This is great for applications that have multiple "editions" and
extend upon a base webapp or evven just a base set of classes.
-->
<!--<extendsConfig>../path/to/quickstart.xml</extendsConfig>-->
<!--
QuickStart supports reading your IDEA module configuration and
using the libraries there. This is especially useful for maven
users who don't have a single directory in their project that
contains all the libraries they need.
-->
<ideaConfig>../../../xwork/xwork.iml,../../core/struts2-core.iml,struts2-showcase.iml</ideaConfig>
<!-- The context in which to deploy the web application -->
<context>/showcase</context>
<!-- The port in which to deploy the web application -->
<port>8080</port>
<!--
The libs directories can be a jar, a directory of jars, or even
a directory of directories (searched recursively)
<libs>
<dir>../../lib</dir>
</libs>
-->
<!--
Optional: the location where your source files are. If this is
not included, the auto-recompiling feature of QuickStart will
not be enabled. You may wish to do this anyway, as this feature
has been known to cause strange side effects. If you don't
specify your sources, you must specify where your classes are by
using the classDirs and libs elements
<sources>
<dir>src/main/java</dir>
</sources>
-->
<!--
The classDirs directories can be a jar or a directory of classes.
The WEB-INF/classes directory for each webDir (below) will automatically
be added if it exists.
-->
<classDirs>
<dir>src/main/resources</dir>
<dir>target/classes</dir>
<dir>../../core/target/classes</dir>
</classDirs>
<!--
You can specify one or more directories where your webapp files
are located. This is useful if you have your project split up in
unique ways. You can also specify the path that the directory is
mapped to, relative to the context.
-->
<webDirs>
<webDir>
<path>/</path>
<dir>src/main/webapp</dir>
</webDir>
</webDirs>
</configuration>
@@ -57,7 +57,7 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
public String execute() throws MalformedURLException, IOException {
if (page != null) {
if (page != null && page.trim().length() > 0) {
InputStream in = ClassLoaderUtil.getResourceAsStream(page.substring(page.indexOf("//")+1), getClass());
page = page.replace("//", "/");
@@ -72,7 +72,7 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
pageLines = read(in, -1);
}
if (className != null) {
if (className != null && className.trim().length() > 0) {
className = "/"+className.replace('.', '/') + ".java";
InputStream in = getClass().getResourceAsStream(className);
if (in == null) {
@@ -81,7 +81,7 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
classLines = read(in, -1);
}
if (config != null) {
if (config != null && config.trim().length() > 0) {
int pos = config.lastIndexOf(':');
configLine = Integer.parseInt(config.substring(pos+1));
config = config.substring(0, pos).replace("//", "/");
@@ -1,11 +0,0 @@
struts.i18n.reload=true
struts.devMode = true
struts.configuration.xml.reload=true
struts.continuations.package=org.apache.struts2.showcase
struts.custom.i18n.resources=globalMessages
#struts.action.extension=jspa
struts.url.http.port = 8080
struts.freemarker.manager.classname=customFreemarkerManager
struts.serve.static=true
struts.serve.static.browserCache=false
struts.codebehind.defaultPackage=person
@@ -7,10 +7,23 @@
<!-- START SNIPPET: xworkSample -->
<struts>
<!-- Some or all of these can be flipped to true for debugging -->
<constant name="struts.i18n.reload" value="false" />
<constant name="struts.devMode" value="false" />
<constant name="struts.configuration.xml.reload" value="false" />
<constant name="struts.custom.i18n.resources" value="globalMessages" />
<constant name="struts.codebehind.defaultPackage" value="person" />
<constant name="struts.freemarker.manager.classname" value="customFreemarkerManager" />
<constant name="struts.serve.static" value="true" />
<constant name="struts.serve.static.browserCache" value="false" />
<include file="struts-chat.xml" />
<include file="struts-hangman.xml" />
<include file="struts-continuations.xml"/>
<include file="struts-tags.xml"/>
<include file="struts-validation.xml" />
@@ -24,7 +24,7 @@ Using a JSON list returned from an action (href="/JSONList.action"), without aut
Reload on type (loadOnTextChange="true"), after 3 characters (loadMinimumCout="3", it is "3" by default), without the down arrow button (showDownArrow="false")
<br/>
<s:autocompleter theme="ajax" indicator="indicator" href="%{jsonList}" cssStyle="width: 200px;" autoComplete="false" loadOnTextChange="true" loadMinimumCount="3" showDownArrow="false"/>
<s:autocompleter name="state" theme="ajax" indicator="indicator" href="%{jsonList}" cssStyle="width: 200px;" autoComplete="false" loadOnTextChange="true" loadMinimumCount="3" showDownArrow="false"/>
<img id="indicator" src="${pageContext.request.contextPath}/images/indicator.gif" alt="Loading..." style="display:none"/>
<br/>
+1 -1
View File
@@ -33,7 +33,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.0.6</version>
<version>2.0.7</version>
</parent>
<scm>
+2 -3
View File
@@ -1,3 +1,2 @@
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/struts2-core-2.0.4.jar -destjar struts2-core-j4-2.0.4.jar
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/struts2-api-2.0.4.jar -destjar struts2-api-j4-2.0.4.jar
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/xwork-2.0.0.jar -destjar xwork-j4-2.0.0.jar
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/struts2-core-2.0.6.jar -destjar struts2-core-j4-2.0.6.jar
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/xwork-2.0.1.jar -destjar xwork-j4-2.0.1.jar
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.0.6</version>
<version>2.0.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
@@ -147,4 +147,8 @@ public final class StrutsConstants {
public static final String STRUTS_XWORKCONVERTER = "struts.xworkConverter";
public static final String STRUTS_ALWAYS_SELECT_FULL_NAMESPACE = "struts.mapper.alwaysSelectFullNamespace";
/** XWork default text provider */
public static final String STRUTS_XWORKTEXTPROVIDER = "struts.xworkTextProvider";
}
@@ -29,18 +29,10 @@ import org.apache.struts2.views.annotations.StrutsTagAttribute;
import com.opensymphony.xwork2.util.ValueStack;
/**
* <!-- START SNIPPET: javadoc -->
* <p>The autocomplete tag is a combobox that can autocomplete text entered on the input box.
* When used on the "simple" theme, the autocompleter can be used like the ComboBox.
* When used on the "ajax" theme, the list can be retieved from an action. This action must
* return a JSON list in the format:</p>
* <pre>
* [
* ["Text 1","Value1"],
* ["Text 2","Value2"],
* ["Text 3","Value3"]
* ]
* </pre>
* <!-- START SNIPPET: ajaxJavadoc -->
* When used on the "ajax" theme, the list can be retieved from an action. </p>
* <B>THE FOLLOWING IS ONLY VALID WHEN AJAX IS CONFIGURED</B>
* <ul>
* <li>href</li>
@@ -70,18 +62,27 @@ import com.opensymphony.xwork2.util.ValueStack;
* 'showErrorTransportText': whether errors should be displayed (on 'targets')<p/>
* 'loadOnTextChange' options will be reloaded everytime a character is typed on the textbox<p/>
* 'loadMinimumCount' minimum number of characters that will force the content to be loaded<p/>
* 'showDownError' show or hide the down arrow button
* 'showDownError' show or hide the down arrow button<p/>
* 'searchType' how the search must be performed, options are: "startstring", "startword" and "substring"<p/>
* 'keyName' name of the field to which the selected key will be assigned<p/>
* 'iconPath' path of icon used for the dropdown
* 'templateCssPath' path to css file used to customize Dojo's widget
* 'iconPath' path of icon used for the dropdown<p/>
* 'templateCssPath' path to css file used to customize Dojo's widget<p/>
* 'dataFieldName' name of the field to be used as the list in the returned JSON string<p/>
* 'notifyTopics' comma separated list of topics names, that will be published. Three parameters are passed:<p/>
* <ul>
* <li>data: selected value when type='valuechanged'</li>
* <li>type: 'before' before the request is made, 'valuechanged' when selection changes, 'load' when the request succeeds, or 'error' when it fails</li>
* <li>request: request javascript object, when type='load' or type='error'</li>
* <ul>
*
*<!-- END SNIPPET: javadoc -->
*<!-- START SNIPPET: example -->
*<p>Autocompleter that gets its list from an action:</p>
*&lt;s:autocompleter name="test" href="%{jsonList}" autoComplete="false"/&gt;
*<br/>
**<p>Autocompleter that uses a list:</p>
*&lt;s:autocompleter name="test" list="{'apple','banana','grape','pear'}" autoComplete="false"/&gt;
*<br/>
*<!-- END SNIPPET: example -->
*/
@StrutsTag(name="autocompleter", tldTagClass="org.apache.struts2.views.jsp.ui.AutocompleterTag", description="Renders a combobox with autocomplete and AJAX capabilities")
public class Autocompleter extends ComboBox {
@@ -107,6 +108,7 @@ public class Autocompleter extends ComboBox {
protected String templateCssPath;
protected String iconPath;
protected String keyName;
protected String dataFieldName;
public Autocompleter(ValueStack stack, HttpServletRequest request,
HttpServletResponse response) {
@@ -169,6 +171,8 @@ public class Autocompleter extends ComboBox {
addParameter("templateCssPath", findString(templateCssPath));
if(iconPath != null)
addParameter("iconPath", findString(iconPath));
if(dataFieldName != null)
addParameter("dataFieldName", findString(dataFieldName));
if(keyName != null)
addParameter("keyName", findString(keyName));
else {
@@ -285,4 +289,9 @@ public class Autocompleter extends ComboBox {
public void setKeyName(String keyName) {
this.keyName = keyName;
}
@StrutsTagAttribute(description="Name of the field in the returned JSON object that contains the data array", defaultValue="Value specified in 'name'")
public void setDataFieldName(String dataFieldName) {
this.dataFieldName = dataFieldName;
}
}
@@ -43,51 +43,53 @@ import com.opensymphony.xwork2.util.ValueStack;
* A stand-alone DateTimePicker widget that makes it easy to select a date/time, or increment by week, month,
* and/or year.
* </p>
* Dates attributes passed in the `RFC 3339` format:
*
* Renders date/time picker element.</p>
* Format supported by this component are:-
* <p>
* It is possible to customize the user-visible formatting with either the
* 'formatLength' (long, short, medium or full) or 'displayFormat' attributes. By defaulty current
* locale will be used.</p>
* </p>
*
* Syntax supported by 'displayFormat' is (http://www.unicode.org/reports/tr35/tr35-4.html#Date_Format_Patterns):-
* <table border="1">
* <tr>
* <td>Format</td>
* <td>Description</td>
* </tr>
* <tr>
* <td>#dd</td>
* <td>Display day in two digits format</td>
* <td>d</td>
* <td>Day of the month</td>
* </tr>
* <tr>
* <td>#d</td>
* <td>Try to display day in one digit format, if cannot use 2 digit format</td>
* <td>D</td>
* <td>Day of year</td>
* </tr>
* <tr>
* <td>#MM</td>
* <td>Display month in two digits format</td>
* <td>M</td>
* <td>Month - Use one or two for the numerical month, three for the abbreviation, or four for the full name, or 5 for the narrow name.</td>
* </tr>
* <tr>
* <td>#M</td>
* <td>Try to display month in one digits format, if cannot use 2 digit format</td>
* <td>h</td>
* <td>Hour [1-12].</td>
* </tr>
* <tr>
* <td>#yyyy</td>
* <td>Display year in four digits format</td>
* <td>H</td>
* <td>Hour [0-23].</td>
* </tr>
* <tr>
* <td>#yy</td>
* <td>Display the last two digits of the yaer</td>
* <td>m</td>
* <td>Minute. Use one or two for zero padding.</td>
* </tr>
* <tr>
* <td>#y</td>
* <td>Display the last digits of the year</td>
* <td>s</td>
* <td>Second. Use one or two for zero padding.</td>
* </tr>
* </table>
*
* <p>
* It is possible to customize the user-visible formatting with either the
* formatLength or displayFormat attributes. The value sent to the server is
* The value sent to the server is
* typically a locale-independent value in a hidden field as defined by the name
* attribute. RFC3339 representation is used by default, but other options are
* available with saveFormat
* attribute. RFC3339 representation is the format used.
* </p>
*
* <p/>
@@ -102,7 +104,7 @@ import com.opensymphony.xwork2.util.ValueStack;
* Example 1:
* &lt;s:datetimepicker name="order.date" label="Order Date" /&gt;
* Example 2:
* &lt;s:datetimepicker name="delivery.date" label="Delivery Date" format="#yyyy-#MM-#dd" /&gt;
* &lt;s:datetimepicker name="delivery.date" label="Delivery Date" format="yyyy-MM-dd" /&gt;
*
* <!-- END SNIPPET: expl1 -->
* </pre>
@@ -297,13 +299,13 @@ public class DateTimePicker extends UIBean {
// try to parse a date
String dateStr = obj.toString();
if(dateStr.equalsIgnoreCase("today"))
return RFC3339_FORMAT.format(new Date());
return RFC3339_FORMAT.format(new Date());
try {
Date date = null;
if(this.displayFormat != null) {
SimpleDateFormat format = new SimpleDateFormat(
this.displayFormat);
(String) getParameters().get("displayFormat"));
date = format.parse(dateStr);
return RFC3339_FORMAT.format(date);
} else {
@@ -69,15 +69,16 @@ import com.opensymphony.xwork2.util.ValueStack;
* 'formFilter' is the name of a function which will be used to filter the fields that will be
* seralized. This function takes as a parameter the element and returns true if the element
* should be included.<p/>
* 'updateFreq' sets(in milliseconds) the update interval.
* 'autoStart' if set to true(true by default) starts the timer automatically
* 'startTimerListenTopics' is a comma-separated list of topics used to start the timer
* 'stopTimerListenTopics' is a comma-separated list of topics used to stop the timer
* 'listenTopics' comma separated list of topics names, that will trigger a request
* 'indicator' element to be shown while the request executing
* 'updateFreq' sets(in milliseconds) the update interval.<p/>
* 'autoStart' if set to true(true by default) starts the timer automatically<p/>
* 'startTimerListenTopics' is a comma-separated list of topics used to start the timer<p/>
* 'stopTimerListenTopics' is a comma-separated list of topics used to stop the timer<p/>
* 'listenTopics' comma separated list of topics names, that will trigger a request<p/>
* 'indicator' element to be shown while the request executing<p/>
* 'showErrorTransportText': whether errors should be displayed (on 'targets')</p>
* 'showLoadingText' show loading text on targets</p>
* 'notifyTopics' comma separated list of topics names, that will be published. Three parameters are passed:
* 'separateScript' Run scripts in a separate scope, unique for each Div<p/>
* 'notifyTopics' comma separated list of topics names, that will be published. Three parameters are passed:<p/>
* <ul>
* <li>data: html or json object when type='load' or type='error'</li>
* <li>type: 'before' before the request is made, 'load' when the request succeeds, or 'error' when it fails</li>
@@ -117,6 +118,7 @@ public class Div extends AbstractRemoteCallUIBean {
protected String startTimerListenTopics;
protected String stopTimerListenTopics;
protected String refreshOnShow;
protected String separateScripts;
public Div(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
super(stack, request, response);
@@ -145,6 +147,8 @@ public class Div extends AbstractRemoteCallUIBean {
addParameter("startTimerListenTopics", findString(startTimerListenTopics));
if (stopTimerListenTopics != null)
addParameter("stopTimerListenTopics", findString(stopTimerListenTopics));
if (separateScripts != null)
addParameter("separateScripts", findValue(separateScripts, Boolean.class));
}
@StrutsTagAttribute(description="Start timer automatically", type="Boolean", defaultValue="true")
@@ -181,4 +185,9 @@ public class Div extends AbstractRemoteCallUIBean {
public void setAfterLoading(String afterLoading) {
this.afterLoading = afterLoading;
}
@StrutsTagAttribute(description="Run scripts in a separate scope, unique for each Div", defaultValue="true")
public void setSeparateScripts(String separateScripts) {
this.separateScripts = separateScripts;
}
}
@@ -31,6 +31,7 @@ import org.apache.struts2.StrutsException;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.LocaleProvider;
import com.opensymphony.xwork2.TextProviderSupport;
import com.opensymphony.xwork2.TextProviderFactory;
import com.opensymphony.xwork2.util.LocalizedTextUtil;
import com.opensymphony.xwork2.util.ValueStack;
@@ -102,10 +103,10 @@ public class I18n extends Component {
if (bundle != null) {
final Locale locale = (Locale) getStack().getContext().get(ActionContext.LOCALE);
getStack().push(new TextProviderSupport(bundle, new LocaleProvider() {
public Locale getLocale() {
return locale;
}
getStack().push(TextProviderFactory.getInstance(bundle, new LocaleProvider() {
public Locale getLocale() {
return locale;
}
}));
pushed = true;
}
@@ -32,7 +32,9 @@ import com.opensymphony.xwork2.util.ValueStack;
* <p>The set tag assigns a value to a variable in a specified scope. It is useful when you wish to assign a variable to a
* complex expression and then simply reference that variable each time rather than the complex expression. This is
* useful in both cases: when the complex expression takes time (performance improvement) or is hard to read (code
* readability improvement).</P>
* readability improvement).</p>
* <p>If the tag is used with body content, the evaluation of the value parameter is omitted. Instead, the String to
* which the body eveluates is set as value for the scoped variable.</p>
*
* The scopes available are as follows :-
* <ul>
@@ -75,7 +77,7 @@ import com.opensymphony.xwork2.util.ValueStack;
* </pre>
*
*/
@StrutsTag(name="set", tldBodyContent="empty", tldTagClass="org.apache.struts2.views.jsp.SetTag", description="Assigns a value to a variable in a specified scope")
@StrutsTag(name="set", tldBodyContent="JSP", tldTagClass="org.apache.struts2.views.jsp.SetTag", description="Assigns a value to a variable in a specified scope")
public class Set extends Component {
protected String name;
protected String scope;
@@ -88,11 +90,18 @@ public class Set extends Component {
public boolean end(Writer writer, String body) {
ValueStack stack = getStack();
Object o;
if (value == null) {
value = "top";
if (body!=null && !body.equals("")) {
o = body;
} else {
o = findValue("top");
}
} else {
o = findValue(value);
}
Object o = findValue(value);
body="";
String name;
if (altSyntax()) {
@@ -26,7 +26,6 @@ import java.util.StringTokenizer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.StrutsException;
import org.apache.struts2.dispatcher.mapper.ActionMapper;
import org.apache.struts2.dispatcher.multipart.MultiPartRequest;
import org.apache.struts2.views.freemarker.FreemarkerManager;
@@ -34,6 +33,7 @@ import org.apache.struts2.views.velocity.VelocityManager;
import com.opensymphony.xwork2.ActionProxyFactory;
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.TextProvider;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.config.ConfigurationProvider;
@@ -41,12 +41,10 @@ import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.ContainerBuilder;
import com.opensymphony.xwork2.inject.Context;
import com.opensymphony.xwork2.inject.Factory;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.inject.Scope;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
import com.opensymphony.xwork2.util.LocalizedTextUtil;
import com.opensymphony.xwork2.util.ObjectTypeDeterminer;
import com.opensymphony.xwork2.util.ObjectTypeDeterminerFactory;
import com.opensymphony.xwork2.util.XWorkConverter;
import com.opensymphony.xwork2.util.location.LocatableProperties;
@@ -154,6 +152,7 @@ public class BeanSelectionProvider implements ConfigurationProvider {
public void register(ContainerBuilder builder, LocatableProperties props) {
alias(ObjectFactory.class, StrutsConstants.STRUTS_OBJECTFACTORY, builder, props);
alias(XWorkConverter.class, StrutsConstants.STRUTS_XWORKCONVERTER, builder, props);
alias(TextProvider.class, StrutsConstants.STRUTS_XWORKTEXTPROVIDER, builder, props);
alias(ActionProxyFactory.class, StrutsConstants.STRUTS_ACTIONPROXYFACTORY, builder, props);
alias(ObjectTypeDeterminer.class, StrutsConstants.STRUTS_OBJECTTYPEDETERMINER, builder, props);
alias(ActionMapper.class, StrutsConstants.STRUTS_MAPPER_CLASS, builder, props);
@@ -52,10 +52,7 @@ import org.apache.struts2.util.ObjectFactoryDestroyable;
import org.apache.struts2.views.freemarker.FreemarkerManager;
import com.opensymphony.xwork2.util.FileManager;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.ActionProxyFactory;
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.*;
import com.opensymphony.xwork2.Result;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.ConfigurationException;
@@ -404,6 +401,9 @@ Caused by: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyExcepti
ObjectTypeDeterminer objectTypeDeterminer = container.getInstance(ObjectTypeDeterminer.class);
ObjectTypeDeterminerFactory.setInstance(objectTypeDeterminer);
TextProvider textProvider = container.getInstance(TextProvider.class);
TextProviderFactory.setInstance(textProvider);
return container;
}
@@ -123,7 +123,7 @@ import com.opensymphony.xwork2.ActionContext;
* <li><b>actionPackages</b> - a comma-delimited list of Java packages to scan for Actions.</li>
*
* <li><b>configProviders</b> - a comma-delimited list of Java classes that implement the
* {@link ConfigurationProvider} interface that should be used for building the {@link Configuration}.</li>
* {@link com.opensymphony.xwork2.config.ConfigurationProvider} interface that should be used for building the {@link com.opensymphony.xwork2.config.Configuration}.</li>
*
* <li><b>*</b> - any other parameters are treated as framework constants.</li>
*
@@ -320,20 +320,20 @@ public class FilterDispatcher implements StrutsStatics, Filter {
// prepare the request no matter what - this ensures that the proper character encoding
// is used before invoking the mapper (see WW-9127)
dispatcher.prepare(request, response);
try {
// Wrap request first, just in case it is multipart/form-data
// parameters might not be accessible through before encoding (ww-1278)
request = dispatcher.wrapRequest(request, getServletContext());
} catch (IOException e) {
String message = "Could not wrap servlet request with MultipartRequestWrapper!";
LOG.error(message, e);
throw new ServletException(message, e);
}
}
else {
} else {
dispatcher = du;
}
try {
// Wrap request first, just in case it is multipart/form-data
// parameters might not be accessible through before encoding (ww-1278)
request = dispatcher.wrapRequest(request, getServletContext());
} catch (IOException e) {
String message = "Could not wrap servlet request with MultipartRequestWrapper!";
LOG.error(message, e);
throw new ServletException(message, e);
}
return request;
}
@@ -537,6 +537,7 @@ public class FilterDispatcher implements StrutsStatics, Filter {
while (-1 != (n = input.read(buffer))) {
output.write(buffer, 0, n);
}
output.flush(); // WW-1526
}
/**
@@ -0,0 +1,275 @@
/*
* $Id: $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.interceptor;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.TextParseUtil;
/**
* <!-- START SNIPPET: description -->
*
* The aim of this interceptor is to set values in the stack/action based on cookie name/value
* of interest. <p/>
*
* If an asterik is present in cookiesName parameter, it will be assume that
* all cookies name are to be injected into struts' action, even though
* cookiesName is comma-separated by other values, eg (cookie1,*,cookie2). <p/>
*
* If cookiesName is left empty it will assume that no cookie will be injected
* into Struts' action. <p/>
*
* If an asterik is present in cookiesValue parameter, it will assume that all
* cookies name irrespective of its value will be injected into Struts' action so
* long as the cookie name matches those specified in cookiesName parameter.<p/>
*
* If cookiesValue is left empty it will assume that all cookie that match the cookieName
* parameter will be injected into Struts' action.<p/>
*
* The action could implements {@link CookiesAware} in order to have a {@link Map}
* of filtered cookies set into it. <p/>
*
* <!-- END SNIPPET: description -->
*
*
* <!-- START SNIPPET: parameters -->
*
* <ul>
* <li>cookiesName (mandatory) - Name of cookies to be injected into the action. If more
* than one cookie name is desired it could be comma-separated.
* If all cookies name is desired, it could simply be *, an asterik.
* When many cookies name are comma-separated either of the cookie
* that match the name in the comma-separated list will be qualified.</li>
* <li>cookiesValue (mandatory) - Value of cookies that if its name matches cookieName attribute
* and its value matched this, will be injected into Struts'
* action. If more than one cookie name is desired it could be
* comma-separated. If left empty, it will assume any value would
* be ok. If more than one value is specified (comma-separated)
* it will assume a match if either value is matched.
* </ul>
*
* <!-- END SNIPPET: parameters -->
*
*
* <!-- START SNIPPET: extending -->
*
* <ul>
* populateCookieValueIntoStack - this method will decide if this cookie value is qualified to be
* populated into the value stack (hence into the action itself)
* injectIntoCookiesAwareAction - this method will inject selected cookies (as a java.util.Map) into
* action that implements {@link CookiesAware}.
* </ul>
*
* <!-- END SNIPPET: extending -->
*
* <pre>
* <!-- START SNIPPET: example -->
*
* &lt;!--
* This example will inject cookies named either 'cookie1' or 'cookie2' whose
* value could be either 'cookie1value' or 'cookie2value' into Struts' action.
* --&gt;
* &lt;action ... &gt;
* &lt;interceptor-ref name="cookie"&gt;
* &lt;param name="cookiesName"&gt;cookie1, cookie2&lt;/param&gt;
* &lt;param name="cookiesValue"&gt;cookie1value, cookie2value&lt;/param&gt;
* &lt;/interceptor-ref&gt;
* ....
* &lt;/action&gt;
*
*
* &lt;!--
* This example will inject cookies named either 'cookie1' or 'cookie2'
* regardless of their value into Struts' action.
* --&gt;
* &lt;action ... &gt;
* &lt;interceptor-ref name="cookie"&gt;
* &lt;param name="cookiesName"&gt;cookie1, cookie2&lt;/param&gt;
* &lt;param name="cookiesValue"&gt;*&lt;/param&gt;
* &lt;interceptor-ref&gt;
* ...
* &lt;/action&gt;
*
*
* &lt;!--
* This example will inject cookies named either 'cookie1' with value
* 'cookie1value' or 'cookie2' with value 'cookie2value' into Struts'
* action.
* --&gt;
* &lt;action ... &gt;
* &lt;interceptor-ref name="cookie"&gt;
* &lt;param name="cookiesName"&gt;cookie1&lt;/param&gt;
* &lt;param name="cookiesValue"&gt;cookie1value&lt;/param&gt;
* &lt;/interceptor-ref&gt;
* &lt;interceptor-ref name="cookie"&gt;
* &lt;param name="cookiesName"&lt;cookie2&lt;/param&gt;
* &lt;param name="cookiesValue"&gt;cookie2value&lt;/param&gt;
* &lt;/interceptor-ref&gt;
* ....
* &lt;/action&gt;
*
* &lt;!--
* This example will inject any cookies regardless of its value into
* Struts' action.
* --&gt;
* &lt;action ... &gt;
* &lt;interceptor-ref name="cookie"&gt;
* &lt;param name="cookiesName"&gt;*&lt;/param&gt;
* &lt;param name="cookiesValue"&gt;*&lt;/param&gt;
* &lt;/interceptor-ref&gt;
* ...
* &lt;/action&gt;
*
* <!-- END SNIPPET: example -->
* </pre>
*
* @see CookiesAware
*/
public class CookieInterceptor extends AbstractInterceptor {
private static final long serialVersionUID = 4153142432948747305L;
private static final Log LOG = LogFactory.getLog(CookieInterceptor.class);
private Set cookiesNameSet = Collections.EMPTY_SET;
private Set cookiesValueSet = Collections.EMPTY_SET;
/**
* Set the <code>cookiesName</code> which if matche will allow the cookie
* to be injected into action, could be comma-separated string.
*
* @param cookiesName
*/
public void setCookiesName(String cookiesName) {
if (cookiesName != null)
this.cookiesNameSet = TextParseUtil.commaDelimitedStringToSet(cookiesName);
}
/**
* Set the <code>cookiesValue</code> which if matched (together with matching
* cookiesName) will caused the cookie to be injected into action, could be
* comma-separated string.
*
* @param cookiesValue
*/
public void setCookiesValue(String cookiesValue) {
if (cookiesValue != null)
this.cookiesValueSet = TextParseUtil.commaDelimitedStringToSet(cookiesValue);
}
public String intercept(ActionInvocation invocation) throws Exception {
if (LOG.isDebugEnabled())
LOG.debug("start interception");
final ValueStack stack = ActionContext.getContext().getValueStack();
HttpServletRequest request = ServletActionContext.getRequest();
// contains selected cookies
Map cookiesMap = new LinkedHashMap();
Cookie cookies[] = request.getCookies();
for (int a=0; a< cookies.length; a++) {
String name = cookies[a].getName();
String value = cookies[a].getValue();
if (cookiesNameSet.contains("*")) {
if (LOG.isDebugEnabled())
LOG.debug("contains cookie name [*] in configured cookies name set, cookie with name ["+name+"] with value ["+value+"] will be injected");
populateCookieValueIntoStack(name, value, cookiesMap, stack);
}
else if (cookiesNameSet.contains(cookies[a].getName())) {
populateCookieValueIntoStack(name, value, cookiesMap, stack);
}
}
injectIntoCookiesAwareAction(invocation.getAction(), cookiesMap);
return invocation.invoke();
}
/**
* Hook that populate cookie value into value stack (hence the action)
* if the criteria is satisfied (if the cookie value matches with those configured).
*
* @param cookieName
* @param cookieValue
* @param cookiesMap
* @param stack
*/
protected void populateCookieValueIntoStack(String cookieName, String cookieValue, Map cookiesMap, ValueStack stack) {
if (cookiesValueSet.isEmpty() || cookiesValueSet.contains("*")) {
// If the interceptor is configured to accept any cookie value
// OR
// no cookiesValue is defined, so as long as the cookie name match
// we'll inject it into Struts' action
if (LOG.isDebugEnabled()) {
if (cookiesValueSet.isEmpty())
LOG.debug("no cookie value is configured, cookie with name ["+cookieName+"] with value ["+cookieValue+"] will be injected");
else if (cookiesValueSet.contains("*"))
LOG.debug("interceptor is configured to accept any value, cookie with name ["+cookieName+"] with value ["+cookieValue+"] will be injected");
}
cookiesMap.put(cookieName, cookieValue);
stack.setValue(cookieName, cookieValue);
}
else {
// if cookiesValues is specified, the cookie's value must match before we
// inject them into Struts' action
if (cookiesValueSet.contains(cookieValue)) {
if (LOG.isDebugEnabled())
LOG.debug("both configured cookie name and value matched, cookie ["+cookieName+"] with value ["+cookieValue+"] will be injected");
cookiesMap.put(cookieName, cookieValue);
stack.setValue(cookieName, cookieValue);
}
}
}
/**
* Hook that set the <code>cookiesMap</code> into action that implements
* {@link CookiesAware}.
*
* @param action
* @param cookiesMap
*/
protected void injectIntoCookiesAwareAction(Object action, Map cookiesMap) {
if (action instanceof CookiesAware) {
if (LOG.isDebugEnabled())
LOG.debug("action ["+action+"] implements CookiesAware, injecting cookies map ["+cookiesMap+"]");
((CookiesAware)action).setCookiesMap(cookiesMap);
}
}
}
@@ -0,0 +1,27 @@
/*
* $Id: $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.interceptor;
import java.util.Map;
public interface CookiesAware {
void setCookiesMap(Map cookies);
}
@@ -202,26 +202,30 @@ public class ScopeInterceptor extends AbstractInterceptor implements PreResultLi
super();
}
// Since 2.0.7. Avoid null references on session serialization (WW-1803).
private static class NULLClass implements Serializable {
public String toString() {
return "NULL";
}
public boolean equals(Object obj) {
return obj == null || (obj instanceof NULLClass);
}
}
private static final Object NULL = new Serializable() {
public String toString() {
return "NULL";
}
};
private static final Object NULL = new NULLClass();
private static final Object nullConvert(Object o) {
if (o == null) {
return NULL;
}
if (o == NULL) {
if (o == NULL || NULL.equals(o)) {
return null;
}
return o;
}
private static Map locks = new IdentityHashMap();
static final void lock(Object o, ActionInvocation invocation) throws Exception {
@@ -23,6 +23,7 @@ package org.apache.struts2.interceptor;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.util.InvocationSessionStore;
@@ -110,6 +111,7 @@ public class TokenSessionStoreInterceptor extends TokenInterceptor {
ActionContext ac = invocation.getInvocationContext();
HttpServletRequest request = (HttpServletRequest) ac.get(ServletActionContext.HTTP_REQUEST);
HttpServletResponse response = (HttpServletResponse) ac.get(ServletActionContext.HTTP_RESPONSE);
String tokenName = TokenHelper.getTokenName();
String token = TokenHelper.getToken(tokenName);
@@ -123,12 +125,18 @@ public class TokenSessionStoreInterceptor extends TokenInterceptor {
if (savedInvocation != null) {
// set the valuestack to the request scope
ValueStack stack = savedInvocation.getStack();
Map context = stack.getContext();
request.setAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY, stack);
ActionContext savedContext = savedInvocation.getInvocationContext();
savedContext.getContextMap().put(ServletActionContext.HTTP_REQUEST, request);
savedContext.getContextMap().put(ServletActionContext.HTTP_RESPONSE, response);
Result result = savedInvocation.getResult();
if ((result != null) && (savedInvocation.getProxy().getExecuteResult())) {
result.execute(savedInvocation);
synchronized (context) {
result.execute(savedInvocation);
}
}
// turn off execution of this invocations result
@@ -80,7 +80,7 @@ public class ContainUtil {
return true;
}
} else if (obj1 instanceof Collection) {
if (((Collection) obj1).contains(obj2)) {
if (((Collection) obj1).contains(obj2) || ((Collection) obj1).contains(obj2.toString())) {
//log.debug("obj1 is a collection and contains obj2");
return true;
}
@@ -94,6 +94,9 @@ public class ContainUtil {
return true;
}
}
} else if (obj1.toString().equals(obj2.toString())) {
//log.debug("obj1 is an object and it's String representation equals obj2's String representation.");
return true;
} else if (obj1.equals(obj2)) {
//log.debug("obj1 is an object and equals obj2");
return true;
@@ -115,7 +115,7 @@ public class StrutsModels {
return comboBox;
}
public AutocompleterModel getAutocompleterModel() {
public AutocompleterModel getAutocompleter() {
if (autocompleterModel == null) {
autocompleterModel = new AutocompleterModel(stack, req, res);
}
@@ -53,6 +53,7 @@ public class AutocompleterTag extends ComboBoxTag {
protected String templateCssPath;
protected String iconPath;
protected String keyName;
protected String dataFieldName;
public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
return new Autocompleter(stack, req, res);
@@ -81,6 +82,7 @@ public class AutocompleterTag extends ComboBoxTag {
autocompleter.setTemplateCssPath(templateCssPath);
autocompleter.setIconPath(iconPath);
autocompleter.setKeyName(keyName);
autocompleter.setDataFieldName(dataFieldName);
}
public void setAutoComplete(String autoComplete) {
@@ -162,4 +164,8 @@ public class AutocompleterTag extends ComboBoxTag {
public void setKeyName(String keyName) {
this.keyName = keyName;
}
public void setDataFieldName(String dataFieldName) {
this.dataFieldName = dataFieldName;
}
}
@@ -38,7 +38,8 @@ public class DivTag extends AbstractRemoteCallUITag {
protected String startTimerListenTopics;
protected String stopTimerListenTopics;
protected String refreshOnShow;
protected String separateScripts;
public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
return new Div(stack, req, res);
}
@@ -53,6 +54,7 @@ public class DivTag extends AbstractRemoteCallUITag {
div.setStartTimerListenTopics(startTimerListenTopics);
div.setStopTimerListenTopics(stopTimerListenTopics);
div.setRefreshOnShow(refreshOnShow);
div.setSeparateScripts(separateScripts);
}
public void setAutoStart(String autoStart) {
@@ -78,4 +80,8 @@ public class DivTag extends AbstractRemoteCallUITag {
public void setRefreshOnShow(String refreshOnShow) {
this.refreshOnShow = refreshOnShow;
}
public void setSeparateScripts(String separateScripts) {
this.separateScripts = separateScripts;
}
}
@@ -159,18 +159,18 @@ public class TextUtil {
addMapping(0xa1, "&iexcl;", strings); //
addMapping(0xa2, "&cent;", strings); //
addMapping(0xa3, "&pound;", strings); //
addMapping(0xa9, "&copy;", strings); //
addMapping(0xae, "&reg;", strings); //
addMapping(0xa9, "&copy;", strings); //
addMapping(0xae, "&reg;", strings); //
addMapping(0xbf, "&iquest;", strings); //
addMapping(0xc0, "&Agrave;", strings); //
addMapping(0xc1, "&Aacute;", strings); //
addMapping(0xc2, "&Acirc;", strings); //
addMapping(0xc3, "&Atilde;", strings); //
addMapping(0xc4, "&Auml;", strings); //
addMapping(0xc5, "&Aring;", strings); //
addMapping(0xc6, "&AElig;", strings); //
addMapping(0xc7, "&Ccedil;", strings); //
addMapping(0xc0, "&Agrave;", strings); //
addMapping(0xc1, "&Aacute;", strings); //
addMapping(0xc2, "&Acirc;", strings); //
addMapping(0xc3, "&Atilde;", strings); //
addMapping(0xc4, "&Auml;", strings); //
addMapping(0xc5, "&Aring;", strings); //
addMapping(0xc6, "&AElig;", strings); //
addMapping(0xc7, "&Ccedil;", strings); //
addMapping(0xc8, "&Egrave;", strings); //
addMapping(0xc9, "&Eacute;", strings); //
addMapping(0xca, "&Ecirc;", strings); //
@@ -186,7 +186,7 @@ public class TextUtil {
addMapping(0xd3, "&Oacute;", strings); //
addMapping(0xd4, "&Ocirc;", strings); //
addMapping(0xd5, "&Otilde;", strings); //
addMapping(0xd6, "&Ouml;", strings); //
addMapping(0xd6, "&Ouml;", strings); //
addMapping(0xd7, "&times;", strings); //
addMapping(0xd8, "&Oslash;", strings); //
addMapping(0xd9, "&Ugrave;", strings); //
@@ -201,8 +201,8 @@ public class TextUtil {
addMapping(0xe1, "&aacute;", strings); //
addMapping(0xe2, "&acirc;", strings); //
addMapping(0xe3, "&atilde;", strings); //
addMapping(0xe4, "&auml;", strings); //
addMapping(0xe5, "&aring;", strings); //
addMapping(0xe4, "&auml;", strings); //
addMapping(0xe5, "&aring;", strings); //
addMapping(0xe6, "&aelig;", strings); //
addMapping(0xe7, "&ccedil;", strings); //
addMapping(0xe8, "&egrave;", strings); //
@@ -220,7 +220,7 @@ public class TextUtil {
addMapping(0xf3, "&oacute;", strings); //
addMapping(0xf4, "&ocirc;", strings); //
addMapping(0xf5, "&otilde;", strings); //
addMapping(0xf6, "&ouml;", strings); //
addMapping(0xf6, "&ouml;", strings); //
addMapping(0xf7, "&divide;", strings); //
addMapping(0xf8, "&oslash;", strings); //
addMapping(0xf9, "&ugrave;", strings); //
@@ -24,9 +24,11 @@ package org.apache.struts2.views.util;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.Collections;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
@@ -37,7 +39,6 @@ import org.apache.commons.logging.LogFactory;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.StrutsConstants;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.TextParseUtil;
import com.opensymphony.xwork2.util.ValueStack;
@@ -61,21 +62,21 @@ public class UrlHelper {
private static final int DEFAULT_HTTPS_PORT = 443;
private static final String AMP = "&amp;";
private static int httpPort = DEFAULT_HTTP_PORT;
private static int httpsPort = DEFAULT_HTTPS_PORT;
private static String customEncoding;
@Inject(StrutsConstants.STRUTS_URL_HTTP_PORT)
public static void setHttpPort(String val) {
httpPort = Integer.parseInt(val);
}
@Inject(StrutsConstants.STRUTS_URL_HTTPS_PORT)
public static void setHttpsPort(String val) {
httpsPort = Integer.parseInt(val);
}
@Inject(StrutsConstants.STRUTS_I18N_ENCODING)
public static void setCustomEncoding(String val) {
customEncoding = val;
@@ -297,7 +298,26 @@ public class UrlHelper {
}
if (paramName != null) {
String translatedParamValue = translateAndDecode(paramValue);
queryParams.put(paramName, translatedParamValue);
if(queryParams.containsKey(paramName)) {
// WW-1619 append new param value to existing value(s)
Object currentParam = queryParams.get(paramName);
if(currentParam instanceof String) {
queryParams.put(paramName, new String[] {
(String) currentParam, translatedParamValue});
} else {
String currentParamValues[] = (String[]) currentParam;
List paramList = new ArrayList(Arrays
.asList(currentParamValues));
paramList.add(translatedParamValue);
String newParamValues[] = new String[paramList
.size()];
queryParams.put(paramName, paramList
.toArray(newParamValues));
}
} else {
queryParams.put(paramName, translatedParamValue);
}
}
}
}
@@ -1,6 +1,6 @@
<html>
<head>
<script language="javascript">
<script type="text/javascript">
var baseUrl = "<@s.url value="/struts" includeParams="none"/>";
window.open(baseUrl+"/webconsole.html", 'OGNL Console','width=500,height=450,'+
'status=no,toolbar=no,menubar=no');
@@ -21,6 +21,7 @@ struts.widget.ComboBoxDataProvider = function(/*Array*/ dataPairs, /*Number*/ li
this.formId = "";
this.formFilter = "";
this.firstRequest = true;
this.cbox = null;
this.init = function(/*Widget*/ cbox, /*DomNode*/ node){
@@ -59,18 +60,39 @@ struts.widget.ComboBoxDataProvider = function(/*Array*/ dataPairs, /*Number*/ li
formNode: dojo.byId(this.formId),
formFilter: window[this.formFilter],
load: dojo.lang.hitch(this, function(type, data, evt) {
//show indicator
dojo.html.hide(this.cbox.indicator);
//show indicator
dojo.html.hide(this.cbox.indicator);
this.cbox.notify.apply(this.cbox, [data, type, evt]);
if(!dojo.lang.isArray(data)){
var arrData = [];
for(var key in data){
arrData.push([data[key], key]);
}
data = arrData;
//if notifyTopics is published on the first request (onload)
//the value of listeners will be reset
if(!this.firstRequest) {
this.cbox.notify.apply(this.cbox, [data, type, evt]);
}
if(!dojo.lang.isArray(data)) {
//if there is a dataFieldName, take it
if(!dojo.string.isBlank(this.cbox.dataFieldName) && data[this.cbox.dataFieldName] != null) {
arrData = data[this.cbox.dataFieldName];
} else {
//try to find a match
var arrData = null;
for(var key in data){
//does it start with the field name? take it
if(key == this.cbox.name) {
arrData = data[key];
break;
}
//grab the first array found, we will use it if nothing else
//is found
if(!arrData && dojo.lang.isArray(data[key])) {
arrData = data = data[key];
}
}
}
data = arrData;
}
this.setData(data);
this.firstRequest = false;
}),
mimetype: "text/json"
});
@@ -167,6 +189,13 @@ struts.widget.ComboBoxDataProvider = function(/*Array*/ dataPairs, /*Number*/ li
this.setData = function(/*Array*/ pdata){
// populate this.data and initialize lookup structures
this.data = pdata;
//all ellements must be a key and value pair
for(var i = 0; i < this.data.length; i++) {
var element = this.data[i];
if(!dojo.lang.isArray(element)) {
this.data[i] = [element, element];
}
}
};
if(dataPairs){
@@ -205,6 +234,7 @@ dojo.widget.defineWidget(
//dojo has "stringstart" which is invalid
searchType: "STARTSTRING",
dataFieldName : "" ,
keyName: "",
templateCssPath: dojo.uri.dojoUri("struts/ComboBox.css"),
//from Dojo's ComboBox
@@ -0,0 +1,35 @@
//If we use "TimePicker" for the name, Dojo get's confused and breaks
//TODO remove this file on nect Dojo release
dojo.provide("struts.widget.StrutsTimePicker");
dojo.require("dojo.widget.DropdownTimePicker");
dojo.widget.defineWidget(
"struts.widget.StrutsTimePicker",
dojo.widget.DropdownTimePicker, {
widgetType : "TimePicker",
inputName: "",
name: "",
postCreate: function() {
struts.widget.StrutsTimePicker.superclass.postCreate.apply(this, arguments);
if(this.value.toLowerCase() == "today") {
this.value = dojo.date.toRfc3339(new Date());
}
this.inputNode.name = this.name;
this.valueNode.name = this.inputName;
},
onSetTime: function() {
struts.widget.StrutsTimePicker.superclass.onSetTime.apply(this, arguments);
if(this.timePicker.selectedTime.anyTime){
this.valueNode.value = "";
} else {
this.valueNode.value = dojo.date.toRfc3339(this.timePicker.time);
}
}
});
@@ -3,6 +3,6 @@ dojo.kwCompoundRequire({
"struts.widget.BindDiv",
"struts.widget.BindAnchor",
"struts.widget.ComboBox",
"struts.widget.DatePicker"]
"struts.widget.StrutsTimePicker"]
});
dojo.provide("struts.widget.*");
+55 -40
View File
@@ -3,49 +3,51 @@
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<bean class="com.opensymphony.xwork2.ObjectFactory" name="xwork" />
<bean type="com.opensymphony.xwork2.ObjectFactory" name="struts" class="org.apache.struts2.impl.StrutsObjectFactory" />
<bean type="com.opensymphony.xwork2.ActionProxyFactory" name="xwork" class="com.opensymphony.xwork2.DefaultActionProxyFactory"/>
<bean type="com.opensymphony.xwork2.ActionProxyFactory" name="struts" class="org.apache.struts2.impl.StrutsActionProxyFactory"/>
<bean type="com.opensymphony.xwork2.util.ObjectTypeDeterminer" name="tiger" class="com.opensymphony.xwork2.util.GenericsObjectTypeDeterminer"/>
<bean type="com.opensymphony.xwork2.util.ObjectTypeDeterminer" name="notiger" class="com.opensymphony.xwork2.util.DefaultObjectTypeDeterminer"/>
<bean type="com.opensymphony.xwork2.util.ObjectTypeDeterminer" name="struts" class="com.opensymphony.xwork2.util.DefaultObjectTypeDeterminer"/>
<bean class="com.opensymphony.xwork2.ObjectFactory" name="xwork" />
<bean type="com.opensymphony.xwork2.ObjectFactory" name="struts" class="org.apache.struts2.impl.StrutsObjectFactory" />
<bean type="com.opensymphony.xwork2.ActionProxyFactory" name="xwork" class="com.opensymphony.xwork2.DefaultActionProxyFactory"/>
<bean type="com.opensymphony.xwork2.ActionProxyFactory" name="struts" class="org.apache.struts2.impl.StrutsActionProxyFactory"/>
<bean type="com.opensymphony.xwork2.util.ObjectTypeDeterminer" name="tiger" class="com.opensymphony.xwork2.util.GenericsObjectTypeDeterminer"/>
<bean type="com.opensymphony.xwork2.util.ObjectTypeDeterminer" name="notiger" class="com.opensymphony.xwork2.util.DefaultObjectTypeDeterminer"/>
<bean type="com.opensymphony.xwork2.util.ObjectTypeDeterminer" name="struts" class="com.opensymphony.xwork2.util.DefaultObjectTypeDeterminer"/>
<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="struts" class="org.apache.struts2.dispatcher.mapper.DefaultActionMapper" />
<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="composite" class="org.apache.struts2.dispatcher.mapper.CompositeActionMapper" />
<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="restful" class="org.apache.struts2.dispatcher.mapper.RestfulActionMapper" />
<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="restful2" class="org.apache.struts2.dispatcher.mapper.Restful2ActionMapper" />
<bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest" name="struts" class="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest" scope="default" optional="true"/>
<bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest" name="jakarta" class="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest" scope="default" optional="true" />
<bean type="org.apache.struts2.views.TagLibrary" name="s" class="org.apache.struts2.views.DefaultTagLibrary" />
<bean class="org.apache.struts2.views.freemarker.FreemarkerManager" name="struts" optional="true"/>
<bean class="org.apache.struts2.views.velocity.VelocityManager" name="struts" optional="true" />
<bean class="org.apache.struts2.components.template.TemplateEngineManager" />
<bean type="org.apache.struts2.components.template.TemplateEngine" name="ftl" class="org.apache.struts2.components.template.FreemarkerTemplateEngine" />
<bean type="org.apache.struts2.components.template.TemplateEngine" name="vm" class="org.apache.struts2.components.template.VelocityTemplateEngine" />
<bean type="org.apache.struts2.components.template.TemplateEngine" name="jsp" class="org.apache.struts2.components.template.JspTemplateEngine" />
<bean type="com.opensymphony.xwork2.util.XWorkConverter" name="xwork1" class="com.opensymphony.xwork2.util.XWorkConverter" />
<bean type="com.opensymphony.xwork2.util.XWorkConverter" name="xwork1" class="com.opensymphony.xwork2.util.XWorkConverter" />
<bean type="com.opensymphony.xwork2.util.XWorkConverter" name="struts" class="com.opensymphony.xwork2.util.AnnotationXWorkConverter" />
<bean type="com.opensymphony.xwork2.TextProvider" name="xwork1" class="com.opensymphony.xwork2.TextProviderSupport" />
<bean type="com.opensymphony.xwork2.TextProvider" name="struts" class="com.opensymphony.xwork2.TextProviderSupport" />
<!-- Only have static injections -->
<bean class="com.opensymphony.xwork2.ObjectFactory" static="true" />
<bean class="com.opensymphony.xwork2.util.XWorkConverter" static="true" />
<bean class="com.opensymphony.xwork2.util.OgnlValueStack" static="true" />
<bean class="org.apache.struts2.dispatcher.Dispatcher" static="true" />
<bean class="org.apache.struts2.components.Include" static="true" />
<bean class="org.apache.struts2.dispatcher.FilterDispatcher" static="true" />
<bean class="org.apache.struts2.views.util.ContextUtil" static="true" />
<bean class="org.apache.struts2.views.util.UrlHelper" static="true" />
<bean class="com.opensymphony.xwork2.util.XWorkConverter" static="true" />
<bean class="com.opensymphony.xwork2.ObjectFactory" static="true" />
<package name="struts-default">
<result-types>
<result-type name="chain" class="com.opensymphony.xwork2.ActionChainResult"/>
@@ -53,48 +55,53 @@
<result-type name="freemarker" class="org.apache.struts2.views.freemarker.FreemarkerResult"/>
<result-type name="httpheader" class="org.apache.struts2.dispatcher.HttpHeaderResult"/>
<result-type name="redirect" class="org.apache.struts2.dispatcher.ServletRedirectResult"/>
<result-type name="redirect-action" class="org.apache.struts2.dispatcher.ServletActionRedirectResult"/>
<result-type name="redirectAction" class="org.apache.struts2.dispatcher.ServletActionRedirectResult"/>
<result-type name="stream" class="org.apache.struts2.dispatcher.StreamResult"/>
<result-type name="velocity" class="org.apache.struts2.dispatcher.VelocityResult"/>
<result-type name="xslt" class="org.apache.struts2.views.xslt.XSLTResult"/>
<result-type name="plainText" class="org.apache.struts2.dispatcher.PlainTextResult" />
<!-- Deprecated name form scheduled for removal in Struts 2.1.0. The camelCase versions are preferred. See ww-1707 -->
<result-type name="redirect-action" class="org.apache.struts2.dispatcher.ServletActionRedirectResult"/>
<result-type name="plaintext" class="org.apache.struts2.dispatcher.PlainTextResult" />
</result-types>
<interceptors>
<interceptor name="alias" class="com.opensymphony.xwork2.interceptor.AliasInterceptor"/>
<interceptor name="autowiring" class="com.opensymphony.xwork2.spring.interceptor.ActionAutowiringInterceptor"/>
<interceptor name="chain" class="com.opensymphony.xwork2.interceptor.ChainingInterceptor"/>
<interceptor name="conversionError" class="org.apache.struts2.interceptor.StrutsConversionErrorInterceptor"/>
<interceptor name="cookie" class="org.apache.struts2.interceptor.CookieInterceptor"/>
<interceptor name="createSession" class="org.apache.struts2.interceptor.CreateSessionInterceptor" />
<interceptor name="debugging" class="org.apache.struts2.interceptor.debugging.DebuggingInterceptor" />
<interceptor name="external-ref" class="com.opensymphony.xwork2.interceptor.ExternalReferencesInterceptor"/>
<interceptor name="externalRef" class="com.opensymphony.xwork2.interceptor.ExternalReferencesInterceptor"/>
<interceptor name="execAndWait" class="org.apache.struts2.interceptor.ExecuteAndWaitInterceptor"/>
<interceptor name="exception" class="com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor"/>
<interceptor name="fileUpload" class="org.apache.struts2.interceptor.FileUploadInterceptor"/>
<interceptor name="i18n" class="com.opensymphony.xwork2.interceptor.I18nInterceptor"/>
<interceptor name="logger" class="com.opensymphony.xwork2.interceptor.LoggingInterceptor"/>
<interceptor name="model-driven" class="com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor"/>
<interceptor name="scoped-model-driven" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor"/>
<interceptor name="modelDriven" class="com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor"/>
<interceptor name="scopedModelDriven" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor"/>
<interceptor name="params" class="com.opensymphony.xwork2.interceptor.ParametersInterceptor"/>
<interceptor name="prepare" class="com.opensymphony.xwork2.interceptor.PrepareInterceptor"/>
<interceptor name="static-params" class="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor"/>
<interceptor name="staticParams" class="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor"/>
<interceptor name="scope" class="org.apache.struts2.interceptor.ScopeInterceptor"/>
<interceptor name="servlet-config" class="org.apache.struts2.interceptor.ServletConfigInterceptor"/>
<interceptor name="servletConfig" class="org.apache.struts2.interceptor.ServletConfigInterceptor"/>
<interceptor name="sessionAutowiring" class="org.apache.struts2.spring.interceptor.SessionContextAutowiringInterceptor"/>
<interceptor name="timer" class="com.opensymphony.xwork2.interceptor.TimerInterceptor"/>
<interceptor name="token" class="org.apache.struts2.interceptor.TokenInterceptor"/>
<interceptor name="token-session" class="org.apache.struts2.interceptor.TokenSessionStoreInterceptor"/>
<interceptor name="tokenSession" class="org.apache.struts2.interceptor.TokenSessionStoreInterceptor"/>
<interceptor name="validation" class="org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor"/>
<interceptor name="workflow" class="com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor"/>
<interceptor name="store" class="org.apache.struts2.interceptor.MessageStoreInterceptor" />
<interceptor name="checkbox" class="org.apache.struts2.interceptor.CheckboxInterceptor" />
<interceptor name="profiling" class="org.apache.struts2.interceptor.ProfilingActivationInterceptor" />
<interceptor name="roles" class="org.apache.struts2.interceptor.RolesInterceptor" />
<!-- Basic stack -->
<interceptor-stack name="basicStack">
<interceptor-ref name="exception"/>
<interceptor-ref name="servlet-config"/>
<interceptor-ref name="servletConfig"/>
<interceptor-ref name="prepare"/>
<interceptor-ref name="checkbox"/>
<interceptor-ref name="params"/>
@@ -116,7 +123,7 @@
<!-- Sample model-driven stack -->
<interceptor-stack name="modelDrivenStack">
<interceptor-ref name="model-driven"/>
<interceptor-ref name="modelDriven"/>
<interceptor-ref name="basicStack"/>
</interceptor-stack>
@@ -148,14 +155,14 @@
<interceptor-ref name="exception"/>
<interceptor-ref name="alias"/>
<interceptor-ref name="params"/>
<interceptor-ref name="servlet-config"/>
<interceptor-ref name="servletConfig"/>
<interceptor-ref name="prepare"/>
<interceptor-ref name="i18n"/>
<interceptor-ref name="chain"/>
<interceptor-ref name="model-driven"/>
<interceptor-ref name="modelDriven"/>
<interceptor-ref name="fileUpload"/>
<interceptor-ref name="checkbox"/>
<interceptor-ref name="static-params"/>
<interceptor-ref name="staticParams"/>
<interceptor-ref name="params"/>
<interceptor-ref name="conversionError"/>
<interceptor-ref name="validation">
@@ -180,19 +187,19 @@
<interceptor-stack name="defaultStack">
<interceptor-ref name="exception"/>
<interceptor-ref name="alias"/>
<interceptor-ref name="servlet-config"/>
<interceptor-ref name="servletConfig"/>
<interceptor-ref name="prepare"/>
<interceptor-ref name="i18n"/>
<interceptor-ref name="chain"/>
<interceptor-ref name="debugging"/>
<interceptor-ref name="profiling"/>
<interceptor-ref name="scoped-model-driven"/>
<interceptor-ref name="model-driven"/>
<interceptor-ref name="scopedModelDriven"/>
<interceptor-ref name="modelDriven"/>
<interceptor-ref name="fileUpload"/>
<interceptor-ref name="checkbox"/>
<interceptor-ref name="static-params"/>
<interceptor-ref name="staticParams"/>
<interceptor-ref name="params">
<param name="excludeParams">dojo\..*</param>
<param name="excludeParams">dojo\..*</param>
</interceptor-ref>
<interceptor-ref name="conversionError"/>
<interceptor-ref name="validation">
@@ -221,9 +228,17 @@
<param name="excludeMethods">input,back,cancel</param>
</interceptor-ref>
</interceptor-stack>
<!-- Deprecated name forms scheduled for removal in Struts 2.1.0. The camelCase versions are preferred. See ww-1707 -->
<interceptor name="external-ref" class="com.opensymphony.xwork2.interceptor.ExternalReferencesInterceptor"/>
<interceptor name="model-driven" class="com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor"/>
<interceptor name="static-params" class="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor"/>
<interceptor name="scoped-model-driven" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor"/>
<interceptor name="servlet-config" class="org.apache.struts2.interceptor.ServletConfigInterceptor"/>
<interceptor name="token-session" class="org.apache.struts2.interceptor.TokenSessionStoreInterceptor"/>
</interceptors>
<default-interceptor-ref name="defaultStack"/>
</package>
@@ -86,6 +86,9 @@
<#if parameters.templateCssPath?if_exists != "">
templateCssPath="<@s.url value='${parameters.templateCssPath}' encode="false" includeParams='none'/>"
</#if>
<#if parameters.dataFieldName?if_exists != "">
dataFieldName="${parameters.dataFieldName?html}"
</#if>
<#include "/${parameters.templateDir}/simple/scripting-events.ftl" />
>
@@ -17,6 +17,9 @@
<#if parameters.refreshOnShow?exists>
refreshOnShow="${parameters.refreshOnShow?string?html}"<#rt/>
</#if>
<#if parameters.separateScripts?exists>
scriptSeparation="${parameters.separateScripts?string?html}"<#rt/>
</#if>
<#include "/${parameters.templateDir}/ajax/ajax-common.ftl" />
<#include "/${parameters.templateDir}/simple/scripting-events.ftl" />
>
@@ -9,5 +9,6 @@ dojo.require("struts.widget.Bind");
dojo.require("struts.widget.BindDiv");
dojo.require("struts.widget.BindAnchor");
dojo.require("struts.widget.ComboBox");
dojo.require("struts.widget.StrutsTimePicker")
dojo.require("dojo.widget.Editor2");
dojo.hostenv.writeIncludes(); // not needed, but allows the Venkman debugger to work with the includes
@@ -83,7 +83,7 @@ dojo.require("dojo.event.connect");
Code that will add javascript needed for tooltips
--><#t/>
<#lt/><!-- javascript that is needed for tooltips -->
<#lt/><script language="JavaScript" type="text/javascript">dojo.require("dojo.widget.html.Tooltip");dojo.require("dojo.fx.html");</script>
<#lt/><script type="text/javascript">dojo.require("dojo.widget.Tooltip");dojo.require("dojo.fx.html");</script>
</table>
</form>
@@ -1,9 +1,9 @@
<#if parameters.validate?exists>
<script src="${base}/struts/validationClient.js"></script>
<script src="${base}/dwr/interface/validator.js"></script>
<script src="${base}/dwr/engine.js"></script>
<script src="${base}/struts/ajax/validation.js"></script>
<script src="${base}/struts/${themeProperties.parent}/validation.js"></script>
<script type="text/javascript" src="${base}/struts/validationClient.js"></script>
<script type="text/javascript" src="${base}/dwr/interface/validator.js"></script>
<script type="text/javascript" src="${base}/dwr/engine.js"></script>
<script type="text/javascript" src="${base}/struts/ajax/validation.js"></script>
<script type="text/javascript" src="${base}/struts/${themeProperties.parent}/validation.js"></script>
</#if>
<form<#rt/>
<#if parameters.namespace?exists>
@@ -1,6 +1,6 @@
<#--include "/${parameters.templateDir}/xhtml/head.ftl" /-->
<#include "/${parameters.templateDir}/${themeProperties.parent}/head.ftl" />
<script language="JavaScript" type="text/javascript"
<script type="text/javascript"
src="<@s.url value='/struts/ajax/dojoRequire.js' includeParams='none' encode='false' />"></script>
<script language="JavaScript" type="text/javascript"
<script type="text/javascript"
src="<@s.url value='/struts/CommonFunctions.js' includeParams='none' encode='false'/>"></script>
@@ -1,4 +1,4 @@
<script language="JavaScript" type="text/javascript">
<script type="text/javascript">
<!--
dojo.require("dojo.lang.*");
dojo.require("dojo.widget.*");
@@ -1,7 +1,7 @@
</div>
</div>
<script language="JavaScript" type="text/javascript">
<script type="text/javascript">
var tabpanelc_$!parameters.id = new TabContent( "$!parameters.id", $!parameters.remote );
dojo.event.topic.subscribe( "$!parameters.subscribeTopicName", tabpanelc_$!parameters.id, "updateVisibility" );
</script>
@@ -1,4 +1,4 @@
<script language="JavaScript" type="text/javascript">
<script type="text/javascript">
<!--
function toggleDebug(debugId) {
var debugDiv = document.getElementById(debugId);
@@ -1,5 +1,5 @@
<#if parameters.validate?default(false) == true>
<script src="${base}/struts/css_xhtml/validation.js" type="text/javascript"></script>
<script type="text/javascript" src="${base}/struts/css_xhtml/validation.js" type="text/javascript"></script>
<#if parameters.onsubmit?exists>
${tag.addParameter('onsubmit', "${parameters.onsubmit}; return validateForm_${parameters.id}();")}
<#else>
@@ -1 +1 @@
</a>
</a><#rt/>
@@ -1,7 +1,10 @@
<a
<#if parameters.id?if_exists != "">id="${parameters.id?html}"</#if>
<#if parameters.href?if_exists != "">href="${parameters.href}"</#if>
<a<#rt/>
<#if parameters.id?if_exists != "">
id="${parameters.id?html}"<#rt/>
</#if>
<#if parameters.href?if_exists != "">
href="${parameters.href}"<#rt/>
</#if>
<#if parameters.tabindex?exists>
tabindex="${parameters.tabindex?html}"<#rt/>
</#if>
@@ -16,4 +19,4 @@
</#if>
<#include "/${parameters.templateDir}/simple/scripting-events.ftl" />
<#include "/${parameters.templateDir}/simple/common-attributes.ftl" />
>
><#rt/>
@@ -1,3 +1,3 @@
<#if parameters.accesskey?exists>
accesskey="${parameters.accesskey?html}"
</#if>
accesskey="${parameters.accesskey?html}"<#rt/>
</#if>
@@ -5,7 +5,7 @@
<#if parameters.type?if_exists == "date">
dojoType="dropdowndatepicker"<#rt/>
<#else>
dojoType="dropdowntimepicker"<#rt/>
dojoType="struts:StrutsTimePicker"<#rt/>
</#if>
<#if parameters.id?if_exists != "">
id="${parameters.id?html}"<#rt/>
@@ -1,4 +1,4 @@
<script language="JavaScript" type="text/javascript">
<script type="text/javascript">
<!--
function toggleDebug(debugId) {
var debugDiv = document.getElementById(debugId);
@@ -86,5 +86,5 @@ dojo.require("dojo.event.*");
--><#t/>
<#if (parameters.hasTooltip?default(false))><#t/>
<#lt/><!-- javascript that is needed for tooltips -->
<#lt/><script language="JavaScript" type="text/javascript">dojo.require("dojo.widget.html.Tooltip");dojo.require("dojo.fx.html");</script>
<#lt/><script type="text/javascript">dojo.require("dojo.widget.Tooltip");dojo.require("dojo.fx.html");</script>
</#if><#t/>
@@ -1,4 +1,4 @@
<script language="JavaScript" type="text/javascript">
<script type="text/javascript">
// Dojo configuration
djConfig = {
baseRelativePath: "<@s.url includeParams='none' value='/struts/dojo' includeParams="none" encode='false'/>",
@@ -7,7 +7,7 @@
debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes
};
</script>
<script language="JavaScript" type="text/javascript"
<script type="text/javascript"
src="<@s.url includeParams='none' value='/struts/dojo/dojo.js' includeParams="none" encode='false'/>"></script>
<script language="JavaScript" type="text/javascript"
<script type="text/javascript"
src="<@s.url includeParams='none' value='/struts/simple/dojoRequire.js' includeParams="none" encode='false'/>"></script>
@@ -1,5 +1,5 @@
<#if !stack.findValue("#inputtransferselect_js_included")?exists><#t/>
<script language="javascript" src="<@s.url value="/struts/inputtransferselect.js" encode='false' includeParams='none'/>"></script>
<script type="text/javascript" src="<@s.url value="/struts/inputtransferselect.js" encode='false' includeParams='none'/>"></script>
<#assign temporaryVariable = stack.setValue("#inputtransferselect_js_included", "true") /><#t/>
</#if><#t/>
<table border="0">
@@ -1,5 +1,5 @@
<#if !stack.findValue("#optiontransferselect_js_included")?exists><#t/>
<script language="javascript" src="<@s.url value="/struts/optiontransferselect.js" encode='false' includeParams='none'/>"></script>
<script type="text/javascript" src="<@s.url value="/struts/optiontransferselect.js" encode='false' includeParams='none'/>"></script>
<#assign temporaryVariable = stack.setValue("#optiontransferselect_js_included", "true") /><#t/>
</#if><#t/>
<table border="0">
@@ -10,7 +10,11 @@
<#else>
<#assign itemValue = stack.findString('top')/>
</#if>
<input type="radio" name="${parameters.name?html}" id="${parameters.id?html}${itemKeyStr?html}"<#rt/>
<input type="radio"<#rt/>
<#if parameters.name?exists>
name="${parameters.name?html}"<#rt/>
</#if>
id="${parameters.id?html}${itemKeyStr?html}"<#rt/>
<#if tag.contains(parameters.nameValue, itemKey)>
checked="checked"<#rt/>
</#if>
@@ -1,3 +1,4 @@
<#setting number_format="#.#####">
<select<#rt/>
name="${parameters.name?default("")?html}"<#rt/>
<#if parameters.get("size")?exists>
@@ -39,13 +40,13 @@
</#if>
<@s.iterator value="parameters.list">
<#if parameters.listKey?exists>
<#if stack.findString(parameters.listKey)?exists>
<#assign itemKey = stack.findString(parameters.listKey).toString()/>
<#if stack.findValue(parameters.listKey)?exists>
<#assign itemKey = stack.findValue(parameters.listKey)/>
<#else>
<#assign itemKey = ''/>
</#if>
<#else>
<#assign itemKey = stack.findValue('top').toString()/>
<#assign itemKey = stack.findValue('top')/>
</#if>
<#if parameters.listValue?exists>
<#if stack.findString(parameters.listValue)?exists>
@@ -57,7 +58,7 @@
<#assign itemValue = stack.findString('top')/>
</#if>
<option value="${itemKey?html}"<#rt/>
<#if tag.contains(parameters.nameValue, itemKey) == true || (parameters.nameValue?exists && parameters.nameValue?string == itemKey)>
<#if tag.contains(parameters.nameValue, itemKey) == true>
selected="selected"<#rt/>
</#if>
>${itemValue?html}</option><#lt/>
@@ -1,5 +1,5 @@
<#if !stack.findValue("#optiontransferselect_js_included")?exists><#t/>
<script language="javascript" src="<@s.url value="/struts/optiontransferselect.js" encode='false' includeParams='none'/>"></script>
<script type="text/javascript" src="<@s.url value="/struts/optiontransferselect.js" encode='false' includeParams='none'/>"></script>
<#assign temporaryVariable = stack.setValue("#optiontransferselect_js_included", "true") /><#t/>
</#if><#t/>
<table>
@@ -0,0 +1,3 @@
<#include "/${parameters.templateDir}/${parameters.theme}/controlheader.ftl" />
<#include "/${parameters.templateDir}/${themeProperties.parent}/autocompleter.ftl" />
<#include "/${parameters.templateDir}/xhtml/controlfooter.ftl" />
@@ -46,12 +46,14 @@ END SNIPPET: supported-validators
while (value.substring(value.length-1, value.length) == ' ')
value = value.substring(0, value.length-1);
</#if>
if((${validator.minLength} > -1 && value.length < ${validator.minLength}) ||
(${validator.maxLength} > -1 && value.length > ${validator.maxLength})) {
if(value.length > 0 && (
(${validator.minLength} > -1 && value.length < ${validator.minLength}) ||
(${validator.maxLength} > -1 && value.length > ${validator.maxLength})
)) {
addError(field, error);
errors = true;
}
}
}
<#elseif validator.validatorType = "regex">
if (field.value != null && !field.value.match("${validator.expression?js_string}")) {
addError(field, error);
@@ -1,5 +1,5 @@
<#if parameters.validate?default(false) == true>
<script src="${base}/struts/xhtml/validation.js"></script>
<script type="text/javascript" src="${base}/struts/xhtml/validation.js"></script>
<#if parameters.onsubmit?exists>
${tag.addParameter('onsubmit', "${parameters.onsubmit}; return validateForm_${parameters.id}();")}
<#else>
@@ -59,6 +59,14 @@ Please do not edit it directly.
<td align="left" valign="top">String</td>
<td align="left" valign="top">The css style definitions for element ro use</td>
</tr>
<tr>
<td align="left" valign="top">dataFieldName</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">Value specified in 'name'</td>
<td align="left" valign="top">true</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Name of the field in the returned JSON object that contains the data array</td>
</tr>
<tr>
<td align="left" valign="top">delay</td>
<td align="left" valign="top">false</td>
+8
View File
@@ -347,6 +347,14 @@ Please do not edit it directly.
<td align="left" valign="top">String</td>
<td align="left" valign="top">Define required position of required form element (left|right)</td>
</tr>
<tr>
<td align="left" valign="top">separateScripts</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">true</td>
<td align="left" valign="top">true</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Run scripts in a separate scope, unique for each Div</td>
</tr>
<tr>
<td align="left" valign="top">showErrorTransportText</td>
<td align="left" valign="top">false</td>
@@ -0,0 +1,57 @@
package org.apache.struts2.components;
import java.util.HashMap;
import java.util.Map;
import org.apache.struts2.views.jsp.AbstractTagTest;
/**
* Verifies correct operation of parameter merging.
*
* Contributed by: Daniel Uribe
*/
public class URLTest extends AbstractTagTest {
public void testIncludeGetDuplicateRequestParams() throws Exception {
String body = "";
Map parameterMap = new HashMap();
parameterMap.put("param", new String[] { "1", "2", "3" });
request.setQueryString("param=1&param=2&param=3");
request.setScheme("http");
request.setParameterMap(parameterMap);
URL url = new URL(stack, request, response);
url.setIncludeParams(URL.GET);
url.setIncludeContext(false);
url.setValue("myAction.action");
url.setNamespace("");
url.start(writer);
url.end(writer, body);
assertEquals("myAction.action?param=1&amp;param=2&amp;param=3",
writer.toString());
}
public void testIncludeAllDuplicateRequestParams() throws Exception {
String body = "";
Map parameterMap = new HashMap();
parameterMap.put("param", new String[] { "1", "2", "3" });
request.setQueryString("param=1&param=2&param=3");
request.setScheme("http");
request.setParameterMap(parameterMap);
URL url = new URL(stack, request, response);
url.setIncludeParams(URL.ALL);
url.setIncludeContext(false);
url.setValue("myAction.action");
url.setNamespace("");
url.start(writer);
url.end(writer, body);
assertEquals("myAction.action?param=1&amp;param=2&amp;param=3",
writer.toString());
}
}
@@ -0,0 +1,345 @@
/*
* $Id: $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.interceptor;
import java.util.Collections;
import java.util.Map;
import javax.servlet.http.Cookie;
import org.easymock.MockControl;
import org.springframework.mock.web.MockHttpServletRequest;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.StrutsTestCase;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.ActionSupport;
public class CookieInterceptorTest extends StrutsTestCase {
public void testIntercepDefault() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest();
request.setCookies(new Cookie[] {
new Cookie("cookie1", "cookie1value"),
new Cookie("cookie2", "cookie2value"),
new Cookie("cookie3", "cookie3value")
});
ServletActionContext.setRequest(request);
MockActionWithCookieAware action = new MockActionWithCookieAware();
ActionContext.getContext().getValueStack().push(action);
MockControl actionInvocationControl = MockControl.createControl(ActionInvocation.class);
ActionInvocation invocation = (ActionInvocation) actionInvocationControl.getMock();
actionInvocationControl.expectAndDefaultReturn(
invocation.getAction(), action);
actionInvocationControl.expectAndDefaultReturn(
invocation.invoke(), Action.SUCCESS);
actionInvocationControl.replay();
// by default the interceptor doesn't accept any cookies
CookieInterceptor interceptor = new CookieInterceptor();
interceptor.intercept(invocation);
assertTrue(action.getCookiesMap().isEmpty());
assertNull(action.getCookie1(), null);
assertNull(action.getCookie2(), null);
assertNull(action.getCookie3(), null);
assertNull(ActionContext.getContext().getValueStack().findValue("cookie1"));
assertNull(ActionContext.getContext().getValueStack().findValue("cookie2"));
assertNull(ActionContext.getContext().getValueStack().findValue("cookie3"));
}
public void testInterceptAll1() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest();
request.setCookies(new Cookie[] {
new Cookie("cookie1", "cookie1value"),
new Cookie("cookie2", "cookie2value"),
new Cookie("cookie3", "cookie3value")
});
ServletActionContext.setRequest(request);
MockActionWithCookieAware action = new MockActionWithCookieAware();
ActionContext.getContext().getValueStack().push(action);
MockControl actionInvocationControl = MockControl.createControl(ActionInvocation.class);
ActionInvocation invocation = (ActionInvocation) actionInvocationControl.getMock();
actionInvocationControl.expectAndDefaultReturn(
invocation.getAction(), action);
actionInvocationControl.expectAndDefaultReturn(
invocation.invoke(), Action.SUCCESS);
actionInvocationControl.replay();
CookieInterceptor interceptor = new CookieInterceptor();
interceptor.setCookiesName("*");
interceptor.setCookiesValue("*");
interceptor.intercept(invocation);
assertFalse(action.getCookiesMap().isEmpty());
assertEquals(action.getCookiesMap().size(), 3);
assertEquals(action.getCookiesMap().get("cookie1"), "cookie1value");
assertEquals(action.getCookiesMap().get("cookie2"), "cookie2value");
assertEquals(action.getCookiesMap().get("cookie3"), "cookie3value");
assertEquals(action.getCookie1(), "cookie1value");
assertEquals(action.getCookie2(), "cookie2value");
assertEquals(action.getCookie3(), "cookie3value");
assertEquals(ActionContext.getContext().getValueStack().findValue("cookie1"), "cookie1value");
assertEquals(ActionContext.getContext().getValueStack().findValue("cookie2"), "cookie2value");
assertEquals(ActionContext.getContext().getValueStack().findValue("cookie3"), "cookie3value");
}
public void testInterceptAll2() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest();
request.setCookies(new Cookie[] {
new Cookie("cookie1", "cookie1value"),
new Cookie("cookie2", "cookie2value"),
new Cookie("cookie3", "cookie3value")
});
ServletActionContext.setRequest(request);
MockActionWithCookieAware action = new MockActionWithCookieAware();
ActionContext.getContext().getValueStack().push(action);
MockControl actionInvocationControl = MockControl.createControl(ActionInvocation.class);
ActionInvocation invocation = (ActionInvocation) actionInvocationControl.getMock();
actionInvocationControl.expectAndDefaultReturn(
invocation.getAction(), action);
actionInvocationControl.expectAndDefaultReturn(
invocation.invoke(), Action.SUCCESS);
actionInvocationControl.replay();
CookieInterceptor interceptor = new CookieInterceptor();
interceptor.setCookiesName("cookie1, cookie2, cookie3");
interceptor.setCookiesValue("cookie1value, cookie2value, cookie3value");
interceptor.intercept(invocation);
assertFalse(action.getCookiesMap().isEmpty());
assertEquals(action.getCookiesMap().size(), 3);
assertEquals(action.getCookiesMap().get("cookie1"), "cookie1value");
assertEquals(action.getCookiesMap().get("cookie2"), "cookie2value");
assertEquals(action.getCookiesMap().get("cookie3"), "cookie3value");
assertEquals(action.getCookie1(), "cookie1value");
assertEquals(action.getCookie2(), "cookie2value");
assertEquals(action.getCookie3(), "cookie3value");
assertEquals(ActionContext.getContext().getValueStack().findValue("cookie1"), "cookie1value");
assertEquals(ActionContext.getContext().getValueStack().findValue("cookie2"), "cookie2value");
assertEquals(ActionContext.getContext().getValueStack().findValue("cookie3"), "cookie3value");
}
public void testInterceptSelectedCookiesNameOnly1() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest();
request.setCookies(new Cookie[] {
new Cookie("cookie1", "cookie1value"),
new Cookie("cookie2", "cookie2value"),
new Cookie("cookie3", "cookie3value")
});
ServletActionContext.setRequest(request);
MockActionWithCookieAware action = new MockActionWithCookieAware();
ActionContext.getContext().getValueStack().push(action);
MockControl actionInvocationControl = MockControl.createControl(ActionInvocation.class);
ActionInvocation invocation = (ActionInvocation) actionInvocationControl.getMock();
actionInvocationControl.expectAndDefaultReturn(
invocation.getAction(), action);
actionInvocationControl.expectAndDefaultReturn(
invocation.invoke(), Action.SUCCESS);
actionInvocationControl.replay();
CookieInterceptor interceptor = new CookieInterceptor();
interceptor.setCookiesName("cookie1, cookie3");
interceptor.setCookiesValue("cookie1value, cookie2value, cookie3value");
interceptor.intercept(invocation);
assertFalse(action.getCookiesMap().isEmpty());
assertEquals(action.getCookiesMap().size(), 2);
assertEquals(action.getCookiesMap().get("cookie1"), "cookie1value");
assertEquals(action.getCookiesMap().get("cookie2"), null);
assertEquals(action.getCookiesMap().get("cookie3"), "cookie3value");
assertEquals(action.getCookie1(), "cookie1value");
assertEquals(action.getCookie2(), null);
assertEquals(action.getCookie3(), "cookie3value");
assertEquals(ActionContext.getContext().getValueStack().findValue("cookie1"), "cookie1value");
assertEquals(ActionContext.getContext().getValueStack().findValue("cookie2"), null);
assertEquals(ActionContext.getContext().getValueStack().findValue("cookie3"), "cookie3value");
}
public void testInterceptSelectedCookiesNameOnly2() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest();
request.setCookies(new Cookie[] {
new Cookie("cookie1", "cookie1value"),
new Cookie("cookie2", "cookie2value"),
new Cookie("cookie3", "cookie3value")
});
ServletActionContext.setRequest(request);
MockActionWithCookieAware action = new MockActionWithCookieAware();
ActionContext.getContext().getValueStack().push(action);
MockControl actionInvocationControl = MockControl.createControl(ActionInvocation.class);
ActionInvocation invocation = (ActionInvocation) actionInvocationControl.getMock();
actionInvocationControl.expectAndDefaultReturn(
invocation.getAction(), action);
actionInvocationControl.expectAndDefaultReturn(
invocation.invoke(), Action.SUCCESS);
actionInvocationControl.replay();
CookieInterceptor interceptor = new CookieInterceptor();
interceptor.setCookiesName("cookie1, cookie3");
interceptor.setCookiesValue("*");
interceptor.intercept(invocation);
assertFalse(action.getCookiesMap().isEmpty());
assertEquals(action.getCookiesMap().size(), 2);
assertEquals(action.getCookiesMap().get("cookie1"), "cookie1value");
assertEquals(action.getCookiesMap().get("cookie2"), null);
assertEquals(action.getCookiesMap().get("cookie3"), "cookie3value");
assertEquals(action.getCookie1(), "cookie1value");
assertEquals(action.getCookie2(), null);
assertEquals(action.getCookie3(), "cookie3value");
assertEquals(ActionContext.getContext().getValueStack().findValue("cookie1"), "cookie1value");
assertEquals(ActionContext.getContext().getValueStack().findValue("cookie2"), null);
assertEquals(ActionContext.getContext().getValueStack().findValue("cookie3"), "cookie3value");
}
public void testInterceptSelectedCookiesNameOnly3() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest();
request.setCookies(new Cookie[] {
new Cookie("cookie1", "cookie1value"),
new Cookie("cookie2", "cookie2value"),
new Cookie("cookie3", "cookie3value")
});
ServletActionContext.setRequest(request);
MockActionWithCookieAware action = new MockActionWithCookieAware();
ActionContext.getContext().getValueStack().push(action);
MockControl actionInvocationControl = MockControl.createControl(ActionInvocation.class);
ActionInvocation invocation = (ActionInvocation) actionInvocationControl.getMock();
actionInvocationControl.expectAndDefaultReturn(
invocation.getAction(), action);
actionInvocationControl.expectAndDefaultReturn(
invocation.invoke(), Action.SUCCESS);
actionInvocationControl.replay();
CookieInterceptor interceptor = new CookieInterceptor();
interceptor.setCookiesName("cookie1, cookie3");
interceptor.setCookiesValue("");
interceptor.intercept(invocation);
assertFalse(action.getCookiesMap().isEmpty());
assertEquals(action.getCookiesMap().size(), 2);
assertEquals(action.getCookiesMap().get("cookie1"), "cookie1value");
assertEquals(action.getCookiesMap().get("cookie2"), null);
assertEquals(action.getCookiesMap().get("cookie3"), "cookie3value");
assertEquals(action.getCookie1(), "cookie1value");
assertEquals(action.getCookie2(), null);
assertEquals(action.getCookie3(), "cookie3value");
assertEquals(ActionContext.getContext().getValueStack().findValue("cookie1"), "cookie1value");
assertEquals(ActionContext.getContext().getValueStack().findValue("cookie2"), null);
assertEquals(ActionContext.getContext().getValueStack().findValue("cookie3"), "cookie3value");
}
public void testInterceptSelectedCookiesNameAndValue() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest();
request.setCookies(new Cookie[] {
new Cookie("cookie1", "cookie1value"),
new Cookie("cookie2", "cookie2value"),
new Cookie("cookie3", "cookie3value")
});
ServletActionContext.setRequest(request);
MockActionWithCookieAware action = new MockActionWithCookieAware();
ActionContext.getContext().getValueStack().push(action);
MockControl actionInvocationControl = MockControl.createControl(ActionInvocation.class);
ActionInvocation invocation = (ActionInvocation) actionInvocationControl.getMock();
actionInvocationControl.expectAndDefaultReturn(
invocation.getAction(), action);
actionInvocationControl.expectAndDefaultReturn(
invocation.invoke(), Action.SUCCESS);
actionInvocationControl.replay();
CookieInterceptor interceptor = new CookieInterceptor();
interceptor.setCookiesName("cookie1, cookie3");
interceptor.setCookiesValue("cookie1value");
interceptor.intercept(invocation);
assertFalse(action.getCookiesMap().isEmpty());
assertEquals(action.getCookiesMap().size(), 1);
assertEquals(action.getCookiesMap().get("cookie1"), "cookie1value");
assertEquals(action.getCookiesMap().get("cookie2"), null);
assertEquals(action.getCookiesMap().get("cookie3"), null);
assertEquals(action.getCookie1(), "cookie1value");
assertEquals(action.getCookie2(), null);
assertEquals(action.getCookie3(), null);
assertEquals(ActionContext.getContext().getValueStack().findValue("cookie1"), "cookie1value");
assertEquals(ActionContext.getContext().getValueStack().findValue("cookie2"), null);
assertEquals(ActionContext.getContext().getValueStack().findValue("cookie3"), null);
}
public static class MockActionWithCookieAware extends ActionSupport implements CookiesAware {
private static final long serialVersionUID = -6202290616812813386L;
private Map cookies = Collections.EMPTY_MAP;
private String cookie1;
private String cookie2;
private String cookie3;
public void setCookiesMap(Map cookies) {
this.cookies = cookies;
}
public Map getCookiesMap() {
return this.cookies;
}
public String getCookie1() { return cookie1; }
public void setCookie1(String cookie1) { this.cookie1 = cookie1; }
public String getCookie2() { return cookie2; }
public void setCookie2(String cookie2) { this.cookie2 = cookie2; }
public String getCookie3() { return cookie3; }
public void setCookie3(String cookie3) { this.cookie3 = cookie3; }
}
}
@@ -22,7 +22,6 @@ package org.apache.struts2.views.jsp;
import java.io.StringWriter;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import org.apache.struts2.views.jsp.ui.AnchorTag;
@@ -30,41 +29,12 @@ import org.apache.struts2.views.jsp.ui.StrutsBodyContent;
/**
*
* Unit test for {@ link AnchorTag}.
*/
public class AnchorTagTest extends AbstractUITagTest {
private StringWriter writer = new StringWriter();
private AnchorTag tag;
public void testActionURL() {
tag.setHref("TestAction.action");
try {
tag.doStartTag();
tag.doEndTag();
assertTrue( writer.toString().indexOf("href=\"TestAction.action\"") > -1);
} catch (JspException ex) {
ex.printStackTrace();
fail();
}
}
public void testAddParameters() {
tag.setHref("/TestAction.action");
String bodyText = "<img src=\"#\"/>";
try {
StrutsBodyContent bodyContent = new StrutsBodyContent(null);
bodyContent.print(bodyText);
tag.setBodyContent(bodyContent);
tag.doStartTag();
tag.doEndTag();
} catch (Exception ex) {
ex.printStackTrace();
fail();
}
}
protected void setUp() throws Exception {
super.setUp();
@@ -78,4 +48,85 @@ public class AnchorTagTest extends AbstractUITagTest {
pageContext.setJspWriter(jspWriter);
}
public void testActionURL() throws Exception {
tag.setHref("TestAction.action");
tag.doStartTag();
tag.doEndTag();
assertTrue(writer.toString().indexOf("href=\"TestAction.action\"") > -1);
assertEquals("<a href=\"TestAction.action\"></a>", writer.toString());
}
public void testNoNewLineAtEnd() throws Exception {
tag.setHref("TestAction.action");
tag.doStartTag();
tag.doEndTag();
assertFalse(writer.toString().endsWith("\n"));
}
public void testAccessKey() throws Exception {
tag.setHref("TestAction.action");
tag.setAccesskey("T");
tag.doStartTag();
tag.doEndTag();
assertTrue(writer.toString().indexOf("accesskey=\"T\"") > -1);
assertFalse(writer.toString().endsWith("\n"));
}
public void testId() throws Exception {
tag.setId("home&improvements");
tag.doStartTag();
tag.doEndTag();
assertEquals("<a id=\"home&amp;improvements\"></a>", writer.toString());
assertFalse(writer.toString().endsWith("\n"));
}
public void testTitle() throws Exception {
tag.setHref("home.ftl");
tag.setTitle("home & improvements");
tag.doStartTag();
tag.doEndTag();
assertEquals("<a href=\"home.ftl\" title=\"home &amp; improvements\"></a>", writer.toString());
assertFalse(writer.toString().endsWith("\n"));
}
public void testOnMouseOver() throws Exception {
tag.setHref("TestAction.action");
tag.setOnmouseover("over");
tag.doStartTag();
tag.doEndTag();
assertTrue(writer.toString().indexOf("onmouseover=\"over\"") > -1);
assertFalse(writer.toString().endsWith("\n"));
}
public void testOnMouseOverAndFocus() throws Exception {
tag.setHref("TestAction.action");
tag.setOnmouseover("overme");
tag.setOnfocus("focusme");
tag.doStartTag();
tag.doEndTag();
assertTrue(writer.toString().indexOf("onmouseover=\"overme\"") > -1);
assertTrue(writer.toString().indexOf("onfocus=\"focusme\"") > -1);
assertFalse(writer.toString().endsWith("\n"));
}
public void testWithContent() throws Exception {
tag.setHref("TestAction.action");
tag.doStartTag();
writer.write("Home");
tag.doEndTag();
assertEquals("<a href=\"TestAction.action\">Home</a>", writer.toString());
assertFalse(writer.toString().endsWith("\n"));
}
public void testAddParameters() throws Exception {
tag.setHref("/TestAction.action");
String bodyText = "<img src=\"#\"/>";
StrutsBodyContent bodyContent = new StrutsBodyContent(null);
bodyContent.print(bodyText);
tag.setBodyContent(bodyContent);
tag.doStartTag();
tag.doEndTag();
}
}
@@ -49,6 +49,7 @@ public class AutocompleterTest extends AbstractUITagTest {
tag.setShowDownArrow("false");
tag.setIconPath("i");
tag.setTemplateCssPath("j");
tag.setDataFieldName("k");
tag.doStartTag();
tag.doEndTag();
@@ -68,6 +68,7 @@ public class DivTest extends AbstractUITagTest {
tag.setHandler("l");
tag.setIndicator("m");
tag.setShowLoadingText("true");
tag.setSeparateScripts("false");
tag.doStartTag();
tag.doEndTag();
@@ -170,6 +170,33 @@ public class SelectTest extends AbstractUITagTest {
}
}
public class LongObject {
private Long id;
private String value;
public LongObject(Long id, String value) {
this.id = id;
this.value = value;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
public void testNullList() throws Exception {
TestAction testAction = (TestAction) action;
testAction.setList2(null);
@@ -239,6 +266,44 @@ public class SelectTest extends AbstractUITagTest {
verify(SelectTag.class.getResource("Select-2.txt"));
}
/**
* WW-1747 - should be a valid test case for the described issue
* @throws Exception
*/
public void testMultipleWithLists() throws Exception {
TestAction testAction = (TestAction) action;
Collection collection = new ArrayList(2);
collection.add(1l);
collection.add(300000000l);
testAction.setCollection(collection);
List selectList = new ArrayList();
selectList.add(new LongObject(1l, "foo"));
selectList.add(new LongObject(2l, "bar"));
selectList.add(new LongObject(300000000l, "foobar"));
testAction.setList2(selectList);
SelectTag tag = new SelectTag();
tag.setPageContext(pageContext);
tag.setLabel("mylabel");
tag.setName("collection");
tag.setList("list2");
tag.setListKey("id");
tag.setListValue("value");
tag.setMultiple("true");
tag.setOnmousedown("alert('onmousedown');");
tag.setOnmousemove("alert('onmousemove');");
tag.setOnmouseout("alert('onmouseout');");
tag.setOnmouseover("alert('onmouseover');");
tag.setOnmouseup("alert('onmouseup');");
tag.doStartTag();
tag.doEndTag();
verify(SelectTag.class.getResource("Select-12.txt"));
}
public void testSimple() throws Exception {
TestAction testAction = (TestAction) action;
testAction.setFoo("hello");
@@ -20,6 +20,7 @@
*/
package org.apache.struts2.views.util;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -28,7 +29,6 @@ import java.util.TreeMap;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.StrutsTestCase;
import com.mockobjects.dynamic.Mock;
@@ -110,8 +110,6 @@ public class UrlHelperTest extends StrutsTestCase {
expectedUrl, url.toString());
}
public void testBuildWithRootContext() {
String expectedUrl = "/MyAction.action";
@@ -320,6 +318,31 @@ public class UrlHelperTest extends StrutsTestCase {
assertEquals(result.size(), 0);
}
public void testParseMultiQuery() throws Exception {
Map result = UrlHelper.parseQueryString("param=1&param=1&param=1");
assertNotNull(result);
assertEquals(result.size(), 1);
String values[] = (String[]) result.get("param");
Arrays.sort(values);
assertEquals(values.length, 3);
assertEquals(values[0], "1");
assertEquals(values[1], "1");
assertEquals(values[2], "1");
}
public void testParseDuplicateQuery() throws Exception {
Map result = UrlHelper.parseQueryString("param=1&param=2&param=3");
assertNotNull(result);
assertEquals(result.size(), 1);
String values[] = (String[]) result.get("param");
Arrays.sort(values);
assertEquals(values.length, 3);
assertEquals(values[0], "1");
assertEquals(values[1], "2");
assertEquals(values[2], "3");
}
public void testTranslateAndEncode() throws Exception {
UrlHelper.setCustomEncoding("UTF-8");
@@ -16,4 +16,5 @@
loadMinimum="3"
visibleDownArrow="false"
buttonSrc="i"
templateCssPath="j">
templateCssPath="j"
dataFieldName="k">
@@ -1,8 +1,8 @@
<script src="/struts/xhtml/validation.js"></script>
<script type="text/javascript" src="/struts/xhtml/validation.js"></script>
<form namespace="" id="myAction" name="myForm" onsubmit="submitMe(); return validateForm_myAction();" action="/myAction.action" method="POST" enctype="myEncType" title="mytitle" accept-charset="UTF-8">
<table class="wwFormTable"> <tr>
<td class="tdLabel"></td>
<td> <script language="javascript" src="/struts/optiontransferselect.js"></script>
<td> <script type="text/javascript" src="/struts/optiontransferselect.js"></script>
<table>
<tr><td>
<select name="myUpDownSelectTag" size="5" id="myAction_myUpDownSelectTag" multiple="multiple">
@@ -1,8 +1,8 @@
<script src="/struts/xhtml/validation.js"></script>
<script type="text/javascript" src="/struts/xhtml/validation.js"></script>
<form namespace="" id="myAction" name="myForm" onsubmit="submitMe(); return validateForm_myAction();" action="/myAction.action" method="POST" enctype="myEncType" title="mytitle" accept-charset="UTF-8">
<table class="wwFormTable"> <tr>
<td class="tdLabel"></td>
<td> <script language="javascript" src="/struts/optiontransferselect.js"></script>
<td> <script type="text/javascript" src="/struts/optiontransferselect.js"></script>
<table>
<tr><td>
<select name="myUpDownSelectTag" size="5" id="myAction_myUpDownSelectTag" multiple="multiple">
@@ -1,7 +1,7 @@
<form namespace="" id="myAction" name="myForm" onsubmit="submitMe(); return true;" action="myAction" method="POST" enctype="myEncType" title="mytitle">
<table class="wwFormTable"> <tr>
<td class="tdLabel"></td>
<td> <script language="javascript" src="/struts/optiontransferselect.js"></script>
<td> <script type="text/javascript" src="/struts/optiontransferselect.js"></script>
<table>
<tr><td>
<select name="myUpDownSelectTag" size="5" id="myAction_myUpDownSelectTag" multiple="multiple">
@@ -1,6 +1,6 @@
<link rel="stylesheet" href="/struts/xhtml/styles.css" type="text/css"/>
<script language="JavaScript" type="text/javascript">
<script type="text/javascript">
// Dojo configuration
djConfig={
baseRelativePath: "/struts/dojo",
@@ -10,8 +10,8 @@
//not needed, but allows the Venkman debugger to work with the includes};
</script>
<script language="JavaScript" type="text/javascript" src="/struts/dojo/dojo.js">
<script type="text/javascript" src="/struts/dojo/dojo.js">
</script>
<script language="JavaScript" type="text/javascript" src="/struts/simple/dojoRequire.js">
<script type="text/javascript" src="/struts/simple/dojoRequire.js">
</script>
@@ -1,5 +1,5 @@
<link rel="stylesheet" href="/struts/xhtml/styles.css" type="text/css"/>
<script language="JavaScript" type="text/javascript">
<script type="text/javascript">
// Dojo configuration
djConfig = {
baseRelativePath: "/struts/dojo",
@@ -8,11 +8,11 @@
debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes
};
</script>
<script language="JavaScript" type="text/javascript"
<script type="text/javascript"
src="/struts/dojo/dojo.js"></script>
<script language="JavaScript" type="text/javascript"
<script type="text/javascript"
src="/struts/simple/dojoRequire.js"></script>
<script language="JavaScript" type="text/javascript"
<script type="text/javascript"
src="/struts/ajax/dojoRequire.js"></script>
<script language="JavaScript" type="text/javascript"
<script type="text/javascript"
src="/struts/CommonFunctions.js"></script>
@@ -1,5 +1,5 @@
<link rel="stylesheet" href="/struts/xhtml/styles.css" type="text/css"/>
<script language="JavaScript" type="text/javascript">
<script type="text/javascript">
// Dojo configuration
djConfig = {
baseRelativePath: "/struts/dojo",
@@ -8,11 +8,11 @@
debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes
};
</script>
<script language="JavaScript" type="text/javascript"
<script type="text/javascript"
src="/struts/dojo/dojo.js"></script>
<script language="JavaScript" type="text/javascript"
<script type="text/javascript"
src="/struts/simple/dojoRequire.js"></script>
<script language="JavaScript" type="text/javascript"
<script type="text/javascript"
src="/struts/ajax/dojoRequire.js"></script>
<script language="JavaScript" type="text/javascript"
<script type="text/javascript"
src="/struts/CommonFunctions.js"></script>
@@ -1,6 +1,6 @@
<link rel="stylesheet" href="/struts/xhtml/styles.css" type="text/css"/>
<script language="JavaScript" type="text/javascript">
<script type="text/javascript">
// Dojo configuration
djConfig={
baseRelativePath: "/struts/dojo",
@@ -10,8 +10,8 @@
//not needed, but allows the Venkman debugger to work with the includes};
</script>
<script language="JavaScript" type="text/javascript" src="/struts/dojo/dojo.js">
<script type="text/javascript" src="/struts/dojo/dojo.js">
</script>
<script language="JavaScript" type="text/javascript" src="/struts/simple/dojoRequire.js">
<script type="text/javascript" src="/struts/simple/dojoRequire.js">
</script>
@@ -0,0 +1,8 @@
<tr>
<td class="tdLabel"><label for="collection" class="label">mylabel:</label></td>
<td><select name="collection" id="collection" multiple="multiple" onmousedown="alert('onmousedown');" onmouseup="alert('onmouseup');" onmouseover="alert('onmouseover');" onmousemove="alert('onmousemove');" onmouseout="alert('onmouseout');">
<option value="1" selected="selected">foo</option>
<option value="2">bar</option>
<option value="300000000" selected="selected">foobar</option>
</select></td>
</tr>
@@ -6,6 +6,7 @@
startTimerListenTopics="h"
stopTimerListenTopics="i"
refreshOnShow="true"
scriptSeparation="false"
id="mylabel"
href="a"
loadingText="b"
@@ -1,7 +1,7 @@
<tr>
<tdclass="tdLabel"></td>
<td>
<scriptlanguage="javascript"src="/struts/inputtransferselect.js"></script>
<script type="text/javascript" src="/struts/inputtransferselect.js"></script>
<tableborder="0">
<tr><td><input type="text" name="collection_input" id="collection_input"/></td>
<td valign="middle"align="center"><inputtype="button"value="-&gt;"onclick="addOption(document.getElementById('collection_input'),document.getElementById('collection'))"/>
@@ -1,7 +1,7 @@
<tr>
<td class="tdLabel"></td>
<td>
<script language="javascript" src="/struts/optiontransferselect.js"></script>
<script type="text/javascript" src="/struts/optiontransferselect.js"></script>
<table border="0">
<tr>
<td>
@@ -1,7 +1,7 @@
<tr>
<td class="tdLabel"></td>
<td>
<script language="javascript" src="/struts/optiontransferselect.js"></script>
<script type="text/javascript" src="/struts/optiontransferselect.js"></script>
<table border="0">
<tr>
<td>
@@ -1,7 +1,7 @@
<tr>
<td class="tdLabel"></td>
<td>
<script language="javascript" src="/struts/optiontransferselect.js"></script>
<script type="text/javascript" src="/struts/optiontransferselect.js"></script>
<table border="0">
<tr>
<td>
@@ -1,7 +1,7 @@
<tr>
<td class="tdLabel"></td>
<td>
<script language="javascript" src="/struts/optiontransferselect.js"></script>
<script type="text/javascript" src="/struts/optiontransferselect.js"></script>
<table border="0">
<tr>
<td>
@@ -1,7 +1,7 @@
<tr>
<td class="tdLabel"></td>
<td>
<script language="javascript" src="/struts/optiontransferselect.js"></script>
<script type="text/javascript" src="/struts/optiontransferselect.js"></script>
<table border="0">
<tr>
<td>
@@ -1,7 +1,7 @@
<tr>
<td class="tdLabel"></td>
<td>
<script language="javascript" src="/struts/optiontransferselect.js"></script>
<script type="text/javascript" src="/struts/optiontransferselect.js"></script>
<table border="0">
<tr>
<td>
@@ -1,7 +1,7 @@
<tr>
<td class="tdLabel"></td>
<td>
<script language="javascript" src="/struts/optiontransferselect.js"></script>
<script type="text/javascript" src="/struts/optiontransferselect.js"></script>
<table border="0">
<tr>
<td>
@@ -16,7 +16,7 @@
</form>
<!-- javascript that is needed for tooltips -->
<script language="JavaScript" type="text/javascript">dojo.require("dojo.widget.html.Tooltip");dojo.require("dojo.fx.html");</script>
<script type="text/javascript">dojo.require("dojo.widget.Tooltip");dojo.require("dojo.fx.html");</script>
@@ -16,4 +16,4 @@
</form>
<!-- javascript that is needed for tooltips -->
<script language="JavaScript" type="text/javascript">dojo.require("dojo.widget.html.Tooltip");dojo.require("dojo.fx.html");</script>
<script type="text/javascript">dojo.require("dojo.widget.Tooltip");dojo.require("dojo.fx.html");</script>
@@ -16,5 +16,5 @@
</form>
<!-- javascript that is needed for tooltips -->
<script language="JavaScript" type="text/javascript">dojo.require("dojo.widget.html.Tooltip");dojo.require("dojo.fx.html");</script>
<script type="text/javascript">dojo.require("dojo.widget.Tooltip");dojo.require("dojo.fx.html");</script>
@@ -1,4 +1,4 @@
<script language="JavaScript" type="text/javascript">
<script type="text/javascript">
<!--
dojo.require("dojo.lang.*");
dojo.require("dojo.widget.*");

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