Compare commits

..

113 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 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 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 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 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
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
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 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 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
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 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 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 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 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 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 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 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 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
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 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 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
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 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 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 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 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 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 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 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 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 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 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
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
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 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 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
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 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
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 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 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 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 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
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 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 fbd8a0a328 WW-1685 Add development menu to Struts 2 area.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@509026 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 23:08:22 +00:00
Thomas Schneider 554a1b5ffc WW-1699 added J2EE 5 compatibility to the StrutsMockServletContext
Contributor: Stepan Koltsov
Reviewed By: Tom Schneider

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508917 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 16:55:20 +00:00
Thomas Schneider 0c3c873c0f WW-1740 added accessor for background process name to allow subclasses to override
Contributer: Thomas Micheline
Reviewed By: Tom Schneider

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508915 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 16:45:59 +00:00
Rainer Hermanns d40fcd2641 bumped OGNL to version 2.6.11
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508902 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 13:56:51 +00:00
Thomas Schneider 697a3b3a1e WW-1702 - fixed error handling in dispatcher
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508883 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 06:43:12 +00:00
Thomas Schneider 6a5e493a45 WW-1709 fixed nullpointer when scheme is null
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508880 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 06:33:26 +00:00
Thomas Schneider 0a388b18e4 WW-1709 fixed nullpointer when scheme is null
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508879 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 06:32:02 +00:00
Thomas Schneider 9a80c9b381 WW-1632 - added rtf support for jasper report result
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508876 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 06:17:25 +00:00
Musachy Barroso 18f41aab19 WW-1633 Add "keyName" attribute to autocompleter (defaults to "${name}Key")
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508777 13f79535-47bb-0310-9956-ffa450edef68
2007-02-17 16:36:08 +00:00
Musachy Barroso 87c3af3654 WW-1745 Add "templateCssPath" and "iconPath" attributes to Autocompleter
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508635 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 22:50:19 +00:00
Musachy Barroso 8f9f1fbd42 - Add README file to META-INF
- Change path of generated TLD to target/classes/META-INF

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508612 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 22:03:55 +00:00
Musachy Barroso d8ea187a2a WW-1729 Add "templateCssPath" attribute to DateTimePicker
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508605 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 21:56:50 +00:00
Musachy Barroso 0534ae35d8 WW-1688 Add "templateCssPath" attribute to tabbedPanel
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508575 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 20:46:49 +00:00
Musachy Barroso bfa0d22c8c WW-1730 The refreshOnShow attribute in tabbedPanel does not work
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508557 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 20:18:30 +00:00
Rainer Hermanns 63be3b2a41 select tag: current option is not selected if actual value to check is no String (aka: nameValue resolves to type other than String)
o added additional unit test submitted by Stuart Piltch 

WW-1711

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508508 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 17:34:22 +00:00
Rainer Hermanns da3e4b0280 select tag: current option is not selected if actual value to check is no String (aka: nameValue resolves to type other than String)
o applied patch to submit.ftl submitted by Stuart Piltch 

