Compare commits

...

221 Commits

Author SHA1 Message Date
Ted Nathan Husted 2ac88b92f1 [maven-scm] copy for tag struts2-parent-2.0.10
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/struts2-parent-2.0.10@574411 13f79535-47bb-0310-9956-ffa450edef68
2007-09-10 23:56:07 +00:00
Nils-Helge Garli 6793ca3737 WW-2164 Backport to 2.0.x branch for error in url when namespace is blank.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@574349 13f79535-47bb-0310-9956-ffa450edef68
2007-09-10 19:55:07 +00:00
Antonio Petrelli b2dc2d3e0e WW-2075
Merge from trunk to STRUTS_2_0_X.
Added configuration to "struts-parent".

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@574268 13f79535-47bb-0310-9956-ffa450edef68
2007-09-10 14:49:47 +00:00
James Holmes f69f5bd22f Fix typo.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@572864 13f79535-47bb-0310-9956-ffa450edef68
2007-09-05 02:42:24 +00:00
Donald J. Brown afe66729d2 Added better error message when a Struts tag is used w/o its filter
WW-1969


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@572226 13f79535-47bb-0310-9956-ffa450edef68
2007-09-03 03:25:47 +00:00
Donald J. Brown 6d7038d9ee Fixing j5-j6 bug in test WW-2045
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@572220 13f79535-47bb-0310-9956-ffa450edef68
2007-09-03 02:46:43 +00:00
James Holmes 7705a823d0 WW-2135 The FreeMarker tag name for the DateTimePicker doesn't match TLD
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@570529 13f79535-47bb-0310-9956-ffa450edef68
2007-08-28 19:04:52 +00:00
James Holmes 7e52314ff9 WW-2142 input streams need to be explicitly closed
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@570513 13f79535-47bb-0310-9956-ffa450edef68
2007-08-28 18:14:00 +00:00
Nils-Helge Garli 16cf6524e4 WW-2105 Added redirectAction-example
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@569333 13f79535-47bb-0310-9956-ffa450edef68
2007-08-24 10:30:27 +00:00
Nils-Helge Garli 76e76ffe95 Backported changes to portlet sample application from 2.1
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@569307 13f79535-47bb-0310-9956-ffa450edef68
2007-08-24 09:16:30 +00:00
Nils-Helge Garli 21ae89b1a8 WW-2013 Backport to 2.0.x
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@569305 13f79535-47bb-0310-9956-ffa450edef68
2007-08-24 09:13:29 +00:00
Nils-Helge Garli da14faef1e WW-1713 Backport to 2.0.x
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@569304 13f79535-47bb-0310-9956-ffa450edef68
2007-08-24 09:12:20 +00:00
René Gielen accd8b1761 WW-1989, WW-2052, WW-2053, WW-2101, WW-2105:
Backporting portlet servlet wrapping, portlet redirect/redirectAction result and related issues to 2.0.x

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@568896 13f79535-47bb-0310-9956-ffa450edef68
2007-08-23 09:05:56 +00:00
René Gielen a794a46e37 WW-1989, WW-2052, WW-2053, WW-2101, WW-2105:
Backporting portlet servlet wrapping, portlet redirect/redirectAction result and related issues to 2.0.x

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@568895 13f79535-47bb-0310-9956-ffa450edef68
2007-08-23 08:57:36 +00:00
René Gielen 34591eb73a WW-1989, WW-2052, WW-2053, WW-2101, WW-2105:
Backporting portlet servlet wrapping, portlet redirect/redirectAction result and related issues to 2.0.x

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@568894 13f79535-47bb-0310-9956-ffa450edef68
2007-08-23 08:54:10 +00:00
René Gielen e87f7868c1 WW-1989, WW-2052, WW-2053, WW-2101, WW-2105:
Backporting portlet servlet wrapping, portlet redirect/redirectAction result and related issues to 2.0.x

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@568892 13f79535-47bb-0310-9956-ffa450edef68
2007-08-23 08:51:20 +00:00
René Gielen 87f408fd81 WW-1989, WW-2052, WW-2053, WW-2101, WW-2105:
Backporting portlet servlet wrapping, portlet redirect/redirectAction result and related issues to 2.0.x

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@568888 13f79535-47bb-0310-9956-ffa450edef68
2007-08-23 08:48:28 +00:00
James Holmes 4c851bb36c WW-2015 url tag, method attribute not evaluating expressions (ognl)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@566730 13f79535-47bb-0310-9956-ffa450edef68
2007-08-16 14:32:53 +00:00
James Holmes 67066e0ded WW-1977 Struts throws stack trace instead of 404 when an action doesn't exist
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@566474 13f79535-47bb-0310-9956-ffa450edef68
2007-08-16 02:55:44 +00:00
James Holmes bd2eb6b8f8 WW-2115 Add Portuguese translation of struts-messages.properties
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@566417 13f79535-47bb-0310-9956-ffa450edef68
2007-08-15 23:59:21 +00:00
James Holmes e89e5934da WW-2115 Add Portuguese translation of struts-messages.properties
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@566414 13f79535-47bb-0310-9956-ffa450edef68
2007-08-15 23:58:15 +00:00
James Holmes 53d1d54536 WW-2103 Invalid Javascript generated for StringLength validator
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@566209 13f79535-47bb-0310-9956-ffa450edef68
2007-08-15 14:55:54 +00:00
James Holmes 6a2daa73cf WW-2058 Client side validation in xhtml template and clearErrorMessages not working in firefox with hidden fields
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@566190 13f79535-47bb-0310-9956-ffa450edef68
2007-08-15 14:35:19 +00:00
James Mitchell 91bbaf81cb WW-2089 align jetty config as to what is in trunk
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@565854 13f79535-47bb-0310-9956-ffa450edef68
2007-08-14 18:50:57 +00:00
James Holmes 7323b8176e WW-2110 css_xhtml checkbox.ftl renders one </div> to many when no label exists
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@565842 13f79535-47bb-0310-9956-ffa450edef68
2007-08-14 17:25:15 +00:00
James Holmes 09628422b9 WW-1761 templates don't specify type="text/javascript"; break W3C validation
Fixed issue of extra type="text/javascript" that was added during the fix for the original opening of the WW-1761 ticket.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@565752 13f79535-47bb-0310-9956-ffa450edef68
2007-08-14 13:45:49 +00:00
René Gielen 4717110ea2 WW-2109:
id resolution for <s:form> - minor cleanups

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@565746 13f79535-47bb-0310-9956-ffa450edef68
2007-08-14 13:40:12 +00:00
René Gielen 065844e9bf WW-2109:
- "Intelligent" id resolution for <s:form> does not work as documented
- minor cleanups

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@565697 13f79535-47bb-0310-9956-ffa450edef68
2007-08-14 10:28:35 +00:00
René Gielen 28d5931300 WW-2109:
"Intelligent" id resolution for <s:form> does not work as documented

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@565695 13f79535-47bb-0310-9956-ffa450edef68
2007-08-14 10:21:53 +00:00
René Gielen 2fa6e12b41 WW-1993:
Clarification about XWorks's new DefaultObjectDeterminer which includes the generics funtionailty of deprecated GenericsObjectDeterminer

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@565686 13f79535-47bb-0310-9956-ffa450edef68
2007-08-14 10:02:21 +00:00
James Holmes a96e4bc920 WW-1950 UrlHelper.buildUrl does not output port even if forceAddSchemeHostAndPort turned on (TestCase included)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@565492 13f79535-47bb-0310-9956-ffa450edef68
2007-08-13 20:00:08 +00:00
James Holmes 1dcfb715c7 WW-1948 s:url tag does not provide forceAddSchemeHostAndPort parameter
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@565422 13f79535-47bb-0310-9956-ffa450edef68
2007-08-13 17:09:16 +00:00
René Gielen 02c7107516 WW-2108:
Make <s:tabbedpanel> being able to remember last selected tab using a cookie

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@565265 13f79535-47bb-0310-9956-ffa450edef68
2007-08-13 08:18:07 +00:00
Donald J. Brown 00cf94d8e5 Turning off JSP EL for all Struts 2 tag attributes, as they are all processed for OGNL
expressions
WW-2107


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@565259 13f79535-47bb-0310-9956-ffa450edef68
2007-08-13 07:55:18 +00:00
James Mitchell df634942e5 WW-2060 remove exclusion reference to domTT.js, which is not even in svn
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@563502 13f79535-47bb-0310-9956-ffa450edef68
2007-08-07 13:58:00 +00:00
James Mitchell 2b96ceaaa1 WW-2054 fix simple typos
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@563491 13f79535-47bb-0310-9956-ffa450edef68
2007-08-07 13:05:43 +00:00
James Mitchell 3e6d92462c WW-2060 add credit where credit is due
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@563483 13f79535-47bb-0310-9956-ffa450edef68
2007-08-07 13:00:08 +00:00
James Holmes 8f18766de8 Fix typos.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@562019 13f79535-47bb-0310-9956-ffa450edef68
2007-08-02 05:28:56 +00:00
James Holmes 57b5229afd Fix typos.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@562016 13f79535-47bb-0310-9956-ffa450edef68
2007-08-02 05:15:23 +00:00
James Holmes 24940124fc WW-2080 actionError, actionMessage and fieldError Freemarker templates do not honor the cssClass and cssStyle attributes
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@561850 13f79535-47bb-0310-9956-ffa450edef68
2007-08-01 16:02:23 +00:00
James Holmes 13bd5c8b3e Fix typo.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@561842 13f79535-47bb-0310-9956-ffa450edef68
2007-08-01 15:32:30 +00:00
James Holmes 011021a77f Fix typo.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@561837 13f79535-47bb-0310-9956-ffa450edef68
2007-08-01 15:19:22 +00:00
James Holmes ab035f743d Fix typo.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@561831 13f79535-47bb-0310-9956-ffa450edef68
2007-08-01 15:16:04 +00:00
James Holmes 2735f31349 Log a warning if user specifies a namespace and action with the <s:form> tag and the action is not found in the namespace. Right now this fails silently and the user gets an HTTP 404 typically. I've had this happen to me and it took a little while to realize I had the wrong namespace or action name. This warning should help users figure out the issue faster by giving them a heads up.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@561617 13f79535-47bb-0310-9956-ffa450edef68
2007-08-01 01:08:36 +00:00
James Holmes 01705e68ec Fix typos.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@561601 13f79535-47bb-0310-9956-ffa450edef68
2007-07-31 23:54:34 +00:00
James Holmes 9ed9973e1f Fix formatting to be all spaces instead of a mix of spaces and tabs.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@561222 13f79535-47bb-0310-9956-ffa450edef68
2007-07-31 02:57:33 +00:00
James Holmes f11cc5c69c Specify XML version and encoding.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@561220 13f79535-47bb-0310-9956-ffa450edef68
2007-07-31 02:45:40 +00:00
James Holmes db3b2c6b4b Fix formatting to be all spaces instead of a mix of spaces and tabs. Also fix init param comments that were incorrect.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@561217 13f79535-47bb-0310-9956-ffa450edef68
2007-07-31 02:35:32 +00:00
René Gielen 7b5a6d4b38 Code cleanups / generification
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@560894 13f79535-47bb-0310-9956-ffa450edef68
2007-07-30 09:05:32 +00:00
René Gielen acc7495fe9 WW-1661:
Backporting Freemarker template caching to 2.0.x tree

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@560881 13f79535-47bb-0310-9956-ffa450edef68
2007-07-30 07:05:55 +00:00
Antonio Petrelli 7b2fb236fc WW-2049
Merge from trunk to STRUTS_2_0_X branch.
Added licenses to plugins code.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@560753 13f79535-47bb-0310-9956-ffa450edef68
2007-07-29 16:18:28 +00:00
Antonio Petrelli 5b5ac79c76 WW-2049
Added licenses specific of STRUTS_2_0_X branch.
Added configuration of RAT plugin in core/pom.xml to exclude some third-party files.


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@560697 13f79535-47bb-0310-9956-ffa450edef68
2007-07-29 08:58:03 +00:00
Antonio Petrelli c6e94237f9 WW-2049
Merge from trunk to STRUTS_2_0_X branch.
Added license to core/pom.xml.
Added configuration of RAT plugin in core/pom.xml to exclude some testing and generated files.
Third bunch of added licenses.
The STRUTS_2_0_X branch has special files that need to be license-fixed.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@560558 13f79535-47bb-0310-9956-ffa450edef68
2007-07-28 15:47:10 +00:00
Musachy Barroso e6a0b64097 WW-2048 AnchorTag has no setter method corresponding to TLD declared attribute 'onLoadJS'
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@560385 13f79535-47bb-0310-9956-ffa450edef68
2007-07-27 21:13:04 +00:00
René Gielen 29cf30f7ed WW-2007:
Fixing problems with generated javascript idetitifiers containing unescaped id parameter value

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@560260 13f79535-47bb-0310-9956-ffa450edef68
2007-07-27 14:57:26 +00:00
James Holmes 1d5b8d05a7 WW-2064 XHTML checkbox template does not include tooltip consistently
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@559846 13f79535-47bb-0310-9956-ffa450edef68
2007-07-26 15:12:01 +00:00
Antonio Petrelli 5101ea1019 WW-2049
Merge from trunk to STRUTS_2_0_X branch.
Second bunch of added licenses.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@559615 13f79535-47bb-0310-9956-ffa450edef68
2007-07-25 21:25:25 +00:00
Antonio Petrelli df8e7346c2 WW-2049
Merge from trunk to STRUTS_2_0_X branch.
Added RAT report to the site.
First bunch of corrected licenses.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@559543 13f79535-47bb-0310-9956-ffa450edef68
2007-07-25 18:05:51 +00:00
James Holmes 5bbc080605 WW-1911 File Upload: content-type validation fails when no file is uploaded
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@559304 13f79535-47bb-0310-9956-ffa450edef68
2007-07-25 03:39:12 +00:00
James Holmes aa17d06e76 WW-1938 Bug with multiple s:param tags inside s:url tag
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@559146 13f79535-47bb-0310-9956-ffa450edef68
2007-07-24 18:15:13 +00:00
James Holmes 8c11875991 WW-2038 Extra carriage returns in simple theme templates
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@558925 13f79535-47bb-0310-9956-ffa450edef68
2007-07-24 04:29:25 +00:00
Ted Nathan Husted 0364dfa037 WW-2054 Update POM for Struts 2.0.10-SNAPSHOT.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@558852 13f79535-47bb-0310-9956-ffa450edef68
2007-07-23 20:18:39 +00:00
Ted Nathan Husted 43d490927d WW-1974 Update POM for Struts 2.0.9. Small changes to Showcase prompts. See issue comment, items (5)-(7)
* The Ajax Hangman isn't "broken" anymore, but it does fail to report when a player wins. 
* At Validation/Field Validators <http://planetstruts.org/struts2-showcase/validation/showFieldValidatorsExamples.action>, the prompt for the date field is still misleading and encourages entry of the wrong style. 
* At Validation <http://localhost:8080/struts2-showcase/validation/index.jsp>, Validation (ajax) is no longer "broken". 


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@558747 13f79535-47bb-0310-9956-ffa450edef68
2007-07-23 14:39:55 +00:00
Ted Nathan Husted d53c2bfff3 WW-1974 Update for latest Retrotranslator.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@558690 13f79535-47bb-0310-9956-ffa450edef68
2007-07-23 11:43:05 +00:00
James Holmes a14bf5e249 Minor error message change.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@558574 13f79535-47bb-0310-9956-ffa450edef68
2007-07-23 01:01:37 +00:00
James Holmes 55a551baa2 WW-2051 add additional javascript hooks for optiontransferselect
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@558460 13f79535-47bb-0310-9956-ffa450edef68
2007-07-22 04:16:29 +00:00
Antonio Petrelli 9f68f0446c WW-1724
Merge from trunk to STRUTS_2_0_X branch.
Added code to Struts 2 showcase to show that the content type is present even with a FreeMarker result, i.e. with a FreeMarker layout page.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@558289 13f79535-47bb-0310-9956-ffa450edef68
2007-07-21 10:41:12 +00:00
James Holmes 8db503996d Fix test failures caused by the fix for WW-1887. FreeMarker was complaining about the toString() call when it was applied to the value created by this tag: <#assign itemKey = ''/>.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@557736 13f79535-47bb-0310-9956-ffa450edef68
2007-07-19 18:57:37 +00:00
Rainer Hermanns 50c3b36776 Tag doc update
Issue Number: WW-1974

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@557702 13f79535-47bb-0310-9956-ffa450edef68
2007-07-19 17:32:48 +00:00
Rainer Hermanns 329bb930f0 Updating to xwork 2.0.4 release
o xwork 2.0.4 contains the fix for the critical security issue
  (see https://issues.apache.org/struts/browse/WW-2030 for details)

Note: The xwork group id changed from 'opensymphony' to 'com.opensymphony'

Issue Number: WW-2030

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@557701 13f79535-47bb-0310-9956-ffa450edef68
2007-07-19 17:31:26 +00:00
James Holmes 3ccfbbfde0 Update to conform to the Struts 2 DTD instead of the XWork DTD.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@557691 13f79535-47bb-0310-9956-ffa450edef68
2007-07-19 17:05:24 +00:00
James Holmes b23b4f0cc3 WW-1887 struts template/simple/select.ftl error/fix
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@557644 13f79535-47bb-0310-9956-ffa450edef68
2007-07-19 14:47:28 +00:00
James Holmes ac503f6260 WW-1850 struts-default package in struts-default.xml should be abstract
This is a backport of the fix made on the trunk for 2.1.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@557639 13f79535-47bb-0310-9956-ffa450edef68
2007-07-19 14:23:05 +00:00
James Holmes 165b4e7799 WW-1854 XSLTResult excludingPattern Property is Missing
This is a backport of the fix made on the trunk for 2.1.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@557637 13f79535-47bb-0310-9956-ffa450edef68
2007-07-19 14:20:13 +00:00
James Holmes 6fcf3cfb56 WW-2020 bug in struts.xml of the portlet demo (bad result URL)
This is a backport of the fix made on the trunk for 2.1.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@557624 13f79535-47bb-0310-9956-ffa450edef68
2007-07-19 13:49:57 +00:00
James Holmes 3559945b53 Fix some typos and bad english.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@557614 13f79535-47bb-0310-9956-ffa450edef68
2007-07-19 13:28:49 +00:00
Antonio Petrelli df0084419b WW-1724
Merged from trunk to 2_0_X branch.
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/branches/STRUTS_2_0_X@557352 13f79535-47bb-0310-9956-ffa450edef68
2007-07-18 18:23:36 +00:00
James Holmes 4f11ad0878 Update docs per WW-1954.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@557348 13f79535-47bb-0310-9956-ffa450edef68
2007-07-18 18:15:37 +00:00
James Holmes 5ae898d0c8 Fix test failures caused by the fix for WW-1618. It turns out that the doubleId was not being handled consistent with the way id is handled. I updated DoubleListUIBean.java to handle doubleId the same way as id. Basically doubleId will now be assigned the same value as doubleName if doubleId does not have a value.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@557345 13f79535-47bb-0310-9956-ffa450edef68
2007-07-18 18:05:09 +00:00
James Holmes 473deb12f2 WW-2031 Update struts-2.0.dtd for empty interceptor stack
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@557317 13f79535-47bb-0310-9956-ffa450edef68
2007-07-18 16:33:55 +00:00
James Holmes 68a045ccc7 WW-1851 Struts 2.0 DTD missing "default-class-ref" element
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@557299 13f79535-47bb-0310-9956-ffa450edef68
2007-07-18 15:41:06 +00:00
James Holmes 2522690491 WW-1618 ww:doubleselect javascript uses name instead of id, resulting in array names that don't work
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@557294 13f79535-47bb-0310-9956-ffa450edef68
2007-07-18 15:26:59 +00:00
James Holmes 99be8e33cd WW-2011 Struts result are not parsed by default
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@557291 13f79535-47bb-0310-9956-ffa450edef68
2007-07-18 15:17:41 +00:00
Antonio Petrelli 350ffdcf87 WW-1992
Merge from Struts 2 trunk to 2.0 branch.
Added tiles-jsp to assembly.


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@547709 13f79535-47bb-0310-9956-ffa450edef68
2007-06-15 15:20:10 +00:00
Musachy Barroso e5b380be24 Update version number to 2.0.8
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@546850 13f79535-47bb-0310-9956-ffa450edef68
2007-06-13 12:56:06 +00:00
Antonio Petrelli 3285a37ebd WW-1973
Merge from trunk.
Updated Struts2-Tiles plugin to depend on Tiles 2.0.4.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@545186 13f79535-47bb-0310-9956-ffa450edef68
2007-06-07 14:12:59 +00:00
Rainer Hermanns d4f5483489 Updating link to 2.0.9 release notes
Issue Number: WW-1974

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@544898 13f79535-47bb-0310-9956-ffa450edef68
2007-06-06 17:51:00 +00:00
Rainer Hermanns 66a507c643 Adding a translate.sh script to backports for OSX/Linux environments
Issue Number: WW-1974

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@544884 13f79535-47bb-0310-9956-ffa450edef68
2007-06-06 16:55:42 +00:00
Rainer Hermanns 9bca8b98cc Preparing 2.0.9 development
o updating pom.xml to 2.0.9-SNAPSHOT

Issue Number: WW-1974

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@544883 13f79535-47bb-0310-9956-ffa450edef68
2007-06-06 16:54:35 +00:00
Rainer Hermanns 76b2800d18 Commenting api inclusion for assembly goal
Issue Number: WW-1834

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@544865 13f79535-47bb-0310-9956-ffa450edef68
2007-06-06 15:24:26 +00:00
Rainer Hermanns 8373599f01 Removing SNAPSHOT for Struts 2.0.8 release
o updated all pom.xml
o updated backport/translate.bat
o updated dependency on struts-annotations to 1.0.2 release

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@544857 13f79535-47bb-0310-9956-ffa450edef68
2007-06-06 14:45:50 +00:00
Musachy Barroso 70341ac8b0 Fix example typo
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@543179 13f79535-47bb-0310-9956-ffa450edef68
2007-05-31 16:28:42 +00:00
Musachy Barroso d304ea3ffd Remove confusing comment
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@543174 13f79535-47bb-0310-9956-ffa450edef68
2007-05-31 16:04:00 +00:00
Rainer Hermanns 97d6872beb Bundle XWork 2.0.3
o updating XWork dep to 2.0.3 release
o added OpenSymphony maven2 repository

Issue Number: WW-1902

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@542529 13f79535-47bb-0310-9956-ffa450edef68
2007-05-29 14:13:56 +00:00
Donald J. Brown 042e6c0422 Fixing tag output to be more xhtml compliant, adding mapper extension test
WW-1649


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@541982 13f79535-47bb-0310-9956-ffa450edef68
2007-05-27 13:04:02 +00:00
Antonio Petrelli 157cc6583c WW-1942
Merge from trunk to STRUTS_2_0_X branch.
In the URL spaces are converted into %20, while in the file must be spaces.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@541676 13f79535-47bb-0310-9956-ffa450edef68
2007-05-25 14:48:33 +00:00
Donald J. Brown 13e976f502 Fixed request parameters to use linkedhashmap
WW-1942


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@541528 13f79535-47bb-0310-9956-ffa450edef68
2007-05-25 04:01:23 +00:00
Donald J. Brown 411ffc127a Changing component parameters to use linkedHashMap (preserve order), fixed tests
to reflect this
WW-1942


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@541522 13f79535-47bb-0310-9956-ffa450edef68
2007-05-25 03:33:45 +00:00
Wendy Smoak 2c9a23eaef Use released version 2.0-alpha-4 of maven-dependency-plugin
WW-1943


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@541185 13f79535-47bb-0310-9956-ffa450edef68
2007-05-24 05:41:11 +00:00
Wendy Smoak 4a6c4ad085 Update to released 1.0-alpha-10 version of plexus-container-default.
The latest release is 1.0-alpha-24 but the plugin will not compile against it.
WW-1943


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@541178 13f79535-47bb-0310-9956-ffa450edef68
2007-05-24 05:33:05 +00:00
Wendy Smoak 53d2f7ea4a Use the 1.0-alpha-2 release (2007-03-14) of retrotranslator-maven-plugin.
WW-1943


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@541159 13f79535-47bb-0310-9956-ffa450edef68
2007-05-24 04:36:53 +00:00
Antonio Petrelli d176c997bf WW-1941
Merge from trunk to STRUTS_2_0_X branch.
Updated Struts 2 - Tiles 2 plugin to use Tiles 2.0.3 in trunk.
Updated Struts 2 showcase to the changes of Struts 2 - Tiles 2 plugin.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@540974 13f79535-47bb-0310-9956-ffa450edef68
2007-05-23 15:16:35 +00:00
Donald J. Brown d543af34cc Changing id parameter name on restful action mapper to optional
WW-1715


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@540814 13f79535-47bb-0310-9956-ffa450edef68
2007-05-23 02:46:05 +00:00
Donald J. Brown 845f524255 Fixed NPE in subset iterator tag
WW-1932


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@540569 13f79535-47bb-0310-9956-ffa450edef68
2007-05-22 12:54:52 +00:00
Donald J. Brown 6b9175c510 Better handling of requests that have no cookies
WW-1920


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@540560 13f79535-47bb-0310-9956-ffa450edef68
2007-05-22 12:31:49 +00:00
Donald J. Brown 0a70a1e477 Fixing selected item not recognized
WW-1907


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@540554 13f79535-47bb-0310-9956-ffa450edef68
2007-05-22 12:18:33 +00:00
Donald J. Brown 29b1593301 Restoring the 'id' attribute to the sort and subset tags in the tld
WW-1905


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@540552 13f79535-47bb-0310-9956-ffa450edef68
2007-05-22 12:13:00 +00:00
Donald J. Brown 77d7527d51 Improving javadoc
WW-1939


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@540146 13f79535-47bb-0310-9956-ffa450edef68
2007-05-21 13:54:32 +00:00
Donald J. Brown 4253375672 Adding ability to set id parameter automatically in restful 2 action mapper
WW-1939


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@540141 13f79535-47bb-0310-9956-ffa450edef68
2007-05-21 13:46:48 +00:00
Donald J. Brown 344eaf3e33 Added tests showing WW-1519 has been fixed
WW-1519


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@539825 13f79535-47bb-0310-9956-ffa450edef68
2007-05-20 04:28:35 +00:00
Donald J. Brown 9a278838c2 Improving opt groups to use toString on key, adding tests
WW-1672


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@539819 13f79535-47bb-0310-9956-ffa450edef68
2007-05-20 03:06:34 +00:00
Donald J. Brown d0f1acad94 Updated blank pom to use newer jetty plugin WW-1715
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@539817 13f79535-47bb-0310-9956-ffa450edef68
2007-05-20 03:02:23 +00:00
Donald J. Brown 44c2413ad2 Changed to correct snapshot jar of struts-annotations
WW-1834


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@539805 13f79535-47bb-0310-9956-ffa450edef68
2007-05-19 22:18:56 +00:00
Donald J. Brown f796b25f33 Improved how properties are loaded, added closing tr tag for debug tag
WW-1746 WW-1712


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@539688 13f79535-47bb-0310-9956-ffa450edef68
2007-05-19 05:12:22 +00:00
Musachy Barroso 862a6ed36e WW-1830 Support non-String attributes to freemarker JSP tag extensions
*  port from fix on WebWork rev 2866

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@539660 13f79535-47bb-0310-9956-ffa450edef68
2007-05-19 01:25:31 +00:00
Musachy Barroso 0a1d4d7728 WW-1858 combobox template is not correct when there is '.' in the name attribute (use id instead of name)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@539116 13f79535-47bb-0310-9956-ffa450edef68
2007-05-17 21:07:16 +00:00
Musachy Barroso 1b3f6102f6 WW-1752 cssStyle and cssClass are ignored in optiontransfer and doubleselect tags
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@539100 13f79535-47bb-0310-9956-ffa450edef68
2007-05-17 20:19:02 +00:00
Donald J. Brown 2ab4926795 Upgrading spring plugin to 2.0.5
WW-1834


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@538403 13f79535-47bb-0310-9956-ffa450edef68
2007-05-16 01:58:46 +00:00
Musachy Barroso b734e6e2e4 WW-1914 attribute tabindex does not get rendered for submit tag
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@537478 13f79535-47bb-0310-9956-ffa450edef68
2007-05-12 16:25:59 +00:00
Musachy Barroso 2f101588c9 WW-1915 Showcase App, File Download section throws Exception
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@536023 13f79535-47bb-0310-9956-ffa450edef68
2007-05-07 23:44:06 +00:00
René Gielen 30359e5f62 WW-1758:
"disabled" attribute was not rendered for <s:submit> tag - modified template, added tests

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@534889 13f79535-47bb-0310-9956-ffa450edef68
2007-05-03 14:25:50 +00:00
Musachy Barroso 3a14ddcaba Improve how the autocompleter gets the data from the JSON response (backport from 2.1)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@533542 13f79535-47bb-0310-9956-ffa450edef68
2007-04-29 18:47:31 +00:00
Donald J. Brown cae4e442ed Fixing initialisation order problem
WW-1753


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@532759 13f79535-47bb-0310-9956-ffa450edef68
2007-04-26 14:27:47 +00:00
Donald J. Brown b9d365a04c Minor javadoc fix
WW-1834


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@532363 13f79535-47bb-0310-9956-ffa450edef68
2007-04-25 14:18:34 +00:00
Donald J. Brown 34993c7473 Backporting fixes to restful2 mapper (confused post w/ put, bad docs, more tests) from trunk
WW-1834


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@531140 13f79535-47bb-0310-9956-ffa450edef68
2007-04-22 04:16:23 +00:00
Rainer Hermanns 6a46ca7fcd FilterDispatcher not always calling ActionContextCleanUp.cleanUp(Request)
o applied patch submitted by Jasper Rosenberg

Issue Number: WW-1816

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@530439 13f79535-47bb-0310-9956-ffa450edef68
2007-04-19 15:00:20 +00:00
Rainer Hermanns 13b136c559 Updated xwork dependency to release 2.0.2
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@530357 13f79535-47bb-0310-9956-ffa450edef68
2007-04-19 10:06:32 +00:00
Musachy Barroso 909f724288 WW-1886 Renaming attribute "searchLimit" to "resultsLimit" as it makes more sense
(the results are the one limited, not the search text)

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@529622 13f79535-47bb-0310-9956-ffa450edef68
2007-04-17 14:24:01 +00:00
Musachy Barroso 60b108e05e WW-1886 Add searchLimit attribute to autocompleter tag
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@529618 13f79535-47bb-0310-9956-ffa450edef68
2007-04-17 14:13:03 +00:00
Rainer Hermanns 60f1622f3d Unit Test fixes for failing tests in Bamboo
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@527824 13f79535-47bb-0310-9956-ffa450edef68
2007-04-12 07:53:39 +00:00
Rainer Hermanns d62437ee75 Upgrading surefire plugin to version 2.3 to get rid off strange unit test failures
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@527821 13f79535-47bb-0310-9956-ffa450edef68
2007-04-12 07:42:56 +00:00
Ted Nathan Husted 2543a00e62 WW-1834 Update release notes link.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@526420 13f79535-47bb-0310-9956-ffa450edef68
2007-04-07 12:16:44 +00:00
Rainer Hermanns e83468aee5 Updating the xwork dependency to 2.0.2-SNAPSHOT to fix several problems reported to XWork and S2:
WW-1635 struts.xml include dependant packages not loading properly
WW-1856 s18n tag appears to be broken

NOTE on XWork 2.x updates: All validators.xml files are now validated, a DTD header is required.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@526222 13f79535-47bb-0310-9956-ffa450edef68
2007-04-06 16:37:54 +00:00
Musachy Barroso 20f7cdc513 WW-1869 Dojo ContentPane fails to parse paths with "!"
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@525342 13f79535-47bb-0310-9956-ffa450edef68
2007-04-04 00:46:57 +00:00
René Gielen 652cd4a899 WW-1856:
Use changed TextProviderFactory (for upcoming XW 2.0.2) to fix issue with broken i18n tag / missing thread safety for TPF

See also:
http://jira.opensymphony.com/browse/XW-487
http://jira.opensymphony.com/browse/XW-476

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@523619 13f79535-47bb-0310-9956-ffa450edef68
2007-03-29 08:31:43 +00:00
James Mitchell 9b8f0a99c5 WW-1840 -- Mailreader -- either show passwords as *** or show them as readonly (text) or remove them
WW-1841 -- Mailreader -- msg text showing in place of logo image (struts.logo.alt)
WW-1842 -- Mailreader -- Remove walking tour

 * 1841 is not resolved, due to an issue with the i18n tag not finding the alternate bundle
 * remove extra extra params from css href and back links





git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@522729 13f79535-47bb-0310-9956-ffa450edef68
2007-03-27 03:47:48 +00:00
Ted Nathan Husted 8df1a49e44 WW-1767 Set STRUTS_2_0_X "head" to 2.0.8-SNAPSHOT
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@520399 13f79535-47bb-0310-9956-ffa450edef68
2007-03-20 14:04:53 +00:00
Ted Nathan Husted 1e769cc3b3 WW-1767 Update POMs for 2.0.7 build.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@520258 13f79535-47bb-0310-9956-ffa450edef68
2007-03-20 03:38:45 +00:00
Ted Nathan Husted 299579aef2 WW-1828 "Login Action validation config file named "Logon-validation.xml" so doesn't validate" - Apply patch submitted by Dave Newton
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@520254 13f79535-47bb-0310-9956-ffa450edef68
2007-03-20 03:26:25 +00:00
Ted Nathan Husted 85c9e4c171 WW-1825 "Anchor tag inserts newline at end of tag" apply patch submitted by Claus Ibsen
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@520249 13f79535-47bb-0310-9956-ffa450edef68
2007-03-20 03:18:23 +00:00
Ted Nathan Husted 6d3cceca00 WW-1814 "Default TypeConverters always created with default ObjectFactory" Reorder statics as suggested by Jasper Rosenberg
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@520241 13f79535-47bb-0310-9956-ffa450edef68
2007-03-20 02:56:03 +00:00
Ted Nathan Husted 2154ad8513 WW-1799 "StringLength validator is inconsistent client side and server side" submitted by Mads Riise Rasmussen
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@520235 13f79535-47bb-0310-9956-ffa450edef68
2007-03-20 02:45:07 +00:00
Ted Nathan Husted fa754949ab WW-1803 "ScopeIntercaptor null references on session serialization" apply patch submitted by Sylvain RIBEYRON.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@520151 13f79535-47bb-0310-9956-ffa450edef68
2007-03-19 22:48:16 +00:00
Ted Nathan Husted 9d71021b14 WW-1767 quickstart is gone, so this should be too!
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@520128 13f79535-47bb-0310-9956-ffa450edef68
2007-03-19 22:27:53 +00:00
Donald J. Brown b6be295074 Improved error handling for invalid package
WW-1826


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@519452 13f79535-47bb-0310-9956-ffa450edef68
2007-03-17 21:50:09 +00:00
Musachy Barroso 13e6ae21d4 WW-1710 Fix wrong reference to dojo tooltip
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@519213 13f79535-47bb-0310-9956-ffa450edef68
2007-03-17 02:05:48 +00:00
Musachy Barroso 1e73567cec WW-1823 rename getAutocompleterModel to getAutocompleter in StrutsModels
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@519207 13f79535-47bb-0310-9956-ffa450edef68
2007-03-17 01:45:04 +00:00
René Gielen 8fa480d66b WW-1707:
Re-add deprecated "plaintext" result name for backwards compatibility

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@518921 13f79535-47bb-0310-9956-ffa450edef68
2007-03-16 10:24:19 +00:00
Ted Nathan Husted 8910d90721 WW-18O4 "Showcase - view source throws NumberFormatException". The problem is that config parameter on the URL is empty (config=). It can be fixed by checing if the parameters are not empty instead of just != null in the ViewSourceAction.java. Submitted by Claus Ibsen.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@517510 13f79535-47bb-0310-9956-ffa450edef68
2007-03-13 03:24:41 +00:00
Ted Nathan Husted db2bf7b4e3 WW-1526 "Error with handling static resources under WebSphere 6". Flush output after copy to appease WebLogic and possibly other containers. Submitted by Adam Czysciak.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@517504 13f79535-47bb-0310-9956-ffa450edef68
2007-03-13 03:12:20 +00:00
Ted Nathan Husted 77cb215263 WW-1787 "Token session interceptor faiing with redirect-action" Apply patch based on WebWork #1404.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@517433 13f79535-47bb-0310-9956-ffa450edef68
2007-03-12 22:34:58 +00:00
Ted Nathan Husted 51d985b3b7 WW-1786 "using session-token interceptor generates FreeMarker template error" Apply patch submitted by Tom Schneider. The change synchronizes on the Ognl context so we don't concurrently execute results. The issue was that we were getting concurrency exceptions around the ognl context because the results were being executed concurrently. The change will reduce throughput when using the session-token interceptor, but it avoids the concurrency issues.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@517424 13f79535-47bb-0310-9956-ffa450edef68
2007-03-12 22:18:44 +00:00
Ted Nathan Husted 3563fe21e7 WW-1754 "The current struts-default.xml prevents TypeConverter wiring." Swap ObjectFactory and XWorkConverter load order per suggestion of Nicolas Berthet.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@517408 13f79535-47bb-0310-9956-ffa450edef68
2007-03-12 21:32:01 +00:00
Ted Nathan Husted 8f589c03db WW-1678 - Port cookie interceptor from WW 2.2.5. Patch submitted by Nate Drake based on code contributed to WebWork2/Open Symphony by Toby Jee and Mathew Payne.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@517374 13f79535-47bb-0310-9956-ffa450edef68
2007-03-12 20:25:06 +00:00
Ted Nathan Husted bb8d0bf28a WW-1619 URL component and URLHelper class do not handle multiple request parameters with the same name correctly when includeParams="get". Apply patch submitted by Tom Schneider.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@517363 13f79535-47bb-0310-9956-ffa450edef68
2007-03-12 20:05:02 +00:00
Ted Nathan Husted 09f11dac5c WW-1707 Apply consistent naming for the results in struts-default.xml
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@517341 13f79535-47bb-0310-9956-ffa450edef68
2007-03-12 19:13:13 +00:00
Ted Nathan Husted fbe7fe226f WW-1801 Remove Spring dependency by copying properties manually.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@517026 13f79535-47bb-0310-9956-ffa450edef68
2007-03-11 21:58:50 +00:00
Donald J. Brown 4e78cfce78 Fixed mailreader to use correct version and spring plugin
WW-1767


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


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@516997 13f79535-47bb-0310-9956-ffa450edef68
2007-03-11 19:40:40 +00:00
Ted Nathan Husted ff7144ca42 WW-1707 Apply consistent naming for the interceptors in struts-default.xml per report by Philip Luppens.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@516937 13f79535-47bb-0310-9956-ffa450edef68
2007-03-11 15:50:48 +00:00
Ted Nathan Husted ae053fb669 WW-1781 - Delete redundant struts.properties file.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@516929 13f79535-47bb-0310-9956-ffa450edef68
2007-03-11 15:34:01 +00:00
Ted Nathan Husted f621683dc1 WW-1781 - Set DevMode to false for example appliations. Remove other redundant or obsolete settings. Conform indentation n struts-default.xml.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@516927 13f79535-47bb-0310-9956-ffa450edef68
2007-03-11 15:29:54 +00:00
René Gielen 209965eff0 WW-1768:
Applied Oleg Gorobets' patch to make Set tag support JSP body as String value to set. Added also some words of documentation of this new feature.

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

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

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

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

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

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@515885 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 01:49:31 +00:00
René Gielen 08f5faf1af Removed broken character encodings, as indicated by bamboo reports
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@515882 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 01:33:04 +00:00
René Gielen 1be016ae02 WW-1747:
- updated test to show number formatting issue pointed out by Mike Baroukh
- fixed issue by preventing freemarker from formatting numbers for this template

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@515872 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 01:07:38 +00:00
Musachy Barroso 0a6c72e0c7 Fix form tag failing tests (add type="text/javascript")
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@515839 13f79535-47bb-0310-9956-ffa450edef68
2007-03-07 23:12:45 +00:00
Musachy Barroso dceee365c0 Add field "name" to autocompleter example
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@514170 13f79535-47bb-0310-9956-ffa450edef68
2007-03-03 15:19:30 +00:00
Musachy Barroso eca621ef35 WW-1777 DateTimePicker now supports expressions in the property "displayFormat"
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@512578 13f79535-47bb-0310-9956-ffa450edef68
2007-02-28 02:44:58 +00:00
Musachy Barroso fdcfcb8c15 WW-1771 Update DateTimePicker tag documentation. Sytax from:
http://www.unicode.org/reports/tr35/tr35-4.html#Date_Format_Patterns

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

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@512128 13f79535-47bb-0310-9956-ffa450edef68
2007-02-27 04:10:16 +00:00
Thomas Schneider 16939ed8b1 WW-1733 Fixed request not being wrapped issue
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@511453 13f79535-47bb-0310-9956-ffa450edef68
2007-02-25 05:35:20 +00:00
Musachy Barroso b39e1f24c2 WW-1671 templates don't specify type="text/javascript"; break W3C validation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@511302 13f79535-47bb-0310-9956-ffa450edef68
2007-02-24 16:49:02 +00:00
Musachy Barroso a1e9ba6aa4 WW-1766 div tag needs the scriptSeparation attribute
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@511299 13f79535-47bb-0310-9956-ffa450edef68
2007-02-24 16:39:53 +00:00
Musachy Barroso 7da5f114b4 WW-1589: Linked autocompleter reset on page reload
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@511295 13f79535-47bb-0310-9956-ffa450edef68
2007-02-24 16:23:00 +00:00
Musachy Barroso 4fd5d2ab15 Add breaklines to javadoc
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@511291 13f79535-47bb-0310-9956-ffa450edef68
2007-02-24 16:12:38 +00:00
Ted Nathan Husted fe3d2c2228 WW-1705 Remove link to "new API".
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@511218 13f79535-47bb-0310-9956-ffa450edef68
2007-02-24 05:38:34 +00:00
Ted Nathan Husted e75a5ae946 WW-1705 Update site for 2.0.6 release.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@511178 13f79535-47bb-0310-9956-ffa450edef68
2007-02-24 01:01:11 +00:00
Musachy Barroso a4e91a9581 add images to homepage
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@511016 13f79535-47bb-0310-9956-ffa450edef68
2007-02-23 16:58:03 +00:00
Ted Nathan Husted 5c1593c02e WW-1705 Encode example URL in MailReader tour.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@510919 13f79535-47bb-0310-9956-ffa450edef68
2007-02-23 12:03:36 +00:00
Musachy Barroso 28a98b5757 WW-1763: autocompleter tag isn´t present in the documentation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@510771 13f79535-47bb-0310-9956-ffa450edef68
2007-02-23 02:43:40 +00:00
Musachy Barroso df14a287d0 WW-1763: autocompleter tag isn´t present in the documentation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@510770 13f79535-47bb-0310-9956-ffa450edef68
2007-02-23 02:40:03 +00:00
Musachy Barroso 60391db64f WW-1602: Autocompleter is not rendering label
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@510748 13f79535-47bb-0310-9956-ffa450edef68
2007-02-23 01:20:37 +00:00
Musachy Barroso 6692879894 WW-1659:
* Update autocompleter to accept JSON generated using the JSON plugin
 * Add "dataFieldName" to identify the field to be used as the data source in the returned JSON string


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

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

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@509812 13f79535-47bb-0310-9956-ffa450edef68
2007-02-20 23:37:47 +00:00
Ted Nathan Husted c6c51c6ba4 WW-1705 Update POMs for 2.0.7-SNAPSHOT.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@509055 13f79535-47bb-0310-9956-ffa450edef68
2007-02-19 01:37:38 +00:00
Ted Nathan Husted f13243a2bf WW-1705 Update POMs for 2.0.6 tag.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@509051 13f79535-47bb-0310-9956-ffa450edef68
2007-02-19 01:33:07 +00:00
Ted Nathan Husted b2496a566c WW-1685 Restore Tiles as a "mainstream" example.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@509048 13f79535-47bb-0310-9956-ffa450edef68
2007-02-19 01:26:47 +00:00
Ted Nathan Husted 756c2f58d5 WW-1685 Playtest Showcase and adjust status of verious examples.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@509047 13f79535-47bb-0310-9956-ffa450edef68
2007-02-19 01:22:52 +00:00
Ted Nathan Husted cac778c170 WW-1685 Playtest Showcase and adjust status of verious examples.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@509034 13f79535-47bb-0310-9956-ffa450edef68
2007-02-19 00:03:37 +00:00
Ted Nathan Husted 66479bc36e WW-1548 Remove continuation support from 2.0.x, which had been classified "sandbox" code.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@509029 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 23:26:15 +00:00
Thomas Schneider e023f033af 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/branches/STRUTS_2_0_X@508916 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 16:54:58 +00:00
Thomas Schneider 8199b1a3b7 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/branches/STRUTS_2_0_X@508914 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 16:45:30 +00:00
Rainer Hermanns d078084107 bumped OGNL to version 2.6.11
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508901 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 13:55:11 +00:00
Thomas Schneider c990786a59 WW-1702 - fixed error handling in dispatcher
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508882 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 06:42:39 +00:00
Thomas Schneider 3f7dd2ef82 WW-1709 fixed nullpointer when scheme is null
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508880 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 06:33:26 +00:00
Thomas Schneider 7d8dfff8a1 WW-1709 fixed nullpointer when scheme is null
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508879 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 06:32:02 +00:00
Thomas Schneider 129e4559ce WW-1632 - added rtf support for jasper report result
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508875 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 06:02:23 +00:00
Musachy Barroso ff9bfe3bd4 WW-1633 Add "keyName" attribute to autocompleter (defaults to "${name}Key")
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508776 13f79535-47bb-0310-9956-ffa450edef68
2007-02-17 16:33:57 +00:00
Musachy Barroso e163098224 WW-1745 Add "templateCssPath" and "iconPath" attributes to Autocompleter
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508631 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 22:48:10 +00:00
Musachy Barroso dd200c173c - 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/branches/STRUTS_2_0_X@508608 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 22:00:17 +00:00
Musachy Barroso d7189a6648 WW-1729 Add "templateCssPath" attribute DateTimePicker
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508602 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 21:53:54 +00:00
Musachy Barroso 2cab82fafc WW-1688 Add "templateCssPath" attribute to tabbedPanel
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508570 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 20:42:17 +00:00
Musachy Barroso 1472a49a0f WW-1730 The refreshOnShow attribute in tabbedPanel does not work
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508556 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 20:15:05 +00:00
Rainer Hermanns 5e3464d467 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/branches/STRUTS_2_0_X@508509 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 17:35:12 +00:00
Rainer Hermanns d60e674046 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/branches/STRUTS_2_0_X@508478 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 16:25:48 +00:00
Rainer Hermanns 6e81a692b7 Fixed broken Unit Test due to changes in xwork
WW-1615


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508465 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 16:12:32 +00:00
Rainer Hermanns fbedbdedbe 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/branches/STRUTS_2_0_X@508441 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 15:14:16 +00:00
Musachy Barroso 1a2bd58e65 Remove redundant tag attribute annotation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508293 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 03:03:30 +00:00
Musachy Barroso 421ff8d068 WW-1570:
Add "showLoading" attribute to ajax tags

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508280 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 02:07:56 +00:00
Ted Nathan Husted 0e7dbe0b62 [WW-1731] Checkin updated tag HTML docs.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@506210 13f79535-47bb-0310-9956-ffa450edef68
2007-02-12 01:33:59 +00:00
Ted Nathan Husted ae4e489d9e [WW-1731] Update POMs. Checkin updated tag HTML docs.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@506206 13f79535-47bb-0310-9956-ffa450edef68
2007-02-12 01:19:09 +00:00
Ted Nathan Husted dcc79d485d [WW-1731] Fix assembly/pom to include codebehind and spring plugins (Good catch Tom!).
[WW-1548] Remove continuations from the 2.0.x branch.
[WW-1700] Remove "new API" from 2.0.x branch (see also r505490 as to the HEAD/2.1.x). 
[WW-1731] Remove TLD as it is generated. 

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@506198 13f79535-47bb-0310-9956-ffa450edef68
2007-02-12 00:57:44 +00:00
Ted Nathan Husted 75b379d5d4 WW-1705 Branching at 2_0_5 tag (again)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@506174 13f79535-47bb-0310-9956-ffa450edef68
2007-02-11 23:34:04 +00:00
Ted Nathan Husted cb580fe614 WW-1685 Tag r503710 as Struts 2.0.5
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_5@503722 13f79535-47bb-0310-9956-ffa450edef68
2007-02-05 15:33:40 +00:00
650 changed files with 15654 additions and 16057 deletions
-54
View File
@@ -1,54 +0,0 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.0.5</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-api</artifactId>
<packaging>jar</packaging>
<name>Struts 2 API</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/api/</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/api/</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/api/</url>
</scm>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
<!-- has to be compile for StrutsTestCase, which is part of the base package so others can write unit tests -->
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<scope>test</scope>
<version>2.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<showPackage>false</showPackage>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -1,65 +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;
/**
* Default action interface. Provided purely for user convenience. Struts does not require actions to implement any
* interfaces. Actions need only implement a public, no argument method which returns {@code String}. If a user does
* not specify a method name, Struts defaults to {@code execute()}.
*
* <p>For example:
*
* <pre>
* static import ResultNames.*;
*
* public class MyAction <b>implements Action</b> {
*
* public String execute() {
* return SUCCESS;
* }
* }
* </pre>
*
* <p>is equivalent to:
*
* <pre>
* static import ResultNames.*;
*
* public class MyAction {
*
* public String execute() {
* return SUCCESS;
* }
* }
* </pre>
*
* @author crazybob@google.com (Bob Lee)
*/
public interface Action {
/**
* Executes this action.
*
* @return result name which matches a result name from the action mapping in the configuration file. See {@link
* ResultNames} for common suggestions.
*/
String execute();
}
@@ -1,61 +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;
/**
* Implemented by actions which may need to record errors or messages.
*
* <pre>
* static import ResultNames.*;
*
* public class SetName implements MessageAware {
*
* Messages messages;
* String name;
*
* public String execute() {
* return SUCCESS;
* }
*
* public void setName(String name) {
* if ("".equals(name))
* messages.forField("name").addError("name.required");
*
* this.name = name;
* }
*
* public void setMessages(Messages messages) {
* this.messages = messages;
* }
* }
* </pre>
*
* @author crazybob@google.com (Bob Lee)
*/
public interface MessageAware {
/**
* Sets messages.
*
* @param messages messages
*/
void setMessages(Messages messages);
}
@@ -1,216 +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;
import java.util.List;
import java.util.Set;
import java.util.Map;
/**
* Collection of messages. Supports nesting messages by field name.
*
* <p>Uses keys when adding instead of actual messages to decouple code from messages.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface Messages {
// TODO: Use Object[] for args instead of String[].
/**
* Message severity.
*/
public enum Severity {
/**
* Informational messages.
*/
INFO,
/**
* Warning messages.
*/
WARN,
/**
* Error messages.
*/
ERROR,
}
/**
* Gets nested messages for the given field.
*
* <p>Supports dot notation to represent nesting. For example:
*
* <pre>
* messages.forField("foo").forField("bar") == messages.forField("foo.bar")
* </pre>
*
* @param fieldName name of the field
* @return nested {@code Messages} for given field name
*/
Messages forField(String fieldName);
/**
* Gets map of field name to messages for that field.
*
* @return map of field name to {@code Messages}
*/
Map<String, Messages> forFields();
/**
* Adds informational message.
*
* @param key message key
* @see Severity.INFO
*/
void addInformation(String key);
/**
* Adds informational message.
*
* @param key message key
* @param arguments message arguments
* @see Severity.INFO
*/
void addInformation(String key, String... arguments);
/**
* Adds warning message.
*
* @param key message key
* @see Severity.WARN
*/
void addWarning(String key);
/**
* Adds warning message.
*
* @param key message key
* @param arguments message arguments
* @see Severity.WARN
*/
void addWarning(String key, String... arguments);
/**
* Adds error message.
*
* @param key message key
* @see Severity.ERROR
*/
void addError(String key);
/**
* Adds error message.
*
* @param key message key
* @param arguments message arguments
* @see Severity.ERROR
*/
void addError(String key, String... arguments);
/**
* Adds message.
*
* @param severity message severity
* @param key message key
*/
void add(Severity severity, String key);
/**
* Adds request-scoped message.
*
* @param severity message severity
* @param key message key
* @param arguments message arguments
*/
void add(Severity severity, String key, String... arguments);
/**
* Gets set of severities for which this {@code Messages} instance has messages. Not recursive.
*
* @return unmodifiable set of {@link Severity} sorted from least to most severe
*/
Set<Severity> getSeverities();
/**
* Gets message strings for the given severity. Not recursive.
*
* @param severity message severity
* @return unmodifiable list of messages
*/
List<String> forSeverity(Severity severity);
/**
* Gets error message strings for this {@code Messages} instance. Not recursive.
*
* @return unmodifiable list of messages
*/
List<String> getErrors();
/**
* Gets error message strings for this {@code Messages} instance. Not recursive.
*
* @return unmodifiable list of messages
*/
List<String> getWarnings();
/**
* Gets informational message strings for this {@code Messages} instance. Not recursive.
*
* @return unmodifiable list of messages
*/
List<String> getInformation();
/**
* Returns true if this or a nested {@code Messages} instance has error messages.
*
* @see Severity.ERROR
*/
boolean hasErrors();
/**
* Returns true if this or a nested {@code Messages} instance has warning messages.
*
* @see Severity.WARN
*/
boolean hasWarnings();
/**
* Returns true if this or a nested {@code Messages} instance has informational messages.
*
* @see Severity.INFO
*/
boolean hasInformation();
/**
* Returns true if this and all nested {@code Messages} instances have no messages.
*/
boolean isEmpty();
/**
* Returns true if this and all nested {@code Messages} instances have no messages for the given severity.
*
* @param severity message severity
*/
boolean isEmpty(Severity severity);
}
@@ -1,56 +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;
/**
* Commonly used result names returned by action methods.
*
* @author crazybob@google.com (Bob Lee)
*/
public final class ResultNames {
private ResultNames() {}
/**
* The action executed successfully.
*/
public static final String SUCCESS = "success";
/**
* The action requires more input, i.e.&nbsp;a validation error occurred.
*/
public static final String INPUT = "input";
/**
* The action requires the user to log in before executing.
*/
public static final String LOGIN = "login";
/**
* The action execution failed irrecoverably.
*/
public static final String ERROR = "error";
/**
* The action executed successfully, but do not execute a result.
*/
public static final String NONE = "none";
}
@@ -1,79 +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.spi;
import java.lang.reflect.Method;
/**
* Context of an action execution.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface ActionContext {
/**
* Gets action instance.
*/
Object getAction();
/**
* Gets action method.
*/
Method getMethod();
/**
* Gets action name.
*/
String getActionName();
/**
* Gets the path for the action's namespace.
*/
String getNamespacePath();
/**
* Gets the {@link Result} instance for the action.
*
* @return {@link Result} instance or {@code null} if we don't have a result yet.
*/
Result getResult();
/**
* Adds a result interceptor for the action. Enables executing code before and after a result, executing an
* alternate result, etc.
*/
void addResultInterceptor(Result interceptor);
/**
* Gets context of action which chained to us.
*
* @return context of previous action or {@code null} if this is the first action in the chain
*/
ActionContext getPrevious();
/**
* Gets context of action which this action chained to.
*
* @return context of next action or {@code null} if we haven't chained to another action yet or this is the last
* action in the chain.
*/
ActionContext getNext();
}
@@ -1,121 +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.spi;
import org.apache.struts2.Messages;
import javax.servlet.ServletContext;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Locale;
import java.util.Map;
/**
* Request context. A single request may span multiple actions with action chaining.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface RequestContext {
/**
* Gets context of the currently executing action.
*
* @return current action context
*/
ActionContext getActionContext();
/**
* Convenience method.&nbsp;Equivalent to {@code getActionContext().getAction()}.
*
* @return currently executing action
*/
Object getAction();
/**
* Gets map of request parameters.
*/
Map<String, String[]> getParameterMap();
/**
* Gets map of request attributes.
*/
Map<String, Object> getAttributeMap();
/**
* Gets map of session attributes.
*/
Map<String, Object> getSessionMap();
/**
* Gets map of application (servlet context) attributes.
*/
Map<String, Object> getApplicationMap();
/**
* Finds cookies with the given name,
*/
List<Cookie> findCookiesForName(String name);
/**
* Gets locale.
*/
Locale getLocale();
/**
* Sets locale. Stores the locale in the session for future requests.
*/
void setLocale(Locale locale);
/**
* Gets messages.
*/
Messages getMessages();
/**
* Gets the servlet request.
*/
HttpServletRequest getServletRequest();
/**
* Gets the servlet response.
*/
HttpServletResponse getServletResponse();
/**
* Gets the servlet context.
*/
ServletContext getServletContext();
/**
* Gets the value stack.
*/
ValueStack getValueStack();
/**
* Invokes the next interceptor or the action method if no more interceptors remain.
*
* @return result name
* @throws IllegalStateException if already invoked or called from the action
*/
String proceed() throws Exception;
}
@@ -1,39 +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.spi;
import org.apache.struts2.spi.RequestContext;
/**
* Implemented by actions that need access to the current {@link org.apache.struts2.spi.RequestContext}. Use
* judiciously.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface RequestContextAware {
/**
* Sets {@link org.apache.struts2.spi.RequestContext}.
*
* @param requestContext
*/
void setRequestContext(RequestContext requestContext);
}
@@ -1,113 +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.spi;
/**
* A central fixture of the Struts framework, the {@code ValueStack} is a stack which contains the actions
* which have executed in addition to other objects. Users can get and set values on the stack using expressions. The
* {@code ValueStack} will search down the stack starting with the most recent objects until it finds an object to
* which the expression can apply.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface ValueStack extends Iterable<Object> {
/**
* Gets the top, most recent object from the stack without changing the stack.
*
* @return the top object
*/
Object peek();
/**
* Removes the top, most recent object from the stack.
*
* @return the top object
*/
Object pop();
/**
* Pushes an object onto the stack.
*
* @param o
*/
void push(Object o);
/**
* Creates a shallow copy of this stack.
*
* @return a new stack which contains the same objects as this one
*/
ValueStack clone();
/**
* Queries the stack. Starts with the top, most recent object. If the expression can apply to the object, this
* method returns the result of evaluating the expression. If the expression does not apply, this method moves
* down the stack to the next object and repeats. Returns {@code null} if the expression doesn't apply to any
* objects.
*
* @param expression
* @return the evaluation of the expression against the first applicable object in the stack
*/
Object get(String expression);
/**
* Queries the stack and converts the result to the specified type. Starts with the top, most recent object. If
* the expression can apply to the object, this method returns the result of evaluating the expression converted
* to the specified type. If the expression does not apply, this method moves down the stack to the next object
* and repeats. Returns {@code null} if the expression doesn't apply to any objects.
*
* @param expression
* @param asType the type to convert the result to
* @return the evaluation of the expression against the first applicable object in the stack converted to the
* specified type
*/
<T> T get(String expression, Class<T> asType);
/**
* Queries the stack and converts the result to a {@code String}. Starts with the top, most recent object. If the
* expression can apply to the object, this method returns the result of evaluating the expression converted to a
* {@code String}. If the expression does not apply, this method moves down the stack to the next object and
* repeats. Returns {@code null} if the expression doesn't apply to any objects.
*
* @param expression
* @return the evaluation of the expression against the first applicable object in the stack converted to a {@code
* String}
*/
String getString(String expression);
/**
* Sets a value on an object from the stack. This method starts at the top, most recent object. If the expression
* applies to that object, this methods sets the given value on that object using the expression and converting
* the type as necessary. If the expression does not apply, this method moves to the next object and repeats.
*
* @param expression
* @param value
*/
void set(String expression, Object value);
/**
* Returns the number of object on the stack.
*
* @return size of stack
*/
int size();
}
-174
View File
@@ -1,174 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
-5
View File
@@ -1,5 +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/).
+7 -15
View File
@@ -1,11 +1,10 @@
<?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.5</version>
<version>2.0.10</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-blank</artifactId>
@@ -13,9 +12,9 @@
<name>Blank Webapp</name>
<scm>
<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>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/struts2-parent-2.0.10</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/struts2-parent-2.0.10</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/struts2-parent-2.0.10</url>
</scm>
<dependencies>
@@ -47,18 +46,11 @@
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty6-plugin</artifactId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.0.1</version>
<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>
+1 -1
View File
@@ -6,7 +6,7 @@
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="true" />
<constant name="struts.devMode" value="false" />
<include file="example.xml"/>
+7 -14
View File
@@ -1,11 +1,10 @@
<?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.5</version>
<version>2.0.10</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-mailreader</artifactId>
@@ -13,13 +12,13 @@
<name>Starter Webapp</name>
<scm>
<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>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/struts2-parent-2.0.10</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/struts2-parent-2.0.10</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/struts2-parent-2.0.10</url>
</scm>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
@@ -31,14 +30,8 @@
<artifactId>struts-mailreader-dao</artifactId>
<version>1.3.5</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="autodetect">
<!-- add your spring beans here -->
</beans>
@@ -32,8 +32,6 @@ import org.apache.struts.apps.mailreader.dao.User;
import org.apache.struts.apps.mailreader.dao.UserDatabase;
import org.apache.struts.apps.mailreader.dao.impl.memory.MemorySubscription;
import org.apache.struts.apps.mailreader.dao.impl.memory.MemoryUser;
import org.springframework.beans.BeanUtils;
import java.util.Map;
/**
@@ -63,6 +61,28 @@ public class MailreaderSupport extends ActionSupport
return Constants.CANCEL;
}
/**
* Convenience method to copy User properties.
**/
protected void copyUser(User source, User target) {
if ((source==null) || (target==null)) return;
target.setFromAddress(source.getFromAddress());
target.setFullName(source.getFullName());
target.setPassword(source.getPassword());
target.setReplyToAddress(source.getReplyToAddress());
}
/**
* Convenience method to copy Subscription properties.
**/
protected void copySubscription(Subscription source, Subscription target) {
if ((source==null) || (target==null)) return;
target.setAutoConnect(source.getAutoConnect());
target.setPassword(source.getPassword());
target.setType(source.getType());
target.setUsername(source.getUsername());
}
// ---- ApplicationAware ----
@@ -435,7 +455,7 @@ public class MailreaderSupport extends ActionSupport
input.setPassword(_password);
User user = createUser(_username, _password);
if (null != user) {
BeanUtils.copyProperties(input,user);
copyUser(input,user);
setUser(user);
}
}
@@ -532,7 +552,7 @@ public class MailreaderSupport extends ActionSupport
Subscription input = getSubscription();
Subscription sub = createSubscription(host);
if (null != sub) {
BeanUtils.copyProperties(input, sub);
copySubscription(input, sub);
setSubscription(sub);
setHost(sub.getHost());
}
-1
View File
@@ -8,7 +8,6 @@
<constant name="struts.action.extension" value="do" />
<constant name="struts.devMode" value="false" />
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.objectFactory" value="spring" />
<include file="mailreader-default.xml"/>
+1 -1
View File
@@ -2,5 +2,5 @@
<hr/>
<p>
<a href="<s:url action="Welcome" />"><s:text name="index.title"/></a>
<a href="<s:url action="Welcome" includeParams="none"/>"><s:text name="index.title"/></a>
</p>
@@ -28,7 +28,7 @@
<s:hidden name="username"/>
</s:else>
<s:password key="password"/>
<s:password key="password" showPassword="true"/>
<s:password key="password2"/>
<s:textfield key="user.fullName"/>
<s:textfield key="user.fromAddress"/>
@@ -13,7 +13,7 @@
<s:if test="task=='Delete'">
<title><s:text name="subscription.title.delete"/></title>
</s:if>
<link href="<s:url value="/css/mailreader.css"/>" rel="stylesheet"
<link href="<s:url value="/css/mailreader.css" includeParams="none"/>" rel="stylesheet"
type="text/css"/>
</head>
@@ -4,11 +4,6 @@
<display-name>Struts 2 Mailreader</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext*.xml</param-value>
</context-param>
<filter>
<filter-name>Struts2</filter-name>
<filter-class>
@@ -18,22 +13,16 @@
<filter-mapping>
<filter-name>Struts2</filter-name>
<url-pattern>/*</url-pattern>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<!-- Application Listener for Mailreader database -->
<listener>
<listener-class>
mailreader2.ApplicationListener
</listener-class>
</listener>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
+3 -4
View File
@@ -44,13 +44,12 @@
<hr/>
<p><s:i18n name="alternate">
<p><s:i18n name="alternate"><a href="http://struts.apache.org/">
<img src="<s:text name="struts.logo.path"/>"
alt="<s:text name="struts.logo.alt"/>"/>
alt="<s:text name="struts.logo.alt"/>" border="0px"/>
</a>
</s:i18n></p>
<p><a href="<s:url action="Tour" />"><s:text name="index.tour"/></a></p>
</body>
</html>
+4 -4
View File
@@ -820,7 +820,7 @@ public class Welcome extends MailreaderSupport {
</p>
<hr/>
<pre><code>&lt;#if (actionErrors?exists && actionErrors?size > 0)>
<pre><code>&lt;#if (actionErrors?exists &amp;&amp; actionErrors?size > 0)>
&lt;ul>
&lt;#list actionErrors as error>
&lt;li>&lt;span class="errorMessage">${error}&lt;/span>&lt;/li>
@@ -837,7 +837,7 @@ public class Welcome extends MailreaderSupport {
</p>
<hr/>
<pre><code>&lt;#if (actionErrors?exists && actionErrors?size > 0)>
<pre><code>&lt;#if (actionErrors?exists &amp;&amp; actionErrors?size > 0)>
<strong>&lt;table></strong>
&lt;#list actionErrors as error>
<strong>&lt;tr>&lt;td></strong>&lt;span class="errorMessage">${error}&lt;/span><strong>&lt;/td>&lt;/tr></strong>
@@ -1064,7 +1064,7 @@ public void setPassword(String password) {
<pre><code>public User <strong>findUser</strong>(String username, String password)
throws <strong>ExpiredPasswordException</strong> {
User user = <strong>getDatabase().findUser(username)</strong>;
if ((user != null) && !user.getPassword().equals(password)) {
if ((user != null) &amp;&amp; !user.getPassword().equals(password)) {
user = null;
}
if (user == null) {
@@ -1427,7 +1427,7 @@ public class <strong>AuthenticationInterceptor</strong> implements Interceptor {
public String <strong>intercept</strong>(ActionInvocation actionInvocation) throws Exception {
Map session = actionInvocation.getInvocationContext().getSession();
User user = (User) session.get(Constants.USER_KEY);
boolean isAuthenticated = (null!=user) && (null!=user.getDatabase());
boolean isAuthenticated = (null!=user) &amp;&amp; (null!=user.getDatabase());
if (<strong>isAuthenticated</strong>) {
return actionInvocation.invoke();
}
+18 -46
View File
@@ -1,31 +1,9 @@
<?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">
<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.5</version>
<version>2.0.10</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
@@ -37,11 +15,11 @@
<module>portlet</module>
<module>showcase</module>
</modules>
<scm>
<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>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/struts2-parent-2.0.10</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/struts2-parent-2.0.10</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/struts2-parent-2.0.10</url>
</scm>
<distributionManagement>
@@ -50,7 +28,7 @@
<url>scp://people.apache.org/www/struts.apache.org/struts2/apps</url>
</site>
</distributionManagement>
<profiles>
<profile>
<id>hostedqa</id>
@@ -105,14 +83,10 @@
</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>
@@ -156,13 +130,11 @@
<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>
@@ -173,9 +145,9 @@
</executions>
</plugin>
</plugins>
<finalName>${pom.artifactId}</finalName>
</build>
<dependencies>
@@ -193,5 +165,5 @@
<scope>test</scope>
</dependency>
</dependencies>
</project>
</project>
+29 -19
View File
@@ -1,21 +1,20 @@
<?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.5</version>
<version>2.0.10</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-portlet</artifactId>
<artifactId>struts2-portlet-branch</artifactId>
<packaging>war</packaging>
<name>Portlet Webapp</name>
<scm>
<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>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/struts2-parent-2.0.10</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/struts2-parent-2.0.10</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/struts2-parent-2.0.10</url>
</scm>
<dependencies>
@@ -29,7 +28,13 @@
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
@@ -51,20 +56,25 @@
<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.0</version>
<version>2.1</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,4 +44,7 @@ public class FormExample extends ActionSupport {
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String displayResult() {
return "displayResult";
}
}
@@ -1,38 +1,37 @@
/*
* $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.servlet;
import javax.servlet.http.HttpServletResponse;
/**
* Implemented by actions which need direct access to the servlet response.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface ServletResponseAware {
/**
* Sets the servlet response.
*
* @param response servlet response
*/
void setServletResponse(HttpServletResponse response);
}
/*
* $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;
}
}
@@ -0,0 +1,81 @@
/*
* $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;
}
}
@@ -0,0 +1,18 @@
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;
}
}
@@ -0,0 +1,48 @@
<?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>
@@ -0,0 +1,14 @@
<?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>
@@ -0,0 +1,130 @@
<?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>
+10 -160
View File
@@ -1,161 +1,11 @@
<?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" />
<?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">
<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>
<struts>
<include file="struts-portlet-default.xml"/>
<include file="struts-view.xml"/>
<include file="struts-edit.xml"/>
<include file="struts-help.xml"/>
</struts>
@@ -1,3 +1,6 @@
<!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"/>
+117 -103
View File
@@ -1,118 +1,132 @@
<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>
<?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-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class>
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class>
<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 view mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>viewNamespace</name>
<value>/view</value>
</init-param>
<!-- The default action to invoke in view mode. -->
<init-param>
<name>defaultViewAction</name>
<value>index</value>
</init-param>
<!-- The edit mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>editNamespace</name>
<value>/edit</value>
</init-param>
<!-- The default action to invoke in edit mode. -->
<init-param>
<name>defaultEditAction</name>
<value>index</value>
</init-param>
<!-- The help mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>helpNamespace</name>
<value>/help</value>
</init-param>
<!-- The default action to invoke in help mode. -->
<init-param>
<name>defaultHelpAction</name>
<value>index</value>
</init-param>
<expiration-cache>0</expiration-cache>
<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>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>edit</portlet-mode>
<portlet-mode>help</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<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-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>
<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 view mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>viewNamespace</name>
<value>/view</value>
</init-param>
<expiration-cache>0</expiration-cache>
<!-- The default action to invoke in view mode. -->
<init-param>
<name>defaultViewAction</name>
<value>index</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>edit</portlet-mode>
<portlet-mode>help</portlet-mode>
</supports>
<!-- The edit mode namespace. Maps to a namespace in the Struts 2 config file. -->
<init-param>
<name>editNamespace</name>
<value>/edit</value>
</init-param>
<supported-locale>en</supported-locale>
<!-- The default action to invoke in edit mode. -->
<init-param>
<name>defaultEditAction</name>
<value>index</value>
</init-param>
<portlet-info>
<title>My StrutsPortlet portlet2</title>
<short-title>SP2</short-title>
<keywords>struts,portlet</keywords>
</portlet-info>
</portlet>
<!-- 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-app>
@@ -0,0 +1,13 @@
<%@ 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>
@@ -0,0 +1,14 @@
<%@ 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>
@@ -0,0 +1,8 @@
<%@ 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>
@@ -0,0 +1,8 @@
<%@ 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,10 +4,12 @@
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="ajaxExample"/>">Ajax</a></li>
<li><a href="<s:url action="fileUpload" method="input"/>">File upload</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>
+23 -42
View File
@@ -1,49 +1,30 @@
<?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>
<filter-mapping>
<filter-name>action2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- 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>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<listener>
<listener-class>
org.apache.struts2.portlet.context.ServletContextHolderListener
</listener-class>
</listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</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>
+16 -16
View File
@@ -1,11 +1,10 @@
<?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.5</version>
<version>2.0.10</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-showcase</artifactId>
@@ -13,11 +12,11 @@
<name>Showcase Webapp</name>
<scm>
<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>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/struts2-parent-2.0.10</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/struts2-parent-2.0.10</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/struts2-parent-2.0.10</url>
</scm>
<profiles>
<profile>
@@ -31,7 +30,7 @@
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-struts1-plugin</artifactId>
@@ -55,7 +54,7 @@
<artifactId>struts2-sitemesh-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-tiles-plugin</artifactId>
@@ -63,9 +62,10 @@
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-continuations-plugin</artifactId>
<version>${pom.version}</version>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>2.0.4</version>
<scope>runtime</scope>
</dependency>
<dependency>
@@ -79,14 +79,14 @@
<artifactId>struts2-spring-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<!-- Velocity -->
<dependency>
<groupId>velocity</groupId>
@@ -137,9 +137,9 @@
<version>1.1.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
-66
View File
@@ -1,66 +0,0 @@
<configuration>
<!--
QuickStart can be used to extend other QuickStart configurations.
This is great for applications that have multiple "editions" and
extend upon a base webapp or evven just a base set of classes.
-->
<!--<extendsConfig>../path/to/quickstart.xml</extendsConfig>-->
<!--
QuickStart supports reading your IDEA module configuration and
using the libraries there. This is especially useful for maven
users who don't have a single directory in their project that
contains all the libraries they need.
-->
<ideaConfig>../../../xwork/xwork.iml,../../core/struts2-core.iml,struts2-showcase.iml</ideaConfig>
<!-- The context in which to deploy the web application -->
<context>/showcase</context>
<!-- The port in which to deploy the web application -->
<port>8080</port>
<!--
The libs directories can be a jar, a directory of jars, or even
a directory of directories (searched recursively)
<libs>
<dir>../../lib</dir>
</libs>
-->
<!--
Optional: the location where your source files are. If this is
not included, the auto-recompiling feature of QuickStart will
not be enabled. You may wish to do this anyway, as this feature
has been known to cause strange side effects. If you don't
specify your sources, you must specify where your classes are by
using the classDirs and libs elements
<sources>
<dir>src/main/java</dir>
</sources>
-->
<!--
The classDirs directories can be a jar or a directory of classes.
The WEB-INF/classes directory for each webDir (below) will automatically
be added if it exists.
-->
<classDirs>
<dir>src/main/resources</dir>
<dir>target/classes</dir>
<dir>../../core/target/classes</dir>
</classDirs>
<!--
You can specify one or more directories where your webapp files
are located. This is useful if you have your project split up in
unique ways. You can also specify the path that the directory is
mapped to, relative to the context.
-->
<webDirs>
<webDir>
<path>/</path>
<dir>src/main/webapp</dir>
</webDir>
</webDirs>
</configuration>
@@ -1,71 +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.showcase;
import java.util.Random;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;
import com.uwyn.rife.continuations.ContinuableObject;
// START SNIPPET: example
public class Guess extends ActionSupport implements Preparable, ContinuableObject {
int guess;
public void prepare() throws Exception {
// We clear the error message state before the action.
// That is because with continuations, the original (or cloned) action is being
// executed, which will still have the old errors and potentially cause problems,
// such as with the workflow interceptor
clearErrorsAndMessages();
}
public String execute() throws Exception {
int answer = new Random().nextInt(100) + 1;
int tries = 5;
while (answer != guess && tries > 0) {
pause(Action.SUCCESS);
if (guess > answer) {
addFieldError("guess", "Too high!");
} else if (guess < answer) {
addFieldError("guess", "Too low!");
}
tries--;
}
if (answer == guess) {
addActionMessage("You got it!");
} else {
addActionMessage("You ran out of tries, the answer was " + answer);
}
return Action.SUCCESS;
}
public void setGuess(int guess) {
this.guess = guess;
}
}
// END SNIPPET: example
@@ -57,7 +57,7 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
public String execute() throws MalformedURLException, IOException {
if (page != null) {
if (page != null && page.trim().length() > 0) {
InputStream in = ClassLoaderUtil.getResourceAsStream(page.substring(page.indexOf("//")+1), getClass());
page = page.replace("//", "/");
@@ -70,18 +70,26 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
}
}
pageLines = read(in, -1);
if (in != null) {
in.close();
}
}
if (className != null) {
className = "/"+className.replace('.', '/') + ".java";
if (className != null && className.trim().length() > 0) {
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) {
if (config != null && config.trim().length() > 0) {
int pos = config.lastIndexOf(':');
configLine = Integer.parseInt(config.substring(pos+1));
config = config.substring(0, pos).replace("//", "/");
@@ -118,8 +126,6 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
this.padding = padding;
}
/**
* @return the classLines
*/
@@ -215,6 +221,4 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
public void setServletContext(ServletContext arg0) {
this.servletContext = arg0;
}
}
+2 -1
View File
@@ -2,4 +2,5 @@ Apache Struts
Copyright 2000-2007 The Apache Software Foundation
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
The Apache Software Foundation (http://www.apache.org/).
Nifty Corners (http://www.html.it/articoli/nifty/index.html).
@@ -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 -->
@@ -1,10 +0,0 @@
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="continuations" extends="struts-default" namespace="/continuations">
<action name="guess" class="org.apache.struts2.showcase.Guess">
<result type="freemarker">guess.ftl</result>
</action>
</package>
</struts>
@@ -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" />
<!-- Diplay entry page that uses Model-Driven technique -->
<!-- Display 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,6 +17,10 @@
<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>
@@ -1,11 +0,0 @@
struts.i18n.reload=true
struts.devMode = true
struts.configuration.xml.reload=true
struts.continuations.package=org.apache.struts2.showcase
struts.custom.i18n.resources=globalMessages
#struts.action.extension=jspa
struts.url.http.port = 8080
struts.freemarker.manager.classname=customFreemarkerManager
struts.serve.static=true
struts.serve.static.browserCache=false
struts.codebehind.defaultPackage=person
+26 -15
View File
@@ -7,16 +7,27 @@
<!-- START SNIPPET: xworkSample -->
<struts>
<!-- Some or all of these can be flipped to true for debugging -->
<constant name="struts.i18n.reload" value="false" />
<constant name="struts.devMode" value="false" />
<constant name="struts.configuration.xml.reload" value="false" />
<constant name="struts.custom.i18n.resources" value="globalMessages" />
<constant name="struts.codebehind.defaultPackage" value="person" />
<constant name="struts.freemarker.manager.classname" value="customFreemarkerManager" />
<constant name="struts.serve.static" value="true" />
<constant name="struts.serve.static.browserCache" value="false" />
<include file="struts-chat.xml" />
<include file="struts-hangman.xml" />
<include file="struts-continuations.xml"/>
<include file="struts-tags.xml"/>
<include file="struts-validation.xml" />
<include file="struts-actionchaining.xml" />
<include file="struts-ajax.xml" />
@@ -26,19 +37,19 @@
<include file="struts-person.xml" />
<include file="struts-wait.xml" />
<include file="struts-jsf.xml" />
<include file="struts-token.xml" />
<include file="struts-model-driven.xml" />
<include file="struts-integration.xml" />
<include file="struts-filedownload.xml" />
<include file="struts-conversion.xml" />
<include file="struts-freemarker.xml" />
<include file="struts-tiles.xml" />
@@ -48,17 +59,17 @@
<package name="default" extends="struts-default">
<interceptors>
<interceptor-stack name="crudStack">
<interceptor-ref name="checkbox" />
<interceptor-ref name="checkbox" />
<interceptor-ref name="params" />
<interceptor-ref name="static-params" />
<interceptor-ref name="static-params" />
<interceptor-ref name="defaultStack" />
</interceptor-stack>
</interceptors>
<action name="showcase">
<result>showcase.jsp</result>
</action>
<action name="viewSource" class="org.apache.struts2.showcase.source.ViewSourceAction">
<result>viewSource.jsp</result>
</action>
@@ -99,7 +110,7 @@
<interceptor-ref name="basicStack"/>
</action>
<action name="edit-*" class="org.apache.struts2.showcase.action.EmployeeAction">
<param name="empId">{1}</param>
<param name="empId">{1}</param>
<result>/empmanager/editEmployee.jsp</result>
<interceptor-ref name="crudStack"><param name="validation.excludeMethods">execute</param></interceptor-ref>
</action>
@@ -5,7 +5,7 @@
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
// Calculate the view sources url
String sourceUrl = request.getContextPath()+"/viewSource.action";
com.opensymphony.xwork2.ActionInvocation inv = com.opensymphony.xwork2.ActionContext.getContext().getActionInvocation();
@@ -14,9 +14,9 @@
com.opensymphony.xwork2.util.location.Location loc = inv.getProxy().getConfig().getLocation();
sourceUrl += "?config="+(loc != null ? loc.getURI()+":"+loc.getLineNumber() : "");
sourceUrl += "&className="+inv.getProxy().getConfig().getClassName();
if (inv.getResult() != null && inv.getResult() instanceof org.apache.struts2.dispatcher.StrutsResultSupport) {
sourceUrl += "&page="+mapping.getNamespace()+"/"+((org.apache.struts2.dispatcher.StrutsResultSupport)inv.getResult()).getLastFinalLocation();
sourceUrl += "&page="+mapping.getNamespace()+"/"+((org.apache.struts2.dispatcher.StrutsResultSupport)inv.getResult()).getLastFinalLocation();
}
} else {
sourceUrl += "?page="+request.getServletPath();
@@ -104,11 +104,11 @@
</div><!-- end content -->
<div>
<p>
<a href="<%=sourceUrl %>">View Sources</a>
</p>
</div>
<div>
<p>
<a href="<%=sourceUrl %>">View Sources</a>
</p>
</div>
<div id="footer" class="clearfix">
<p>Copyright &copy; 2003-<s:property value="#dateAction.now.year + 1900" /> The Apache Software Foundation.</p>
</div><!-- end footer -->
@@ -28,15 +28,21 @@
<tiles-definitions>
<definition name="showcase.index" template="/tiles/layout.jsp">
<put name="title" value="Tiles Showcase"/>
<put name="header" value="/tiles/header.jsp"/>
<put name="body" value="/tiles/body.jsp"/>
<put-attribute name="title" value="Tiles Showcase"/>
<put-attribute name="header" value="/tiles/header.jsp"/>
<put-attribute name="body" value="/tiles/body.jsp"/>
</definition>
<definition name="showcase.freemarker" template="/tiles/layout.jsp">
<put name="title" value="Tiles/Freemarker Showcase"/>
<put name="header" value="/tiles/header.jsp"/>
<put name="body" value="/tiles/body.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"/>
</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"/>
</definition>
</tiles-definitions>
@@ -5,11 +5,6 @@
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>
@@ -57,7 +52,7 @@
<listener>
<listener-class>
org.apache.tiles.listener.TilesListener
org.apache.struts2.tiles.StrutsTilesListener
</listener-class>
</listener>
@@ -85,6 +80,12 @@
<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>
@@ -24,7 +24,7 @@ Using a JSON list returned from an action (href="/JSONList.action"), without aut
Reload on type (loadOnTextChange="true"), after 3 characters (loadMinimumCout="3", it is "3" by default), without the down arrow button (showDownArrow="false")
<br/>
<s:autocompleter theme="ajax" indicator="indicator" href="%{jsonList}" cssStyle="width: 200px;" autoComplete="false" loadOnTextChange="true" loadMinimumCount="3" showDownArrow="false"/>
<s:autocompleter name="state" theme="ajax" indicator="indicator" href="%{jsonList}" cssStyle="width: 200px;" autoComplete="false" loadOnTextChange="true" loadMinimumCount="3" showDownArrow="false"/>
<img id="indicator" src="${pageContext.request.contextPath}/images/indicator.gif" alt="Loading..." style="display:none"/>
<br/>
+2 -2
View File
@@ -15,9 +15,9 @@ Note: The Ajax tags are experimental. These examples have only been tested under
<li><a href="remotediv">Remote div tag</a></li>
<li><a href="remotelink">Remote link tag</a></li>
<li><a href="tabbedpanel">Tabbed panel</a></li>
<li><a href="widgets">Widgets </a> (may not work in all browsers!)
<li><a href="widgets">Widgets </a> (may not work in all browsers!)
see the <a href="http://www.dojotoolkit.org">dojo website</a> for more information</li>
<li>(broken) <a href="remoteforms">Remote forms</a></li>
<li><a href="remoteforms">Remote forms</a></li>
</ul>
</body>
</html>
@@ -1,18 +0,0 @@
<!-- START SNIPPET: example -->
<html>
<head>
<title></title>
</head>
<body>
<#list actionMessages as msg>
${msg}
</#list>
<@s.form action="guess" method="post">
<@s.textfield label="Guess" name="guess"/>
<@s.submit value="Guess"/>
</@s.form>
</body>
</html>
<!-- END SNIPPET: example -->
+3 -12
View File
@@ -1,6 +1,6 @@
<%--
<%--
showcase.jsp
@version $Date$ $Id$
--%>
@@ -32,7 +32,7 @@
<p>
<%-- THIS LIST IS MAINTAINED IN WEB-INF/decorators/main.jsp TO CREATE THE MENU BAR -- EDIT THERE AND COPY HERE --%>
<ul>
<li><a href="<s:url value="/showcase.jsp"/>">Home</a></li>
<li><a href="<s:url value="/showcase.jsp"/>">Home</a></li>
<li><a href="<s:url value="/ajax/index.jsp" />">Ajax Theme for Struts Tags</a></li>
<li><a href="<s:url value="/chat/index.jsp"/>">Ajax Chat</a>
<li><a href="<s:url action="actionChain1!input" namespace="/actionchaining" includeParams="none" />">Action Chaining</a></li>
@@ -52,15 +52,6 @@
<li><a href="<s:url value="/validation/index.jsp"/>">Validation</a></li>
<li class="last"><a href="<s:url value="/help.jsp"/>">Help</a></li>
</ul>
<h2>Sandbox</h2>
<p>
These examples are under development and may not be fully operational.
</p>
<ul>
<li><a href="<s:url action="guess" namespace="/continuations" />">Continuations</a></li>
</ul>
</p>
</body>
@@ -10,6 +10,9 @@
<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>
@@ -0,0 +1,12 @@
<#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>
@@ -1,4 +1,4 @@
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%-- Show usage; Used in Header --%>
@@ -6,10 +6,12 @@
<html>
<head><title><tiles:getAsString name="title"/></title></head>
<body>
<tiles:attribute name="header"/>
<tiles:insertAttribute name="header"/>
<p id="body">
<tiles:attribute name="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>(broken) <s:a href="%{quizAjax}">Validation (ajax)</s:a></li>
<li><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>
+30 -24
View File
@@ -1,14 +1,14 @@
<?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.
@@ -33,7 +33,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.0.5</version>
<version>2.0.10-SNAPSHOT</version>
</parent>
<scm>
@@ -100,10 +100,10 @@
<configuration>
<artifactItems>
<artifactItem>
<groupId>opensymphony</groupId>
<groupId>com.opensymphony</groupId>
<artifactId>xwork</artifactId>
<classifier>javadoc</classifier>
<version>2.0.0</version>
<version>2.0.4</version>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/xwork-apidocs</outputDirectory>
@@ -155,12 +155,13 @@
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-api</artifactId>
<artifactId>struts2-core</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<artifactId>struts2-codebehind-plugin</artifactId>
<version>${version}</version>
</dependency>
@@ -192,38 +193,50 @@
<groupId>org.apache.struts</groupId>
<artifactId>struts2-pell-multipart-plugin</artifactId>
<version>${version}</version>
</dependency>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plexus-plugin</artifactId>
<version>${version}</version>
</dependency>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitegraph-plugin</artifactId>
<version>${version}</version>
</dependency>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitemesh-plugin</artifactId>
<version>${version}</version>
</dependency>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-struts1-plugin</artifactId>
<version>${version}</version>
</dependency>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-tiles-plugin</artifactId>
<version>${version}</version>
</dependency>
</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 +390,7 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
<version>1.0-alpha-10-SNAPSHOT</version>
<version>1.0-alpha-10</version>
<scope>provided</scope>
</dependency>
@@ -416,7 +429,7 @@
<version>1.2.8</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>myfaces</groupId>
@@ -425,13 +438,6 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.rifers</groupId>
<artifactId>rife-continuations</artifactId>
<version>0.0.2</version>
<scope>provided</scope>
</dependency>
<!-- Exclude transitive dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
+4 -4
View File
@@ -58,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>
@@ -130,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>
+2 -2
View File
@@ -60,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>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2 -3
View File
@@ -1,3 +1,2 @@
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/struts2-core-2.0.4.jar -destjar struts2-core-j4-2.0.4.jar
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/struts2-api-2.0.4.jar -destjar struts2-api-j4-2.0.4.jar
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/xwork-2.0.0.jar -destjar xwork-j4-2.0.0.jar
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/struts2-core-2.0.9.jar -destjar struts2-core-j4-2.0.9.jar
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/xwork-2.0.4.jar -destjar xwork-j4-2.0.4.jar
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/struts2-core-2.0.9.jar -destjar struts2-core-j4-2.0.9.jar
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/xwork-2.0.4.jar -destjar xwork-j4-2.0.4.jar
+130 -94
View File
@@ -1,11 +1,32 @@
<?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">
<!--
/*
* $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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.0.5</version>
<version>2.0.10</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
@@ -13,16 +34,16 @@
<name>Struts 2 Core</name>
<scm>
<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>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/struts2-parent-2.0.10</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/struts2-parent-2.0.10</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/struts2-parent-2.0.10</url>
</scm>
<build>
<plugins>
<plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.0-alpha-1-SNAPSHOT</version>
<version>2.0-alpha-4</version>
<executions>
<execution>
<id>unpack-xwork</id>
@@ -31,25 +52,25 @@
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>opensymphony</groupId>
<artifactId>xwork</artifactId>
<version>2.0.0</version>
<classifier>sources</classifier>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/xwork-sources</outputDirectory>
</configuration>
<artifactItems>
<artifactItem>
<groupId>com.opensymphony</groupId>
<artifactId>xwork</artifactId>
<version>2.0.4</version>
<classifier>sources</classifier>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/xwork-sources</outputDirectory>
</configuration>
</execution>
</executions>
</executions>
</plugin>
<plugin>
<groupId>org.apache.myfaces.tobago</groupId>
<artifactId>maven-apt-plugin</artifactId>
<configuration>
<A>uri=/struts-tags,tlibVersion=2.2.3,jspVersion=1.2,shortName=s,displayName="Struts Tags",
outFile=${basedir}/src/main/resources/META-INF/struts-tags.tld,
outFile=${basedir}/target/classes/META-INF/struts-tags.tld,
description="To make it easier to access dynamic data;
the Apache Struts framework includes a library of custom tags.
The tags interact with the framework's validation and internationalization features;
@@ -75,14 +96,14 @@
<goal>execute</goal>
</goals>
</execution>
</executions>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.2</version>
<configuration>
@@ -107,72 +128,93 @@
</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
<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
Samples:
$ cd struts/struts2/
$ mvn clean install -Papps,j4 -Djava14.jar=$JAVA_HOME/../Classes/classes.jar
$ mvn clean install -Papps,j4 -Djava14.jar="$JAVA_HOME/jre/lib/rt.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>
-->
<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>
@@ -250,15 +292,9 @@
<dependencies>
<dependency>
<groupId>opensymphony</groupId>
<groupId>com.opensymphony</groupId>
<artifactId>xwork</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-api</artifactId>
<version>${pom.version}</version>
<version>2.0.4</version>
</dependency>
<dependency>
@@ -282,9 +318,9 @@
</dependency>
<dependency>
<groupId>ognl</groupId>
<groupId>opensymphony</groupId>
<artifactId>ognl</artifactId>
<version>2.6.9</version>
<version>2.6.11</version>
</dependency>
<dependency>
@@ -467,10 +503,10 @@
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts-annotations</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.2</version>
<optional>true</optional>
</dependency>
</dependencies>
</project>
@@ -76,6 +76,9 @@ 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";
@@ -147,4 +150,11 @@ public final class StrutsConstants {
public static final String STRUTS_XWORKCONVERTER = "struts.xworkConverter";
public static final String STRUTS_ALWAYS_SELECT_FULL_NAMESPACE = "struts.mapper.alwaysSelectFullNamespace";
/** XWork default text provider */
public static final String STRUTS_XWORKTEXTPROVIDER = "struts.xworkTextProvider";
/** 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";
}
@@ -49,6 +49,7 @@ public abstract class AbstractRemoteCallUIBean extends ClosingUIBean implements
protected String notifyTopics;
protected String showErrorTransportText;
protected String indicator;
protected String showLoadingText;
public AbstractRemoteCallUIBean(ValueStack stack, HttpServletRequest request,
HttpServletResponse response) {
@@ -86,6 +87,8 @@ public abstract class AbstractRemoteCallUIBean extends ClosingUIBean implements
addParameter("showErrorTransportText", findValue(showErrorTransportText, Boolean.class));
else
addParameter("showErrorTransportText", true);
if (showLoadingText != null)
addParameter("showLoadingText", findString(showLoadingText));
}
@@ -165,4 +168,8 @@ public abstract class AbstractRemoteCallUIBean extends ClosingUIBean implements
this.indicator = indicator;
}
@StrutsTagAttribute(description="Show loading text on targets", type="Boolean", defaultValue="true")
public void setShowLoadingText(String showLoadingText) {
this.showLoadingText = showLoadingText;
}
}
@@ -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;
*
@@ -71,6 +71,7 @@ import com.opensymphony.xwork2.util.ValueStack;
* 'listenTopics' comma separated list of topics names, that will trigger a request
* 'indicator' element to be shown while the request executing
* 'showErrorTransportText': whether errors should be displayed (on 'targets')</p>
* 'showLoadingText' show loading text on targets</p>
* 'notifyTopics' comma separated list of topics names, that will be published. Three parameters are passed:<p/>
* <ul>
* <li>data: html or json object when type='load' or type='error'</li>
@@ -29,18 +29,10 @@ import org.apache.struts2.views.annotations.StrutsTagAttribute;
import com.opensymphony.xwork2.util.ValueStack;
/**
* <!-- START SNIPPET: javadoc -->
* <p>The autocomplete tag is a combobox that can autocomplete text entered on the input box.
* When used on the "simple" theme, the autocompleter can be used like the ComboBox.
* When used on the "ajax" theme, the list can be retieved from an action. This action must
* return a JSON list in the format:</p>
* <pre>
* [
* ["Text 1","Value1"],
* ["Text 2","Value2"],
* ["Text 3","Value3"]
* ]
* </pre>
* <!-- START SNIPPET: ajaxJavadoc -->
* When used on the "ajax" theme, the list can be retieved from an action. </p>
* <B>THE FOLLOWING IS ONLY VALID WHEN AJAX IS CONFIGURED</B>
* <ul>
* <li>href</li>
@@ -70,15 +62,27 @@ import com.opensymphony.xwork2.util.ValueStack;
* 'showErrorTransportText': whether errors should be displayed (on 'targets')<p/>
* 'loadOnTextChange' options will be reloaded everytime a character is typed on the textbox<p/>
* 'loadMinimumCount' minimum number of characters that will force the content to be loaded<p/>
* 'showDownError' show or hide the down arrow button
* 'showDownError' show or hide the down arrow button<p/>
* 'searchType' how the search must be performed, options are: "startstring", "startword" and "substring"<p/>
* 'keyName' name of the field to which the selected key will be assigned<p/>
* 'iconPath' path of icon used for the dropdown<p/>
* 'templateCssPath' path to css file used to customize Dojo's widget<p/>
* 'dataFieldName' name of the field to be used as the list in the returned JSON string<p/>
* 'notifyTopics' comma separated list of topics names, that will be published. Three parameters are passed:<p/>
* <ul>
* <li>data: selected value when type='valuechanged'</li>
* <li>type: 'before' before the request is made, 'valuechanged' when selection changes, 'load' when the request succeeds, or 'error' when it fails</li>
* <li>request: request javascript object, when type='load' or type='error'</li>
* <ul>
*
*<!-- END SNIPPET: javadoc -->
*<!-- START SNIPPET: example -->
*<p>Autocompleter that gets its list from an action:</p>
*&lt;s:autocompleter name="test" href="%{jsonList}" autoComplete="false"/&gt;
*<br/>
**<p>Autocompleter that uses a list:</p>
*&lt;s:autocompleter name="test" list="{'apple','banana','grape','pear'}" autoComplete="false"/&gt;
*<br/>
*<!-- END SNIPPET: example -->
*/
@StrutsTag(name="autocompleter", tldTagClass="org.apache.struts2.views.jsp.ui.AutocompleterTag", description="Renders a combobox with autocomplete and AJAX capabilities")
public class Autocompleter extends ComboBox {
@@ -101,7 +105,12 @@ public class Autocompleter extends ComboBox {
protected String loadOnTextChange;
protected String loadMinimumCount;
protected String showDownArrow;
protected String templateCssPath;
protected String iconPath;
protected String keyName;
protected String dataFieldName;
protected String resultsLimit;
public Autocompleter(ValueStack stack, HttpServletRequest request,
HttpServletResponse response) {
super(stack, request, response);
@@ -159,11 +168,23 @@ public class Autocompleter extends ComboBox {
addParameter("showDownArrow", findValue(showDownArrow, Boolean.class));
else
addParameter("showDownArrow", Boolean.TRUE);
//get the key value
if(name != null) {
String keyNameExpr = "%{" + name + "Key}";
addParameter("key", findString(keyNameExpr));
if(templateCssPath != null)
addParameter("templateCssPath", findString(templateCssPath));
if(iconPath != null)
addParameter("iconPath", findString(iconPath));
if(dataFieldName != null)
addParameter("dataFieldName", findString(dataFieldName));
if(keyName != null)
addParameter("keyName", findString(keyName));
else {
keyName = name + "Key";
addParameter("keyName", findString(keyName));
}
String keyNameExpr = "%{" + keyName + "}";
addParameter("key", findString(keyNameExpr));
if(resultsLimit != null)
addParameter("searchLimit", findString(resultsLimit));
}
protected Object findListValue() {
@@ -256,4 +277,29 @@ public class Autocompleter extends ComboBox {
public void setList(String list) {
super.setList(list);
}
@StrutsTagAttribute(description="Template css path")
public void setTemplateCssPath(String templateCssPath) {
this.templateCssPath = templateCssPath;
}
@StrutsTagAttribute(description="Path to icon used for the dropdown")
public void setIconPath(String iconPath) {
this.iconPath = iconPath;
}
@StrutsTagAttribute(description="Name of the field to which the selected key will be assigned")
public void setKeyName(String keyName) {
this.keyName = keyName;
}
@StrutsTagAttribute(description="Name of the field in the returned JSON object that contains the data array", defaultValue="Value specified in 'name'")
public void setDataFieldName(String dataFieldName) {
this.dataFieldName = dataFieldName;
}
@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 HashMap();
this.parameters = new LinkedHashMap();
getComponentStack().push(this);
}
/**
* Get's the name of this component.
* Gets the name of this component.
* @return the name of this component.
*/
private String getComponentName() {
@@ -87,7 +87,7 @@ public class Component {
}
/**
* Get's the OGNL value stack assoicated with this component.
* Gets 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 {
}
/**
* Get's the component stack of this component.
* Gets 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>.
@@ -338,12 +338,14 @@ public class Component {
*/
protected String determineActionURL(String action, String namespace, String method,
HttpServletRequest req, HttpServletResponse res, Map parameters, String scheme,
boolean includeContext, boolean encodeResult) {
boolean includeContext, boolean encodeResult, boolean forceAddSchemeHostAndPort,
boolean escapeAmp) {
String finalAction = findString(action);
String finalMethod = method != null ? findString(method) : method;
String finalNamespace = determineNamespace(namespace, getStack(), req);
ActionMapping mapping = new ActionMapping(finalAction, finalNamespace, method, parameters);
ActionMapping mapping = new ActionMapping(finalAction, finalNamespace, finalMethod, parameters);
String uri = actionMapper.getUriFromActionMapping(mapping);
return UrlHelper.buildUrl(uri, req, res, parameters, scheme, includeContext, encodeResult);
return UrlHelper.buildUrl(uri, req, res, parameters, scheme, includeContext, encodeResult, forceAddSchemeHostAndPort, escapeAmp);
}
/**
@@ -407,7 +409,7 @@ public class Component {
}
/**
* Get's the parameters.
* Gets the parameters.
* @return the parameters. Is never <tt>null</tt>.
*/
public Map getParameters() {
@@ -415,7 +417,7 @@ public class Component {
}
/**
* Add's all the given parameters to this componenets own parameters.
* Adds all the given parameters to this component's own parameters.
* @param params the parameters to add.
*/
public void addAllParameters(Map params) {
@@ -423,9 +425,9 @@ public class Component {
}
/**
* Add's the given key and value to this components own parameter.
* Adds the given key and value to this component's own parameter.
* <p/>
* If the provided key is <tt>null</tt> nothing happends.
* If the provided key is <tt>null</tt> nothing happens.
* 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.
@@ -444,7 +446,7 @@ public class Component {
}
/**
* Get's the id for referencing element.
* Gets the id for referencing element.
* @return the id for referencing element.
*/
public String getId() {
@@ -465,5 +467,4 @@ public class Component {
public boolean usesBody() {
return false;
}
}
@@ -43,51 +43,53 @@ import com.opensymphony.xwork2.util.ValueStack;
* A stand-alone DateTimePicker widget that makes it easy to select a date/time, or increment by week, month,
* and/or year.
* </p>
* Dates attributes passed in the `RFC 3339` format:
*
* Renders date/time picker element.</p>
* Format supported by this component are:-
* <p>
* It is possible to customize the user-visible formatting with either the
* 'formatLength' (long, short, medium or full) or 'displayFormat' attributes. By defaulty current
* locale will be used.</p>
* </p>
*
* Syntax supported by 'displayFormat' is (http://www.unicode.org/reports/tr35/tr35-4.html#Date_Format_Patterns):-
* <table border="1">
* <tr>
* <td>Format</td>
* <td>Description</td>
* </tr>
* <tr>
* <td>#dd</td>
* <td>Display day in two digits format</td>
* <td>d</td>
* <td>Day of the month</td>
* </tr>
* <tr>
* <td>#d</td>
* <td>Try to display day in one digit format, if cannot use 2 digit format</td>
* <td>D</td>
* <td>Day of year</td>
* </tr>
* <tr>
* <td>#MM</td>
* <td>Display month in two digits format</td>
* <td>M</td>
* <td>Month - Use one or two for the numerical month, three for the abbreviation, or four for the full name, or 5 for the narrow name.</td>
* </tr>
* <tr>
* <td>#M</td>
* <td>Try to display month in one digits format, if cannot use 2 digit format</td>
* <td>h</td>
* <td>Hour [1-12].</td>
* </tr>
* <tr>
* <td>#yyyy</td>
* <td>Display year in four digits format</td>
* <td>H</td>
* <td>Hour [0-23].</td>
* </tr>
* <tr>
* <td>#yy</td>
* <td>Display the last two digits of the yaer</td>
* <td>m</td>
* <td>Minute. Use one or two for zero padding.</td>
* </tr>
* <tr>
* <td>#y</td>
* <td>Display the last digits of the year</td>
* <td>s</td>
* <td>Second. Use one or two for zero padding.</td>
* </tr>
* </table>
*
* <p>
* It is possible to customize the user-visible formatting with either the
* formatLength or displayFormat attributes. The value sent to the server is
* The value sent to the server is
* typically a locale-independent value in a hidden field as defined by the name
* attribute. RFC3339 representation is used by default, but other options are
* available with saveFormat
* attribute. RFC3339 representation is the format used.
* </p>
*
* <p/>
@@ -102,7 +104,7 @@ import com.opensymphony.xwork2.util.ValueStack;
* Example 1:
* &lt;s:datetimepicker name="order.date" label="Order Date" /&gt;
* Example 2:
* &lt;s:datetimepicker name="delivery.date" label="Delivery Date" format="#yyyy-#MM-#dd" /&gt;
* &lt;s:datetimepicker name="delivery.date" label="Delivery Date" format="yyyy-MM-dd" /&gt;
*
* <!-- END SNIPPET: expl1 -->
* </pre>
@@ -127,7 +129,7 @@ import com.opensymphony.xwork2.util.ValueStack;
public class DateTimePicker extends UIBean {
final public static String TEMPLATE = "datetimepicker";
final private static SimpleDateFormat RFC3399_FORMAT = new SimpleDateFormat(
final private static SimpleDateFormat RFC3339_FORMAT = new SimpleDateFormat(
"yyyy-MM-dd'T'HH:mm:ss");
final protected static Log LOG = LogFactory.getLog(DateTimePicker.class);
@@ -146,6 +148,7 @@ public class DateTimePicker extends UIBean {
protected String staticDisplay;
protected String dayWidth;
protected String language;
protected String templateCssPath;
public DateTimePicker(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
super(stack, request, response);
@@ -177,7 +180,7 @@ public class DateTimePicker extends UIBean {
if(value != null)
addParameter("value", findString(value));
if(iconPath != null)
addParameter("iconPath", iconPath);
addParameter("iconPath", findString(iconPath));
if(formatLength != null)
addParameter("formatLength", findString(formatLength));
if(displayFormat != null)
@@ -191,7 +194,9 @@ public class DateTimePicker extends UIBean {
addParameter("type", findString(type));
else
addParameter("type", "date");
if(templateCssPath != null)
addParameter("templateCssPath", findString(templateCssPath));
// format the value to RFC 3399
if(parameters.containsKey("value")) {
parameters.put("nameValue", format(parameters.get("value")));
@@ -258,7 +263,7 @@ public class DateTimePicker extends UIBean {
this.formatLength = formatLength;
}
@StrutsTagAttribute(description=" Path to icon used for the dropdown")
@StrutsTagAttribute(description="Path to icon used for the dropdown")
public void setIconPath(String iconPath) {
this.iconPath = iconPath;
}
@@ -279,25 +284,30 @@ public class DateTimePicker extends UIBean {
this.toggleType = toggleType;
}
@StrutsTagAttribute(description="Template css path")
public void setTemplateCssPath(String templateCssPath) {
this.templateCssPath = templateCssPath;
}
private String format(Object obj) {
if(obj == null)
return null;
if(obj instanceof Date) {
return RFC3399_FORMAT.format((Date) obj);
return RFC3339_FORMAT.format((Date) obj);
} else {
// try to parse a date
String dateStr = obj.toString();
if(dateStr.equalsIgnoreCase("today"))
return RFC3399_FORMAT.format(new Date());
return RFC3339_FORMAT.format(new Date());
try {
Date date = null;
if(this.displayFormat != null) {
SimpleDateFormat format = new SimpleDateFormat(
this.displayFormat);
(String) getParameters().get("displayFormat"));
date = format.parse(dateStr);
return RFC3399_FORMAT.format(date);
return RFC3339_FORMAT.format(date);
} else {
// last resource to assume already in correct/default format
return dateStr;
@@ -69,14 +69,16 @@ import com.opensymphony.xwork2.util.ValueStack;
* 'formFilter' is the name of a function which will be used to filter the fields that will be
* seralized. This function takes as a parameter the element and returns true if the element
* should be included.<p/>
* 'updateFreq' sets(in milliseconds) the update interval.
* 'autoStart' if set to true(true by default) starts the timer automatically
* 'startTimerListenTopics' is a comma-separated list of topics used to start the timer
* 'stopTimerListenTopics' is a comma-separated list of topics used to stop the timer
* 'listenTopics' comma separated list of topics names, that will trigger a request
* 'indicator' element to be shown while the request executing
* 'updateFreq' sets(in milliseconds) the update interval.<p/>
* 'autoStart' if set to true(true by default) starts the timer automatically<p/>
* 'startTimerListenTopics' is a comma-separated list of topics used to start the timer<p/>
* 'stopTimerListenTopics' is a comma-separated list of topics used to stop the timer<p/>
* 'listenTopics' comma separated list of topics names, that will trigger a request<p/>
* 'indicator' element to be shown while the request executing<p/>
* 'showErrorTransportText': whether errors should be displayed (on 'targets')</p>
* 'notifyTopics' comma separated list of topics names, that will be published. Three parameters are passed:
* 'showLoadingText' show loading text on targets</p>
* 'separateScript' Run scripts in a separate scope, unique for each Div<p/>
* 'notifyTopics' comma separated list of topics names, that will be published. Three parameters are passed:<p/>
* <ul>
* <li>data: html or json object when type='load' or type='error'</li>
* <li>type: 'before' before the request is made, 'load' when the request succeeds, or 'error' when it fails</li>
@@ -116,6 +118,7 @@ public class Div extends AbstractRemoteCallUIBean {
protected String startTimerListenTopics;
protected String stopTimerListenTopics;
protected String refreshOnShow;
protected String separateScripts;
public Div(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
super(stack, request, response);
@@ -144,6 +147,8 @@ public class Div extends AbstractRemoteCallUIBean {
addParameter("startTimerListenTopics", findString(startTimerListenTopics));
if (stopTimerListenTopics != null)
addParameter("stopTimerListenTopics", findString(stopTimerListenTopics));
if (separateScripts != null)
addParameter("separateScripts", findValue(separateScripts, Boolean.class));
}
@StrutsTagAttribute(description="Start timer automatically", type="Boolean", defaultValue="true")
@@ -180,4 +185,9 @@ public class Div extends AbstractRemoteCallUIBean {
public void setAfterLoading(String afterLoading) {
this.afterLoading = afterLoading;
}
@StrutsTagAttribute(description="Run scripts in a separate scope, unique for each Div", defaultValue="true")
public void setSeparateScripts(String separateScripts) {
this.separateScripts = separateScripts;
}
}
@@ -192,6 +192,8 @@ 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) {
@@ -514,7 +516,6 @@ public abstract class DoubleListUIBean extends ListUIBean {
return doubleList;
}
@StrutsTagAttribute(description="Set the list key of the second attribute")
public String getDoubleListKey() {
return doubleListKey;
}
@@ -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,24 +20,6 @@
*/
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;
@@ -47,12 +29,29 @@ 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.ValueStack;
import com.opensymphony.xwork2.util.TextUtils;
import com.opensymphony.xwork2.util.ValueStack;
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 -->
@@ -95,6 +94,11 @@ import com.opensymphony.xwork2.validator.Validator;
*/
@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";
@@ -204,7 +208,7 @@ public class Form extends ClosingUIBean {
}
/**
* Form component determine the its HTML element id as follows:-
* The Form component determines 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>
@@ -222,6 +226,9 @@ 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 {
@@ -287,14 +294,20 @@ public class Form extends ClosingUIBean {
}
// if the id isn't specified, use the action name
if (id == null) {
addParameter("id", action);
if (id == null && action!=null) {
addParameter("id", escape(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);
@@ -329,7 +342,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.booleanValue()) {
if (validate != null && validate) {
addParameter("performValidation", Boolean.FALSE);
@@ -337,9 +350,8 @@ public class Form extends ClosingUIBean {
ActionConfig actionConfig = runtimeConfiguration.getActionConfig(namespace, actionName);
if (actionConfig != null) {
List interceptors = actionConfig.getInterceptors();
for (Iterator i = interceptors.iterator(); i.hasNext();) {
InterceptorMapping interceptorMapping = (InterceptorMapping) i.next();
List<InterceptorMapping> interceptors = actionConfig.getInterceptors();
for (InterceptorMapping interceptorMapping : interceptors) {
if (ValidationInterceptor.class.isInstance(interceptorMapping.getInterceptor())) {
ValidationInterceptor validationInterceptor = (ValidationInterceptor) interceptorMapping.getInterceptor();
@@ -363,11 +375,6 @@ 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())) {
@@ -375,7 +382,7 @@ public class Form extends ClosingUIBean {
}
}
if (action != null) {
String result = PortletUrlHelper.buildUrl(action, namespace,
String result = PortletUrlHelper.buildUrl(action, namespace, null,
getParameters(), type, portletMode, windowState);
addParameter("action", result);
@@ -409,10 +416,9 @@ public class Form extends ClosingUIBean {
return Collections.EMPTY_LIST;
}
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();
List<Validator> all = ActionValidatorManagerFactory.getInstance().getValidators(actionClass, (String) getParameters().get("actionName"));
List<Validator> validators = new ArrayList<Validator>();
for (Validator validator : all) {
if (validator instanceof FieldValidator) {
FieldValidator fieldValidator = (FieldValidator) validator;
if (fieldValidator.getFieldName().equals(name)) {
@@ -440,7 +446,7 @@ public class Form extends ClosingUIBean {
this.onsubmit = onsubmit;
}
@StrutsTagAttribute(description="Set action nane to submit to, without .action suffix", defaultValue="current action")
@StrutsTagAttribute(description="Set action name to submit to, without .action suffix", defaultValue="current action")
public void setAction(String action) {
this.action = action;
}
@@ -471,7 +477,7 @@ public class Form extends ClosingUIBean {
this.validate = validate;
}
@StrutsTagAttribute(description="he portlet mode to display after the form submit")
@StrutsTagAttribute(description="The portlet mode to display after the form submit")
public void setPortletMode(String portletMode) {
this.portletMode = portletMode;
}
@@ -20,20 +20,20 @@
*/
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.util.LocalizedTextUtil;
import com.opensymphony.xwork2.util.ValueStack;
/**
* <!-- START SNIPPET: javadoc -->
*
@@ -102,10 +102,12 @@ public class I18n extends Component {
if (bundle != null) {
final Locale locale = (Locale) getStack().getContext().get(ActionContext.LOCALE);
getStack().push(new TextProviderSupport(bundle, new LocaleProvider() {
public Locale getLocale() {
return locale;
}
TextProviderFactory tpf = new TextProviderFactory();
Dispatcher.getInstance().getContainer().inject(tpf);
getStack().push(tpf.createInstance(bundle, new LocaleProvider() {
public Locale getLocale() {
return locale;
}
}));
pushed = true;
}
@@ -123,6 +123,14 @@ 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);
@@ -252,6 +260,34 @@ 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
@@ -476,5 +512,66 @@ 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;
}
}
@@ -47,6 +47,8 @@ public interface RemoteUICallBean {
void setShowErrorTransportText(String showError);
void setShowLoadingText(String showLoadingText);
void setIndicator(String indicator);
}
@@ -32,7 +32,9 @@ import com.opensymphony.xwork2.util.ValueStack;
* <p>The set tag assigns a value to a variable in a specified scope. It is useful when you wish to assign a variable to a
* complex expression and then simply reference that variable each time rather than the complex expression. This is
* useful in both cases: when the complex expression takes time (performance improvement) or is hard to read (code
* readability improvement).</P>
* readability improvement).</p>
* <p>If the tag is used with body content, the evaluation of the value parameter is omitted. Instead, the String to
* which the body eveluates is set as value for the scoped variable.</p>
*
* The scopes available are as follows :-
* <ul>
@@ -75,7 +77,7 @@ import com.opensymphony.xwork2.util.ValueStack;
* </pre>
*
*/
@StrutsTag(name="set", tldBodyContent="empty", tldTagClass="org.apache.struts2.views.jsp.SetTag", description="Assigns a value to a variable in a specified scope")
@StrutsTag(name="set", tldBodyContent="JSP", tldTagClass="org.apache.struts2.views.jsp.SetTag", description="Assigns a value to a variable in a specified scope")
public class Set extends Component {
protected String name;
protected String scope;
@@ -88,11 +90,18 @@ public class Set extends Component {
public boolean end(Writer writer, String body) {
ValueStack stack = getStack();
Object o;
if (value == null) {
value = "top";
if (body!=null && !body.equals("")) {
o = body;
} else {
o = findValue("top");
}
} else {
o = findValue(value);
}
Object o = findValue(value);
body="";
String name;
if (altSyntax()) {
@@ -48,19 +48,19 @@ import com.opensymphony.xwork2.util.ValueStack;
* <p/> <b>Examples</b>
* <pre>
* <!-- START SNIPPET: example -->
* &lt;s:submit value="%{'Submit'}" /&gt;
* &lt;s:submit value="%{'Submit the form'}" /&gt;
* <!-- END SNIPPET: example -->
* </pre>
* <pre>
* <!-- START SNIPPET: example2 -->
* Render an image submit:
* &lt;s:submit type="image" value="%{'Submit'}" label="Submit the form" src="submit.gif"/&gt;
* &lt;s:submit type="image" value="%{'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'}" label="Submit the form"/&gt;
* &lt;s:submit type="button" value="%{'Submit the form'}"/&gt;
* <!-- END SNIPPET: example3 -->
* </pre>
*
@@ -101,6 +101,7 @@ import com.opensymphony.xwork2.util.ValueStack;
* 'listenTopics' comma separated list of topics names, that will trigger a request
* 'indicator' element to be shown while the request executing
* 'showErrorTransportText': whether errors should be displayed (on 'targets')</p>
* 'showLoadingText' show loading text on targets</p>
* 'notifyTopics' comma separated list of topics names, that will be published. Three parameters are passed:<p/>
* <ul>
* <li>data: html or json object when type='load' or type='error'</li>
@@ -154,7 +155,7 @@ public class Submit extends FormButton implements RemoteUICallBean{
protected String notifyTopics;
protected String showErrorTransportText;
protected String indicator;
protected String showLoadingText;
//these two are called "preInvokeJS" and "onLoadJS" on the tld
//Names changed here to keep some consistency
protected String beforeLoading;
@@ -214,6 +215,8 @@ public class Submit extends FormButton implements RemoteUICallBean{
addParameter("indicator", findString(indicator));
if (targets != null)
addParameter("targets", findString(targets));
if (showLoadingText != null)
addParameter("showLoadingText", findString(showLoadingText));
}
/**
@@ -327,4 +330,9 @@ public class Submit extends FormButton implements RemoteUICallBean{
public void setIndicator(String indicator) {
this.indicator = indicator;
}
@StrutsTagAttribute(description="Show loading text on targets", type="Boolean", defaultValue="true")
public void setShowLoadingText(String showLoadingText) {
this.showLoadingText = showLoadingText;
}
}
@@ -32,6 +32,11 @@ 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>
@@ -66,6 +71,8 @@ public class TabbedPanel extends ClosingUIBean {
protected String selectedTab;
protected String closeButton;
protected String doLayout ;
protected String templateCssPath;
protected String useSelectedTabCookie;
public TabbedPanel(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
super(stack, request, response);
@@ -89,6 +96,11 @@ public class TabbedPanel extends ClosingUIBean {
addParameter("labelPosition", null);
addParameter("labelPosition", labelPosition);
}
if(templateCssPath != null)
addParameter("templateCssPath", findString(templateCssPath));
if(useSelectedTabCookie != null) {
addParameter("useSelectedTabCookie", findString(useSelectedTabCookie));
}
}
public String getDefaultOpenTemplate() {
@@ -124,4 +136,16 @@ public class TabbedPanel extends ClosingUIBean {
public void setDoLayout(String doLayout) {
this.doLayout = doLayout;
}
@StrutsTagAttribute(description="Template css path")
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;
}
}
@@ -852,7 +852,8 @@ public abstract class UIBean extends Component {
/**
* Create HTML id element for the component and populate this component parmaeter
* map.
* 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.
*
* The order is as follows :-
* <ol>
@@ -864,19 +865,22 @@ 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()) {
addParameter("id", findString(id));
tryId = findString(id);
} else {
addParameter("id", id);
tryId = id;
}
} else if (form != null) {
addParameter("id", form.getParameters().get("id") + "_"
+ escape(name != null ? findString(name) : null));
tryId = form.getParameters().get("id") + "_"
+ escape(name != null ? findString(name) : null);
} else {
addParameter("id", escape(name != null ? findString(name) : null));
tryId = escape(name != null ? findString(name) : null);
}
addParameter("id", tryId);
addParameter("escapedId", escape(tryId));
}
@StrutsTagAttribute(description="The template directory.")
@@ -903,7 +907,7 @@ public abstract class UIBean extends Component {
this.cssClass = cssClass;
}
@StrutsTagAttribute(description="The css style definitions for element ro use")
@StrutsTagAttribute(description="The css style definitions for element to use")
public void setCssStyle(String cssStyle) {
this.cssStyle = cssStyle;
}
@@ -53,6 +53,12 @@ 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
@@ -68,16 +74,21 @@ 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) default to the scheme this request is in</li>
* <li>scheme (String) - http scheme (http, https) defaults to the scheme this request is in</li>
* <li>namespace - action's namespace</li>
* <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'.
* <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'.
* 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) - determine wheather to include the web app context path. Default is true.</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>
* </ul>
*
* <!-- END SNIPPET: params -->
@@ -98,7 +109,7 @@ import com.opensymphony.xwork2.util.ValueStack;
*
* &lt;-- Example 3--&gt;
* &lt;s:url includeParams="get" &gt;
* &lt:param name="id" value="%{'22'}" /&gt;
* &lt;s:param name="id" value="%{'22'}" /&gt;
* &lt;/s:url&gt;
*
* <!-- END SNIPPET: example -->
@@ -135,10 +146,12 @@ 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;
@@ -236,14 +249,14 @@ public class URL extends Component {
String result;
if (value == null && action != null) {
if(Dispatcher.getInstance().isPortletSupportActive() && PortletActionContext.isPortletRequest()) {
result = PortletUrlHelper.buildUrl(action, namespace, parameters, portletUrlType, portletMode, windowState);
if (Dispatcher.getInstance().isPortletSupportActive() && PortletActionContext.isPortletRequest()) {
result = PortletUrlHelper.buildUrl(action, namespace, method, parameters, portletUrlType, portletMode, windowState);
}
else {
result = determineActionURL(action, namespace, method, req, res, parameters, scheme, includeContext, encode);
result = determineActionURL(action, namespace, method, req, res, parameters, scheme, includeContext, encode, forceAddSchemeHostAndPort, escapeAmp);
}
} else {
if(Dispatcher.getInstance().isPortletSupportActive() && PortletActionContext.isPortletRequest()) {
if (Dispatcher.getInstance().isPortletSupportActive() && PortletActionContext.isPortletRequest()) {
result = PortletUrlHelper.buildResourceUrl(value, parameters);
}
else {
@@ -254,7 +267,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);
result = UrlHelper.buildUrl(_value, req, res, parameters, scheme, includeContext, encode, forceAddSchemeHostAndPort, escapeAmp);
}
}
if ( anchor != null && anchor.length() > 0 ) {
@@ -293,7 +306,7 @@ public class URL extends Component {
this.value = value;
}
@StrutsTagAttribute(description="he action generate url for, if not using value")
@StrutsTagAttribute(description="The action to generate the URL for, if not using value")
public void setAction(String action) {
this.action = action;
}
@@ -313,7 +326,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;
}
@@ -328,7 +341,7 @@ public class URL extends Component {
this.windowState = windowState;
}
@StrutsTagAttribute(description="Specifies if this should be a portlet render or action url")
@StrutsTagAttribute(description="Specifies if this should be a portlet render or action URL. Default is \"render\". To create an action URL, use \"action\".")
public void setPortletUrlType(String portletUrlType) {
this.portletUrlType = portletUrlType;
}
@@ -338,6 +351,16 @@ 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 +1,23 @@
<!--
/*
* $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,6 +77,12 @@ 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,9 +22,7 @@ package org.apache.struts2.components.template;
import java.io.IOException;
import java.io.Writer;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.*;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
@@ -33,6 +31,7 @@ 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;
@@ -41,8 +40,7 @@ import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.util.ValueStack;
import freemarker.template.Configuration;
import freemarker.template.SimpleHash;
import freemarker.template.*;
/**
* Freemarker based template engine.
@@ -51,6 +49,10 @@ 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",
@@ -82,22 +84,40 @@ public class FreemarkerTemplateEngine extends BaseTemplateEngine {
Configuration config = freemarkerManager.getConfiguration(servletContext);
// get the list of templates we can use
List templates = templateContext.getTemplate().getPossibleTemplates(this);
List<Template> templates = templateContext.getTemplate().getPossibleTemplates(this);
// find the right template
freemarker.template.Template template = null;
String templateName = null;
Exception exception = null;
for (Iterator iterator = templates.iterator(); iterator.hasNext();) {
Template t = (Template) iterator.next();
for (Template t : templates) {
templateName = getFinalTemplateName(t);
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;
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;
}
}
}
}
@@ -154,4 +174,40 @@ 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,19 +20,16 @@
*/
package org.apache.struts2.components.template;
import java.util.Iterator;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.PageContext;
import com.opensymphony.xwork2.util.ValueStack;
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 com.opensymphony.xwork2.util.ValueStack;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.PageContext;
import java.util.List;
/**
* JSP based template engine.
@@ -50,11 +47,10 @@ public class JspTemplateEngine extends BaseTemplateEngine {
ValueStack stack = templateContext.getStack();
stack.push(tag);
PageContext pageContext = (PageContext) stack.getContext().get(ServletActionContext.PAGE_CONTEXT);
List templates = template.getPossibleTemplates(this);
List<Template> templates = template.getPossibleTemplates(this);
Exception exception = null;
boolean success = false;
for (Iterator iterator = templates.iterator(); iterator.hasNext();) {
Template t = (Template) iterator.next();
for (Template t : templates) {
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 getPossibleTemplates(TemplateEngine engine) {
List list = new ArrayList(3);
public List<Template> getPossibleTemplates(TemplateEngine engine) {
List<Template> list = new ArrayList<Template>(3);
Template template = this;
String parentTheme;
list.add(template);
@@ -20,16 +20,7 @@
*/
package org.apache.struts2.components.template;
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 com.opensymphony.xwork2.inject.Inject;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.ServletActionContext;
@@ -37,7 +28,13 @@ import org.apache.struts2.views.velocity.VelocityManager;
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.context.Context;
import com.opensymphony.xwork2.inject.Inject;
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;
/**
* Velocity based template engine.
@@ -64,14 +61,13 @@ public class VelocityTemplateEngine extends BaseTemplateEngine {
VelocityEngine velocityEngine = velocityManager.getVelocityEngine();
// get the list of templates we can use
List templates = templateContext.getTemplate().getPossibleTemplates(this);
List<Template> templates = templateContext.getTemplate().getPossibleTemplates(this);
// find the right template
org.apache.velocity.Template template = null;
String templateName = null;
Exception exception = null;
for (Iterator iterator = templates.iterator(); iterator.hasNext();) {
Template t = (Template) iterator.next();
for (Template t : templates) {
templateName = getFinalTemplateName(t);
try {
// try to load, and if it works, stop at the first one

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