WW-1711

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508467 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 16:15:25 +00:00
Rainer Hermanns fba1a707d7 Fixed broken Unit Test due to changes in xwork
WW-1615

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508466 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 16:13:51 +00:00
Rainer Hermanns 84863ffaae Updated deps:
o OGNL 2.6.10
o XWork 2.0.1
Issue Number: WW-1615


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508440 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 15:10:29 +00:00
Musachy Barroso 8b32755ba1 Remove redundant tag attribute annotation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508296 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 03:10:38 +00:00
Musachy Barroso 9872cc64db WW-1570 Add "showLoading" attribute to ajax tags
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508285 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 02:42:24 +00:00
Ted Nathan Husted 40ed474347 WW-1585 Checkin a copy of our autoexport template for the Struts Documentation.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@507721 13f79535-47bb-0310-9956-ffa450edef68
2007-02-14 22:30:46 +00:00
Bob Lee 5ae4898a5d Removed dependency from core on the new api. We can bring it back when we're ready.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@505490 13f79535-47bb-0310-9956-ffa450edef68
2007-02-09 20:50:24 +00:00
Antonio Petrelli 522961d993 WW-1724
The request context for Struts 2 - Tiles 2 integration tries to dispatch the request if possible.
It includes it only if the response has been committed, or if it is a FreeMarker request (this must be fixed).

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@504948 13f79535-47bb-0310-9956-ffa450edef68
2007-02-08 16:40:27 +00:00
Ted Nathan Husted 02249e0558 WW-1715 Update POMs for the 2.1.0 snapshot.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@504540 13f79535-47bb-0310-9956-ffa450edef68
2007-02-07 13:23:42 +00:00
René Gielen a5f3306e9b WW-1711:
This fix will work also with primitve types & is more fm-like

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@504196 13f79535-47bb-0310-9956-ffa450edef68
2007-02-06 16:58:23 +00:00
René Gielen 1432b02048 Fix for WW-1711:
current option is not selected if actual value to check is no String (aka: nameValue resolves to type other than String)

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@504142 13f79535-47bb-0310-9956-ffa450edef68
2007-02-06 14:06:46 +00:00
Ted Nathan Husted 017537f20a WW-1685 Update site.xml for 2.0.6. Fix link to FAQ.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@503774 13f79535-47bb-0310-9956-ffa450edef68
2007-02-05 17:13:01 +00:00
Ted Nathan Husted 80d3f05fe7 WW-1685 Update POMs for the next shapshot.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@503763 13f79535-47bb-0310-9956-ffa450edef68
2007-02-05 16:48:39 +00:00
570 changed files with 3872 additions and 14308 deletions
+15 -7
View File
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.0.14</version>
<version>2.0.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-blank</artifactId>
@@ -12,9 +13,9 @@
<name>Blank Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_14/apps/blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_14/apps/blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_0_14/apps/blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/apps/blank/</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/blank/</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/apps/blank/</url>
</scm>
<dependencies>
@@ -46,11 +47,18 @@
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.0.1</version>
<artifactId>maven-jetty6-plugin</artifactId>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-j2ee_1.4_spec</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
+6 -5
View File
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.0.14</version>
<version>2.0.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-mailreader</artifactId>
@@ -12,9 +13,9 @@
<name>Starter Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_14/apps/mailreader</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_14/apps/mailreader</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_0_14/apps/mailreader</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/apps/mailreader/</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/mailreader/</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/apps/mailreader/</url>
</scm>
<dependencies>
+1 -1
View File
@@ -6,7 +6,7 @@
<struts>
<constant name="struts.action.extension" value="do" />
<constant name="struts.devMode" value="true" />
<constant name="struts.devMode" value="false" />
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<include file="mailreader-default.xml"/>
+1 -1
View File
@@ -2,5 +2,5 @@
<hr/>
<p>
<a href="<s:url action="Welcome" includeParams="none"/>"><s:text name="index.title"/></a>
<a href="<s:url action="Welcome" />"><s:text name="index.title"/></a>
</p>
+1 -4
View File
@@ -9,17 +9,14 @@
type="text/css"/>
</head>
<body onload="self.focus();document.Login.username.focus()">
<body onLoad="self.focus();document.Login.username.focus()">
<s:actionerror />
<s:text name="doesntexist" />
<s:form action="Login" validate="true">
<s:textfield key="username" />
<s:password key="password" showPassword="true"/>
<s:textfield name="doesntexist" />
<s:submit key="button.save"/>
<s:reset key="button.reset"/>
@@ -20,7 +20,6 @@
<li><a href="<s:url action="Logout"/>">
<s:text name="mainMenu.logout"/>
</a>
</li>
</ul>
</body>
</html>
@@ -14,7 +14,7 @@
type="text/css"/>
</head>
<body onload="self.focus();document.Registration_save_username.focus()">
<body onLoad="self.focus();document.Registration_save_username.focus()">
<s:actionerror/>
<s:form action="Registration_save" validate="false">
@@ -28,7 +28,7 @@
<s:hidden name="username"/>
</s:else>
<s:password key="password" showPassword="true"/>
<s:password key="password"/>
<s:password key="password2"/>
<s:textfield key="user.fullName"/>
<s:textfield key="user.fromAddress"/>
@@ -13,11 +13,11 @@
<s:if test="task=='Delete'">
<title><s:text name="subscription.title.delete"/></title>
</s:if>
<link href="<s:url value="/css/mailreader.css" includeParams="none"/>" rel="stylesheet"
<link href="<s:url value="/css/mailreader.css"/>" rel="stylesheet"
type="text/css"/>
</head>
<body onload="self.focus();document.Subscription.username.focus()">
<body onLoad="self.focus();document.Subscription.username.focus()">
<s:actionerror/>
<s:form action="Subscription_save" validate="true">
@@ -13,7 +13,7 @@
<filter-mapping>
<filter-name>Struts2</filter-name>
<url-pattern>*.do</url-pattern>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Application Listener for Mailreader database -->
+4 -3
View File
@@ -44,12 +44,13 @@
<hr/>
<p><s:i18n name="alternate"><a href="http://struts.apache.org/">
<p><s:i18n name="alternate">
<img src="<s:text name="struts.logo.path"/>"
alt="<s:text name="struts.logo.alt"/>" border="0px"/>
</a>
alt="<s:text name="struts.logo.alt"/>"/>
</s:i18n></p>
<p><a href="<s:url action="Tour" />"><s:text name="index.tour"/></a></p>
</body>
</html>
+29 -29
View File
@@ -182,36 +182,36 @@
&lt;display-name>Struts 2 MailReader&lt;/display-name>
<strong>&lt;filter&gt;
&lt;filter-name&gt;struts2&lt;/filter-name&gt;
&lt;filter-class&gt;
<strong>&lt;filter>
&lt;filter-name>struts2&lt;/filter-name>
&lt;filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
&lt;/filter-class&gt;
&lt;/filter&gt;</strong>
&lt;/filter-class>
&lt;/filter></strong>
&lt;filter-mapping&gt;
&lt;filter-name&gt;<strong>struts2</strong>&lt;/filter-name&gt;
&lt;url-pattern&gt;/*&lt;/url-pattern&gt;
&lt;/filter-mapping&gt;
&lt;filter-mapping>
&lt;filter-name><strong>struts2</strong>&lt;/filter-name>
&lt;url-pattern>/*&lt;/url-pattern>
&lt;/filter-mapping>
&lt;listener&gt;
&lt;listener-class&gt;
&lt;listener>
&lt;listener-class>
org.springframework.web.context.ContextLoaderListener
&lt;/listener-class&gt;
&lt;/listener&gt;
&lt;/listener-class>
&lt;/listener>
&lt;!-- Application Listener for MailReader database --&gt;
&lt;listener&gt;
&lt;listener-class&gt;
&lt;!-- Application Listener for MailReader database -->
&lt;listener>
&lt;listener-class>
mailreader2.ApplicationListener
&lt;/listener-class&gt;
&lt;/listener&gt;
&lt;/listener-class>
&lt;/listener>
&lt;welcome-file-list&gt;
&lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
&lt;/welcome-file-list&gt;
&lt;welcome-file-list>
&lt;welcome-file>index.html&lt;/welcome-file>
&lt;/welcome-file-list>
&lt;/web-app&gt;</code></pre>
&lt;/web-app></code></pre>
<hr/>
<p>
@@ -281,13 +281,13 @@
<hr/>
<h5>MailReader's index.html</h5>
<pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;
&lt;html&gt;&lt;head&gt;
&lt;META HTTP-EQUIV="Refresh" CONTENT="0;<strong>URL=Welcome.do</strong>"&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;Loading ...&lt;/p&gt;
&lt;/body&gt;&lt;/html&gt;</code></pre>
<pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&lt;html>&lt;head>
&lt;META HTTP-EQUIV="Refresh" CONTENT="0;<strong>URL=Welcome.do</strong>">
&lt;/head>
&lt;body>
&lt;p>Loading ...&lt;/p>
&lt;/body>&lt;/html></code></pre>
<hr/>
<p>
+40 -13
View File
@@ -1,9 +1,31 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* Copyright 2005-2006 The Apache Software Foundation.
*
* Licensed 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.
*
* $Id$
*/
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.0.14</version>
<version>2.0.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
@@ -17,9 +39,9 @@
</modules>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_14/apps</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_14/apps</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_0_14/apps</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/apps/</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/apps/</url>
</scm>
<distributionManagement>
@@ -83,10 +105,14 @@
</goals>
<configuration>
<tasks>
<taskdef resource="hostedqatasks" classpathref="maven.plugin.classpath" />
<upload file="${project.build.directory}/${project.build.finalName}.war" account="struts" email="${email}" password="${password}" resourceId="${resourceId}" />
<taskdef resource="hostedqatasks" classpathref="maven.plugin.classpath"/>
<upload file="${project.build.directory}/${project.build.finalName}.war"
account="struts" email="${email}"
password="${password}" resourceId="${resourceId}"/>
<playsuite suiteId="${suiteId}" clientConfigs="${clientConfigs}" appConfigs="${appConfigs}" account="struts" email="${email}" password="${password}" />
<playsuite suiteId="${suiteId}" clientConfigs="${clientConfigs}" appConfigs="${appConfigs}" account="struts"
email="${email}"
password="${password}"/>
</tasks>
</configuration>
</execution>
@@ -109,7 +135,6 @@
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>0.3.1</version>
<configuration>
<container>
<containerId>tomcat5x</containerId>
@@ -131,11 +156,13 @@
<phase>process-sources</phase>
<configuration>
<tasks>
<copy todir="${project.build.directory}/${pom.artifactId}/WEB-INF/src/java" failonerror="false">
<fileset dir="${basedir}/src/main/java" />
<copy todir="${project.build.directory}/${pom.artifactId}/WEB-INF/src/java"
failonerror="false">
<fileset dir="${basedir}/src/main/java"/>
</copy>
<copy todir="${project.build.directory}/${pom.artifactId}/WEB-INF/src/java" failonerror="false">
<fileset dir="${basedir}/src/main/resources" />
<copy todir="${project.build.directory}/${pom.artifactId}/WEB-INF/src/java"
failonerror="false">
<fileset dir="${basedir}/src/main/resources"/>
</copy>
</tasks>
</configuration>
+17 -27
View File
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.0.14</version>
<version>2.0.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-portlet</artifactId>
@@ -12,9 +13,9 @@
<name>Portlet Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_14/apps/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_14/apps/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_0_14/apps/portlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/apps/portlet/</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/portlet/</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/apps/portlet/</url>
</scm>
<dependencies>
@@ -28,12 +29,6 @@
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>${pom.version}</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
@@ -56,25 +51,20 @@
<artifactId>commons-digester</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.1</version>
<version>2.0</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.12</version>
</dependency>
</dependencies>
</project>
@@ -44,7 +44,4 @@ public class FormExample extends ActionSupport {
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String displayResult() {
return "displayResult";
}
}
@@ -1,37 +0,0 @@
/*
* $Id: FormExample.java 471756 2006-11-06 15:01:43Z husted $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.portlet.example;
import org.apache.struts2.portlet.example.model.Name;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
/**
*/
public class FormExampleModelDriven extends ActionSupport implements ModelDriven<Name> {
private Name name = new Name();
public Name getModel() {
return name;
}
}
@@ -1,81 +0,0 @@
/*
* $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.portlet.example.fileupload;
import java.io.File;
import org.apache.struts2.dispatcher.DefaultActionSupport;
/**
* File Upload example's action. <code>FileUploadAction</code>
*
*/
public class FileUploadAction extends DefaultActionSupport {
private static final long serialVersionUID = 5156288255337069381L;
private String contentType;
private File upload;
private String fileName;
private String caption;
// since we are using <s:file name="upload" .../> the file name will be
// obtained through getter/setter of <file-tag-name>FileName
public String getUploadFileName() {
return fileName;
}
public void setUploadFileName(String fileName) {
this.fileName = fileName;
}
// since we are using <s:file name="upload" ... /> the content type will be
// obtained through getter/setter of <file-tag-name>ContentType
public String getUploadContentType() {
return contentType;
}
public void setUploadContentType(String contentType) {
this.contentType = contentType;
}
// since we are using <s:file name="upload" ... /> the File itself will be
// obtained through getter/setter of <file-tag-name>
public File getUpload() {
return upload;
}
public void setUpload(File upload) {
this.upload = upload;
}
public String getCaption() {
return caption;
}
public void setCaption(String caption) {
this.caption = caption;
}
public String upload() throws Exception {
return SUCCESS;
}
}
@@ -1,18 +0,0 @@
package org.apache.struts2.portlet.example.model;
public class Name {
private String firstName;
private String lastName;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
@@ -1,48 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="edit" extends="struts-portlet-default"
namespace="/edit">
<action name="index"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">/WEB-INF/edit/index.jsp</result>
</action>
<action name="test"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">/WEB-INF/edit/test.jsp</result>
</action>
<action name="formExampleEdit"
class="org.apache.struts2.portlet.example.FormExample" method="input">
<result name="input">
/WEB-INF/edit/formExampleInput.jsp
</result>
</action>
<action name="processFormExampleEdit"
class="org.apache.struts2.portlet.example.FormExample">
<result name="input">
/WEB-INF/edit/formExampleInput.jsp
</result>
<result name="success">
/edit/processFormExampleForward.action?firstName=${firstName}&amp;lastName=${lastName}
</result>
</action>
<action name="processFormExampleForward"
class="org.apache.struts2.portlet.example.FormExample">
<result name="success">
/WEB-INF/edit/formExample.jsp
</result>
</action>
</package>
<package name="editTest" extends="edit" namespace="/edit/dummy/test">
<action name="testAction"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">/WEB-INF/edit/namespaceTest.jsp</result>
</action>
</package>
</struts>
@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="help" extends="struts-portlet-default"
namespace="/help">
<action name="index"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">/WEB-INF/help/index.jsp</result>
</action>
</package>
</struts>
@@ -1,130 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="view" extends="struts-portlet-default"
namespace="/view">
<action name="index"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">/WEB-INF/view/index.jsp</result>
</action>
<action name="formExample"
class="org.apache.struts2.portlet.example.FormExample" method="input">
<result name="input">
/WEB-INF/view/formExampleInput.jsp
</result>
</action>
<action name="processFormExample"
class="org.apache.struts2.portlet.example.FormExample">
<result name="input">
/WEB-INF/view/formExampleInput.jsp
</result>
<result name="success">
/WEB-INF/view/formExample.jsp
</result>
</action>
<action name="formExamplePrg" class="org.apache.struts2.portlet.example.FormExample">
<result name="input">
/WEB-INF/view/formExampleInputPrg.jsp
</result>
<result name="success" type="redirectAction">
<param name="actionName">formExamplePrg</param>
<param name="method">displayResult</param>
<param name="firstName">${firstName}</param>
<param name="lastName">${lastName}</param>
</result>
<result name="displayResult">
/WEB-INF/view/formExample.jsp
</result>
</action>
<action name="formExampleModelDriven"
class="org.apache.struts2.portlet.example.FormExampleModelDriven">
<result name="input">
/WEB-INF/view/formExampleInputModelDriven.jsp
</result>
<result name="success">
/WEB-INF/view/formExample.jsp
</result>
</action>
<action name="validationExample"
class="org.apache.struts2.portlet.example.FormExample" method="input">
<result name="input">
/WEB-INF/view/formExampleInputValidation.jsp
</result>
</action>
<action name="processValidationExample"
class="org.apache.struts2.portlet.example.FormExample">
<result name="success">
/WEB-INF/view/formExample.jsp
</result>
<result name="input">
/WEB-INF/view/formExampleInputValidation.jsp
</result>
</action>
<action name="fileUpload" class="org.apache.struts2.portlet.example.fileupload.FileUploadAction">
<result name="input">
/WEB-INF/view/fileUpload.jsp
</result>
<result name="success">
/WEB-INF/view/fileUploadSuccess.jsp
</result>
</action>
<action name="tokenExample"
class="com.opensymphony.xwork2.ActionSupport" method="input">
<result name="input">
/WEB-INF/view/tokenExampleInput.jsp
</result>
</action>
<action name="processTokenExample"
class="com.opensymphony.xwork2.ActionSupport">
<result name="input">
/WEB-INF/view/tokenExampleInput.jsp
</result>
<result name="invalid.token">
/WEB-INF/view/tokenExampleInput.jsp
</result>
<result name="success">
/WEB-INF/view/tokenExample.jsp
</result>
<interceptor-ref name="portletDefaultStackWithToken" />
</action>
<action name="springExample" class="springAction">
<result name="success">
/WEB-INF/view/springExample.jsp
</result>
</action>
<action name="freeMarkerExample"
class="com.opensymphony.xwork2.ActionSupport" method="input">
<result type="freemarker" name="input">
/WEB-INF/view/freeMarkerExampleInput.ftl
</result>
</action>
<action name="processFreeMarkerExample"
class="org.apache.struts2.portlet.example.FormExample">
<result name="success">/view/processFreeMarkerView.action?firstName=${firstName}&amp;lastName=${lastName}</result>
</action>
<action name="processFreeMarkerView" class="org.apache.struts2.portlet.example.FormExample">
<result type="freemarker" name="success">/WEB-INF/view/freeMarkerExample.ftl</result>
</action>
<action name="velocityHelloWorld" class="com.opensymphony.xwork2.ActionSupport">
<result type="velocity" name="success">/WEB-INF/view/helloWorld.vm</result>
</action>
</package>
</struts>
+160 -10
View File
@@ -1,11 +1,161 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE xwork PUBLIC
"-//OpenSymphony Group//XWork 1.1.1//EN"
"http://www.opensymphony.com/xwork/xwork-1.1.1.dtd">
<xwork>
<include file="struts-portlet-default.xml" />
<struts>
<include file="struts-portlet-default.xml"/>
<include file="struts-view.xml"/>
<include file="struts-edit.xml"/>
<include file="struts-help.xml"/>
</struts>
<package name="view" extends="struts-portlet-default"
namespace="/view">
<action name="index"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">/WEB-INF/view/index.jsp</result>
</action>
<action name="formExample"
class="org.apache.struts2.portlet.example.FormExample" method="input">
<result name="input">
/WEB-INF/view/formExampleInput.jsp
</result>
</action>
<action name="processFormExample"
class="org.apache.struts2.portlet.example.FormExample">
<result name="input">
/WEB-INF/view/formExampleInput.jsp
</result>
<result name="success">
/WEB-INF/view/formExample.jsp
</result>
</action>
<action name="validationExample"
class="org.apache.struts2.portlet.example.FormExample" method="input">
<result name="input">
/WEB-INF/view/formExampleInputValidation.jsp
</result>
</action>
<action name="processValidationExample"
class="org.apache.struts2.portlet.example.FormExample">
<result name="success">
/WEB-INF/view/formExample.jsp
</result>
<result name="input">
/WEB-INF/view/formExampleInputValidation.jsp
</result>
<interceptor-ref name="validationWorkflowStack" />
</action>
<action name="tokenExample"
class="com.opensymphony.xwork2.ActionSupport" method="input">
<result name="input">
/WEB-INF/view/tokenExampleInput.jsp
</result>
</action>
<action name="processTokenExample"
class="com.opensymphony.xwork2.ActionSupport">
<result name="input">
/WEB-INF/view/tokenExampleInput.jsp
</result>
<result name="invalid.token">
/WEB-INF/view/tokenExampleInput.jsp
</result>
<result name="success">
/WEB-INF/view/tokenExample.jsp
</result>
<interceptor-ref name="token" />
<interceptor-ref name="defaultStack" />
</action>
<action name="springExample" class="springAction">
<result name="success">
/WEB-INF/view/springExample.jsp
</result>
</action>
<action name="ajaxExample"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">
/WEB-INF/view/ajaxExample.jsp
</result>
</action>
<action name="ajaxData"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">/WEB-INF/view/ajaxData.jsp</result>
</action>
<action name="freeMarkerExample"
class="com.opensymphony.xwork2.ActionSupport" method="input">
<result type="freemarker" name="input">
/WEB-INF/view/freeMarkerExampleInput.ftl
</result>
</action>
<action name="processFreeMarkerExample"
class="org.apache.struts2.portlet.example.FormExample">
<result name="success">/view/processFreeMarkerView.action?firstName=${firstName}&amp;lastName=${lastName}</result>
</action>
<action name="processFreeMarkerView" class="org.apache.struts2.portlet.example.FormExample">
<result type="freemarker" name="success">/WEB-INF/view/freeMarkerExample.ftl</result>
</action>
<action name="velocityHelloWorld" class="com.opensymphony.xwork2.ActionSupport">
<result type="velocity" name="success">/WEB-INF/view/helloWorld.vm</result>
</action>
</package>
<package name="edit" extends="struts-portlet-default"
namespace="/edit">
<action name="index"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">/WEB-INF/edit/index.jsp</result>
</action>
<action name="test"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">/WEB-INF/edit/test.jsp</result>
</action>
<action name="formExampleEdit"
class="org.apache.struts2.portlet.example.FormExample" method="input">
<result name="input">
/WEB-INF/edit/formExampleInput.jsp
</result>
</action>
<action name="processFormExampleEdit"
class="org.apache.struts2.portlet.example.FormExample">
<result name="input">
/WEB-INF/edtt/formExampleInput.jsp
</result>
<result name="success">
/edit/processFormExampleForward.action?firstName=${firstName}&amp;lastName=${lastName}
</result>
</action>
<action name="processFormExampleForward"
class="org.apache.struts2.portlet.example.FormExample">
<result name="success">
/WEB-INF/edit/formExample.jsp
</result>
</action>
</package>
<package name="editTest" extends="edit" namespace="/edit/dummy/test">
<action name="testAction"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">/WEB-INF/edit/namespaceTest.jsp</result>
</action>
</package>
<package name="help" extends="struts-portlet-default"
namespace="/help">
<action name="index"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">/WEB-INF/help/index.jsp</result>
</action>
</package>
</xwork>
@@ -1,6 +1,3 @@
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator Config 1.0//EN"
"http://www.opensymphony.com/xwork/xwork-validator-config-1.0.dtd">
<validators>
<validator name="required" class="com.opensymphony.xwork2.validator.validators.RequiredFieldValidator"/>
<validator name="requiredstring" class="com.opensymphony.xwork2.validator.validators.RequiredStringValidator"/>
+103 -117
View File
@@ -1,132 +1,118 @@
<?xml version="1.0" encoding="UTF-8"?>
<portlet-app
version="1.0"
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
id="struts-portlet">
<portlet id="StrutsPortlet">
<description xml:lang="EN">Struts Test Portlet</description>
<portlet-name>StrutsPortlet</portlet-name>
<display-name xml:lang="EN">Struts Test Portlet</display-name>
<portlet-app version="1.0" xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" id="struts-portlet">
<portlet id="StrutsPortlet">
<description xml:lang="EN">Struts Test Portlet</description>
<portlet-name>StrutsPortlet</portlet-name>
<display-name xml:lang="EN">Struts Test Portlet</display-name>
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class>
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class>
<!-- The view mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>viewNamespace</name>
<value>/view</value>
</init-param>
<!-- The default action to invoke in view mode. -->
<init-param>
<name>defaultViewAction</name>
<value>index</value>
</init-param>
<!-- The edit mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>editNamespace</name>
<value>/edit</value>
</init-param>
<!-- The default action to invoke in edit mode. -->
<init-param>
<name>defaultEditAction</name>
<value>index</value>
</init-param>
<!-- The help mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>helpNamespace</name>
<value>/help</value>
</init-param>
<!-- The default action to invoke in help mode. -->
<init-param>
<name>defaultHelpAction</name>
<value>index</value>
</init-param>
<init-param>
<!-- The view mode namespace. Maps to a namespace in the xwork config file -->
<name>viewNamespace</name>
<value>/view</value>
</init-param>
<init-param>
<!-- The default action to invoke in view mode -->
<name>defaultViewAction</name>
<value>index</value>
</init-param>
<init-param>
<!-- The view mode namespace. Maps to a namespace in the xwork config file -->
<name>editNamespace</name>
<value>/edit</value>
</init-param>
<init-param>
<!-- The default action to invoke in view mode -->
<name>defaultEditAction</name>
<value>index</value>
</init-param>
<init-param>
<!-- The view mode namespace. Maps to a namespace in the xwork config file -->
<name>helpNamespace</name>
<value>/help</value>
</init-param>
<init-param>
<!-- The default action to invoke in view mode -->
<name>defaultHelpAction</name>
<value>index</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>edit</portlet-mode>
<portlet-mode>help</portlet-mode>
<portlet-mode>view</portlet-mode>
</supports>
<expiration-cache>0</expiration-cache>
<supported-locale>en</supported-locale>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>edit</portlet-mode>
<portlet-mode>help</portlet-mode>
</supports>
<portlet-info>
<title>My StrutsPortlet portlet</title>
<short-title>SP</short-title>
<keywords>struts,portlet</keywords>
</portlet-info>
</portlet>
<supported-locale>en</supported-locale>
<portlet-info>
<title>My StrutsPortlet portlet</title>
<short-title>SP</short-title>
<keywords>struts,portlet</keywords>
</portlet-info>
</portlet>
<portlet id="StrutsPortlet2">
<description xml:lang="EN">Struts Test Portlet2</description>
<portlet-name>StrutsPortlet2</portlet-name>
<display-name xml:lang="EN">Struts Test Portlet2</display-name>
<portlet id="StrutsPortlet2">
<description xml:lang="EN">Struts Test Portlet2</description>
<portlet-name>StrutsPortlet2</portlet-name>
<display-name xml:lang="EN">Struts Test Portlet2</display-name>
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class>
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class>
<!-- The view mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>viewNamespace</name>
<value>/view</value>
</init-param>
<init-param>
<!-- The view mode namespace. Maps to a namespace in the xwork config file -->
<name>viewNamespace</name>
<value>/view</value>
</init-param>
<init-param>
<!-- The default action to invoke in view mode -->
<name>defaultViewAction</name>
<value>index</value>
</init-param>
<init-param>
<!-- The view mode namespace. Maps to a namespace in the xwork config file -->
<name>editNamespace</name>
<value>/edit</value>
</init-param>
<init-param>
<!-- The default action to invoke in view mode -->
<name>defaultEditAction</name>
<value>index</value>
</init-param>
<init-param>
<!-- The view mode namespace. Maps to a namespace in the xwork config file -->
<name>helpNamespace</name>
<value>/help</value>
</init-param>
<init-param>
<!-- The default action to invoke in view mode -->
<name>defaultHelpAction</name>
<value>index</value>
</init-param>
<!-- The default action to invoke in view mode. -->
<init-param>
<name>defaultViewAction</name>
<value>index</value>
</init-param>
<expiration-cache>0</expiration-cache>
<!-- The edit mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>editNamespace</name>
<value>/edit</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>edit</portlet-mode>
<portlet-mode>help</portlet-mode>
</supports>
<!-- The default action to invoke in edit mode. -->
<init-param>
<name>defaultEditAction</name>
<value>index</value>
</init-param>
<supported-locale>en</supported-locale>
<!-- The help mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>helpNamespace</name>
<value>/help</value>
</init-param>
<!-- The default action to invoke in help mode. -->
<init-param>
<name>defaultHelpAction</name>
<value>index</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>edit</portlet-mode>
<portlet-mode>help</portlet-mode>
<portlet-mode>view</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<portlet-info>
<title>My StrutsPortlet portlet2</title>
<short-title>SP2</short-title>
<keywords>struts,portlet</keywords>
</portlet-info>
</portlet>
<portlet-info>
<title>My StrutsPortlet portlet2</title>
<short-title>SP2</short-title>
<keywords>struts,portlet</keywords>
</portlet-info>
</portlet>
</portlet-app>
@@ -1,13 +0,0 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<h1>Fileupload sample</h1>
<s:actionerror />
<s:fielderror />
<s:form action="fileUpload" method="POST" enctype="multipart/form-data">
<s:file name="upload" label="File"/>
<s:textfield name="caption" label="Caption"/>
<s:submit />
</s:form>
@@ -1,14 +0,0 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<h1>Fileupload sample</h1>
<p>
<ul>
<li>ContentType: <s:property value="uploadContentType" /></li>
<li>FileName: <s:property value="uploadFileName" /></li>
<li>File: <s:property value="upload" /></li>
<li>Caption:<s:property value="caption" /></li>
</ul>
</p>
@@ -1,8 +0,0 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<H2>Input your name</H2>
<s:form action="formExampleModelDriven" method="POST">
<s:textfield label="First name" name="firstName" value="%{firstName}"/>
<s:textfield label="Last name" name="lastName" value="%{lastName}"/>
<s:submit value="Submit the form"/>
</s:form>
@@ -1,8 +0,0 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<H2>Input your name</H2>
<s:form action="formExamplePrg" method="POST">
<s:textfield label="First name" name="firstName" value="%{firstName}"/>
<s:textfield label="Last name" name="lastName" value="%{lastName}"/>
<s:submit value="Submit the form"/>
</s:form>
@@ -4,12 +4,10 @@
Here you'll find examples of what is possible with the Struts Portlet integration framework.
<ul>
<li><a href="<s:url action="formExample"/>">A simple form</a></li>
<li><a href="<s:url action="formExamplePrg" method="input"/>">Form example with proper PRG</a></li>
<li><a href="<s:url action="formExampleModelDriven" method="input"/>">Model driven example</li>
<li><a href="<s:url action="validationExample"/>">Validation</a></li>
<li><a href="<s:url action="tokenExample"/>">Token</a></li>
<li><a href="<s:url action="springExample"/>">Spring integration</a></li>
<li><a href="<s:url action="fileUpload" method="input"/>">File upload</li>
<li><a href="<s:url action="ajaxExample"/>">Ajax</a></li>
<li><a href="<s:url action="freeMarkerExample"/>">FreeMarker</a></li>
<li><a href="<s:url action="velocityHelloWorld"/>">Velocity</a></li>
<li><a href="<s:url action="index" portletMode="edit"/>">Go to edit mode and see what's there</a></li>
+42 -23
View File
@@ -1,30 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app id="StrutsPortlet">
<!-- Uncomment/comment this if you need/don't need Spring support -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext*.xml</param-value>
</context-param>
<filter id="filterdispatcher">
<filter-name>action2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<!-- Uncomment/comment this if you need/don't need Spring support -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext*.xml</param-value>
</context-param>
<filter id="filterdispatcher">
<filter-name>Struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>Struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>action2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<listener>
<listener-class>
org.apache.struts2.portlet.context.ServletContextHolderListener
</listener-class>
</listener>
<servlet id="preparator">
<servlet-name>preparator</servlet-name>
<servlet-class>
org.apache.struts2.portlet.context.PreparatorServlet
</servlet-class>
</servlet>
<servlet id="dwr">
<servlet-name>dwr</servlet-name>
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>dwr</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
</web-app>
+6 -12
View File
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.0.14</version>
<version>2.0.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-showcase</artifactId>
@@ -12,9 +13,9 @@
<name>Showcase Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_14/apps/showcase</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_14/apps/showcase</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_0_14/apps/showcase</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/apps/showcase/</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/showcase/</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/apps/showcase/</url>
</scm>
@@ -61,13 +62,6 @@
<version>${pom.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>2.0.4</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-codebehind-plugin</artifactId>
@@ -70,23 +70,15 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
}
}
pageLines = read(in, -1);
if (in != null) {
in.close();
}
}
if (className != null && className.trim().length() > 0) {
className = "/" + className.replace('.', '/') + ".java";
className = "/"+className.replace('.', '/') + ".java";
InputStream in = getClass().getResourceAsStream(className);
if (in == null) {
in = servletContext.getResourceAsStream("/WEB-INF/src"+className);
}
classLines = read(in, -1);
if (in != null) {
in.close();
}
}
if (config != null && config.trim().length() > 0) {
@@ -126,6 +118,8 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
this.padding = padding;
}
/**
* @return the classLines
*/
@@ -221,4 +215,6 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
public void setServletContext(ServletContext arg0) {
this.servletContext = arg0;
}
}
+1 -2
View File
@@ -2,5 +2,4 @@ Apache Struts
Copyright 2000-2007 The Apache Software Foundation
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
Nifty Corners (http://www.html.it/articoli/nifty/index.html).
The Apache Software Foundation (http://www.apache.org/).
@@ -1,73 +1,73 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<!-- START SNIPPET: fieldValidatorsExample -->
"-//OpenSymphony Group//XWork Validator 1.0//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<!-- START SNIPPET: fieldValidatorsExample -->
<validators>
<field name="requiredValidatorField">
<field-validator type="required">
<message><![CDATA[ required ]]></message>
</field-validator>
</field>
<field name="requiredStringValidatorField">
<field-validator type="requiredstring">
<param name="trim">true</param>
<field name="requiredValidatorField">
<field-validator type="required">
<message><![CDATA[ required ]]></message>
</field-validator>
</field>
<field name="requiredStringValidatorField">
<field-validator type="requiredstring">
<param name="trim">true</param>
<message key="i18n.nothing.here"><![CDATA[ required and must be string ]]></message>
</field-validator>
</field>
<field name="requiredStringValidatorField">
<field-validator type="requiredstring">
<param name="trim">true</param>
</field-validator>
</field>
<field name="requiredStringValidatorField">
<field-validator type="requiredstring">
<param name="trim">true</param>
<message key="i18n.requiredstring"><![CDATA[ required and must be string ]]></message>
</field-validator>
</field>
<field name="integerValidatorField">
<field-validator type="int">
<param name="min">1</param>
<param name="max">10</param>
<message><![CDATA[ must be integer min 1 max 10 if supplied ]]></message>
</field-validator>
</field>
<field name="dateValidatorField">
<field-validator type="date">
<param name="min">01/01/1990</param>
<param name="max">01/01/2000</param>
<message><![CDATA[ must be a min 01/01/1990 max 01/01/2000 if supplied ]]></message>
</field-validator>
</field>
<field name="emailValidatorField">
<field-validator type="email">
<message><![CDATA[ must be a valid email if supplied ]]></message>
</field-validator>
</field>
<field name="urlValidatorField">
<field-validator type="url">
<message><![CDATA[ must be a valid url if supplied ]]></message>
</field-validator>
</field>
<field name="stringLengthValidatorField">
<field-validator type="stringlength">
<param name="maxLength">4</param>
<param name="minLength">2</param>
<param name="trim">true</param>
<message><![CDATA[ must be a String of a specific greater than 1 less than 5 if specified ]]></message>
</field-validator>
</field>
<field name="regexValidatorField">
<field-validator type="regex">
<param name="expression">.*\.txt</param>
<message><![CDATA[ regexValidatorField must match a regexp (.*\.txt) if specified ]]></message>
</field-validator>
</field>
<field name="fieldExpressionValidatorField">
<field-validator type="fieldexpression">
<param name="expression">(fieldExpressionValidatorField == requiredValidatorField)</param>
<message><![CDATA[ must be the same as the Required Validator Field if specified ]]></message>
</field-validator>
</field>
</field-validator>
</field>
<field name="integerValidatorField">
<field-validator type="int">
<param name="min">1</param>
<param name="max">10</param>
<message><![CDATA[ must be integer min 1 max 10 if supplied ]]></message>
</field-validator>
</field>
<field name="dateValidatorField">
<field-validator type="date">
<param name="min">01/01/1990</param>
<param name="max">01/01/2000</param>
<message><![CDATA[ must be a min 01-01-1990 max 01-01-2000 if supplied ]]></message>
</field-validator>
</field>
<field name="emailValidatorField">
<field-validator type="email">
<message><![CDATA[ must be a valid email if supplied ]]></message>
</field-validator>
</field>
<field name="urlValidatorField">
<field-validator type="url">
<message><![CDATA[ must be a valid url if supplied ]]></message>
</field-validator>
</field>
<field name="stringLengthValidatorField">
<field-validator type="stringlength">
<param name="maxLength">4</param>
<param name="minLength">2</param>
<param name="trim">true</param>
<message><![CDATA[ must be a String of a specific greater than 1 less than 5 if specified ]]></message>
</field-validator>
</field>
<field name="regexValidatorField">
<field-validator type="regex">
<param name="expression">.*\.txt</param>
<message><![CDATA[ regexValidatorField must match a regexp (.*\.txt) if specified ]]></message>
</field-validator>
</field>
<field name="fieldExpressionValidatorField">
<field-validator type="fieldexpression">
<param name="expression">(fieldExpressionValidatorField == requiredValidatorField)</param>
<message><![CDATA[ must be the same as the Required Validator Field if specified ]]></message>
</field-validator>
</field>
</validators>
<!-- END SNIPPET: fieldValidatorsExample -->
@@ -10,7 +10,7 @@
<default-action-ref name="download"/>
<action name="download" class="org.apache.struts2.showcase.filedownload.FileDownloadAction">
<param name="inputPath">/images/struts.gif</param>
<param name="inputPath">\images\struts.gif</param>
<result name="success" type="stream">
<param name="contentType">image/gif</param>
<param name="inputName">inputStream</param>
@@ -20,7 +20,7 @@
</action>
<action name="download2" class="org.apache.struts2.showcase.filedownload.FileDownloadAction">
<param name="inputPath">/images/struts-gif.zip</param>
<param name="inputPath">\images\struts-gif.zip</param>
<result name="success" type="stream">
<param name="contentType">application/zip</param>
<param name="inputName">inputStream</param>
@@ -30,7 +30,7 @@
<default-interceptor-ref name="integration" />
<default-action-ref name="editGangster" />
<!-- Display entry page that uses Model-Driven technique -->
<!-- Diplay entry page that uses Model-Driven technique -->
<action name="editGangster" class="org.apache.struts2.s1.Struts1Action">
<param name="className">org.apache.struts2.showcase.integration.EditGangsterAction</param>
<result>modelDriven.jsp</result>
@@ -17,10 +17,6 @@
<result type="tiles">showcase.freemarker</result>
</action>
<action name="freemarkerLayout">
<result type="tiles">showcase.freemarkerLayout</result>
</action>
<action name="sanity">
<result type="redirect">/tiles/layout.jsp</result>
<result type="redirect" name="success">/tiles/layout.jsp</result>
@@ -28,21 +28,15 @@
<tiles-definitions>
<definition name="showcase.index" template="/tiles/layout.jsp">
<put-attribute name="title" value="Tiles Showcase"/>
<put-attribute name="header" value="/tiles/header.jsp"/>
<put-attribute name="body" value="/tiles/body.jsp"/>
<put name="title" value="Tiles Showcase"/>
<put name="header" value="/tiles/header.jsp"/>
<put name="body" value="/tiles/body.jsp"/>
</definition>
<definition name="showcase.freemarker" template="/tiles/layout.jsp">
<put-attribute name="title" value="Tiles/Freemarker Showcase"/>
<put-attribute name="header" value="/tiles/header.jsp"/>
<put-attribute name="body" value="/tiles/body.ftl"/>
</definition>
<definition name="showcase.freemarkerLayout" template="/tiles/layout.ftl">
<put-attribute name="title" value="Tiles/Freemarker Showcase"/>
<put-attribute name="header" value="/tiles/header.jsp"/>
<put-attribute name="body" value="/tiles/body.ftl"/>
<put name="title" value="Tiles/Freemarker Showcase"/>
<put name="header" value="/tiles/header.jsp"/>
<put name="body" value="/tiles/body.ftl"/>
</definition>
</tiles-definitions>
@@ -5,6 +5,11 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Struts Showcase Application</display-name>
<context-param>
<param-name>org.apache.tiles.CONTAINER_FACTORY</param-name>
<param-value>org.apache.struts2.tiles.StrutsTilesContainerFactory</param-value>
</context-param>
<filter>
<filter-name>struts-cleanup</filter-name>
@@ -52,7 +57,7 @@
<listener>
<listener-class>
org.apache.struts2.tiles.StrutsTilesListener
org.apache.tiles.listener.TilesListener
</listener-class>
</listener>
@@ -80,12 +85,6 @@
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>JspSupportServlet</servlet-name>
<servlet-class>org.apache.struts2.views.JspSupportServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- JavaServer Faces Servlet Mapping, not called directly -->
<servlet-mapping>
@@ -11,7 +11,7 @@
</li>
<li>
<@s.url id="url" action="hangmanAjax" namespace="/hangman" />
<@s.a href="%{#url}">Hangman (Ajax - Experimental)</@s.a>
(broken) <@s.a href="%{#url}">Hangman (Ajax - Experimental)</@s.a>
</li>
</ul>
</body>
@@ -10,9 +10,6 @@
<li>
<a href="freemarker.action">View FreeMarker Example</a>
</li>
<li>
<a href="freemarkerLayout.action">View Example with a FreeMarker Layout</a>
</li>
</ul>
</div>
@@ -1,12 +0,0 @@
<#assign tiles=JspTaglibs["http://tiles.apache.org/tags-tiles"]>
<@tiles.importAttribute name="title" scope="request"/>
<html>
<head><title><@tiles.getAsString name="title"/></title></head>
<body>
<@tiles.insertAttribute name="header"/>
<p id="body">
<@tiles.insertAttribute name="body"/>
</p>
<p>Notice that this is a layout made in FreeMarker</p>
</body>
</html>
@@ -11,7 +11,5 @@
<p id="body">
<tiles:insertAttribute name="body"/>
</p>
<p>Notice that this is a layout made in JSP</p>
</body>
</html>
@@ -13,7 +13,7 @@
</head>
<body>
<h1>Validation Examples</h1>
<s:url id="quizBasic" namespace="/validation" action="quizBasic" method="input"/>
<s:url id="quizClient" namespace="/validation" action="quizClient" method="input"/>
<s:url id="quizClientCss" namespace="/validation" action="quizClientCss" method="input"/>
@@ -24,13 +24,13 @@
<s:url id="clientSideValidationUrl" action="clientSideValidationExample" namespace="/validation" />
<s:url id="backToShowcase" action="showcase" namespace="/" />
<s:url id="storeMessageAcrossRequestExample" value="/validation/storeErrorsAcrossRequestExample.jsp" />
<ul>
<li><s:a href="%{fieldValidatorUrl}">Field Validators</s:a></li>
<li><s:a href="%{clientSideValidationUrl}">Field Validators with client-side JavaScript</s:a></li>
<li><s:a href="%{nonFieldValidatorUrl}">Non Field Validator</s:a></li>
<li><s:a href="%{storeMessageAcrossRequestExample}">Store across request using MessageStoreInterceptor (Example)</s:a></li>
<li><s:a href="%{quizAjax}">Validation (ajax)</s:a></li>
<li>(broken) <s:a href="%{quizAjax}">Validation (ajax)</s:a></li>
<li><s:a href="%{quizBasic}">Validation (basic)</s:a></li>
<li><s:a href="%{quizClient}">Validation (client)</s:a></li>
<li><s:a href="%{quizClientCss}">Validation (client using css_xhtml theme)</s:a></li>
+39 -32
View File
@@ -1,4 +1,26 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<?xml version="1.0"?>
<!--
/*
* Copyright 2005-2006 The Apache Software Foundation.
*
* Licensed 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.
*
* $Id$
*/
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-assembly</artifactId>
@@ -11,13 +33,14 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.0.14</version>
<version>2.0.7</version>
</parent>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_14/assembly</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_14/assembly</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_0_14/assembly</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/assembly</connection>
<developerConnection>
scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/assembly</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/assembly</url>
</scm>
<build>
@@ -77,10 +100,10 @@
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.opensymphony</groupId>
<groupId>opensymphony</groupId>
<artifactId>xwork</artifactId>
<classifier>javadoc</classifier>
<version>2.0.7</version>
<version>2.0.0</version>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/xwork-apidocs</outputDirectory>
@@ -96,9 +119,12 @@
<phase>process-resources</phase>
<configuration>
<tasks>
<mkdir dir="${project.build.directory}/cwiki" />
<get src="http://struts.apache.org/2.x/docs.zip" dest="${project.build.directory}/docs.zip" ignoreerrors="false" />
<unzip src="${project.build.directory}/docs.zip" dest="${project.build.directory}/cwiki" />
<mkdir dir="${project.build.directory}/cwiki"/>
<get src="http://struts.apache.org/2.x/docs.zip"
dest="${project.build.directory}/docs.zip"
ignoreerrors="false"/>
<unzip src="${project.build.directory}/docs.zip"
dest="${project.build.directory}/cwiki"/>
</tasks>
</configuration>
<goals>
@@ -109,26 +135,13 @@
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-1</version>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>attached</goal>
</goals>
</execution>
</executions>
<version>2.0.1</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/all.xml</descriptor>
<descriptor>src/main/assembly/lib.xml</descriptor>
<!--
<descriptor>src/main/assembly/lib-jdk14.xml</descriptor>
-->
<descriptor>src/main/assembly/apps.xml</descriptor>
<descriptor>src/main/assembly/src.xml</descriptor>
<descriptor>src/main/assembly/docs.xml</descriptor>
</descriptors>
<finalName>struts-${version}</finalName>
<outputDirectory>target/assembly/out</outputDirectory>
@@ -218,12 +231,6 @@
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>2.0.4</version>
<scope>runtime</scope>
</dependency>
<!-- Include optional dependencies -->
<dependency>
@@ -377,7 +384,7 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
<version>1.0-alpha-10</version>
<version>1.0-alpha-10-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
@@ -435,4 +442,4 @@
</dependencies>
</project>
</project>
+4 -26
View File
@@ -27,12 +27,6 @@
<dependencySet>
<outputDirectory>lib</outputDirectory>
<scope>runtime</scope>
<excludes>
<exclude>net.sf.retrotranslator:retrotranslator-runtime</exclude>
<exclude>backport-util-concurrent:backport-util-concurrent</exclude>
<exclude>junit:junit</exclude>
<exclude>*:jdk14</exclude>
</excludes>
</dependencySet>
</dependencySets>
<fileSets>
@@ -64,10 +58,10 @@
<directory>../target/site</directory>
<outputDirectory>docs</outputDirectory>
</fileSet>
<!--fileSet>
<fileSet>
<directory>../api/target/site</directory>
<outputDirectory>docs/struts2-api</outputDirectory>
</fileSet-->
</fileSet>
<fileSet>
<directory>../core/target/site</directory>
<outputDirectory>docs/struts2-core</outputDirectory>
@@ -86,10 +80,6 @@
<outputDirectory>docs/struts2-plugins/struts2-$plugin-plugin</outputDirectory>
</fileSet>
-->
<fileSet>
<directory>../plugins/codebehind/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-codebehind-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/config-browser/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-config-browser-plugin</outputDirectory>
@@ -122,10 +112,6 @@
<directory>../plugins/sitegraph/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-sitegraph-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/spring/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-spring-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/sitemesh/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-sitemesh-plugin</outputDirectory>
@@ -144,14 +130,14 @@
<include>src/</include>
</includes>
</fileSet>
<!--fileSet>
<fileSet>
<directory>../api</directory>
<outputDirectory>src/api</outputDirectory>
<includes>
<include>pom.xml</include>
<include>src/</include>
</includes>
</fileSet-->
</fileSet>
<fileSet>
<directory>../apps</directory>
<outputDirectory>src/apps</outputDirectory>
@@ -200,13 +186,5 @@
<include>src/</include>
</includes>
</fileSet>
<fileSet>
<directory>../plugins</directory>
<outputDirectory>src/plugins</outputDirectory>
<excludes>
<exclude>*/target/**</exclude>
<exclude>target/**</exclude>
</excludes>
</fileSet>
</fileSets>
</assembly>
-116
View File
@@ -1,116 +0,0 @@
<!--
/*
* $Id: docs.xml 651587 2008-04-25 12:15:09Z hermanns $
*
* 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.
*/
-->
<assembly>
<id>docs</id>
<formats>
<format>zip</format>
</formats>
<fileSets>
<!-- Include the XWork Javadoc in the assembly -->
<fileSet>
<directory>target/xwork-apidocs</directory>
<outputDirectory>docs/xwork-apidocs</outputDirectory>
</fileSet>
<!-- Include the website in the assembly -->
<fileSet>
<directory>../target/site</directory>
<outputDirectory>docs</outputDirectory>
</fileSet>
<fileSet>
<directory>../api/target/site</directory>
<outputDirectory>docs/struts2-api</outputDirectory>
</fileSet>
<fileSet>
<directory>../core/target/site</directory>
<outputDirectory>docs/struts2-core</outputDirectory>
</fileSet>
<!-- Include the Confluence docs in the assembly -->
<fileSet>
<directory>target/cwiki</directory>
<outputDirectory>docs</outputDirectory>
</fileSet>
<!-- Plugins -->
<fileSet>
<directory>../plugins/codebehind/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-codebehind-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/config-browser/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-config-browser-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/jasperreports/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-jasperreports-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/jfreechart/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-jfreechart-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/jsf/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-jsf-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/jsf/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-junit-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/pell-multipart/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-pell-multipart-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/plexus/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-plexus-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/sitegraph/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-sitegraph-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/sitemesh/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-sitemesh-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/spring/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-spring-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/struts1/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-struts1-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/tiles/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-testng-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/tiles/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-tiles-plugin</outputDirectory>
</fileSet>
</fileSets>
</assembly>
-58
View File
@@ -1,58 +0,0 @@
<!--
/*
* $Id: lib-jdk14.xml 615299 2008-01-25 18:26:44Z apetrelli $
*
* 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.
*/
-->
<assembly>
<id>lib-jdk14</id>
<formats>
<format>zip</format>
</formats>
<dependencySets>
<dependencySet useTransitiveFiltering="true">
<outputDirectory>jdk14</outputDirectory>
<outputFileNameMapping>${artifactId}-${version}.${extension}</outputFileNameMapping>
<includes>
<include>net.sf.retrotranslator:retrotranslator-runtime</include>
<include>backport-util-concurrent:backport-util-concurrent</include>
</includes>
</dependencySet>
<dependencySet>
<useTransitiveFiltering>true</useTransitiveFiltering>
<outputDirectory>jdk14</outputDirectory>
<outputFileNameMapping>${artifactId}-${version}-jdk14.${extension}</outputFileNameMapping>
<includes>
<include>org.apache.struts:*:jar:jdk14</include>
<include>com.opensymphony:xwork:jar:jdk14</include>
</includes>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>src/main/resources/backport</directory>
<outputDirectory></outputDirectory>
<includes>
<include>*LICENSE*</include>
<include>NOTICE*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
-6
View File
@@ -27,12 +27,6 @@
<dependencySet>
<outputDirectory>lib</outputDirectory>
<scope>runtime</scope>
<excludes>
<exclude>net.sf.retrotranslator:retrotranslator-runtime</exclude>
<exclude>backport-util-concurrent:backport-util-concurrent</exclude>
<exclude>junit:junit</exclude>
<exclude>*:jdk14</exclude>
</excludes>
</dependencySet>
</dependencySets>
<fileSets>
+3 -2
View File
@@ -47,6 +47,7 @@
<include>README*</include>
<include>LICENSE*</include>
<include>NOTICE*</include>
<include>build.xml</include>
</includes>
</fileSet>
@@ -59,14 +60,14 @@
<include>src/</include>
</includes>
</fileSet>
<!--fileSet>
<fileSet>
<directory>../api</directory>
<outputDirectory>src/api</outputDirectory>
<includes>
<include>pom.xml</include>
<include>src/</include>
</includes>
</fileSet-->
</fileSet>
<fileSet>
<directory>../apps</directory>
<outputDirectory>src/apps</outputDirectory>
@@ -1,7 +0,0 @@
Apache Struts
Copyright 2000-2007 The Apache Software Foundation
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
Retrotranslator (http://retrotranslator.sourceforge.net/).
@@ -1,29 +0,0 @@
Retrotranslator: a Java bytecode transformer that translates Java classes
compiled with JDK 5.0 into classes that can be run on JVM 1.4.
Copyright (c) 2005, 2006 Taras Puchko
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2 -2
View File
@@ -1,2 +1,2 @@
java -jar retrotranslator-transformer-1.2.2.jar -advanced -srcjar ../lib/struts2-core-2.0.14.jar -destjar struts2-core-j4-2.0.14.jar
java -jar retrotranslator-transformer-1.2.2.jar -advanced -srcjar ../lib/xwork-2.0.7.jar -destjar xwork-j4-2.0.7.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
-3
View File
@@ -1,3 +0,0 @@
#!/bin/sh
java -jar retrotranslator-transformer-1.2.2.jar -advanced -srcjar ../lib/struts2-core-2.0.14.jar -destjar struts2-core-j4-2.0.14.jar
java -jar retrotranslator-transformer-1.2.2.jar -advanced -srcjar ../lib/xwork-2.0.7.jar -destjar xwork-j4-2.0.7.jar
+75 -54
View File
@@ -1,32 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* $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.
*/
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.0.14</version>
<version>2.0.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
@@ -34,16 +13,16 @@
<name>Struts 2 Core</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_14/core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_14/core</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_0_14/core</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/core/</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/core/</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/core/</url>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.0-alpha-4</version>
<version>2.0-alpha-1-SNAPSHOT</version>
<executions>
<execution>
<id>unpack-xwork</id>
@@ -54,9 +33,9 @@
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.opensymphony</groupId>
<groupId>opensymphony</groupId>
<artifactId>xwork</artifactId>
<version>2.0.7</version>
<version>2.0.1</version>
<classifier>sources</classifier>
</artifactItem>
</artifactItems>
@@ -128,30 +107,73 @@
</links>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rat-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<configuration>
<includes>
<include>pom.xml</include>
<include>src/**</include>
</includes>
<excludes>
<exclude>src/test/resources/org/apache/struts2/views/jsp/ui/*</exclude>
<exclude>src/main/etc/**</exclude>
<exclude>src/main/resources/org/apache/struts2/static/dojo/src/**</exclude>
<exclude>src/main/resources/org/apache/struts2/static/dojo/*</exclude>
<exclude>src/main/resources/org/apache/struts2/static/niftycorners/**</exclude>
<exclude>src/test/resources/org/apache/struts2/interceptor/validation/*</exclude>
<exclude>src/site/resources/tags/**</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</reporting>
<profiles>
<profile>
<!--
Run the translator for Java 1.4 compatiblity
Sample:
$ cd struts/struts2/
$ mvn clean install -Papps,j4 -Djava14.jar=$JAVA_HOME/../Classes/classes.jar
-->
<id>j4</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>retrotranslator-maven-plugin</artifactId>
<executions>
<execution>
<id>retrotranslate</id>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>create-j4-jar</id>
<goals><goal>jar</goal></goals>
<configuration>
<classesDirectory>${project.build.directory}/classes-retro</classesDirectory>
<classifier>j4</classifier>
<archive>
<manifestEntries>
<Extension-Name>${project.artifactId}-j4</Extension-Name>
<Specification-Vendor>${project.organization.name}</Specification-Vendor>
<Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
<Implementation-Title>${project.description}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
<Revision>${scm.revision}</Revision>
</manifestEntries>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>sun.jdk</groupId>
<artifactId>rt</artifactId>
<version>1.4.0</version>
<scope>system</scope>
<!-- path to rt.jar (on OSX, it's classes.jar) -->
<systemPath>${java14.jar}</systemPath>
</dependency>
<dependency>
<groupId>net.sf.retrotranslator</groupId>
<artifactId>retrotranslator-runtime</artifactId>
<version>1.0.8</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>alljars</id>
<build>
@@ -228,9 +250,9 @@
<dependencies>
<dependency>
<groupId>com.opensymphony</groupId>
<groupId>opensymphony</groupId>
<artifactId>xwork</artifactId>
<version>2.0.7</version>
<version>2.0.1</version>
</dependency>
<dependency>
@@ -439,8 +461,7 @@
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts-annotations</artifactId>
<scope>compile</scope>
<version>1.0.2</version>
<version>1.0-SNAPSHOT</version>
<optional>true</optional>
</dependency>
@@ -76,9 +76,6 @@ public final class StrutsConstants {
/** The org.apache.struts2.views.freemarker.FreemarkerManager implementation class */
public static final String STRUTS_FREEMARKER_MANAGER_CLASSNAME = "struts.freemarker.manager.classname";
/** Cache Freemarker templates */
public static final String STRUTS_FREEMARKER_TEMPLATES_CACHE = "struts.freemarker.templatesCache";
/** org.apache.struts2.views.velocity.VelocityManager implementation class */
public static final String STRUTS_VELOCITY_MANAGER_CLASSNAME = "struts.velocity.manager.classname";
@@ -154,7 +151,4 @@ public final class StrutsConstants {
/** XWork default text provider */
public static final String STRUTS_XWORKTEXTPROVIDER = "struts.xworkTextProvider";
/** The name of the parameter to create when mapping an id (used by some action mappers) */
public static final String STRUTS_ID_PARAMETER_NAME = "struts.mapper.idParameterName";
}
@@ -60,7 +60,7 @@ public abstract class AbstractRemoteCallUIBean extends ClosingUIBean implements
super.evaluateExtraParams();
if (href != null)
addParameter("href", ensureAttributeSafelyNotEscaped(findString(href)));
addParameter("href", findString(href));
if (errorText != null)
addParameter("errorText", findString(errorText));
if (loadingText != null)
@@ -41,7 +41,7 @@ import com.opensymphony.xwork2.util.ValueStack;
* <!-- START SNIPPET: example -->
*
* &lt;s:actionerror /&gt;
* &lt;s:form .... &gt;
* &lt;s:form .... &gt;>
* ....
* &lt;/s:form&gt;
*
@@ -109,7 +109,6 @@ public class Autocompleter extends ComboBox {
protected String iconPath;
protected String keyName;
protected String dataFieldName;
protected String resultsLimit;
public Autocompleter(ValueStack stack, HttpServletRequest request,
HttpServletResponse response) {
@@ -173,7 +172,7 @@ public class Autocompleter extends ComboBox {
if(iconPath != null)
addParameter("iconPath", findString(iconPath));
if(dataFieldName != null)
addParameter("dataFieldName", findString(dataFieldName));
addParameter("dataFieldName", findString(dataFieldName));
if(keyName != null)
addParameter("keyName", findString(keyName));
else {
@@ -183,8 +182,6 @@ public class Autocompleter extends ComboBox {
String keyNameExpr = "%{" + keyName + "}";
addParameter("key", findString(keyNameExpr));
if(resultsLimit != null)
addParameter("searchLimit", findString(resultsLimit));
}
protected Object findListValue() {
@@ -297,9 +294,4 @@ public class Autocompleter extends ComboBox {
public void setDataFieldName(String dataFieldName) {
this.dataFieldName = dataFieldName;
}
@StrutsTagAttribute(description="Limit how many results are shown as autocompletion options", defaultValue="30")
public void setResultsLimit(String resultsLimit) {
this.resultsLimit = resultsLimit;
}
}
@@ -23,8 +23,8 @@ package org.apache.struts2.components;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Stack;
@@ -65,12 +65,12 @@ public class Component {
*/
public Component(ValueStack stack) {
this.stack = stack;
this.parameters = new LinkedHashMap();
this.parameters = new HashMap();
getComponentStack().push(this);
}
/**
* Gets the name of this component.
* Get's the name of this component.
* @return the name of this component.
*/
private String getComponentName() {
@@ -87,7 +87,7 @@ public class Component {
}
/**
* Gets the OGNL value stack assoicated with this component.
* Get's the OGNL value stack assoicated with this component.
* @return the OGNL value stack assoicated with this component.
*/
public ValueStack getStack() {
@@ -95,7 +95,7 @@ public class Component {
}
/**
* Gets the component stack of this component.
* Get's the component stack of this component.
* @return the component stack of this component, never <tt>null</tt>.
*/
public Stack getComponentStack() {
@@ -215,7 +215,7 @@ public class Component {
}
/**
* Constructs a <code>RuntimeException</code> based on the given information.
* Constructs?a <code>RuntimeException</code> based on the given information.
* <p/>
* A message is constructed and logged at ERROR level before being returned
* as a <code>RuntimeException</code>.
@@ -323,26 +323,6 @@ public class Component {
}
}
/**
* Renders an action URL by consulting the {@link org.apache.struts2.dispatcher.mapper.ActionMapper}.
* @param action the action
* @param namespace the namespace
* @param method the method
* @param req HTTP request
* @param res HTTP response
* @param parameters parameters
* @param scheme http or https
* @param includeContext should the context path be included or not
* @param encodeResult should the url be encoded
* @return the action url.
*/
@Deprecated
protected String determineActionURL(String action, String namespace, String method,
HttpServletRequest req, HttpServletResponse res, Map parameters, String scheme,
boolean includeContext, boolean encodeResult) {
return determineActionURL(action, namespace, method, req, res, parameters, scheme, includeContext, encodeResult, false, true);
}
/**
* Renders an action URL by consulting the {@link org.apache.struts2.dispatcher.mapper.ActionMapper}.
* @param action the action
@@ -354,20 +334,16 @@ public class Component {
* @param scheme http or https
* @param includeContext should the context path be included or not
* @param encodeResult should the url be encoded
* @param forceAddSchemeHostAndPort should the scheme host and port be added to the url no matter what
* @param escapeAmp should the ampersands used separate parameters be escaped or not
* @return the action url.
*/
protected String determineActionURL(String action, String namespace, String method,
HttpServletRequest req, HttpServletResponse res, Map parameters, String scheme,
boolean includeContext, boolean encodeResult, boolean forceAddSchemeHostAndPort,
boolean escapeAmp) {
boolean includeContext, boolean encodeResult) {
String finalAction = findString(action);
String finalMethod = method != null ? findString(method) : method;
String finalNamespace = determineNamespace(namespace, getStack(), req);
ActionMapping mapping = new ActionMapping(finalAction, finalNamespace, finalMethod, parameters);
ActionMapping mapping = new ActionMapping(finalAction, finalNamespace, method, parameters);
String uri = actionMapper.getUriFromActionMapping(mapping);
return UrlHelper.buildUrl(uri, req, res, parameters, scheme, includeContext, encodeResult, forceAddSchemeHostAndPort, escapeAmp);
return UrlHelper.buildUrl(uri, req, res, parameters, scheme, includeContext, encodeResult);
}
/**
@@ -431,7 +407,7 @@ public class Component {
}
/**
* Gets the parameters.
* Get's the parameters.
* @return the parameters. Is never <tt>null</tt>.
*/
public Map getParameters() {
@@ -439,7 +415,7 @@ public class Component {
}
/**
* Adds all the given parameters to this component's own parameters.
* Add's all the given parameters to this componenets own parameters.
* @param params the parameters to add.
*/
public void addAllParameters(Map params) {
@@ -447,9 +423,9 @@ public class Component {
}
/**
* Adds the given key and value to this component's own parameter.
* Add's the given key and value to this components own parameter.
* <p/>
* If the provided key is <tt>null</tt> nothing happens.
* If the provided key is <tt>null</tt> nothing happends.
* If the provided value is <tt>null</tt> any existing parameter with
* the given key name is removed.
* @param key the key of the new parameter to add.
@@ -468,7 +444,7 @@ public class Component {
}
/**
* Gets the id for referencing element.
* Get's the id for referencing element.
* @return the id for referencing element.
*/
public String getId() {
@@ -489,4 +465,5 @@ public class Component {
public boolean usesBody() {
return false;
}
}
@@ -21,9 +21,7 @@
package org.apache.struts2.components;
import java.text.ParseException;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
@@ -131,10 +129,8 @@ import com.opensymphony.xwork2.util.ValueStack;
public class DateTimePicker extends UIBean {
final public static String TEMPLATE = "datetimepicker";
// Backported changes from s2 trunk (r657936)
// final private static SimpleDateFormat RFC3339_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
final private static String RFC3339_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
final private static String RFC3339_PATTERN = "{0,date," + RFC3339_FORMAT + "}";
final private static SimpleDateFormat RFC3339_FORMAT = new SimpleDateFormat(
"yyyy-MM-dd'T'HH:mm:ss");
final protected static Log LOG = LogFactory.getLog(DateTimePicker.class);
protected String iconPath;
@@ -298,14 +294,12 @@ public class DateTimePicker extends UIBean {
return null;
if(obj instanceof Date) {
return MessageFormat.format(RFC3339_PATTERN, (Date) obj);
} else if(obj instanceof Calendar) {
return MessageFormat.format(RFC3339_PATTERN, ((Calendar) obj).getTime());
return RFC3339_FORMAT.format((Date) obj);
} else {
// try to parse a date
String dateStr = obj.toString();
if(dateStr.equalsIgnoreCase("today"))
return MessageFormat.format(RFC3339_PATTERN, new Date());
return RFC3339_FORMAT.format(new Date());
try {
Date date = null;
@@ -313,7 +307,7 @@ public class DateTimePicker extends UIBean {
SimpleDateFormat format = new SimpleDateFormat(
(String) getParameters().get("displayFormat"));
date = format.parse(dateStr);
return MessageFormat.format(RFC3339_PATTERN, date);
return RFC3339_FORMAT.format(date);
} else {
// last resource to assume already in correct/default format
return dateStr;
@@ -192,8 +192,6 @@ public abstract class DoubleListUIBean extends ListUIBean {
}
} else if (form != null) {
addParameter("doubleId", form.getParameters().get("id") + "_" +escape(this.doubleName));
} else {
addParameter("doubleId", escape(doubleName !=null ? findString(doubleName) : null));
}
if (doubleOnclick != null) {
@@ -51,7 +51,7 @@ import com.opensymphony.xwork2.util.ValueStack;
* &lt;s:param&gt;field1&lt;/s:param&gt;
* &lt;s:param&gt;field2&lt;/s:param&gt;
* &lt;/s:fielderror&gt;
* &lt;s:form .... &gt;
* &lt;s:form .... &gt;>
* ....
* &lt;/s:form&gt;
*
@@ -61,7 +61,7 @@ import com.opensymphony.xwork2.util.ValueStack;
* &lt;s:param value="%{'field1'}" /&gt;
* &lt;s:param value="%{'field2'}" /&gt;
* &lt;/s:fielderror&gt;
* &lt;s:form .... &gt;
* &lt;s:form .... &gt;>
* ....
* &lt;/s:form&gt;
*
@@ -20,6 +20,24 @@
*/
package org.apache.struts2.components;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.dispatcher.Dispatcher;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import org.apache.struts2.portlet.context.PortletActionContext;
import org.apache.struts2.portlet.util.PortletUrlHelper;
import org.apache.struts2.views.util.UrlHelper;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.ObjectFactory;
@@ -29,29 +47,12 @@ import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.config.entities.InterceptorMapping;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptorUtil;
import com.opensymphony.xwork2.util.TextUtils;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.TextUtils;
import com.opensymphony.xwork2.validator.ActionValidatorManagerFactory;
import com.opensymphony.xwork2.validator.FieldValidator;
import com.opensymphony.xwork2.validator.ValidationInterceptor;
import com.opensymphony.xwork2.validator.Validator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.dispatcher.Dispatcher;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import org.apache.struts2.portlet.context.PortletActionContext;
import org.apache.struts2.portlet.util.PortletUrlHelper;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.views.util.UrlHelper;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
/**
* <!-- START SNIPPET: javadoc -->
@@ -94,11 +95,6 @@ import java.util.Set;
*/
@StrutsTag(name="form", tldTagClass="org.apache.struts2.views.jsp.ui.FormTag", description="Renders an input form")
public class Form extends ClosingUIBean {
/**
* Provide a logging instance.
*/
private static final Log LOG = LogFactory.getLog(Form.class);
public static final String OPEN_TEMPLATE = "form";
public static final String TEMPLATE = "form-close";
@@ -208,7 +204,7 @@ public class Form extends ClosingUIBean {
}
/**
* The Form component determines its HTML element id as follows:-
* Form component determine the its HTML element id as follows:-
* <ol>
* <li>if an 'id' attribute is specified.</li>
* <li>if an 'action' attribute is specified, it will be used as the id.</li>
@@ -226,9 +222,6 @@ public class Form extends ClosingUIBean {
if (id != null) {
addParameter("id", escape(id));
}
// if no id given, it will be tried to generate it from the action attribute in the
// corresponding evaluateExtraParams method
if (Dispatcher.getInstance().isPortletSupportActive() && PortletActionContext.isPortletRequest()) {
evaluateExtraParamsPortletRequest(namespace, action);
} else {
@@ -294,20 +287,14 @@ public class Form extends ClosingUIBean {
}
// if the id isn't specified, use the action name
if (id == null && action!=null) {
addParameter("id", escape(action));
if (id == null) {
addParameter("id", action);
}
} else if (action != null) {
// Since we can't find an action alias in the configuration, we just assume
// the action attribute supplied is the path to be used as the URI this
// the action attribute supplied is the path to be used as the uri this
// form is submitting to.
// Warn user that the specified namespace/action combo
// was not found in the configuration.
if (namespace != null) {
LOG.warn("No configuration found for the specified action: '" + action + "' in namespace: '" + namespace + "'. Form action defaulting to 'action' attribute's literal value.");
}
String result = UrlHelper.buildUrl(action, request, response, null);
addParameter("action", result);
@@ -342,7 +329,7 @@ public class Form extends ClosingUIBean {
// Only evaluate if Client-Side js is to be enable when validate=true
Boolean validate = (Boolean) getParameters().get("validate");
if (validate != null && validate) {
if (validate != null && validate.booleanValue()) {
addParameter("performValidation", Boolean.FALSE);
@@ -350,8 +337,9 @@ public class Form extends ClosingUIBean {
ActionConfig actionConfig = runtimeConfiguration.getActionConfig(namespace, actionName);
if (actionConfig != null) {
List<InterceptorMapping> interceptors = actionConfig.getInterceptors();
for (InterceptorMapping interceptorMapping : interceptors) {
List interceptors = actionConfig.getInterceptors();
for (Iterator i = interceptors.iterator(); i.hasNext();) {
InterceptorMapping interceptorMapping = (InterceptorMapping) i.next();
if (ValidationInterceptor.class.isInstance(interceptorMapping.getInterceptor())) {
ValidationInterceptor validationInterceptor = (ValidationInterceptor) interceptorMapping.getInterceptor();
@@ -375,6 +363,11 @@ public class Form extends ClosingUIBean {
*/
private void evaluateExtraParamsPortletRequest(String namespace, String action) {
if (this.action != null) {
// if it isn't specified, we'll make somethig up
action = findString(this.action);
}
String type = "action";
if (TextUtils.stringSet(method)) {
if ("GET".equalsIgnoreCase(method.trim())) {
@@ -382,7 +375,7 @@ public class Form extends ClosingUIBean {
}
}
if (action != null) {
String result = PortletUrlHelper.buildUrl(action, namespace, null,
String result = PortletUrlHelper.buildUrl(action, namespace,
getParameters(), type, portletMode, windowState);
addParameter("action", result);
@@ -416,9 +409,10 @@ public class Form extends ClosingUIBean {
return Collections.EMPTY_LIST;
}
List<Validator> all = ActionValidatorManagerFactory.getInstance().getValidators(actionClass, (String) getParameters().get("actionName"));
List<Validator> validators = new ArrayList<Validator>();
for (Validator validator : all) {
List all = ActionValidatorManagerFactory.getInstance().getValidators(actionClass, (String) getParameters().get("actionName"));
List validators = new ArrayList();
for (Iterator iterator = all.iterator(); iterator.hasNext();) {
Validator validator = (Validator) iterator.next();
if (validator instanceof FieldValidator) {
FieldValidator fieldValidator = (FieldValidator) validator;
if (fieldValidator.getFieldName().equals(name)) {
@@ -446,7 +440,7 @@ public class Form extends ClosingUIBean {
this.onsubmit = onsubmit;
}
@StrutsTagAttribute(description="Set action name to submit to, without .action suffix", defaultValue="current action")
@StrutsTagAttribute(description="Set action nane to submit to, without .action suffix", defaultValue="current action")
public void setAction(String action) {
this.action = action;
}
@@ -477,7 +471,7 @@ public class Form extends ClosingUIBean {
this.validate = validate;
}
@StrutsTagAttribute(description="The portlet mode to display after the form submit")
@StrutsTagAttribute(description="he portlet mode to display after the form submit")
public void setPortletMode(String portletMode) {
this.portletMode = portletMode;
}
@@ -20,20 +20,21 @@
*/
package org.apache.struts2.components;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.LocaleProvider;
import com.opensymphony.xwork2.TextProviderFactory;
import com.opensymphony.xwork2.util.LocalizedTextUtil;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.StrutsException;
import org.apache.struts2.dispatcher.Dispatcher;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import java.io.Writer;
import java.util.Locale;
import java.util.ResourceBundle;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
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;
/**
* <!-- START SNIPPET: javadoc -->
*
@@ -102,9 +103,7 @@ public class I18n extends Component {
if (bundle != null) {
final Locale locale = (Locale) getStack().getContext().get(ActionContext.LOCALE);
TextProviderFactory tpf = new TextProviderFactory();
Dispatcher.getInstance().getContainer().inject(tpf);
getStack().push(tpf.createInstance(bundle, new LocaleProvider() {
getStack().push(TextProviderFactory.getInstance(bundle, new LocaleProvider() {
public Locale getLocale() {
return locale;
}
@@ -123,14 +123,6 @@ public class OptionTransferSelect extends DoubleListUIBean {
protected String rightUpLabel;
protected String rightDownLabel;
protected String addToLeftOnclick;
protected String addToRightOnclick;
protected String addAllToLeftOnclick;
protected String addAllToRightOnclick;
protected String selectAllOnclick;
protected String upDownOnLeftOnclick;
protected String upDownOnRightOnclick;
public OptionTransferSelect(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
super(stack, request, response);
@@ -260,34 +252,6 @@ public class OptionTransferSelect extends DoubleListUIBean {
rightDownLabel != null ? findValue(rightDownLabel, String.class) : "v");
// selectAllOnclick
addParameter("selectAllOnclick",
selectAllOnclick != null ? findValue(selectAllOnclick, String.class) : "");
// addToLeftOnclick
addParameter("addToLeftOnclick",
addToLeftOnclick != null ? findValue(addToLeftOnclick, String.class) : "");
// addToRightOnclick
addParameter("addToRightOnclick",
addToRightOnclick != null ? findValue(addToRightOnclick, String.class) : "");
// addAllToLeftOnclick
addParameter("addAllToLeftOnclick",
addAllToLeftOnclick != null ? findValue(addAllToLeftOnclick, String.class) : "");
// addAllToRightOnclick
addParameter("addAllToRightOnclick",
addAllToRightOnclick != null ? findValue(addAllToRightOnclick, String.class) : "");
// upDownOnLeftOnclick
addParameter("upDownOnLeftOnclick",
upDownOnLeftOnclick != null ? findValue(upDownOnLeftOnclick, String.class) : "");
// upDownOnRightOnclick
addParameter("upDownOnRightOnclick",
upDownOnRightOnclick != null ? findValue(upDownOnRightOnclick, String.class) : "");
// inform the form component our select tag infos, so they know how to select
// its elements upon onsubmit
@@ -512,66 +476,5 @@ public class OptionTransferSelect extends DoubleListUIBean {
return rightDownLabel;
}
public String getAddAllToLeftOnclick() {
return addAllToLeftOnclick;
}
@StrutsTagAttribute(description="Javascript to run after Add All To Left button pressed")
public void setAddAllToLeftOnclick(String addAllToLeftOnclick) {
this.addAllToLeftOnclick = addAllToLeftOnclick;
}
public String getAddAllToRightOnclick() {
return addAllToRightOnclick;
}
@StrutsTagAttribute(description="Javascript to run after Add All To Right button pressed")
public void setAddAllToRightOnclick(String addAllToRightOnclick) {
this.addAllToRightOnclick = addAllToRightOnclick;
}
public String getAddToLeftOnclick() {
return addToLeftOnclick;
}
@StrutsTagAttribute(description="Javascript to run after Add To Left button pressed")
public void setAddToLeftOnclick(String addToLeftOnclick) {
this.addToLeftOnclick = addToLeftOnclick;
}
public String getAddToRightOnclick() {
return addToRightOnclick;
}
@StrutsTagAttribute(description="Javascript to run after Add To Right button pressed")
public void setAddToRightOnclick(String addToRightOnclick) {
this.addToRightOnclick = addToRightOnclick;
}
@StrutsTagAttribute(description="Javascript to run after up / down on the left side buttons pressed")
public void setUpDownOnLeftOnclick(String upDownOnLeftOnclick) {
this.upDownOnLeftOnclick = upDownOnLeftOnclick;
}
public String getUpDownOnLeftOnclick() {
return this.upDownOnLeftOnclick;
}
@StrutsTagAttribute(description="Javascript to run after up / down on the right side buttons pressed")
public void setUpDownOnRightOnclick(String upDownOnRightOnclick) {
this.upDownOnRightOnclick = upDownOnRightOnclick;
}
public String getUpDownOnRightOnclick() {
return this.upDownOnRightOnclick;
}
@StrutsTagAttribute(description="Javascript to run after Select All button pressed")
public void setSelectAllOnclick(String selectAllOnclick) {
this.selectAllOnclick = selectAllOnclick;
}
public String getSelectAllOnclick() {
return this.selectAllOnclick;
}
}
@@ -48,19 +48,19 @@ import com.opensymphony.xwork2.util.ValueStack;
* <p/> <b>Examples</b>
* <pre>
* <!-- START SNIPPET: example -->
* &lt;s:submit value="%{'Submit the form'}" /&gt;
* &lt;s:submit value="%{'Submit'}" /&gt;
* <!-- END SNIPPET: example -->
* </pre>
* <pre>
* <!-- START SNIPPET: example2 -->
* Render an image submit:
* &lt;s:submit type="image" value="%{'Submit the form'}" src="submit.gif"/&gt;
* &lt;s:submit type="image" value="%{'Submit'}" label="Submit the form" src="submit.gif"/&gt;
* <!-- END SNIPPET: example2 -->
* </pre>
* <pre>
* <!-- START SNIPPET: example3 -->
* Render an button submit:
* &lt;s:submit type="button" value="%{'Submit the form'}"/&gt;
* &lt;s:submit type="button" value="%{'Submit'}" label="Submit the form"/&gt;
* <!-- END SNIPPET: example3 -->
* </pre>
*
@@ -32,11 +32,6 @@ import com.opensymphony.xwork2.util.ValueStack;
* <!-- START SNIPPET: javadoc -->
* The tabbedpanel widget is primarily an AJAX component, where each tab can either be local content or remote
* content (refreshed each time the user selects that tab).</p>
* If the useSelectedTabCookie attribute is set to true, the id of the selected tab is saved in a cookie on activation.
* When coming back to this view, the cookie is read and the tab will be activated again, unless an actual value for the
* selectedTab attribute is specified.</p>
* If you want to use the cookie feature, please be sure that you provide a unique id for your tabbedpanel component,
* since this will also be the identifying name component of the stored cookie.</p>
* <!-- END SNIPPET: javadoc -->
*
* <p/> <b>Examples</b>
@@ -72,7 +67,6 @@ public class TabbedPanel extends ClosingUIBean {
protected String closeButton;
protected String doLayout ;
protected String templateCssPath;
protected String useSelectedTabCookie;
public TabbedPanel(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
super(stack, request, response);
@@ -98,9 +92,6 @@ public class TabbedPanel extends ClosingUIBean {
}
if(templateCssPath != null)
addParameter("templateCssPath", findString(templateCssPath));
if(useSelectedTabCookie != null) {
addParameter("useSelectedTabCookie", findString(useSelectedTabCookie));
}
}
public String getDefaultOpenTemplate() {
@@ -141,11 +132,4 @@ public class TabbedPanel extends ClosingUIBean {
public void setTemplateCssPath(String templateCssPath) {
this.templateCssPath = templateCssPath;
}
@StrutsTagAttribute(required = false, defaultValue = "false", description = "If set to true, the id of the last selected " +
"tab will be stored in cookie. If the view is rendered, it will be tried to read this cookie and activate " +
"the corresponding tab on success, unless overridden by the selectedTab attribute. The cookie name is \"Struts2TabbedPanel_selectedTab_\"+id.")
public void setUseSelectedTabCookie( String useSelectedTabCookie ) {
this.useSelectedTabCookie = useSelectedTabCookie;
}
}
@@ -790,20 +790,6 @@ public abstract class UIBean extends Component {
}
}
/**
* Ensures an unescaped attribute value cannot be vulnerable to XSS attacks
*
* @param val The value to check
* @return The escaped value
*/
protected String ensureAttributeSafelyNotEscaped(String val) {
if (val != null) {
return val.replaceAll("\"", "&#34;");
} else {
return "";
}
}
protected void evaluateExtraParams() {
}
@@ -866,8 +852,7 @@ public abstract class UIBean extends Component {
/**
* Create HTML id element for the component and populate this component parmaeter
* map. Additionally, a parameter named escapedId is populated which contains the found id value filtered by
* {@link #escape(String)}, needed eg. for naming Javascript identifiers based on the id value.
* map.
*
* The order is as follows :-
* <ol>
@@ -879,22 +864,19 @@ public abstract class UIBean extends Component {
* @param form
*/
protected void populateComponentHtmlId(Form form) {
String tryId;
if (id != null) {
// this check is needed for backwards compatibility with 2.1.x
if (altSyntax()) {
tryId = findString(id);
addParameter("id", findString(id));
} else {
tryId = id;
addParameter("id", id);
}
} else if (form != null) {
tryId = form.getParameters().get("id") + "_"
+ escape(name != null ? findString(name) : null);
addParameter("id", form.getParameters().get("id") + "_"
+ escape(name != null ? findString(name) : null));
} else {
tryId = escape(name != null ? findString(name) : null);
addParameter("id", escape(name != null ? findString(name) : null));
}
addParameter("id", tryId);
addParameter("escapedId", escape(tryId));
}
@StrutsTagAttribute(description="The template directory.")
@@ -921,7 +903,7 @@ public abstract class UIBean extends Component {
this.cssClass = cssClass;
}
@StrutsTagAttribute(description="The css style definitions for element to use")
@StrutsTagAttribute(description="The css style definitions for element ro use")
public void setCssStyle(String cssStyle) {
this.cssStyle = cssStyle;
}
@@ -53,12 +53,6 @@ import com.opensymphony.xwork2.util.ValueStack;
* additional request parameters.</p>
*
* <b>NOTE:</b>
* <p>By default request parameters will be separated using escaped ampersands (i.e., &amp;amp;).
* This is necessary for XHTML compliance, however, when using the URL generated by this tag
* with the &lt;s:property&gt; tag, the <b>escapeAmp</b> attribute should be used to disable
* ampersand escaping.</p>
*
* <b>NOTE:</b>
* <p>When includeParams is 'all' or 'get', the parameter defined in param tag will take
* precedence and will not be overriden if they exists in the parameter submitted. For
* example, in Example 3 below, if there is a id parameter in the url where the page this
@@ -74,21 +68,16 @@ import com.opensymphony.xwork2.util.ValueStack;
* <ul>
* <li>action (String) - (value or action choose either one, if both exist value takes precedence) action's name (alias) <li>
* <li>value (String) - (value or action choose either one, if both exist value takes precedence) the url itself</li>
* <li>scheme (String) - http scheme (http, https) defaults to the scheme this request is in</li>
* <li>scheme (String) - http scheme (http, https) default to the scheme this request is in</li>
* <li>namespace - action's namespace</li>
* <li>method (String) - action's method name, defaults to 'execute'</li>
* <li>encode (Boolean) - url encode the generated url. Defaults to 'true'.</li>
* <li>includeParams (String) - The includeParams attribute may have the value 'none', 'get' or 'all'. Defaults to 'get'.
* <li>method (String) - action's method, default to execute() </li>
* <li>encode (Boolean) - url encode the generated url. Default is true</li>
* <li>includeParams (String) - The includeParams attribute may have the value 'none', 'get' or 'all'. Default is 'get'.
* none - include no parameters in the URL
* get - include only GET parameters in the URL (default)
* all - include both GET and POST parameters in the URL
* </li>
* <li>includeContext (Boolean) - Specifies whether to include the web app context path. Defaults to 'true'.</li>
* <li>escapeAmp (Boolean) - Specifies whether to escape ampersand (&amp;) to (&amp;amp;) or not. Defaults to 'true'.</li>
* <li>portletMode (String) - The resulting portlet mode.</li>
* <li>windowState (String) - The resulting portlet window state.</li>
* <li>portletUrlType (String) - Specifies if this should be a portlet render or action URL.</li>
* <li>forceAddSchemeHostAndPort (Boolean) - Specifies whether to force the addition of scheme, host and port or not.</li>
* <li>includeContext (Boolean) - determine wheather to include the web app context path. Default is true.</li>
* </ul>
*
* <!-- END SNIPPET: params -->
@@ -109,7 +98,7 @@ import com.opensymphony.xwork2.util.ValueStack;
*
* &lt;-- Example 3--&gt;
* &lt;s:url includeParams="get" &gt;
* &lt;s:param name="id" value="%{'22'}" /&gt;
* &lt:param name="id" value="%{'22'}" /&gt;
* &lt;/s:url&gt;
*
* <!-- END SNIPPET: example -->
@@ -146,12 +135,10 @@ public class URL extends Component {
protected String method;
protected boolean encode = true;
protected boolean includeContext = true;
protected boolean escapeAmp = true;
protected String portletMode;
protected String windowState;
protected String portletUrlType;
protected String anchor;
protected boolean forceAddSchemeHostAndPort;
protected String urlIncludeParams;
protected ExtraParameterProvider extraParameterProvider;
@@ -249,14 +236,14 @@ public class URL extends Component {
String result;
if (value == null && action != null) {
if (Dispatcher.getInstance().isPortletSupportActive() && PortletActionContext.isPortletRequest()) {
result = PortletUrlHelper.buildUrl(action, namespace, method, parameters, portletUrlType, portletMode, windowState);
if(Dispatcher.getInstance().isPortletSupportActive() && PortletActionContext.isPortletRequest()) {
result = PortletUrlHelper.buildUrl(action, namespace, parameters, portletUrlType, portletMode, windowState);
}
else {
result = determineActionURL(action, namespace, method, req, res, parameters, scheme, includeContext, encode, forceAddSchemeHostAndPort, escapeAmp);
result = determineActionURL(action, namespace, method, req, res, parameters, scheme, includeContext, encode);
}
} else {
if (Dispatcher.getInstance().isPortletSupportActive() && PortletActionContext.isPortletRequest()) {
if(Dispatcher.getInstance().isPortletSupportActive() && PortletActionContext.isPortletRequest()) {
result = PortletUrlHelper.buildResourceUrl(value, parameters);
}
else {
@@ -267,7 +254,7 @@ public class URL extends Component {
if (_value != null && _value.indexOf("?") > 0) {
_value = _value.substring(0, _value.indexOf("?"));
}
result = UrlHelper.buildUrl(_value, req, res, parameters, scheme, includeContext, encode, forceAddSchemeHostAndPort, escapeAmp);
result = UrlHelper.buildUrl(_value, req, res, parameters, scheme, includeContext, encode);
}
}
if ( anchor != null && anchor.length() > 0 ) {
@@ -306,7 +293,7 @@ public class URL extends Component {
this.value = value;
}
@StrutsTagAttribute(description="The action to generate the URL for, if not using value")
@StrutsTagAttribute(description="he action generate url for, if not using value")
public void setAction(String action) {
this.action = action;
}
@@ -326,7 +313,7 @@ public class URL extends Component {
this.encode = encode;
}
@StrutsTagAttribute(description="Whether actual context should be included in URL", type="Boolean", defaultValue="true")
@StrutsTagAttribute(description="Whether actual context should be included in url", type="Boolean", defaultValue="true")
public void setIncludeContext(boolean includeContext) {
this.includeContext = includeContext;
}
@@ -341,7 +328,7 @@ public class URL extends Component {
this.windowState = windowState;
}
@StrutsTagAttribute(description="Specifies if this should be a portlet render or action URL. Default is \"render\". To create an action URL, use \"action\".")
@StrutsTagAttribute(description="Specifies if this should be a portlet render or action url")
public void setPortletUrlType(String portletUrlType) {
this.portletUrlType = portletUrlType;
}
@@ -351,16 +338,6 @@ public class URL extends Component {
this.anchor = anchor;
}
@StrutsTagAttribute(description="Specifies whether to escape ampersand (&amp;) to (&amp;amp;) or not", type="Boolean", defaultValue="true")
public void setEscapeAmp(boolean escapeAmp) {
this.escapeAmp = escapeAmp;
}
@StrutsTagAttribute(description="Specifies whether to force the addition of scheme, host and port or not", type="Boolean", defaultValue="false")
public void setForceAddSchemeHostAndPort(boolean forceAddSchemeHostAndPort) {
this.forceAddSchemeHostAndPort = forceAddSchemeHostAndPort;
}
/**
* Merge request parameters into current parameters. If a parameter is
@@ -1,23 +1 @@
<!--
/*
* $Id: pom.xml 560558 2007-07-28 15:47:10Z apetrelli $
*
* 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.
*/
-->
<body>JSP UI tags for rendering table output in HTML.</body>
@@ -52,7 +52,7 @@ public abstract class BaseTemplateEngine implements TemplateEngine {
if (props == null) {
String propName = template.getDir() + "/" + template.getTheme() + "/"+getThemePropertiesFileName();
// WW-1292
// WW-1292
// let's try getting it from the filesystem
File propFile = new File(propName);
InputStream is = null;
@@ -77,12 +77,6 @@ public abstract class BaseTemplateEngine implements TemplateEngine {
props.load(is);
} catch (IOException e) {
LOG.error("Could not load " + propName, e);
} finally {
try {
is.close();
} catch(IOException io) {
LOG.warn("Unable to close input stream", io);
}
}
}
@@ -22,7 +22,9 @@ package org.apache.struts2.components.template;
import java.io.IOException;
import java.io.Writer;
import java.util.*;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
@@ -31,7 +33,6 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.views.freemarker.FreemarkerManager;
import com.opensymphony.xwork2.inject.Inject;
@@ -40,7 +41,8 @@ import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.util.ValueStack;
import freemarker.template.*;
import freemarker.template.Configuration;
import freemarker.template.SimpleHash;
/**
* Freemarker based template engine.
@@ -49,10 +51,6 @@ public class FreemarkerTemplateEngine extends BaseTemplateEngine {
static Class bodyContent = null;
private FreemarkerManager freemarkerManager;
private final HashMap<String, freemarker.template.Template> templates = new HashMap<String, freemarker.template.Template>();
private final HashSet<String> missingTemplates = new HashSet<String>();
private boolean freemarkerCaching = false;
static {
try {
bodyContent = ClassLoaderUtil.loadClass("javax.servlet.jsp.tagext.BodyContent",
@@ -84,40 +82,22 @@ public class FreemarkerTemplateEngine extends BaseTemplateEngine {
Configuration config = freemarkerManager.getConfiguration(servletContext);
// get the list of templates we can use
List<Template> templates = templateContext.getTemplate().getPossibleTemplates(this);
List templates = templateContext.getTemplate().getPossibleTemplates(this);
// find the right template
freemarker.template.Template template = null;
String templateName = null;
Exception exception = null;
for (Template t : templates) {
for (Iterator iterator = templates.iterator(); iterator.hasNext();) {
Template t = (Template) iterator.next();
templateName = getFinalTemplateName(t);
if (freemarkerCaching) {
if (!isTemplateMissing(templateName)) {
try {
template = findInCache(templateName); // look in cache first
if (template == null) {
// try to load, and if it works, stop at the first one
template = config.getTemplate(templateName);
addToCache(templateName, template);
}
break;
} catch (IOException e) {
addToMissingTemplateCache(templateName);
if (exception == null) {
exception = e;
}
}
}
} else {
try {
// try to load, and if it works, stop at the first one
template = config.getTemplate(templateName);
break;
} catch (IOException e) {
if (exception == null) {
exception = e;
}
try {
// try to load, and if it works, stop at the first one
template = config.getTemplate(templateName);
break;
} catch (IOException e) {
if (exception == null) {
exception = e;
}
}
}
@@ -174,40 +154,4 @@ public class FreemarkerTemplateEngine extends BaseTemplateEngine {
protected String getSuffix() {
return "ftl";
}
protected void addToMissingTemplateCache(String templateName) {
synchronized(missingTemplates) {
missingTemplates.add(templateName);
}
}
protected boolean isTemplateMissing(String templateName) {
synchronized(missingTemplates) {
return missingTemplates.contains(templateName);
}
}
protected void addToCache(String templateName,
freemarker.template.Template template) {
synchronized(templates) {
templates.put(templateName, template);
}
}
protected freemarker.template.Template findInCache(String templateName) {
synchronized(templates) {
return templates.get(templateName);
}
}
/**
* Enables or disables Struts caching of Freemarker templates. By default disabled.
* Set struts.freemarker.templatesCache=true to enable cache
* @param cacheTemplates "true" if the template engine should cache freemarker template
* internally
*/
@Inject(StrutsConstants.STRUTS_FREEMARKER_TEMPLATES_CACHE)
public void setCacheTemplates(String cacheTemplates) {
freemarkerCaching = "true".equals(cacheTemplates);
}
}
@@ -20,16 +20,19 @@
*/
package org.apache.struts2.components.template;
import com.opensymphony.xwork2.util.ValueStack;
import java.util.Iterator;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.PageContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.components.Include;
import org.apache.struts2.components.UIBean;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.PageContext;
import java.util.List;
import com.opensymphony.xwork2.util.ValueStack;
/**
* JSP based template engine.
@@ -47,10 +50,11 @@ public class JspTemplateEngine extends BaseTemplateEngine {
ValueStack stack = templateContext.getStack();
stack.push(tag);
PageContext pageContext = (PageContext) stack.getContext().get(ServletActionContext.PAGE_CONTEXT);
List<Template> templates = template.getPossibleTemplates(this);
List templates = template.getPossibleTemplates(this);
Exception exception = null;
boolean success = false;
for (Template t : templates) {
for (Iterator iterator = templates.iterator(); iterator.hasNext();) {
Template t = (Template) iterator.next();
try {
Include.include(getFinalTemplateName(t), pageContext.getOut(),
pageContext.getRequest(), (HttpServletResponse) pageContext.getResponse());
@@ -59,8 +59,8 @@ public class Template implements Cloneable {
return name;
}
public List<Template> getPossibleTemplates(TemplateEngine engine) {
List<Template> list = new ArrayList<Template>(3);
public List getPossibleTemplates(TemplateEngine engine) {
List list = new ArrayList(3);
Template template = this;
String parentTheme;
list.add(template);
@@ -20,7 +20,16 @@
*/
package org.apache.struts2.components.template;
import com.opensymphony.xwork2.inject.Inject;
import java.io.IOException;
import java.io.Writer;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.ServletActionContext;
@@ -28,13 +37,7 @@ import org.apache.struts2.views.velocity.VelocityManager;
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.context.Context;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.Writer;
import java.util.List;
import java.util.Map;
import com.opensymphony.xwork2.inject.Inject;
/**
* Velocity based template engine.
@@ -61,13 +64,14 @@ public class VelocityTemplateEngine extends BaseTemplateEngine {
VelocityEngine velocityEngine = velocityManager.getVelocityEngine();
// get the list of templates we can use
List<Template> templates = templateContext.getTemplate().getPossibleTemplates(this);
List templates = templateContext.getTemplate().getPossibleTemplates(this);
// find the right template
org.apache.velocity.Template template = null;
String templateName = null;
Exception exception = null;
for (Template t : templates) {
for (Iterator iterator = templates.iterator(); iterator.hasNext();) {
Template t = (Template) iterator.next();
templateName = getFinalTemplateName(t);
try {
// try to load, and if it works, stop at the first one
@@ -163,7 +163,6 @@ public class BeanSelectionProvider implements ConfigurationProvider {
if ("true".equalsIgnoreCase(props.getProperty(StrutsConstants.STRUTS_DEVMODE))) {
props.setProperty(StrutsConstants.STRUTS_I18N_RELOAD, "true");
props.setProperty(StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD, "true");
props.setProperty(StrutsConstants.STRUTS_FREEMARKER_TEMPLATES_CACHE, "false");
// Convert struts properties into ones that xwork expects
props.setProperty("devMode", "true");
} else {
@@ -29,7 +29,6 @@ import java.util.Properties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.StrutsException;
import org.apache.struts2.util.ClassLoaderUtils;
import com.opensymphony.xwork2.util.location.LocatableProperties;
import com.opensymphony.xwork2.util.location.Location;
@@ -54,7 +53,7 @@ class PropertiesSettings extends Settings {
*/
public PropertiesSettings(String name) {
URL settingsUrl = ClassLoaderUtils.getResource(name + ".properties", getClass());
URL settingsUrl = Thread.currentThread().getContextClassLoader().getResource(name + ".properties");
if (settingsUrl == null) {
LOG.debug(name + ".properties missing");
@@ -1,23 +1 @@
<!--
/*
* $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
*
* 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.
*/
-->
<body>Classes for Struts configuration and property handling.</body>
@@ -401,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;
}
@@ -746,15 +749,12 @@ Caused by: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyExcepti
}
} else {
try {
// WW-1977: Only put errors in the request when code is a 500 error
if (code == HttpServletResponse.SC_INTERNAL_SERVER_ERROR) {
// send a http error response to use the servlet defined error handler
// make the exception availible to the web.xml defined error page
request.setAttribute("javax.servlet.error.exception", e);
// send a http error response to use the servlet defined error handler
// make the exception availible to the web.xml defined error page
request.setAttribute("javax.servlet.error.exception", e);
// for compatibility
request.setAttribute("javax.servlet.jsp.jspException", e);
}
// for compatibility
request.setAttribute("javax.servlet.jsp.jspException", e);
// send the error response
response.sendError(code, e.getMessage());
@@ -23,9 +23,7 @@ package org.apache.struts2.dispatcher;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URL;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Enumeration;
@@ -150,12 +148,10 @@ public class FilterDispatcher implements StrutsStatics, Filter {
*/
private static final Log LOG = LogFactory.getLog(FilterDispatcher.class);
static final String DEFAULT_STATIC_PACKAGES = "org.apache.struts2.static template org.apache.struts2.interceptor.debugging";
/**
* Store set of path prefixes to use with static resources.
*/
String[] pathPrefixes;
private String[] pathPrefixes;
/**
* Provide a formatted date for setting heading information when caching static content.
@@ -205,7 +201,7 @@ public class FilterDispatcher implements StrutsStatics, Filter {
dispatcher.init();
String param = filterConfig.getInitParameter("packages");
String packages = DEFAULT_STATIC_PACKAGES;
String packages = "org.apache.struts2.static template org.apache.struts2.interceptor.debugging";
if (param != null) {
packages = param + " " + packages;
}
@@ -383,7 +379,7 @@ public class FilterDispatcher implements StrutsStatics, Filter {
*/
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;
ServletContext servletContext = getServletContext();
@@ -398,6 +394,7 @@ public class FilterDispatcher implements StrutsStatics, Filter {
} catch (Exception ex) {
LOG.error("error getting ActionMapping", ex);
dispatcher.sendError(request, response, servletContext, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, ex);
ActionContextCleanUp.cleanUp(req);
return;
}
@@ -410,7 +407,8 @@ public class FilterDispatcher implements StrutsStatics, Filter {
}
if (serveStatic && resourcePath.startsWith("/struts")) {
findStaticResource(resourcePath, findAndCheckResources(resourcePath), request, response);
String name = resourcePath.substring("/struts".length());
findStaticResource(name, request, response);
} else {
// this is a normal request, let it pass through
chain.doFilter(request, response);
@@ -419,151 +417,85 @@ public class FilterDispatcher implements StrutsStatics, Filter {
return;
}
dispatcher.serviceAction(request, response, servletContext, mapping);
} finally {
try {
ActionContextCleanUp.cleanUp(req);
dispatcher.serviceAction(request, response, servletContext, mapping);
} finally {
UtilTimerStack.pop(timerKey);
ActionContextCleanUp.cleanUp(req);
}
}
finally {
UtilTimerStack.pop(timerKey);
}
}
/**
* Locate a static resource and copy directly to the response,
* setting the appropriate caching headers.
* setting the appropriate caching headers.
*
* @param path The resource path
* @param resourceUrls List of matching resource URLs
* @param name The resource name
* @param request The request
* @param response The response
* @throws IOException If anything goes wrong
*/
public void findStaticResource(String path, List<URL> resourceUrls, HttpServletRequest request, HttpServletResponse response)
throws IOException {
for (URL resourceUrl : resourceUrls) {
InputStream is;
try {
is = resourceUrl.openStream();
} catch (Exception ex) {
// just ignore it
continue;
}
protected void findStaticResource(String name, HttpServletRequest request, HttpServletResponse response) throws IOException {
if (!name.endsWith(".class")) {
for (String pathPrefix : pathPrefixes) {
InputStream is = findInputStream(name, pathPrefix);
if (is != null) {
Calendar cal = Calendar.getInstance();
// check for if-modified-since, prior to any other headers
long ifModifiedSince = 0;
try {
ifModifiedSince = request.getDateHeader("If-Modified-Since");
} catch (Exception e) {
LOG.warn("Invalid If-Modified-Since header value: '" + request.getHeader("If-Modified-Since") + "', ignoring");
}
long lastModifiedMillis = lastModifiedCal.getTimeInMillis();
long now = cal.getTimeInMillis();
cal.add(Calendar.DAY_OF_MONTH, 1);
long expires = cal.getTimeInMillis();
if (ifModifiedSince > 0 && ifModifiedSince <= lastModifiedMillis) {
// not modified, content is not sent - only basic headers and status SC_NOT_MODIFIED
response.setDateHeader("Expires", expires);
response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
is.close();
return;
}
// set the content-type header
String contentType = getContentType(name);
if (contentType != null) {
response.setContentType(contentType);
}
//not inside the try block, as this could throw IOExceptions also
if (is != null) {
process(is, path, request, response);
return;
if (serveStaticBrowserCache) {
// set heading information for caching static content
response.setDateHeader("Date", now);
response.setDateHeader("Expires", expires);
response.setDateHeader("Retry-After", expires);
response.setHeader("Cache-Control", "public");
response.setDateHeader("Last-Modified", lastModifiedMillis);
} else {
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Pragma", "no-cache");
response.setHeader("Expires", "-1");
}
try {
copy(is, response.getOutputStream());
} finally {
is.close();
}
return;
}
}
}
response.sendError(HttpServletResponse.SC_NOT_FOUND);
}
/**
* Locate a static classpath resource and check for safety constraints.
*
* @param path The resource path to check for available resources
* @return verified classpath resource URLs
* @throws IOException If anything goes wrong
*/
protected List<URL> findAndCheckResources(String path) throws IOException {
String name = cleanupPath(path);
List<URL> resourceUrls = new ArrayList<URL>(pathPrefixes.length);
for (String pathPrefix : pathPrefixes) {
URL resourceUrl = findResource(buildPath(name, pathPrefix));
String pathEnding = buildPath(name, pathPrefix);
//check that the resource path is under the pathPrefix path
if (resourceUrl != null && resourceUrl.getFile().endsWith(pathEnding)) {
resourceUrls.add(resourceUrl);
}
}
return resourceUrls;
}
/**
* Look for a static resource in the classpath.
*
* @param path The resource path
* @return The inputstream of the resource
* @throws IOException If there is a problem locating the resource
*/
protected URL findResource(String path) throws IOException {
return ClassLoaderUtil.getResource(path, getClass());
}
/**
* @param name resource name
* @param packagePrefix The package prefix to use to locate the resource
* @return full path
* @throws java.io.UnsupportedEncodingException
* @throws IOException
*/
protected String buildPath(String name, String packagePrefix) throws UnsupportedEncodingException {
String resourcePath;
if (packagePrefix.endsWith("/") && name.startsWith("/")) {
resourcePath = packagePrefix + name.substring(1);
} else {
resourcePath = packagePrefix + name;
}
return URLDecoder.decode(resourcePath, encoding);
}
protected void process(InputStream is, String path, HttpServletRequest request, HttpServletResponse response) throws IOException {
if (is != null) {
Calendar cal = Calendar.getInstance();
// check for if-modified-since, prior to any other headers
long ifModifiedSince = 0;
try {
ifModifiedSince = request.getDateHeader("If-Modified-Since");
} catch (Exception e) {
LOG.warn("Invalid If-Modified-Since header value: '"
+ request.getHeader("If-Modified-Since") + "', ignoring");
}
long lastModifiedMillis = lastModifiedCal.getTimeInMillis();
long now = cal.getTimeInMillis();
cal.add(Calendar.DAY_OF_MONTH, 1);
long expires = cal.getTimeInMillis();
if (ifModifiedSince > 0 && ifModifiedSince <= lastModifiedMillis) {
// not modified, content is not sent - only basic
// headers and status SC_NOT_MODIFIED
response.setDateHeader("Expires", expires);
response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
is.close();
return;
}
// set the content-type header
String contentType = getContentType(path);
if (contentType != null) {
response.setContentType(contentType);
}
if (serveStaticBrowserCache) {
// set heading information for caching static content
response.setDateHeader("Date", now);
response.setDateHeader("Expires", expires);
response.setDateHeader("Retry-After", expires);
response.setHeader("Cache-Control", "public");
response.setDateHeader("Last-Modified", lastModifiedMillis);
} else {
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Pragma", "no-cache");
response.setHeader("Expires", "-1");
}
try {
copy(is, response.getOutputStream());
} finally {
is.close();
}
}
}
/**
* Determine the content type for the resource name.
*
@@ -628,13 +560,4 @@ public class FilterDispatcher implements StrutsStatics, Filter {
return ClassLoaderUtil.getResourceAsStream(resourcePath, getClass());
}
/**
* @param path requested path
* @return path without leading "/struts" or "/static"
*/
protected String cleanupPath(String path) {
//path will start with "/struts" or "/static", remove them
return path.substring(7);
}
}
@@ -23,7 +23,6 @@ package org.apache.struts2.dispatcher;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -46,6 +45,19 @@ import com.opensymphony.xwork2.inject.Inject;
* standard redirect result.
*
* <p/>
* @TODO - the below sentence is confusing and seems to be contradictory -- FIX ME
* To pass parameters, use the &lt;param&gt; ... &lt;/param&gt; tag. The following parameters will not be
* passed because they are part of the config param for this particular result.
*
* <ul>
* <li>actionName</li>
* <li>namespace</li>
* <li>method</li>
* <li>encode</li>
* <li>parse</li>
* <li>location</li>
* <li>prependServletContext</li>
* </ul>
*
* See examples below for an example of how request parameters could be passed in.
*
@@ -124,7 +136,7 @@ public class ServletActionRedirectResult extends ServletRedirectResult {
protected String namespace;
protected String method;
private Map<String, String> requestParameters = new LinkedHashMap<String, String>();
private Map<String, String> requestParameters = new HashMap<String, String>();
public ServletActionRedirectResult() {
super();
@@ -33,7 +33,7 @@ import com.opensymphony.xwork2.ActionInvocation;
/**
* <!-- START SNIPPET: description -->
*
* A custom Result type for sending raw data (via an InputStream) directly to the
* A custom Result type for send raw data (via an InputStream) directly to the
* HttpServletResponse. Very useful for allowing users to download content.
*
* <!-- END SNIPPET: description -->
@@ -117,7 +117,7 @@ public abstract class StrutsResultSupport implements Result, StrutsStatics {
}
public StrutsResultSupport(String location) {
this(location, true, false);
this(location, false, false);
}
public StrutsResultSupport(String location, boolean parse, boolean encode) {
@@ -485,17 +485,11 @@ public class DefaultActionMapper implements ActionMapper {
return uri.toString();
}
public boolean isSlashesInActionNames() {
return allowSlashesInActionNames;
}
/**
/**
* Defines a parameter action prefix
*/
interface ParameterAction {
void execute(String key, ActionMapping mapping);
}
}
@@ -21,7 +21,6 @@
package org.apache.struts2.dispatcher.mapper;
import com.opensymphony.xwork2.config.ConfigurationManager;
import com.opensymphony.xwork2.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
@@ -30,7 +29,6 @@ import java.net.URLDecoder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.StrutsConstants;
/**
* <!-- START SNIPPET: description -->
@@ -58,25 +56,16 @@ import org.apache.struts2.StrutsConstants;
* &lt;/action&gt;
* </pre>
* <p>
* This mapper supports the following parameters:
* </p>
* <ul>
* <li><code>struts.mapper.idParameterName</code> - If set, this value will be the name
* of the parameter under which the id is stored. The id will then be removed
* from the action name. This allows restful actions to not require wildcards.
* </li>
* </ul>
* <p>
* The following URL's will invoke its methods:
* </p>
* <ul>
* <li><code>GET: /movie/ => method="index"</code></li>
* <li><code>GET: /movie => method="index"</code></li>
* <li><code>GET: /movie/Thrillers => method="view", id="Thrillers"</code></li>
* <li><code>GET: /movie/Thrillers!edit => method="edit", id="Thrillers"</code></li>
* <li><code>GET: /movie/new => method="editNew"</code></li>
* <li><code>POST: /movie/ => method="create"</code></li>
* <li><code>PUT: /movie/Thrillers => method="update", id="Thrillers"</code></li>
* <li><code>DELETE: /movie/Thrillers => method="remove", id="Thrillers"</code></li>
* <li><code>GET: /movie/new => method="editNew"</code></li>
* <li><code>POST: /movie/Thrillers => method="create"</code></li>
* <li><code>PUT: /movie/ => method="update"</code></li>
* <li><code>DELETE: /movie/Thrillers => method="remove"</code></li>
* </ul>
* <p>
* To simulate the HTTP methods PUT and DELETE, since they aren't supported by HTML,
@@ -94,13 +83,7 @@ import org.apache.struts2.StrutsConstants;
public class Restful2ActionMapper extends DefaultActionMapper {
protected static final Log LOG = LogFactory.getLog(Restful2ActionMapper.class);
public static final String HTTP_METHOD_PARAM = "__http_method";
private String idParameterName = null;
public Restful2ActionMapper() {
setSlashesInActionNames("true");
}
private static final String HTTP_METHOD_PARAM = "__http_method";
/*
* (non-Javadoc)
@@ -109,9 +92,6 @@ public class Restful2ActionMapper extends DefaultActionMapper {
*/
public ActionMapping getMapping(HttpServletRequest request, ConfigurationManager configManager) {
if (!isSlashesInActionNames()) {
throw new IllegalStateException("This action mapper requires the setting 'slashesInActionNames' to be set to 'true'");
}
ActionMapping mapping = super.getMapping(request, configManager);
if (mapping == null) {
@@ -134,7 +114,7 @@ public class Restful2ActionMapper extends DefaultActionMapper {
mapping.setMethod("index");
// Creating a new entry on POST e.g. foo/
} else if (isPost(request)) {
} else if (isPut(request)) {
mapping.setMethod("create");
}
@@ -149,25 +129,14 @@ public class Restful2ActionMapper extends DefaultActionMapper {
} else if (isGet(request)) {
mapping.setMethod("view");
// Updating an item e.g. foo/1
} else if (isPost(request)) {
mapping.setMethod("update");
// Removing an item e.g. foo/1
} else if (isDelete(request)) {
mapping.setMethod("remove");
// Updating an item e.g. foo/1
} else if (isPut(request)) {
mapping.setMethod("update");
}
if (idParameterName != null) {
if (mapping.getParams() == null) {
mapping.setParams(new HashMap());
}
mapping.getParams().put(idParameterName, id);
}
}
if (idParameterName != null && lastSlashPos > -1) {
actionName = actionName.substring(0, lastSlashPos);
}
}
@@ -236,15 +205,4 @@ public class Restful2ActionMapper extends DefaultActionMapper {
}
}
public String getIdParameterName() {
return idParameterName;
}
@Inject(required=false,value=StrutsConstants.STRUTS_ID_PARAMETER_NAME)
public void setIdParameterName(String idParameterName) {
this.idParameterName = idParameterName;
}
}
@@ -115,12 +115,6 @@ public class JakartaMultiPartRequest implements MultiPartRequest {
} else {
log.debug("Item is a file upload");
// Skip file uploads that don't have a file name - meaning that no file was selected.
if (item.getName() == null || item.getName().trim().length() < 1) {
log.debug("No file has been uploaded for the field: " + item.getFieldName());
continue;
}
List<FileItem> values;
if (files.get(item.getFieldName()) != null) {
values = files.get(item.getFieldName());
@@ -1,23 +1 @@
<!--
/*
* $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.
*/
-->
<body>Classes to help dispatch multipart HTTP requests.</body>
@@ -1,23 +1 @@
<!--
/*
* $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.
*/
-->
<body>Classes for action dispatching in Struts (the Controller part of MVC).</body>
@@ -202,19 +202,17 @@ public class CookieInterceptor extends AbstractInterceptor {
Map cookiesMap = new LinkedHashMap();
Cookie cookies[] = request.getCookies();
if (cookies != null) {
for (int a=0; a< cookies.length; a++) {
String name = cookies[a].getName();
String value = cookies[a].getValue();
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);
}
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);
}
}
@@ -26,10 +26,10 @@ import java.util.Map;
/**
* Actions that want access to the user's HTTP session should implement this interface.<p>
* <p/>
* This will give them access to a Map where they can put objects that can be made available
* to subsequent requests.<p/>
* This interface is only relevant if the Action is used in a servlet environment.<p>
* <p/>
* Typical uses may be cached user data such as name, or a shopping cart.
* Note that using this interface makes the Action tied to a servlet environment, so it should be
* avoided if possible since things like unit testing will become more difficult.
*
*/
public interface SessionAware {
@@ -103,24 +103,4 @@ public interface PortletActionConstants {
* {@link org.apache.struts2.portlet.context.PortletActionContext}.
*/
String DEFAULT_ACTION_FOR_MODE = "struts.portlet.defaultActionForMode";
/**
* Key for request attribute indicating if the action has been reset.
*/
String ACTION_RESET = "struts.portlet.actionReset";
/**
* Key for session attribute indicating the location of the render direct action.
*/
String RENDER_DIRECT_LOCATION = "struts.portlet.renderDirectLocation";
/**
* Session key where the value stack from the event phase is stored.
*/
String STACK_FROM_EVENT_PHASE = "struts.portlet.valueStackFromEventPhase";
/**
* Default name of dispatcher servlet in web.xml
*/
String DEFAULT_DISPATCHER_SERVLET_NAME = "Struts2PortletDispatcherServlet";
}
@@ -22,11 +22,16 @@ package org.apache.struts2.portlet.context;
import java.util.Map;
import javax.portlet.*;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletConfig;
import javax.portlet.PortletRequest;
import javax.portlet.PortletResponse;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import org.apache.struts2.portlet.PortletActionConstants;
import org.apache.struts2.StrutsStatics;
import com.opensymphony.xwork2.ActionContext;
@@ -189,12 +194,4 @@ public class PortletActionContext implements PortletActionConstants {
return (Map)getContext().get(MODE_NAMESPACE_MAP);
}
/**
* Get the portlet context.
* @return The portlet context.
*/
public static PortletContext getPortletContext() {
return (PortletContext)getContext().get(StrutsStatics.STRUTS_PORTLET_CONTEXT);
}
}
@@ -0,0 +1,66 @@
/*
* $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.portlet.context;
import java.io.IOException;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.StrutsStatics;
import com.opensymphony.xwork2.ActionContext;
/**
* Since a portlet is not dispatched the same way as a servlet, the
* {@link org.apache.struts2.ServletActionContext} is not immediately available, as it
* depends on objects from the servlet API. However, the WW2 view implementations require access
* to the objects in the {@link org.apache.struts2.ServletActionContext}, and this servlet
* makes sure that these are available when the portlet actions are executing the render results.
*
*/
public class PreparatorServlet extends HttpServlet implements StrutsStatics {
private static final long serialVersionUID = 1853399729352984089L;
private final static Log LOG = LogFactory.getLog(PreparatorServlet.class);
/**
* Prepares the {@link org.apache.struts2.ServletActionContext} with the
* {@link ServletContext}, {@link HttpServletRequest} and {@link HttpServletResponse}.
*/
public void service(HttpServletRequest servletRequest,
HttpServletResponse servletResponse) throws ServletException,
IOException {
LOG.debug("Preparing servlet objects for dispatch");
ServletContext ctx = getServletContext();
ActionContext.getContext().put(SERVLET_CONTEXT, ctx);
ActionContext.getContext().put(HTTP_REQUEST, servletRequest);
ActionContext.getContext().put(HTTP_RESPONSE, servletResponse);
LOG.debug("Preparation complete");
}
}
@@ -0,0 +1,63 @@
/*
* $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.portlet.context;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
/**
* Some of the factory/managers (e.g. the ObjectFactory) need access to
* the {@link org.apache.struts2.ServletActionContext} object when initializing.
* This {@link javax.servlet.ServletContextListener} keeps a reference to the
* {@link javax.servlet.ServletContext} and exposes it through a <code>public static</code>
* method.
*
*/
public class ServletContextHolderListener implements ServletContextListener {
private static ServletContext context = null;
/**
* @return The current servlet context
*/
public static ServletContext getServletContext() {
return context;
}
/**
* Stores the reference to the {@link ServletContext}.
*
* @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent)
*/
public void contextInitialized(ServletContextEvent event) {
context = event.getServletContext();
}
/**
* @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent)
*/
public void contextDestroyed(ServletContextEvent event) {
context = null;
}
}
@@ -23,10 +23,6 @@ package org.apache.struts2.portlet.dispatcher;
import com.opensymphony.xwork2.Action;
import java.io.Serializable;
import java.util.Map;
import org.apache.struts2.interceptor.SessionAware;
import org.apache.struts2.portlet.PortletActionConstants;
/**
* When a portlet is targetted for an <code>event</code>, the portlet will receive two
@@ -42,7 +38,7 @@ import org.apache.struts2.portlet.PortletActionConstants;
* specifying this action and the location of the view, which then will be executed in the
* following render request.
*/
public class DirectRenderFromEventAction implements SessionAware, PortletActionConstants, Action, Serializable {
public class DirectRenderFromEventAction implements Action, Serializable {
private static final long serialVersionUID = -1814807772308405785L;
@@ -57,6 +53,15 @@ public class DirectRenderFromEventAction implements SessionAware, PortletActionC
return location;
}
/**
* Set the location of the view.
*
* @param location The location to set.
*/
public void setLocation(String location) {
this.location = location;
}
/**
* Always return success.
*
@@ -65,8 +70,4 @@ public class DirectRenderFromEventAction implements SessionAware, PortletActionC
public String execute() throws Exception {
return SUCCESS;
}
public void setSession(Map session) {
location = (String)session.get(RENDER_DIRECT_LOCATION);
}
}
@@ -20,14 +20,23 @@
*/
package org.apache.struts2.portlet.dispatcher;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.ActionProxyFactory;
import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.util.FileManager;
import com.opensymphony.xwork2.util.LocalizedTextUtil;
import com.opensymphony.xwork2.util.TextUtils;
import java.io.IOException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.GenericPortlet;
import javax.portlet.PortletConfig;
import javax.portlet.PortletException;
import javax.portlet.PortletMode;
import javax.portlet.PortletRequest;
import javax.portlet.PortletResponse;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.StrutsConstants;
@@ -44,20 +53,19 @@ import org.apache.struts2.portlet.PortletApplicationMap;
import org.apache.struts2.portlet.PortletRequestMap;
import org.apache.struts2.portlet.PortletSessionMap;
import org.apache.struts2.portlet.context.PortletActionContext;
import org.apache.struts2.portlet.servlet.PortletServletContext;
import org.apache.struts2.portlet.servlet.PortletServletRequest;
import org.apache.struts2.portlet.servlet.PortletServletResponse;
import org.apache.struts2.portlet.context.ServletContextHolderListener;
import org.apache.struts2.portlet.util.HttpServletRequestMock;
import org.apache.struts2.util.AttributeMap;
import javax.portlet.*;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import com.opensymphony.xwork2.util.FileManager;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.ActionProxyFactory;
import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.util.LocalizedTextUtil;
import com.opensymphony.xwork2.util.TextUtils;
/**
* <!-- START SNIPPET: javadoc -->
@@ -68,7 +76,7 @@ import java.util.Map;
* </p>
* <!-- END SNIPPET: javadoc -->
*
* @author Nils-Helge Garli
* @author <a href="nils-helge.garli@bekk.no">Nils-Helge Garli </a>
* @author Rainer Hermanns
*
* <p><b>Init parameters</b></p>
@@ -179,10 +187,9 @@ public class Jsr168Dispatcher extends GenericPortlet implements StrutsStatics,
String value = cfg.getInitParameter(name);
params.put(name, value);
}
// TODO: CHECK IF NEEDED (RG Portlet Refactoring Backports)
Dispatcher.setPortletSupportActive(true);
dispatcherUtils = new Dispatcher(new PortletServletContext(cfg.getPortletContext()), params);
dispatcherUtils = new Dispatcher(ServletContextHolderListener.getServletContext(), params);
dispatcherUtils.init();
// For testability
@@ -293,7 +300,6 @@ public class Jsr168Dispatcher extends GenericPortlet implements StrutsStatics,
LOG.debug("Entering render");
resetActionContext();
response.setTitle(getTitle(request));
if(!request.getWindowState().equals(WindowState.MINIMIZED)) {
try {
// Check to see if an event set the render to be included directly
serviceAction(request, response, getActionMapping(request),
@@ -304,7 +310,6 @@ public class Jsr168Dispatcher extends GenericPortlet implements StrutsStatics,
} finally {
resetActionContext();
}
}
}
/**
@@ -331,22 +336,11 @@ public class Jsr168Dispatcher extends GenericPortlet implements StrutsStatics,
*/
public HashMap createContextMap(Map requestMap, Map parameterMap,
Map sessionMap, Map applicationMap, PortletRequest request,
PortletResponse response, PortletConfig portletConfig, Integer phase) throws IOException {
PortletResponse response, PortletConfig portletConfig, Integer phase) {
// TODO Must put http request/response objects into map for use with
// ServletActionContext
HttpServletResponse dummyResponse = new PortletServletResponse(response);
HttpServletRequest dummyRequest = new PortletServletRequest(request, getPortletContext());
ServletContext dummyServletContext = new PortletServletContext(getPortletContext());
if(EVENT_PHASE.equals(phase)) {
dummyRequest = dispatcherUtils.wrapRequest(dummyRequest, dummyServletContext);
}
HashMap<String,Object> extraContext = new HashMap<String,Object>();
// The dummy servlet objects. Eases reuse of existing interceptors that uses the servlet objects.
extraContext.put(StrutsStatics.HTTP_REQUEST, dummyRequest);
extraContext.put(StrutsStatics.HTTP_RESPONSE, dummyResponse);
extraContext.put(StrutsStatics.SERVLET_CONTEXT, dummyServletContext);
// End dummy servlet objects
extraContext.put(ActionContext.PARAMETERS, parameterMap);
extraContext.put(ActionContext.SESSION, sessionMap);
extraContext.put(ActionContext.APPLICATION, applicationMap);
@@ -403,13 +397,13 @@ public class Jsr168Dispatcher extends GenericPortlet implements StrutsStatics,
Map sessionMap, Map applicationMap, String portletNamespace,
Integer phase) throws PortletException {
LOG.debug("serviceAction");
HashMap extraContext = createContextMap(requestMap, parameterMap,
sessionMap, applicationMap, request, response,
getPortletConfig(), phase);
String actionName = mapping.getName();
String namespace = mapping.getNamespace();
Dispatcher.setInstance(dispatcherUtils);
try {
HashMap extraContext = createContextMap(requestMap, parameterMap,
sessionMap, applicationMap, request, response,
getPortletConfig(), phase);
LOG.debug("Creating action proxy for name = " + actionName
+ ", namespace = " + namespace);
ActionProxy proxy = factory.createActionProxy(namespace,
@@ -417,7 +411,27 @@ public class Jsr168Dispatcher extends GenericPortlet implements StrutsStatics,
proxy.setMethod(mapping.getMethod());
request.setAttribute("struts.valueStack", proxy.getInvocation()
.getStack());
if (PortletActionConstants.RENDER_PHASE.equals(phase)
&& TextUtils.stringSet(request
.getParameter(EVENT_ACTION))) {
ActionProxy action = (ActionProxy) request.getPortletSession()
.getAttribute(EVENT_ACTION);
if (action != null) {
ValueStack stack = proxy.getInvocation().getStack();
Object top = stack.pop();
stack.push(action.getInvocation().getAction());
stack.push(top);
}
}
proxy.execute();
if (PortletActionConstants.EVENT_PHASE.equals(phase)) {
// Store the executed action in the session for retrieval in the
// render phase.
ActionResponse actionResp = (ActionResponse) response;
request.getPortletSession().setAttribute(EVENT_ACTION, proxy);
actionResp.setRenderParameter(EVENT_ACTION, "true");
}
} catch (ConfigurationException e) {
LOG.error("Could not find action", e);
throw new PortletException("Could not find action " + actionName, e);
@@ -453,18 +467,20 @@ public class Jsr168Dispatcher extends GenericPortlet implements StrutsStatics,
ActionMapping mapping = null;
String actionPath = null;
if (resetAction(request)) {
mapping = actionMap.get(request.getPortletMode());
mapping = (ActionMapping) actionMap.get(request.getPortletMode());
} else {
actionPath = request.getParameter(ACTION_PARAM);
if (!TextUtils.stringSet(actionPath)) {
mapping = actionMap.get(request
mapping = (ActionMapping) actionMap.get(request
.getPortletMode());
} else {
// Use the usual action mapper, but it is expecting an action extension
// on the uri, so we add the default one, which should be ok as the
// portlet is a portlet first, a servlet second
PortletServletRequest httpRequest = new PortletServletRequest(request, getPortletContext());
HttpServletRequestMock httpRequest = new HttpServletRequestMock()
.setServletPath(actionPath + ".action")
.setParameterMap(request.getParameterMap());
mapping = actionMapper.getMapping(httpRequest, dispatcherUtils.getConfigurationManager());
}
}
@@ -568,12 +584,6 @@ public class Jsr168Dispatcher extends GenericPortlet implements StrutsStatics,
reset = true;
}
}
if(reset) {
request.setAttribute(ACTION_RESET, Boolean.TRUE);
}
else {
request.setAttribute(ACTION_RESET, Boolean.FALSE);
}
return reset;
}

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