Compare commits

...

193 Commits

Author SHA1 Message Date
Ted Nathan Husted ea055ccb9d WW-1715 Tag r589454 as Struts 2.1.0
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_0@589458 13f79535-47bb-0310-9956-ffa450edef68
2007-10-29 01:12:30 +00:00
Ted Nathan Husted 82e768b673 WW-1715 Update POMs and backport for 2.1.0.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@589454 13f79535-47bb-0310-9956-ffa450edef68
2007-10-29 01:09:07 +00:00
Ted Nathan Husted 002f4ab8c0 WW-1715 Update site for 2.0.11 and prepare for 2.1.0.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@589447 13f79535-47bb-0310-9956-ffa450edef68
2007-10-29 00:40:29 +00:00
Donald J. Brown 2cce257320 Adding automatic mode for message store interceptor
WW-2276


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@589240 13f79535-47bb-0310-9956-ffa450edef68
2007-10-27 23:36:15 +00:00
Donald J. Brown 146d2677c6 Improving parsing of extension list to be more intuitive
WW-1715


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@589053 13f79535-47bb-0310-9956-ffa450edef68
2007-10-27 06:49:24 +00:00
Musachy Barroso f628fa5baa use ?default instead of ! for people using older freemarker versions
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@588640 13f79535-47bb-0310-9956-ffa450edef68
2007-10-26 13:38:35 +00:00
Donald J. Brown 36e823c7e9 Getting rid of unnecessary calls to setup WW-1715
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@588199 13f79535-47bb-0310-9956-ffa450edef68
2007-10-25 11:02:52 +00:00
Donald J. Brown 90efa7b36a Nulling out variables on teardown to fix memory leak in tests WW-1715
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@588189 13f79535-47bb-0310-9956-ffa450edef68
2007-10-25 10:11:44 +00:00
Donald J. Brown 342a201eb7 Cleaning up logging during unit tests WW-1715
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@588186 13f79535-47bb-0310-9956-ffa450edef68
2007-10-25 10:01:04 +00:00
Donald J. Brown dbcc05d102 Minor tweaks to tests to reduce memory usage WW-1715
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@588112 13f79535-47bb-0310-9956-ffa450edef68
2007-10-25 02:11:26 +00:00
David Newton c231c7290a RequestAware JavaDoc clarification.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@586974 13f79535-47bb-0310-9956-ffa450edef68
2007-10-21 23:33:53 +00:00
David Newton 8c483d68bc PrincipalProxy JavaDoc correction, SessionAware JavaDoc clarification.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@586964 13f79535-47bb-0310-9956-ffa450edef68
2007-10-21 22:34:13 +00:00
Donald J. Brown 6a5c4c2c53 Making it easier to extend the classpath package provider
WW-1715


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@586740 13f79535-47bb-0310-9956-ffa450edef68
2007-10-20 15:08:15 +00:00
Donald J. Brown 2ba492bceb Better handling of urls that use semicolons
WW-2268


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@586739 13f79535-47bb-0310-9956-ffa450edef68
2007-10-20 15:07:09 +00:00
Donald J. Brown 9375fe9c6a Adding test for original extension uri building
WW-2267


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@586696 13f79535-47bb-0310-9956-ffa450edef68
2007-10-20 10:04:53 +00:00
Donald J. Brown de6869e67f Making it possible to use multiple extensions simultaneously, improving reloadability
WW-2267


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@586694 13f79535-47bb-0310-9956-ffa450edef68
2007-10-20 09:56:20 +00:00
Ted Nathan Husted 97fa4e4a37 Update status.txt with 2007 board reports and project votes; update announcements and ApacheCon programs.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@585986 13f79535-47bb-0310-9956-ffa450edef68
2007-10-18 14:47:36 +00:00
Rainer Hermanns c8db212ccf Resolve snapshot dependencies
o dojo plugin still used struts-annotations-1.0.2-SNAPSHOT

Issue Number: WW-2151


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@585160 13f79535-47bb-0310-9956-ffa450edef68
2007-10-16 14:47:24 +00:00
Rainer Hermanns bbc9c697cd Updating xwork dependency to release 2.1.0
o corrected groupId to com.opensymphony
o added maven2 OpenSymphony repository

WW-1715


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@584832 13f79535-47bb-0310-9956-ffa450edef68
2007-10-15 18:08:08 +00:00
Donald J. Brown 09d906ef98 Adding missing test
WW-2251


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@584416 13f79535-47bb-0310-9956-ffa450edef68
2007-10-13 15:50:32 +00:00
Donald J. Brown 04505b92a2 Adding action annotation
WW-2251


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@584413 13f79535-47bb-0310-9956-ffa450edef68
2007-10-13 15:41:39 +00:00
Donald J. Brown 6ee3d124e4 Adding a wildcard processing plugin point
WW-2250


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@584404 13f79535-47bb-0310-9956-ffa450edef68
2007-10-13 14:06:08 +00:00
Donald J. Brown 5494663fd4 Moving zero config code into codebehind plugin, minor fix to showcase
WW-2247


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@584166 13f79535-47bb-0310-9956-ffa450edef68
2007-10-12 14:07:52 +00:00
Donald J. Brown b07f659693 Removing commons logging from pom
WW-1413


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@582713 13f79535-47bb-0310-9956-ffa450edef68
2007-10-08 05:59:39 +00:00
Donald J. Brown 2ea2d869cc Replacing all usages of commons logging with xwork logging. Yay for closing memory leaks.
WW-1413


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@582626 13f79535-47bb-0310-9956-ffa450edef68
2007-10-07 13:26:12 +00:00
Donald J. Brown bbd4170da6 Updating plugin ext points doc
WW-2192


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@581894 13f79535-47bb-0310-9956-ffa450edef68
2007-10-04 13:39:08 +00:00
Musachy Barroso 4e9821f05b WW-2017 dojo.hostenv.writeIncludes should pass the true parameter
* dojo.hostenv.writeIncludes will only be included if debug="true" on head tag

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@580449 13f79535-47bb-0310-9956-ffa450edef68
2007-09-28 18:18:02 +00:00
Musachy Barroso 74b2fb7bf4 WW-2220 Autocompleter tag does not provide a way to specify initial key value
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@580387 13f79535-47bb-0310-9956-ffa450edef68
2007-09-28 15:21:15 +00:00
Musachy Barroso 250442591c WW-2220 Autocompleter tag does not provide a way to specify initial key value
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@580386 13f79535-47bb-0310-9956-ffa450edef68
2007-09-28 15:20:38 +00:00
Musachy Barroso f087df85f9 Add step to Dojo profile building (copy nls folder)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@580370 13f79535-47bb-0310-9956-ffa450edef68
2007-09-28 14:34:42 +00:00
Musachy Barroso 4283e8972d It seems like the building project was fixed on 0.4.3
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@580369 13f79535-47bb-0310-9956-ffa450edef68
2007-09-28 14:33:13 +00:00
Musachy Barroso 712fd1a1ab WW-2219 i18n strings are not included on the dojo profile build
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@580368 13f79535-47bb-0310-9956-ffa450edef68
2007-09-28 14:31:04 +00:00
Nils-Helge Garli 35521822c3 WW-2211 Added support for switching portlet mode in the redirect action result type
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@580136 13f79535-47bb-0310-9956-ffa450edef68
2007-09-27 19:45:46 +00:00
Nils-Helge Garli d452e63c79 WW-2212 Added support for ! character in default action configuration
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@580135 13f79535-47bb-0310-9956-ffa450edef68
2007-09-27 19:45:06 +00:00
Nils-Helge Garli 81b7e03f1f Use Spring portlet mock classes
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@580134 13f79535-47bb-0310-9956-ffa450edef68
2007-09-27 19:44:01 +00:00
Musachy Barroso c8eef15176 WW-2216 Improve/complete JavaDocs for IteratorStatus/<s:iterator/> tag.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@580128 13f79535-47bb-0310-9956-ffa450edef68
2007-09-27 19:15:04 +00:00
Musachy Barroso 8645eee9bd WW-2214 wrong tag in docs
Patch provided by Wes Wannemacher

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@580120 13f79535-47bb-0310-9956-ffa450edef68
2007-09-27 18:48:56 +00:00
Donald J. Brown 86777e8614 Removed unused param element from default definitions
WW-2209


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@579651 13f79535-47bb-0310-9956-ffa450edef68
2007-09-26 13:20:34 +00:00
Donald J. Brown 5ccff073f5 Cleaning up imports WW-2208
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@579641 13f79535-47bb-0310-9956-ffa450edef68
2007-09-26 12:36:25 +00:00
Musachy Barroso c9eaf8f3e0 WW-2206 sx:submit does not evaluate expressions in the src attribute
Patch submitted by Wes Wannemacher.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@579330 13f79535-47bb-0310-9956-ffa450edef68
2007-09-25 17:48:03 +00:00
Musachy Barroso b3893699ae Make cache="true" the default for the head tag
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@579235 13f79535-47bb-0310-9956-ffa450edef68
2007-09-25 13:20:55 +00:00
Donald J. Brown 0023041b60 Hopefully improved method calls for the action tag
WW-2102


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@579210 13f79535-47bb-0310-9956-ffa450edef68
2007-09-25 11:55:37 +00:00
Donald J. Brown a3e6c3c124 Ensuring parameters in the parameter map will be String arrays
WW-1960


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@579205 13f79535-47bb-0310-9956-ffa450edef68
2007-09-25 11:23:05 +00:00
Donald J. Brown 0be14bb564 Cleaning up unnecessary dispatcher.getInstance calls, spelling cleanups
WW-1715


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@579186 13f79535-47bb-0310-9956-ffa450edef68
2007-09-25 10:39:07 +00:00
Donald J. Brown f88c1e7dcb Better handling of action context creation
WW-2203


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@579021 13f79535-47bb-0310-9956-ffa450edef68
2007-09-25 00:07:19 +00:00
Musachy Barroso f58eafdab5 Fixing javadocs for snippet plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@578438 13f79535-47bb-0310-9956-ffa450edef68
2007-09-22 13:41:05 +00:00
Musachy Barroso 74c03ad8a0 Fixing javadocs for snippet plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@578437 13f79535-47bb-0310-9956-ffa450edef68
2007-09-22 13:38:09 +00:00
Musachy Barroso 135d31371b Fixing javadocs for snippet plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@578436 13f79535-47bb-0310-9956-ffa450edef68
2007-09-22 13:35:38 +00:00
Musachy Barroso 29a23e7dfa Fixing javadocs for snippet plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@578435 13f79535-47bb-0310-9956-ffa450edef68
2007-09-22 13:32:34 +00:00
Musachy Barroso 37bc43a90b Fixing javadocs for snippet plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@578434 13f79535-47bb-0310-9956-ffa450edef68
2007-09-22 13:29:24 +00:00
Musachy Barroso 71130ad3d4 Fixing javadocs for snippet plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@578433 13f79535-47bb-0310-9956-ffa450edef68
2007-09-22 13:28:28 +00:00
Musachy Barroso d8f865dcc4 Fixing javadocs for snippet plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@578432 13f79535-47bb-0310-9956-ffa450edef68
2007-09-22 13:24:12 +00:00
Donald J. Brown 82b39dc8fb Minor spelling fixes
WW-2184

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@578005 13f79535-47bb-0310-9956-ffa450edef68
2007-09-21 07:28:45 +00:00
Musachy Barroso fb42b3e194 Fixing javadocs for snippet plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@577834 13f79535-47bb-0310-9956-ffa450edef68
2007-09-20 17:49:18 +00:00
Musachy Barroso 0e9d6210ef Fixing javadocs for snippet plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@577828 13f79535-47bb-0310-9956-ffa450edef68
2007-09-20 17:36:59 +00:00
Musachy Barroso 2763cf9a00 Fixing javadocs for snippet plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@577826 13f79535-47bb-0310-9956-ffa450edef68
2007-09-20 17:30:59 +00:00
Musachy Barroso fe264d59a4 Fixing javadocs for snippet plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@577825 13f79535-47bb-0310-9956-ffa450edef68
2007-09-20 17:29:36 +00:00
Musachy Barroso 68c4436d44 Fixing javadocs for snippet plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@577810 13f79535-47bb-0310-9956-ffa450edef68
2007-09-20 16:50:01 +00:00
Donald J. Brown 101aa85aa1 Fixing tests
WW-1715


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@577775 13f79535-47bb-0310-9956-ffa450edef68
2007-09-20 14:43:38 +00:00
Musachy Barroso 962f5886af Fixing javadocs for snippet plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@577766 13f79535-47bb-0310-9956-ffa450edef68
2007-09-20 14:26:36 +00:00
Musachy Barroso 1352a01555 Fixing javadocs for snippet plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@577758 13f79535-47bb-0310-9956-ffa450edef68
2007-09-20 14:06:09 +00:00
Donald J. Brown 2092931e7b Fixing blank test
WW-1715


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@577750 13f79535-47bb-0310-9956-ffa450edef68
2007-09-20 13:54:31 +00:00
Musachy Barroso f7cee24e11 Fixing javadocs for snippet plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@577747 13f79535-47bb-0310-9956-ffa450edef68
2007-09-20 13:49:59 +00:00
Musachy Barroso 6c29f36d23 Fixing javadocs for snippet plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@577745 13f79535-47bb-0310-9956-ffa450edef68
2007-09-20 13:49:15 +00:00
Musachy Barroso 92aa692879 Fixing javadocs for snippet plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@577743 13f79535-47bb-0310-9956-ffa450edef68
2007-09-20 13:39:10 +00:00
Musachy Barroso b66d3bd2a9 Remove break lines from javadoc
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@577738 13f79535-47bb-0310-9956-ffa450edef68
2007-09-20 13:32:20 +00:00
Donald J. Brown 7b781ce56d Updating docs on plugin api points WW-1715
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@577733 13f79535-47bb-0310-9956-ffa450edef68
2007-09-20 13:10:00 +00:00
Donald J. Brown cbdf6f296c Changes necessary for XWork 2.1:
* New EL abstraction to allow ONGL to be replaced
 * Got rid of static factories and state, in favor of dep injection
 * New plugin API points for the EL abstraction

XW-566 XW-461 XW-561


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@577728 13f79535-47bb-0310-9956-ffa450edef68
2007-09-20 12:51:41 +00:00
James Holmes 895682acd0 WW-2181 SessionAware documentation is misleading about unit testing
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@576957 13f79535-47bb-0310-9956-ffa450edef68
2007-09-18 15:53:17 +00:00
James Holmes 415377c10f WW-2183 XSLT result type is extremely slow for actions that produce a large xml document
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@575841 13f79535-47bb-0310-9956-ffa450edef68
2007-09-15 01:05:56 +00:00
Nils-Helge Garli d09da593eb WW-2164 Action was not added if namespace was blank
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@574163 13f79535-47bb-0310-9956-ffa450edef68
2007-09-10 08:03:42 +00:00
Philip Luppens 6d6492b1f0 Fixed class to pass unit test. Don't really like the solution, but for now it should work.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@573921 13f79535-47bb-0310-9956-ffa450edef68
2007-09-08 22:46:02 +00:00
Philip Luppens c872ba3108 Missed JUnit test in last commit. Still having troubles to get the testcases to run normally. If this commit doesn't solve it, I might need some more time to fix this.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@573919 13f79535-47bb-0310-9956-ffa450edef68
2007-09-08 22:28:42 +00:00
Philip Luppens 137da15d07 Made some minimal changes to improve the JFreeChart Result:
- chart getter can be specified
- type (png/jpg) can be specified
- throws NPEs if required fields are missing
- added example configuration and Action

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@573912 13f79535-47bb-0310-9956-ffa450edef68
2007-09-08 21:48:46 +00:00
Donald J. Brown e2b0819538 Adding ability to load templates from classpath, in addition to web context
WW-2146


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@573816 13f79535-47bb-0310-9956-ffa450edef68
2007-09-08 10:56:10 +00:00
Donald J. Brown ca2fa277d3 Fix handling of empty extension during url creation
WW-2163


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@573805 13f79535-47bb-0310-9956-ffa450edef68
2007-09-08 09:16:43 +00:00
Donald J. Brown 733fb5e8a2 Make it possible to access actions without an extension
WW-2163


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@573790 13f79535-47bb-0310-9956-ffa450edef68
2007-09-08 07:07:48 +00:00
Donald J. Brown 802ed18ca4 Fixing test WW-2160
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@573609 13f79535-47bb-0310-9956-ffa450edef68
2007-09-07 15:21:38 +00:00
Donald J. Brown 26b76a25f1 Turning off static method access in ognl expressions by default
WW-2160


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@573606 13f79535-47bb-0310-9956-ffa450edef68
2007-09-07 15:18:09 +00:00
Donald J. Brown 1a537ff27c Fixing references to xwork type system
XW-561


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@573461 13f79535-47bb-0310-9956-ffa450edef68
2007-09-07 05:20:55 +00:00
Donald J. Brown 9cd3aa23a8 Updating classes to match new XWork type conversion API
XW-561


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@573454 13f79535-47bb-0310-9956-ffa450edef68
2007-09-07 04:43:05 +00:00
James Holmes 4f342ae935 Fix formatting.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@572866 13f79535-47bb-0310-9956-ffa450edef68
2007-09-05 02:56:14 +00:00
James Holmes e5696eff33 FFix typo.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@572865 13f79535-47bb-0310-9956-ffa450edef68
2007-09-05 02:43:15 +00:00
James Holmes e6d012a9ae WW-2132 Add support for JSP tag library dynamic attributes
Update JSP version to 2.0 to support the <dynamic-attributes> element.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@572756 13f79535-47bb-0310-9956-ffa450edef68
2007-09-04 17:52:09 +00:00
Donald J. Brown 8c775ce550 Removing the unused struts.configuration.files setting WW-1966
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@572437 13f79535-47bb-0310-9956-ffa450edef68
2007-09-03 22:16:49 +00:00
Donald J. Brown 6a4ea41f79 Switched the injection order to favor application scope WW-2125
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@572228 13f79535-47bb-0310-9956-ffa450edef68
2007-09-03 03:43:57 +00:00
Donald J. Brown 66bec3e8ab Adding better error message when a Struts tag is used w/o the servlet filter
WW-1969


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@572225 13f79535-47bb-0310-9956-ffa450edef68
2007-09-03 03:24:53 +00:00
Donald J. Brown cc48951911 Fixing j5-j6 bug in test WW-2045
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@572219 13f79535-47bb-0310-9956-ffa450edef68
2007-09-03 02:45:32 +00:00
Donald J. Brown f72fada5cb Fixed selection of radio item when value is null
WW-2045


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@572216 13f79535-47bb-0310-9956-ffa450edef68
2007-09-03 02:39:34 +00:00
Donald J. Brown 81d5ca327a Adding printing of jar and plugin info
WW-2154


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@571991 13f79535-47bb-0310-9956-ffa450edef68
2007-09-02 14:33:15 +00:00
Donald J. Brown af781d0079 Fixed xwork pom info, updated for xwork resolver change
WW-1715



git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@571990 13f79535-47bb-0310-9956-ffa450edef68
2007-09-02 14:31:04 +00:00
Donald J. Brown b416c2fbe1 Taking the Struts 1.3.5 jar out of the dependency chain WW-1715
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@571958 13f79535-47bb-0310-9956-ffa450edef68
2007-09-02 11:39:33 +00:00
Donald J. Brown 501f80d465 Added display of constants and beans
WW-2153


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@571945 13f79535-47bb-0310-9956-ffa450edef68
2007-09-02 10:49:26 +00:00
Antonio Petrelli b25dc1b3c3 WW-2151
Resolved snapshot dependencies by using the latest released version available, with the exception of Plexus (using 1.0-alpha-10) and XWork (still using SNAPSHOT).

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@571941 13f79535-47bb-0310-9956-ffa450edef68
2007-09-02 10:41:16 +00:00
Antonio Petrelli 37d78edf96 WW-2075
Added configuration to "struts-parent".

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@571533 13f79535-47bb-0310-9956-ffa450edef68
2007-08-31 18:30:51 +00:00
Musachy Barroso 8c3f7952dd WW-2136 Missing tag TextArea on dojo plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@571254 13f79535-47bb-0310-9956-ffa450edef68
2007-08-30 17:45:48 +00:00
Musachy Barroso e601d02be6 WW-2136 Missing tag TextArea on dojo plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@571253 13f79535-47bb-0310-9956-ffa450edef68
2007-08-30 17:45:40 +00:00
Musachy Barroso 19efe8ff3a WW-2136 Missing tag TextArea on dojo plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@571252 13f79535-47bb-0310-9956-ffa450edef68
2007-08-30 17:45:21 +00:00
Musachy Barroso 6fd66f2695 WW-2077 Change parseWidgets to false in djConfig inside head FTL .Should be false for better performance!
* Remove ids from some widgets to make easier the testing of this improvement

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@571239 13f79535-47bb-0310-9956-ffa450edef68
2007-08-30 16:48:51 +00:00
Antonio Petrelli 786a94f35e WW-2049
Re-added the license header in a correct way, because i removed by mistake an important line.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@570699 13f79535-47bb-0310-9956-ffa450edef68
2007-08-29 08:44:02 +00:00
James Holmes c23822d31b WW-2142 input streams need to be explicitly closed
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@570518 13f79535-47bb-0310-9956-ffa450edef68
2007-08-28 18:26:48 +00:00
James Holmes 369b22af7b WW-2132 Add support for JSP tag library dynamic attributes
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@570496 13f79535-47bb-0310-9956-ffa450edef68
2007-08-28 17:38:36 +00:00
Donald J. Brown ce3042977f Fixing bad javadoc comment
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@570056 13f79535-47bb-0310-9956-ffa450edef68
2007-08-27 09:42:54 +00:00
Musachy Barroso c082194bd4 Update tag reference doc
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@569864 13f79535-47bb-0310-9956-ffa450edef68
2007-08-26 19:18:42 +00:00
Musachy Barroso add167aefd WW-2077 Change parseWidgets to false in djConfig inside head FTL .Should be false for better performance!
* Now there is a new property "parseContent" in the "head" tag, which is set to "false" by default. If set to true, Dojo will scan the whole document looking for widgets.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@569863 13f79535-47bb-0310-9956-ffa450edef68
2007-08-26 19:18:15 +00:00
Musachy Barroso 168bf5e8ab Fix URL in tree examples
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@569582 13f79535-47bb-0310-9956-ffa450edef68
2007-08-24 23:58:27 +00:00
Musachy Barroso e977b5a63e WW-2134 Upgrade Dojo from 0.4.2 to 0.4.3 to address possible XSS Issues
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@569576 13f79535-47bb-0310-9956-ffa450edef68
2007-08-24 23:47:20 +00:00
James Holmes fb57ae14cd Revert upgrade from OGNL 2.6.11 to 2.7. There were compilation issues in the Struts 1 plugin due to differences in one of the OGNL interfaces that the Struts 1 plugin uses for accessing DynaBean properties.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@568984 13f79535-47bb-0310-9956-ffa450edef68
2007-08-23 13:39:58 +00:00
James Holmes 6cd8b820fb WW-2128 Upgrade to OGNL 2.7
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@568734 13f79535-47bb-0310-9956-ffa450edef68
2007-08-22 19:28:42 +00:00
Musachy Barroso 217c43f21c Fix spelling error
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@568318 13f79535-47bb-0310-9956-ffa450edef68
2007-08-21 23:07:00 +00:00
James Holmes ce80410c58 WW-2015 url tag, method attribute not evaluating expressions (ognl)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@566729 13f79535-47bb-0310-9956-ffa450edef68
2007-08-16 14:32:47 +00:00
James Holmes 55ea2ea1d9 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/trunk@566475 13f79535-47bb-0310-9956-ffa450edef68
2007-08-16 02:57:03 +00:00
James Holmes ccc7b7471c WW-2104 Add default dispatcher constant
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@566443 13f79535-47bb-0310-9956-ffa450edef68
2007-08-16 00:38:19 +00:00
James Holmes e0a606e2b7 WW-2115 Add Portuguese translation of struts-messages.properties
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@566418 13f79535-47bb-0310-9956-ffa450edef68
2007-08-15 23:59:51 +00:00
Nils-Helge Garli a6aedd2dfb WW-2104 Renamed name of dispatcher servlet and made the name configurable
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@566324 13f79535-47bb-0310-9956-ffa450edef68
2007-08-15 20:14:20 +00:00
James Holmes d8ac6de7bb WW-2103 Invalid Javascript generated for StringLength validator
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@566210 13f79535-47bb-0310-9956-ffa450edef68
2007-08-15 14:56:06 +00:00
James Holmes 4b6504b01e 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/trunk@566192 13f79535-47bb-0310-9956-ffa450edef68
2007-08-15 14:36:25 +00:00
Nils-Helge Garli 11a819d4d2 WW-2105 Do not copy the valuestack from event to render when the request cycle has been proper PRG
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@566092 13f79535-47bb-0310-9956-ffa450edef68
2007-08-15 10:22:56 +00:00
James Holmes 7c11bd3564 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/trunk@565844 13f79535-47bb-0310-9956-ffa450edef68
2007-08-14 17:29:29 +00:00
René Gielen 7ec7764e16 WW-2109:
id resolution for <s:form> - minor cleanups, some former changes rolled back again

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@565759 13f79535-47bb-0310-9956-ffa450edef68
2007-08-14 13:52:41 +00:00
René Gielen 60227b13f0 WW-2109:
id resolution for <s:form> - minor cleanups

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@565756 13f79535-47bb-0310-9956-ffa450edef68
2007-08-14 13:49:45 +00:00
René Gielen 67de561c2a 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/trunk@565687 13f79535-47bb-0310-9956-ffa450edef68
2007-08-14 10:03:06 +00:00
James Holmes ad4c656209 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/trunk@565609 13f79535-47bb-0310-9956-ffa450edef68
2007-08-14 02:02:49 +00:00
Musachy Barroso fe1ef6b99e Update tags reference documentation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@565513 13f79535-47bb-0310-9956-ffa450edef68
2007-08-13 20:48:26 +00:00
Musachy Barroso 3d3ed4d537 WW-2106 HTML loaded by the ajax tags is parsed for dojo widgets, this should be optional and there should be a "parseContent" attribute to control it
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@565512 13f79535-47bb-0310-9956-ffa450edef68
2007-08-13 20:47:50 +00:00
James Holmes 90c9f6ff3b WW-1948 s:url tag does not provide forceAddSchemeHostAndPort parameter
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@565429 13f79535-47bb-0310-9956-ffa450edef68
2007-08-13 17:15:28 +00:00
René Gielen 9fe437b44a WW-2108:
Fix for failing Bamboo build

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@565288 13f79535-47bb-0310-9956-ffa450edef68
2007-08-13 10:02:48 +00:00
René Gielen 34d8707456 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/trunk@565267 13f79535-47bb-0310-9956-ffa450edef68
2007-08-13 08:33:44 +00:00
René Gielen 8f411c1d12 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/trunk@565264 13f79535-47bb-0310-9956-ffa450edef68
2007-08-13 08:13:30 +00:00
Donald J. Brown 5e68db2e90 Turning off JSP EL for all tag attributes, as all attributes are processed for OGNL
expressions
WW-2107


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@565258 13f79535-47bb-0310-9956-ffa450edef68
2007-08-13 07:51:59 +00:00
Nils-Helge Garli 3bc1186993 Removed "portletSupportActive" which is no longer needed.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@565246 13f79535-47bb-0310-9956-ffa450edef68
2007-08-13 05:37:23 +00:00
Nils-Helge Garli 6e141ac437 Changed description for the portletUrlType attribute of the url component.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@565086 13f79535-47bb-0310-9956-ffa450edef68
2007-08-12 17:40:28 +00:00
Nils-Helge Garli 051f059e70 Not needed anymore
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@565066 13f79535-47bb-0310-9956-ffa450edef68
2007-08-12 13:23:10 +00:00
Nils-Helge Garli ac5928a0bc Cleanup of dependencies
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@565065 13f79535-47bb-0310-9956-ffa450edef68
2007-08-12 13:22:49 +00:00
Nils-Helge Garli 8646947822 Added "view" as supported mode
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@565064 13f79535-47bb-0310-9956-ffa450edef68
2007-08-12 13:22:26 +00:00
Nils-Helge Garli 4f37c65f78 Added example for model driven and file upload
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@565061 13f79535-47bb-0310-9956-ffa450edef68
2007-08-12 13:02:27 +00:00
Nils-Helge Garli fefbe21884 WW-1877 Removed ajax examples
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@565053 13f79535-47bb-0310-9956-ffa450edef68
2007-08-12 12:44:55 +00:00
Nils-Helge Garli e7e6065b36 WW-1877 Removed ajax examples
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@565051 13f79535-47bb-0310-9956-ffa450edef68
2007-08-12 12:39:40 +00:00
Nils-Helge Garli 3fea9c6f50 Fixed problem with the interceptor stack for the token example
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@565048 13f79535-47bb-0310-9956-ffa450edef68
2007-08-12 12:28:06 +00:00
Nils-Helge Garli 64a653aa59 Restructured configuration files and added uncommented entry for dispatcher servlet in web.xml
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@565047 13f79535-47bb-0310-9956-ffa450edef68
2007-08-12 12:24:16 +00:00
Nils-Helge Garli 45ab263e00 WW-2105 Added new PortletActionRedirectResult class to handle the same syntax as for the ServletActionRedirectResult
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@565009 13f79535-47bb-0310-9956-ffa450edef68
2007-08-12 07:43:13 +00:00
Nils-Helge Garli 3715572d7c WW-2105 "Override" the redirectAction result type with the PortletResult type.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@565005 13f79535-47bb-0310-9956-ffa450edef68
2007-08-12 06:03:38 +00:00
Nils-Helge Garli 672bb186cd WW-1713 Consider "method" tag attribute when creating urls
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@564967 13f79535-47bb-0310-9956-ffa450edef68
2007-08-11 20:20:33 +00:00
Nils-Helge Garli f54b26d71f WW-2104 Added experimental support for intermediate dispatcher servlet allowing for wrapping the request to the JSP in a StrutsWrapperRequest
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@564926 13f79535-47bb-0310-9956-ffa450edef68
2007-08-11 14:31:18 +00:00
Nils-Helge Garli 9fbbeea663 Added missing license headers.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@564610 13f79535-47bb-0310-9956-ffa450edef68
2007-08-10 14:46:41 +00:00
Nils-Helge Garli 06d7cb4e06 Added missing license headers.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@564609 13f79535-47bb-0310-9956-ffa450edef68
2007-08-10 14:45:51 +00:00
Nils-Helge Garli 1800f44731 WW-2053,WW-2101 Removed ServletContextHolder - Using mock servlet object instead. New interceptor for state handling.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@564602 13f79535-47bb-0310-9956-ffa450edef68
2007-08-10 14:16:24 +00:00
Nils-Helge Garli 8f4dfbe63f WW-2101 Removed PreparatorServlet - Replaced by mock servlet implementation classes in org.apache.struts2.portlet.servlet
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@564599 13f79535-47bb-0310-9956-ffa450edef68
2007-08-10 14:05:17 +00:00
Nils-Helge Garli de9f68d868 Removed mock - Replaced by the classes in org.apache.struts2.portlet.servlet
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@564594 13f79535-47bb-0310-9956-ffa450edef68
2007-08-10 13:57:22 +00:00
Nils-Helge Garli 0b24ede354 WW-1836 Order of the entries in the entry set is not guaranteed.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@564485 13f79535-47bb-0310-9956-ffa450edef68
2007-08-10 06:37:07 +00:00
Nils-Helge Garli d222f92835 WW-1836 Refactored unit tests for PortletSessionMap and PortletRequestMap. Also removed some unecessary logging.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@564476 13f79535-47bb-0310-9956-ffa450edef68
2007-08-10 06:07:48 +00:00
Antonio Petrelli 266a553f5d WW-2049
Reverted the license headers in sample apps code. I left only in pom.xml files and in Java code.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@564339 13f79535-47bb-0310-9956-ffa450edef68
2007-08-09 18:59:58 +00:00
Nils-Helge Garli 3774507d5f WW-2096 Missing test-change that subclipse didn't pick up...
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@564287 13f79535-47bb-0310-9956-ffa450edef68
2007-08-09 17:29:01 +00:00
Nils-Helge Garli fe8fd6125c WW-2097 The PortletAwareInterceptor replaces the PortletPreferencesInterceptor.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@564283 13f79535-47bb-0310-9956-ffa450edef68
2007-08-09 17:16:06 +00:00
Nils-Helge Garli 979b8c0544 WW-2097 New "aware" interfaces and interceptor. The PortletAwareInterceptor replaces the PortletPreferencesInterceptor.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@564282 13f79535-47bb-0310-9956-ffa450edef68
2007-08-09 17:15:28 +00:00
Nils-Helge Garli a42a60b1ab WW-1989,WW-2053,WW-2096 Push action on stack instead of action proxy. Also use the new wrapper servlet objects to support components/interceptors that rely on the servlet classes.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@564280 13f79535-47bb-0310-9956-ffa450edef68
2007-08-09 17:06:07 +00:00
Nils-Helge Garli 330f6ecb56 Added method to get the portlet context
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@564279 13f79535-47bb-0310-9956-ffa450edef68
2007-08-09 17:00:49 +00:00
Nils-Helge Garli 2440ce6bdb WW-1989,WW-2053 Provide "mock" implentation of servlet classes wrapping the portlet classes. Eases reuse of components/interceptors that has references to servlet api objects.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@564246 13f79535-47bb-0310-9956-ffa450edef68
2007-08-09 15:36:52 +00:00
Nils-Helge Garli bdbe0bf7f9 WW-2052 Put location from renderDirect action in session instead of render parameter
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@564120 13f79535-47bb-0310-9956-ffa450edef68
2007-08-09 07:14:51 +00:00
James Mitchell 463ce50112 WW-2060 give credit where credit is due
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@563485 13f79535-47bb-0310-9956-ffa450edef68
2007-08-07 13:01:09 +00:00
Antonio Petrelli f50c16070f WW-2049
First bunch of license headers in sample apps code.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@563238 13f79535-47bb-0310-9956-ffa450edef68
2007-08-06 19:53:57 +00:00
James Holmes ebb6c3f814 Fix typos.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@562020 13f79535-47bb-0310-9956-ffa450edef68
2007-08-02 05:29:21 +00:00
James Holmes b5b90755f5 Fix typos.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@562017 13f79535-47bb-0310-9956-ffa450edef68
2007-08-02 05:16:18 +00:00
James Holmes bc9c3477bf 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/trunk@561856 13f79535-47bb-0310-9956-ffa450edef68
2007-08-01 16:22:11 +00:00
James Holmes 90a91201e8 Fix typo.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@561841 13f79535-47bb-0310-9956-ffa450edef68
2007-08-01 15:31:56 +00:00
James Holmes 59a63106a0 Fix typo.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@561839 13f79535-47bb-0310-9956-ffa450edef68
2007-08-01 15:19:52 +00:00
James Holmes c1ff9ac97b Fix typo.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@561835 13f79535-47bb-0310-9956-ffa450edef68
2007-08-01 15:17:23 +00:00
James Holmes cad5823cb8 Remove spurious space character in bypass message.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@561647 13f79535-47bb-0310-9956-ffa450edef68
2007-08-01 04:36:52 +00:00
James Holmes ff78317b63 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/trunk@561619 13f79535-47bb-0310-9956-ffa450edef68
2007-08-01 01:14:18 +00:00
James Holmes 524c3d5c15 Fix typos.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@561600 13f79535-47bb-0310-9956-ffa450edef68
2007-07-31 23:50:04 +00:00
Musachy Barroso b8ccb9e9c3 Improve select tag documentation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@561407 13f79535-47bb-0310-9956-ffa450edef68
2007-07-31 17:44:17 +00:00
James Holmes 4ce0026a55 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/trunk@561223 13f79535-47bb-0310-9956-ffa450edef68
2007-07-31 02:58:36 +00:00
James Holmes 2ea2f95b36 Specify XML version and encoding.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@561219 13f79535-47bb-0310-9956-ffa450edef68
2007-07-31 02:44:54 +00:00
James Holmes daa46fb71f 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/trunk@561218 13f79535-47bb-0310-9956-ffa450edef68
2007-07-31 02:37:02 +00:00
Donald J. Brown 20da1d6161 Making the mapper easier to extend
WW-2078


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@560966 13f79535-47bb-0310-9956-ffa450edef68
2007-07-30 13:08:11 +00:00
René Gielen 80bb25dd2f Code cleanups / generification
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@560895 13f79535-47bb-0310-9956-ffa450edef68
2007-07-30 09:06:37 +00:00
René Gielen f4d14204e3 WW-1661:
Minor code cleanups

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@560880 13f79535-47bb-0310-9956-ffa450edef68
2007-07-30 07:04:19 +00:00
Antonio Petrelli cf351ce368 WW-2049
Added licenses to plugins code.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@560745 13f79535-47bb-0310-9956-ffa450edef68
2007-07-29 15:55:59 +00:00
Antonio Petrelli 13b5b3a41a WW-2049
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 main project, the "core" and "api" modules have only correct license headers.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@560554 13f79535-47bb-0310-9956-ffa450edef68
2007-07-28 15:14:04 +00:00
Musachy Barroso 560213cbe9 WW-2050 Separate JSONValidationInterceptor from AnnotationValidationInterceptor
Patch provided by Lukasz Racon

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@560339 13f79535-47bb-0310-9956-ffa450edef68
2007-07-27 17:57:41 +00:00
Musachy Barroso b42a06f505 Update tag description
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@560334 13f79535-47bb-0310-9956-ffa450edef68
2007-07-27 17:40:52 +00:00
Musachy Barroso e6c552dffa WW-2050 Separate JSONValidationInterceptor from AnnotationValidationInterceptor
Patch provided by Lukasz Racon

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@560333 13f79535-47bb-0310-9956-ffa450edef68
2007-07-27 17:40:09 +00:00
Musachy Barroso 8066a53a0b WW-2050 Separate JSONValidationInterceptor from AnnotationValidationInterceptor
Patch provided by Lukasz Racon 

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@560331 13f79535-47bb-0310-9956-ffa450edef68
2007-07-27 17:38:35 +00:00
Musachy Barroso 65cf49a1a1 WW-2050 Separate JSONValidationInterceptor from AnnotationValidationInterceptor
Patch provided by Lukasz Racon 

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@560329 13f79535-47bb-0310-9956-ffa450edef68
2007-07-27 17:38:24 +00:00
Musachy Barroso bf1fc42345 WW-2070 Add an object browser to the debugging interceptor
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@560261 13f79535-47bb-0310-9956-ffa450edef68
2007-07-27 14:58:05 +00:00
René Gielen 0875a59f33 WW-2007:
Fixing problems with generated javascript idetitifiers containing unescaped id parameter value

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@560258 13f79535-47bb-0310-9956-ffa450edef68
2007-07-27 14:56:11 +00:00
James Holmes 44aeb64064 WW-2064 XHTML checkbox template does not include tooltip consistently
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@559849 13f79535-47bb-0310-9956-ffa450edef68
2007-07-26 15:16:40 +00:00
Antonio Petrelli cbe136ab09 WW-2049
Second bunch of added licenses.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@559604 13f79535-47bb-0310-9956-ffa450edef68
2007-07-25 21:01:25 +00:00
James Holmes 3d9f578992 WW-1911 File Upload: content-type validation fails when no file is uploaded
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@559307 13f79535-47bb-0310-9956-ffa450edef68
2007-07-25 03:45:17 +00:00
Antonio Petrelli c2f13be89b WW-2049
Added RAT report to the site.
First bunch of corrected licenses.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@559206 13f79535-47bb-0310-9956-ffa450edef68
2007-07-24 21:01:18 +00:00
James Holmes ffd0fb693b WW-1938 Bug with multiple s:param tags inside s:url tag
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@559127 13f79535-47bb-0310-9956-ffa450edef68
2007-07-24 17:33:38 +00:00
James Holmes 00c246f530 Add missing license.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@559107 13f79535-47bb-0310-9956-ffa450edef68
2007-07-24 17:03:11 +00:00
James Holmes 170f5226ea Add missing license.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@559086 13f79535-47bb-0310-9956-ffa450edef68
2007-07-24 15:36:11 +00:00
1185 changed files with 78573 additions and 64242 deletions
+23 -1
View File
@@ -1,11 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.1.0</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-api</artifactId>
+23 -1
View File
@@ -1,11 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.1.0</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-blank</artifactId>
@@ -21,10 +21,12 @@
package example;
import org.apache.struts2.StrutsTestCase;
import com.opensymphony.xwork2.ActionSupport;
import junit.framework.TestCase;
public class HelloWorldTest extends TestCase {
public class HelloWorldTest extends StrutsTestCase {
public void testHelloWorld() throws Exception {
HelloWorld hello_world = new HelloWorld();
+23 -1
View File
@@ -1,11 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.1.0</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-mailreader</artifactId>
@@ -21,14 +21,20 @@
package mailreader2;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.apps.mailreader.dao.impl.memory.MemoryUserDatabase;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import java.io.*;
import org.apache.struts.apps.mailreader.dao.impl.memory.MemoryUserDatabase;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* <p><code>ServletContextListener</code> that initializes and finalizes the
@@ -94,7 +100,7 @@ public final class ApplicationListener implements ServletContextListener {
/**
* <p>Logging output for this plug in instance.</p>
*/
private Log log = LogFactory.getLog(this.getClass());
private Logger log = LoggerFactory.getLogger(this.getClass());
// ------------------------------------------------------------- Properties
@@ -1,3 +1,23 @@
/*
* $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 mailreader2;
import com.opensymphony.xwork2.interceptor.Interceptor;
@@ -21,18 +21,20 @@
package mailreader2;
import org.apache.struts2.interceptor.ApplicationAware;
import org.apache.struts2.interceptor.SessionAware;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.util.Map;
import org.apache.struts.apps.mailreader.dao.ExpiredPasswordException;
import org.apache.struts.apps.mailreader.dao.Subscription;
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 java.util.Map;
import org.apache.struts2.interceptor.ApplicationAware;
import org.apache.struts2.interceptor.SessionAware;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* <p> Base Action for MailreaderSupport application. </p>
@@ -386,7 +388,7 @@ public class MailreaderSupport extends ActionSupport
/**
* <p><code>Log</code> instance for this application. </p>
*/
protected Log log = LogFactory.getLog(Constants.PACKAGE);
protected Logger log = LoggerFactory.getLogger(Constants.PACKAGE);
/**
* <p> Persist the User object, including subscriptions, to the database.
+20 -17
View File
@@ -1,21 +1,24 @@
<?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$
*
* 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.
*/
-->
@@ -25,7 +28,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.1.0</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
@@ -58,7 +61,7 @@
<dependency>
<groupId>com.hostedqa</groupId>
<artifactId>hostedqa-remote-ant</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.7</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -121,7 +124,7 @@
<dependency>
<groupId>com.hostedqa</groupId>
<artifactId>hostedqa-remote-ant</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.7</version>
</dependency>
</dependencies>
</plugin>
+92 -40
View File
@@ -1,11 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.1.0</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-portlet</artifactId>
@@ -17,38 +39,38 @@
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/portlet/</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/apps/portlet/</url>
</scm>
<profiles>
<profile>
<id>pluto</id>
<build>
<plugins>
<!-- configure maven-war-plugin to use updated web.xml -->
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
</configuration>
</plugin>
<!-- bind 'pluto:assemble' goal to 'process-resources' lifecycle -->
<plugin>
<groupId>org.apache.pluto</groupId>
<artifactId>maven-pluto-plugin</artifactId>
<version>1.1.3</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<profiles>
<profile>
<id>pluto</id>
<build>
<plugins>
<!-- configure maven-war-plugin to use updated web.xml -->
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
</configuration>
</plugin>
<!-- bind 'pluto:assemble' goal to 'process-resources' lifecycle -->
<plugin>
<groupId>org.apache.pluto</groupId>
<artifactId>maven-pluto-plugin</artifactId>
<version>1.1.3</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>portlet-api</groupId>
@@ -87,14 +109,22 @@
<artifactId>commons-digester</artifactId>
<version>1.8</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.9</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>
@@ -103,4 +133,26 @@
</dependencies>
<reporting>
<plugins>
<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/main/etc/gridsphere/README-gridsphere.txt</exclude>
<exclude>src/main/etc/gridsphere/struts-portlet</exclude>
<exclude>src/main/etc/jetspeed2/README-jetspeed2.txt</exclude>
<exclude>src/main/etc/jetspeed2/struts-portlet.psml</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
@@ -0,0 +1,37 @@
/*
* $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,115 @@
<?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="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>
@@ -1 +0,0 @@
struts.objectFactory = spring
+3 -155
View File
@@ -4,159 +4,7 @@
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="struts-portlet-default.xml" />
<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/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>
<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>
<include file="struts-view.xml"/>
<include file="struts-edit.xml"/>
<include file="struts-help.xml"/>
</struts>
@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dwr PUBLIC
"-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
"http://www.getahead.ltd.uk/dwr/dwr10.dtd">
<dwr>
<allow>
<create creator="new" javascript="validator">
<param name="class" value="org.apache.struts2.validators.DWRValidator"/>
</create>
<convert converter="bean" match="com.opensymphony.xwork2.ValidationAwareSupport"/>
</allow>
<signatures>
<![CDATA[
import java.util.Map;
import org.apache.struts2.validators.DWRValidator;
DWRValidator.doPost(String, String, Map<String, String>);
]]>
</signatures>
</dwr>
+116 -103
View File
@@ -1,118 +1,131 @@
<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>view</portlet-mode>
<portlet-mode>edit</portlet-mode>
<portlet-mode>help</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>
</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>
@@ -1 +0,0 @@
<H2>Hello from Ajax!</H2>
@@ -1 +0,0 @@
This data is fetched via Ajax! The server time is <%= new java.util.Date() %>
@@ -1,48 +0,0 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<s:head theme="ajax"/>
<link rel="stylesheet" type="text/css" href="<s:url value="/struts/tabs.css"/>">
<b>This is a tabbed pane with two panels that fetches data from a remote action via ajax</b>
<s:tabbedPanel id="test2" theme="simple" >
<s:div id="left" label="left" theme="ajax">
This is the left pane<br/>
<s:form >
<s:textfield name="tt" label="Test Text" /> <br/>
<s:textfield name="tt2" label="Test Text2" />
</s:form>
</s:div>
<s:div href="<s:url action="ajaxData"/>" id="ryh1" theme="ajax" label="remote one" />
<s:div id="middle" label="middle" theme="ajax">
middle tab<br/>
<s:form >
<s:textfield name="tt" label="Test Text44" /> <br/>
<s:textfield name="tt2" label="Test Text442" />
</s:form>
</s:div>
<s:div href="<s:url action="ajaxData"/>" id="ryh21" theme="ajax" label="remote right" />
</s:tabbedPanel>
<p/>
A DIV that waits for 5 seconds before loading the contents
<s:div
id="once"
theme="ajax"
cssStyle="border: 1px solid yellow;"
href="<s:url action="ajaxData"/>"
delay="5000"
loadingText="loading...">
Waiting for data</s:div>
<p/>
A DIV that is updated every 2 seconds
<s:div
id="twoseconds"
cssStyle="border: 1px solid yellow;"
href="<s:url action="ajaxData"/>"
theme="ajax"
delay="2000"
updateFreq="2000"
errorText="There was an error"
loadingText="loading...">Initial Content
</s:div>
<p/>
<a href="<s:url action="index"/>">Back to front page</a>
@@ -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>
@@ -4,10 +4,11 @@
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="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>
+21 -37
View File
@@ -4,46 +4,30 @@
<!-- 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>
<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>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<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.apache.struts2.portlet.context.ServletContextHolderListener
</listener-class>
<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>
<!-- Uncomment to use the dispatcher servlet -->
<!--<servlet id="Struts2PortletDispatcherServlet">
<servlet-name>Struts2PortletDispatcherServlet</servlet-name>
<servlet-class>org.apache.struts2.portlet.dispatcher.DispatcherServlet</servlet-class>
</servlet>-->
</web-app>
+23 -1
View File
@@ -1,11 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.1.0</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-showcase</artifactId>
@@ -1,3 +1,23 @@
/*
* $Id: pom.xml 559206 2007-07-24 21:01:18Z 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.
*/
package org.apache.struts2.showcase;
import org.apache.struts2.showcase.ajax.tree.Category;
@@ -1,3 +1,23 @@
/*
* $Id: pom.xml 559206 2007-07-24 21:01:18Z 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.
*/
package org.apache.struts2.showcase.ajax;
import java.util.ArrayList;
@@ -21,20 +21,20 @@
package org.apache.struts2.showcase.chat;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.dispatcher.SessionMap;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
public class ChatAuthenticationInterceptor implements Interceptor {
private static final long serialVersionUID = 1L;
private static final Log _log = LogFactory.getLog(ChatAuthenticationInterceptor.class);
private static final Logger LOG = LoggerFactory.getLogger(ChatAuthenticationInterceptor.class);
public static final String USER_SESSION_KEY = "chatUserSessionKey";
@@ -46,7 +46,7 @@ public class ChatAuthenticationInterceptor implements Interceptor {
public String intercept(ActionInvocation invocation) throws Exception {
_log.debug("Authenticating chat user");
LOG.debug("Authenticating chat user");
SessionMap session = (SessionMap) ActionContext.getContext().get(ActionContext.SESSION);
User user = (User) session.get(USER_SESSION_KEY);
@@ -22,20 +22,19 @@ package org.apache.struts2.showcase.chat;
import javax.servlet.http.HttpSession;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* Authenticate showcase chat example, make sure everyone have a username.
*/
public class ChatInterceptor implements Interceptor {
private static final Log _log = LogFactory.getLog(ChatInterceptor.class);
private static final Logger LOG = LoggerFactory.getLogger(ChatInterceptor.class);
private static final long serialVersionUID = 1L;
@@ -51,7 +50,7 @@ public class ChatInterceptor implements Interceptor {
HttpSession session = (HttpSession) ActionContext.getContext().get(ActionContext.SESSION);
User chatUser = (User) session.getAttribute(CHAT_USER_SESSION_KEY);
if (chatUser == null) {
_log.debug("Chat user not logged in");
LOG.debug("Chat user not logged in");
return Action.LOGIN;
}
return invocation.invoke();
@@ -24,14 +24,15 @@ import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
public class ChatSessionListener implements HttpSessionListener {
private static final Log _log = LogFactory.getLog(ChatSessionListener.class);
private static final Logger LOG = LoggerFactory.getLogger(ChatSessionListener.class);
public void sessionCreated(HttpSessionEvent event) {
}
@@ -45,7 +46,7 @@ public class ChatSessionListener implements HttpSessionListener {
ChatService service = (ChatService) context.getBean("chatService");
service.logout(user.getName());
_log.info("session expired, logged user ["+user.getName()+"] out");
LOG.info("session expired, logged user ["+user.getName()+"] out");
}
}
}
@@ -25,13 +25,14 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.util.StrutsTypeConverter;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
public class DateConverter extends StrutsTypeConverter {
private static final Log _log = LogFactory.getLog(DateConverter.class);
private static final Logger LOG = LoggerFactory.getLogger(DateConverter.class);
public Object convertFromString(Map context, String[] values, Class toClass) {
@@ -41,7 +42,7 @@ public class DateConverter extends StrutsTypeConverter {
return sdf.parse(values[0]);
}
catch(ParseException e) {
_log.error("error converting value ["+values[0]+"] to Date ", e);
LOG.error("error converting value ["+values[0]+"] to Date ", e);
}
}
return null;
@@ -26,7 +26,7 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.views.freemarker.FreemarkerManager;
import org.apache.struts2.views.freemarker.ScopesHashModel;
import com.opensymphony.xwork2.util.OgnlValueStack;
import com.opensymphony.xwork2.ognl.OgnlValueStack;
import com.opensymphony.xwork2.util.ValueStack;
/**
@@ -72,6 +72,10 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
}
}
pageLines = read(in, -1);
if (in != null) {
in.close();
}
}
if (className != null && className.trim().length() > 0) {
@@ -81,6 +85,10 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
in = servletContext.getResourceAsStream("/WEB-INF/src"+className);
}
classLines = read(in, -1);
if (in != null) {
in.close();
}
}
String rootPath = ServletActionContext.getServletContext().getRealPath("/");
+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).
@@ -76,6 +76,7 @@
</action>
<action name="quizAjax" class="org.apache.struts2.showcase.validation.QuizAction">
<interceptor-ref name="jsonValidationWorkflowStack"/>
<result name="input">/validation/quiz-ajax.jsp</result>
<result>/validation/quiz-success.jsp</result>
</action>
<action name="getNodes" class="org.apache.struts2.showcase.ShowAjaxDynamicTreeAction">
@@ -7,39 +7,39 @@
<struts>
<package name="integration" extends="struts1-default" namespace="/integration">
<interceptors>
<interceptor name="gangsterForm" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor">
<param name="className">org.apache.struts2.showcase.integration.GangsterForm</param>
<param name="name">gangsterForm</param>
</interceptor>
<interceptor name="gangsterValidation" class="org.apache.struts2.s1.ActionFormValidationInterceptor">
<param name="pathnames">/org/apache/struts/validator/validator-rules.xml,/WEB-INF/validation.xml</param>
</interceptor>
<interceptors>
<interceptor name="gangsterForm" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor">
<param name="className">org.apache.struts2.showcase.integration.GangsterForm</param>
<param name="name">gangsterForm</param>
</interceptor>
<interceptor name="gangsterValidation" class="org.apache.struts2.s1.ActionFormValidationInterceptor">
<param name="pathnames">/org/apache/struts/validator/validator-rules.xml,/WEB-INF/validation.xml</param>
</interceptor>
<interceptor-stack name="integration">
<interceptor-ref name="staticParams"/>
<interceptor-ref name="gangsterForm"/>
<interceptor-ref name="modelDriven"/>
<interceptor-ref name="actionForm-reset"/>
<interceptor-ref name="basicStack"/>
<interceptor-ref name="gangsterValidation"/>
<interceptor-ref name="workflow"/>
</interceptor-stack>
</interceptors>
<interceptor-stack name="integration">
<interceptor-ref name="staticParams"/>
<interceptor-ref name="gangsterForm"/>
<interceptor-ref name="modelDriven"/>
<interceptor-ref name="actionForm-reset"/>
<interceptor-ref name="basicStack"/>
<interceptor-ref name="gangsterValidation"/>
<interceptor-ref name="workflow"/>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="integration" />
<default-action-ref name="editGangster" />
<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>
<param name="className">org.apache.struts2.showcase.integration.EditGangsterAction</param>
<result>modelDriven.jsp</result>
</action>
<!-- Display the result page whose content is populated using the Model-Driven technique -->
<action name="saveGangster" class="org.apache.struts2.s1.Struts1Action">
<param name="className">org.apache.struts2.showcase.integration.SaveGangsterAction</param>
<param name="validate">true</param>
<param name="className">org.apache.struts2.showcase.integration.SaveGangsterAction</param>
<param name="validate">true</param>
<result name="input">modelDriven.jsp</result>
<result>modelDrivenResult.jsp</result>
</action>
@@ -12,6 +12,7 @@
<constant name="struts.devMode" value="true" />
<constant name="struts.configuration.xml.reload" value="false" />
<constant name="struts.custom.i18n.resources" value="globalMessages" />
<constant name="struts.action.extension" value="action,," />
<constant name="struts.codebehind.defaultPackage" value="person" />
<constant name="struts.freemarker.manager.classname" value="customFreemarkerManager" />
@@ -66,6 +67,8 @@
</interceptor-stack>
</interceptors>
<default-action-ref name="showcase" />
<action name="showcase">
<result>showcase.jsp</result>
</action>
@@ -62,7 +62,8 @@ Using a JSON list returned from an action (href="/JSONList.action"), without aut
Reload on type (loadOnTextChange="true"), after 3 characters (loadMinimumCount="3", it is "3" by default), without the down arrow button (showDownArrow="false")
<br/>
<sx:autocompleter
<sx:autocompleter
id="auto2"
indicator="indicator"
href="%{jsonList}"
cssStyle="width: 200px;"
@@ -33,7 +33,7 @@
<p>
1. Attach to "onclick" event on button. Update content of Div 1. Use with indicator.
<img id="indicator" src="${pageContext.request.contextPath}/images/indicator.gif" alt="Loading..." style="display:none"/>
<sx:bind id="ex1" href="%{#ajaxTest}" sources="button" targets="div1" events="onclick" indicator="indicator" />
<sx:bind href="%{#ajaxTest}" sources="button" targets="div1" events="onclick" indicator="indicator" />
<br/>
<s:submit theme="simple" type="submit" value="submit" id="button"/>
</p>
@@ -38,7 +38,7 @@ A submit button, that highlights (blue color) its targets
A submit button, with an indicator
<img id="indicator" src="${pageContext.request.contextPath}/images/indicator.gif" alt="Loading..." style="display:none"/>
<sx:submit type="submit" value="submit" targets="t1" href="%{ajaxTest}" indicator="indicator"/>
<sx:submit id="submit2" type="submit" value="submit" targets="t1" href="%{ajaxTest}" indicator="indicator"/>
<br/><br/>
@@ -48,9 +48,9 @@ A submit button, with "notifyTopics"
<br/><br/>
Use an image as submit
<s:url value="/images/struts-power.gif" var="imgUrl" />
<sx:submit type="image" label="Alt Text" targets="t1"
src="${pageContext.request.contextPath}/images/struts-power.gif" href="%{ajaxTest}" />
src="%{imgUrl}" href="%{ajaxTest}" />
<br/><br/>
<label for="textInput">Text to be echoed</label>
@@ -13,7 +13,6 @@
<body>
<sx:div
id="once"
cssStyle="border: 1px solid yellow;"
href="%{ajaxTest}">
Initial Content</sx:div>
@@ -55,7 +55,7 @@
<s:url var="ajaxTest" value="/AjaxTest.action" />
<s:url var="test3" value="/Test3.action" />
<sx:a id="link0"
<sx:a
href="%{#ajaxTest}"
targets="t1"
highlightColor="red"
@@ -11,18 +11,15 @@
<body>
<sx:tabbedpanel id="test2" cssStyle="width: 500px; height: 300px;" doLayout="true">
<sx:div id="left" label="test1" >
I'm a Tab!!!
</sx:div >
<sx:div id="middle" label="test2" >
I'm the other Tab!!!
</sx:div >
</sx:tabbedpanel>
<sx:tabbedpanel id="test2" cssStyle="width: 500px; height: 300px;" doLayout="true">
<sx:div label="test1" >
I'm a Tab!!!
</sx:div >
<sx:div id="middle" label="test2" >
I'm the other Tab!!!
</sx:div >
</sx:tabbedpanel>
<s:include value="../footer.jsp"/>
</body>
@@ -1,5 +1,6 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<html>
<head>
@@ -19,16 +20,16 @@ NOTES:
Default Editor configuration:<br/>
<s:form id="form1" action="AjaxRemoteForm" method="post">
<s:textarea name="data" theme="ajax" cols="50" rows="10" value="Test Data 1" />
<sx:textarea name="data" cols="50" rows="10" value="Test Data 1" />
<s:submit value="Submit"/>
</s:form>
<br/>
Configured Editor configuration:<br/>
Configured Editor configuration:<br/>
<s:form id="form2" action="AjaxRemoteForm" method="post">
<s:textarea id="editor2" name="data" theme="ajax" cols="50" rows="10" value="Test Data 2">
<sx:textarea id="editor2" name="data" cols="50" rows="10" value="Test Data 2">
<s:param name="editorControls">textGroup;|;justifyGroup;|;listGroup;|;indentGroup</s:param>
</s:textarea>
</sx:textarea>
<s:submit value="Submit"/>
</s:form>
<br/>
+1 -1
View File
@@ -34,7 +34,7 @@
<ul>
<li><a href="<s:url value="/showcase.jsp"/>">Home</a></li>
<li><a href="<s:url value="/interactive/index.jsp" />">Interactive demo of OGNL and JSP tags</a></li>
<li><a href="<s:url value="/ajax/index.jsp" />">Ajax pugin for Struts</a></li>
<li><a href="<s:url value="/ajax/index.jsp" />">Ajax plugin for Struts</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>
<li><a href="<s:url action="index" namespace="/config-browser" includeParams="none" />">Config Browser</a></li>
@@ -10,7 +10,7 @@
<body>
<table>
<sx:datetimepicker label="toggleType='wipe'" value="%{'2006-10-31'}" toggleType="wipe" toggleDuration="300" name="test"/>
<sx:datetimepicker label="toggleType='explode'" value="%{'2006-07-22'}" toggleType="explode" toggleDuration="500"/>
<sx:datetimepicker label="toggleType='explode'" value="%{'2006-07-22'}" toggleType="explode" toggleDuration="500" id="dp2"/>
<sx:datetimepicker label="toggleType='fade'" value="%{'2006-06-30'}" toggleType="fade" toggleDuration="500"/>
<sx:datetimepicker label="With value='today'" name="dddp1" value="%{'today'}" />
<sx:datetimepicker label="US format, empty" name="dddp2" language="en-us" />
@@ -13,7 +13,7 @@
<script language="JavaScript" type="text/javascript">
dojo.event.topic.subscribe("treeSelected", function treeNodeSelected(node) {
dojo.io.bind({
url: "<s:url value='/tags/ui/ajax/dynamicTreeSelectAction.action'/>&nodeId="+node.node.widgetId,
url: "<s:url value='/tags/ui/ajax/dynamicTreeSelectAction.action'/>?nodeId="+node.node.widgetId,
load: function(type, data, evt) {
var divDisplay = dojo.byId("displayId");
divDisplay.innerHTML=data;
@@ -3,7 +3,7 @@
<html>
<head>
<title>Showcase - UI Tag Example - Tree Example (Static)</title>
<sx:head />
<sx:head/>
</head>
<body>
@@ -12,7 +12,7 @@
<script language="JavaScript" type="text/javascript">
dojo.event.topic.subscribe("treeSelected", function treeNodeSelected(node) {
dojo.io.bind({
url: "<s:url value='/tags/ui/ajax/staticTreeSelectAction.action'/>&nodeId="+node.node.title,
url: "<s:url value='/tags/ui/ajax/staticTreeSelectAction.action'/>?nodeId="+node.node.title,
load: function(type, data, evt) {
var divDisplay = dojo.byId("displayIt");
divDisplay.innerHTML=data;
@@ -24,9 +24,9 @@
<div style="float:left; margin-right: 50px;">
<sx:tree label="parent" id="parentId" templateCssPath="/struts/tree.css"
<sx:tree label="parent" templateCssPath="/struts/tree.css"
showRootGrid="true" showGrid="true" treeSelectedTopic="treeSelected">
<sx:treenode label="child1" id="child1Id">
<sx:treenode label="child1" >
<sx:treenode label="grandchild1" id="grandchild1Id"/>
<sx:treenode label="grandchild2" id="grandchild2Id"/>
<sx:treenode label="grandchild3" id="grandchild3Id"/>
@@ -5,8 +5,8 @@
<html>
<head>
<title>Validation -Ajax</title>
<sx:head cache="true" compressed="false"/>
<title>Validation - Ajax</title>
<sx:head cache="false" compressed="false"/>
</head>
<s:url var="url" namespace="/validation" action="quizAjax"/>
+2 -2
View File
@@ -33,7 +33,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.1.0</version>
</parent>
<scm>
@@ -383,7 +383,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>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+48 -15
View File
@@ -1,11 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.1.0</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
@@ -22,7 +44,7 @@
<plugins>
<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>
@@ -33,9 +55,9 @@
<configuration>
<artifactItems>
<artifactItem>
<groupId>opensymphony</groupId>
<groupId>com.opensymphony</groupId>
<artifactId>xwork</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.1.0</version>
<classifier>sources</classifier>
</artifactItem>
</artifactItems>
@@ -48,7 +70,7 @@
<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",
<A>uri=/struts-tags,tlibVersion=2.2.3,jspVersion=2.0,shortName=s,displayName="Struts Tags",
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.
@@ -107,6 +129,23 @@
</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/resources/org/apache/struts2/static/domTT.js</exclude>
<exclude>src/test/resources/org/apache/struts2/interceptor/validation/*</exclude>
<exclude>src/site/resources/tags/**</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</reporting>
@@ -250,9 +289,9 @@
<dependencies>
<dependency>
<groupId>opensymphony</groupId>
<groupId>com.opensymphony</groupId>
<artifactId>xwork</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.1.0</version>
</dependency>
<!--<dependency>-->
@@ -287,12 +326,6 @@
<version>2.6.11</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.0.4</version>
</dependency>
<!-- Ajax -->
<dependency>
<groupId>uk.ltd.getahead</groupId>
@@ -426,7 +459,7 @@
<scope>test</scope>
</dependency>
<dependency>
<dependency>
<groupId>jmock</groupId>
<artifactId>jmock</artifactId>
<version>1.0.1</version>
@@ -446,7 +479,7 @@
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts-annotations</artifactId>
<version>1.0.2-SNAPSHOT</version>
<version>1.0.2</version>
<optional>true</optional>
</dependency>
@@ -37,12 +37,20 @@ public class RequestUtils {
*/
public static String getServletPath(HttpServletRequest request) {
String servletPath = request.getServletPath();
String requestUri = request.getRequestURI();
// Detecting other characters that the servlet container cut off (like anything after ';')
if (requestUri != null && servletPath != null && !requestUri.endsWith(servletPath)) {
int pos = requestUri.indexOf(servletPath);
if (pos > -1) {
servletPath = requestUri.substring(requestUri.indexOf(servletPath));
}
}
if (null != servletPath && !"".equals(servletPath)) {
return servletPath;
}
String requestUri = request.getRequestURI();
int startIndex = request.getContextPath().equals("") ? 0 : request.getContextPath().length();
int endIndex = request.getPathInfo() == null ? requestUri.length() : requestUri.lastIndexOf(request.getPathInfo());
@@ -161,5 +161,23 @@ public final class StrutsConstants {
/** 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";
/** The name of the parameter to determine whether static method access will be allowed in OGNL expressions or not */
public static final String STRUTS_ALLOW_STATIC_METHOD_ACCESS = "struts.ognl.allowStaticMethodAccess";
/** The com.opensymphony.xwork2.validator.ActionValidatorManager implementation class */
public static final String STRUTS_ACTIONVALIDATORMANAGER = "struts.actionValidatorManager";
/** The {@link com.opensymphony.xwork2.util.ValueStackFactory} implementation class */
public static final String STRUTS_VALUESTACKFACTORY = "struts.valueStackFactory";
/** The {@link com.opensymphony.xwork2.reflection.ReflectionProvider} implementation class */
public static final String STRUTS_REFLECTIONPROVIDER = "struts.reflectionProvider";
/** The {@link com.opensymphony.xwork2.reflection.ReflectionContextFactory} implementation class */
public static final String STRUTS_REFLECTIONCONTEXTFACTORY = "struts.reflectionContextFactory";
/** The {@link com.opensymphony.xwork2.util.PatternMatcher} implementation class */
public static final String STRUTS_PATTERNMATCHER = "struts.patternMatcher";
}
@@ -20,18 +20,57 @@
*/
package org.apache.struts2;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import java.util.logging.ConsoleHandler;
import java.util.logging.Formatter;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
import org.apache.struts2.dispatcher.Dispatcher;
import org.apache.struts2.util.StrutsTestCaseHelper;
import com.opensymphony.xwork2.XWorkTestCase;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import com.opensymphony.xwork2.util.logging.jdk.JdkLoggerFactory;
/**
* Base test case for JUnit testing Struts.
*/
public abstract class StrutsTestCase extends XWorkTestCase {
static {
ConsoleHandler handler = new ConsoleHandler();
final SimpleDateFormat df = new SimpleDateFormat("mm:ss.SSS");
Formatter formatter = new Formatter() {
@Override
public String format(LogRecord record) {
StringBuilder sb = new StringBuilder();
sb.append(record.getLevel());
sb.append(':');
for (int x=9-record.getLevel().toString().length(); x>0; x--) {
sb.append(' ');
}
sb.append('[');
sb.append(df.format(new Date(record.getMillis())));
sb.append("] ");
sb.append(formatMessage(record));
sb.append('\n');
return sb.toString();
}
};
handler.setFormatter(formatter);
Logger logger = Logger.getLogger("");
if (logger.getHandlers().length > 0)
logger.removeHandler(logger.getHandlers ()[0]);
logger.addHandler(handler);
logger.setLevel(Level.WARNING);
LoggerFactory.setLoggerFactory(new JdkLoggerFactory());
}
/**
* Sets up the configuration settings, XWork configuration, and
* message resources
@@ -23,6 +23,7 @@ package org.apache.struts2.components;
import java.io.IOException;
import java.io.Writer;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.servlet.ServletContext;
@@ -30,14 +31,12 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.PageContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.StrutsException;
import org.apache.struts2.dispatcher.Dispatcher;
import org.apache.struts2.dispatcher.RequestMap;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.views.jsp.TagUtils;
import com.opensymphony.xwork2.ActionContext;
@@ -46,6 +45,8 @@ import com.opensymphony.xwork2.ActionProxyFactory;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.ValueStackFactory;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* <!-- START SNIPPET: javadoc -->
@@ -59,8 +60,8 @@ import com.opensymphony.xwork2.util.ValueStackFactory;
* <li>id (String) - the id (if specified) to put the action under stack's context.
* <li>name* (String) - name of the action to be executed (without the extension suffix eg. .action)</li>
* <li>namespace (String) - default to the namespace where this action tag is invoked</li>
* <li>executeResult (Boolean) - default is false. Decides wheather the result of this action is to be executed or not</li>
* <li>ignoreContextParams (Boolean) - default to false. Decides wheather the request parameters are to be included when the action is invoked</li>
* <li>executeResult (Boolean) - default is false. Decides whether the result of this action is to be executed or not</li>
* <li>ignoreContextParams (Boolean) - default to false. Decides whether the request parameters are to be included when the action is invoked</li>
* </ul>
* <!-- END SNIPPET: params -->
*
@@ -115,11 +116,12 @@ import com.opensymphony.xwork2.util.ValueStackFactory;
*/
@StrutsTag(name="action", tldTagClass="org.apache.struts2.views.jsp.ActionTag", description="Execute an action from within a view")
public class ActionComponent extends ContextBean {
private static final Log LOG = LogFactory.getLog(ActionComponent.class);
private static final Logger LOG = LoggerFactory.getLogger(ActionComponent.class);
protected HttpServletResponse res;
protected HttpServletRequest req;
protected ValueStackFactory valueStackFactory;
protected ActionProxyFactory actionProxyFactory;
protected ActionProxy proxy;
protected String name;
@@ -141,6 +143,11 @@ public class ActionComponent extends ContextBean {
public void setActionProxyFactory(ActionProxyFactory actionProxyFactory) {
this.actionProxyFactory = actionProxyFactory;
}
@Inject
public void setValueStackFactory(ValueStackFactory valueStackFactory) {
this.valueStackFactory = valueStackFactory;
}
public boolean end(Writer writer, String body) {
boolean end = super.end(writer, "", false);
@@ -164,18 +171,8 @@ public class ActionComponent extends ContextBean {
return end;
}
private Map createExtraContext() {
Map parentParams = null;
if (!ignoreContextParams) {
parentParams = new ActionContext(getStack().getContext()).getParameters();
}
Map newParams = (parentParams != null) ? new HashMap(parentParams) : new HashMap();
if (parameters != null) {
newParams.putAll(parameters);
}
protected Map createExtraContext() {
Map newParams = createParametersForContext();
ActionContext ctx = new ActionContext(stack.getContext());
ServletContext servletContext = (ServletContext) ctx.get(ServletActionContext.SERVLET_CONTEXT);
@@ -192,7 +189,7 @@ public class ActionComponent extends ContextBean {
res,
servletContext);
ValueStack newStack = ValueStackFactory.getFactory().createValueStack(stack);
ValueStack newStack = valueStackFactory.createValueStack(stack);
extraContext.put(ActionContext.VALUE_STACK, newStack);
// add page context, such that ServletDispatcherResult will do an include
@@ -201,6 +198,40 @@ public class ActionComponent extends ContextBean {
return extraContext;
}
/**
* Creates parameters map using parameters from the value stack and component parameters. Any non-String array
* values will be converted into a single-value String array.
*
* @return A map of String[] parameters
*/
protected Map<String,String[]> createParametersForContext() {
Map parentParams = null;
if (!ignoreContextParams) {
parentParams = new ActionContext(getStack().getContext()).getParameters();
}
Map<String,String[]> newParams = (parentParams != null)
? new HashMap<String,String[]>(parentParams)
: new HashMap<String,String[]>();
if (parameters != null) {
Map<String,String[]> params = new HashMap<String,String[]>();
for (Iterator i = parameters.entrySet().iterator(); i.hasNext(); ) {
Map.Entry entry = (Map.Entry) i.next();
String key = (String) entry.getKey();
Object val = entry.getValue();
if (val.getClass().isArray() && String.class == val.getClass().getComponentType()) {
params.put(key, (String[])val);
} else {
params.put(key, new String[]{val.toString()});
}
}
newParams.putAll(params);
}
return newParams;
}
public ActionProxy getProxy() {
return proxy;
}
@@ -247,9 +278,7 @@ public class ActionComponent extends ContextBean {
try {
proxy = actionProxyFactory.createActionProxy(namespace, actionName, createExtraContext(), executeResult, true);
if (null != methodName) {
proxy.setMethod(methodName);
}
proxy.setMethod(methodName);
// set the new stack into the request for the taglib to use
req.setAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY, proxy.getInvocation().getStack());
proxy.execute();
@@ -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;
*
@@ -46,7 +46,11 @@ import com.opensymphony.xwork2.util.ValueStack;
* </pre>
*
*/
@StrutsTag(name="a", tldTagClass="org.apache.struts2.views.jsp.ui.AnchorTag", description="Render a HTML href element that when clicked can optionally call a URL via remote XMLHttpRequest and updates its targets")
@StrutsTag(
name="a",
tldTagClass="org.apache.struts2.views.jsp.ui.AnchorTag",
description="Render a HTML href element that when clicked can optionally call a URL via remote XMLHttpRequest and updates its targets",
allowDynamicAttributes=true)
public class Anchor extends ClosingUIBean {
public static final String OPEN_TEMPLATE = "a";
public static final String TEMPLATE = "a-close";
@@ -25,15 +25,15 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.components.Param.UnnamedParametric;
import org.apache.struts2.util.AppendIteratorFilter;
import org.apache.struts2.util.MakeIterator;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* <!-- START SNIPPET: javadoc -->
@@ -118,7 +118,7 @@ import com.opensymphony.xwork2.util.ValueStack;
@StrutsTag(name="append", tldTagClass="org.apache.struts2.views.jsp.iterator.AppendIteratorTag", description="Append the values of a list of iterators to one iterator")
public class AppendIterator extends ContextBean implements UnnamedParametric {
private static final Log _log = LogFactory.getLog(AppendIterator.class);
private static final Logger LOG = LoggerFactory.getLogger(AppendIterator.class);
private AppendIteratorFilter appendIteratorFilter= null;
private List _parameters;
@@ -140,7 +140,7 @@ public class AppendIterator extends ContextBean implements UnnamedParametric {
Object iteratorEntryObj = paramEntries.next();
if (! MakeIterator.isIterable(iteratorEntryObj)) {
_log.warn("param with value resolved as "+iteratorEntryObj+" cannot be make as iterator, it will be ignored and hence will not appear in the merged iterator");
LOG.warn("param with value resolved as "+iteratorEntryObj+" cannot be make as iterator, it will be ignored and hence will not appear in the merged iterator");
continue;
}
appendIteratorFilter.setSource(MakeIterator.convert(iteratorEntryObj));
@@ -22,16 +22,16 @@ package org.apache.struts2.components;
import java.io.Writer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.util.OgnlUtil;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import com.opensymphony.xwork2.util.reflection.ReflectionProvider;
/**
* <!-- START SNIPPET: javadoc -->
@@ -96,11 +96,12 @@ import com.opensymphony.xwork2.util.ValueStack;
@StrutsTag(name="bean", tldTagClass="org.apache.struts2.views.jsp.BeanTag",
description="Instantiate a JavaBean and place it in the context")
public class Bean extends ContextBean {
protected static Log log = LogFactory.getLog(Bean.class);
protected static Logger LOG = LoggerFactory.getLogger(Bean.class);
protected Object bean;
protected String name;
protected ObjectFactory objectFactory;
protected ReflectionProvider reflectionProvider;
public Bean(ValueStack stack) {
super(stack);
@@ -110,6 +111,11 @@ public class Bean extends ContextBean {
public void setObjectFactory(ObjectFactory objectFactory) {
this.objectFactory = objectFactory;
}
@Inject
public void setReflectionProvider(ReflectionProvider prov) {
this.reflectionProvider = prov;
}
public boolean start(Writer writer) {
boolean result = super.start(writer);
@@ -120,7 +126,7 @@ public class Bean extends ContextBean {
String beanName = findString(name, "name", "Bean name is required. Example: com.acme.FooBean");
bean = objectFactory.buildBean(ClassLoaderUtil.loadClass(beanName, getClass()), stack.getContext());
} catch (Exception e) {
log.error("Could not instantiate bean", e);
LOG.error("Could not instantiate bean", e);
return false;
}
@@ -142,7 +148,7 @@ public class Bean extends ContextBean {
}
public void addParameter(String key, Object value) {
OgnlUtil.setProperty(key, value, bean, getStack().getContext());
reflectionProvider.setProperty(key, value, bean, getStack().getContext());
}
@StrutsTagAttribute(description="The class name of the bean to be instantiated (must respect JavaBean specification)",
@@ -50,7 +50,11 @@ import com.opensymphony.xwork2.util.ValueStack;
* </pre>
*
*/
@StrutsTag(name="checkbox", tldTagClass="org.apache.struts2.views.jsp.ui.CheckboxTag", description="Render a checkbox input field")
@StrutsTag(
name="checkbox",
tldTagClass="org.apache.struts2.views.jsp.ui.CheckboxTag",
description="Render a checkbox input field",
allowDynamicAttributes=true)
public class Checkbox extends UIBean {
final public static String TEMPLATE = "checkbox";
@@ -25,17 +25,17 @@ import java.io.Writer;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* ClosingUIBean is the standard superclass for UI components such as div etc.
*/
public abstract class ClosingUIBean extends UIBean {
private static final Log LOG = LogFactory.getLog(ClosingUIBean.class);
private static final Logger LOG = LoggerFactory.getLogger(ClosingUIBean.class);
protected ClosingUIBean(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
super(stack, request, response);
@@ -31,7 +31,6 @@ import java.util.Stack;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.StrutsException;
import org.apache.struts2.dispatcher.mapper.ActionMapper;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
@@ -69,7 +68,7 @@ public class Component {
}
/**
* Get's the name of this component.
* Gets the name of this component.
* @return the name of this component.
*/
private String getComponentName() {
@@ -86,7 +85,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() {
@@ -94,7 +93,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() {
@@ -214,7 +213,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>.
@@ -333,16 +332,20 @@ public class Component {
* @param scheme http or https
* @param includeContext should the context path be included or not
* @param encodeResult should the url be encoded
* @param forceAddSchemeHostAndPort should the scheme host and port be forced
* @param escapeAmp should ampersand (&) be escaped to &amp;
* @return the action url.
*/
protected String determineActionURL(String action, String namespace, String method,
HttpServletRequest req, HttpServletResponse res, Map parameters, String scheme,
boolean includeContext, boolean encodeResult) {
boolean 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);
}
/**
@@ -406,7 +409,7 @@ public class Component {
}
/**
* Get's the parameters.
* Gets the parameters.
* @return the parameters. Is never <tt>null</tt>.
*/
public Map getParameters() {
@@ -414,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) {
@@ -422,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.
@@ -449,5 +452,4 @@ public class Component {
public boolean usesBody() {
return false;
}
}
@@ -29,14 +29,14 @@ import java.util.Calendar;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.TextProvider;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* <!-- START SNIPPET: javadoc -->
@@ -142,7 +142,7 @@ import com.opensymphony.xwork2.util.ValueStack;
@StrutsTag(name="date", tldBodyContent="empty", tldTagClass="org.apache.struts2.views.jsp.DateTag", description="Render a formatted date.")
public class Date extends ContextBean {
private static final Log LOG = LogFactory.getLog(Date.class);
private static final Logger LOG = LoggerFactory.getLogger(Date.class);
/**
* Property name to fall back when no format is specified
*/
@@ -20,8 +20,9 @@
*/
package org.apache.struts2.components;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.OgnlUtil;
import com.opensymphony.xwork2.util.reflection.ReflectionProvider;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
@@ -38,11 +39,20 @@ import org.apache.struts2.StrutsException;
description="Prints debugging information")
public class Debug extends UIBean {
public static final String TEMPLATE = "debug";
protected ReflectionProvider reflectionProvider;
public Debug(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
super(stack, request, response);
}
@Inject
public void setReflectionProvider(ReflectionProvider prov) {
this.reflectionProvider = prov;
}
protected String getDefaultTemplate() {
return TEMPLATE;
}
@@ -57,7 +67,7 @@ public class Debug extends UIBean {
Object o = iter.next();
Map values;
try {
values = OgnlUtil.getBeanMap(o);
values = reflectionProvider.getBeanMap(o);
} catch (Exception e) {
throw new StrutsException("Caught an exception while getting the property values of " + o, e);
}
@@ -33,7 +33,11 @@ import com.opensymphony.xwork2.util.ValueStack;
* <!-- END SNIPPET: javadoc -->
*
*/
@StrutsTag(name="div", tldTagClass="org.apache.struts2.views.jsp.ui.DivTag", description="Render HTML div providing content from remote call via AJAX")
@StrutsTag(
name="div",
tldTagClass="org.apache.struts2.views.jsp.ui.DivTag",
description="Render an HTML div",
allowDynamicAttributes=true)
public class Div extends ClosingUIBean {
public static final String TEMPLATE = "div";
@@ -24,7 +24,6 @@ import java.io.Writer;
import java.util.Map;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
import com.opensymphony.xwork2.util.ValueStack;
@@ -24,7 +24,6 @@ import java.io.Writer;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
import com.opensymphony.xwork2.util.ValueStack;
@@ -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;
*
@@ -23,12 +23,12 @@ package org.apache.struts2.components;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* <!-- START SNIPPET: javadoc -->
@@ -45,9 +45,13 @@ import com.opensymphony.xwork2.util.ValueStack;
* </pre>
*
*/
@StrutsTag(name="file", tldTagClass="org.apache.struts2.views.jsp.ui.FileTag", description="Render a file input field")
@StrutsTag(
name="file",
tldTagClass="org.apache.struts2.views.jsp.ui.FileTag",
description="Render a file input field",
allowDynamicAttributes=true)
public class File extends UIBean {
private final static Log log = LogFactory.getLog(File.class);
private final static Logger LOG = LoggerFactory.getLogger(File.class);
final public static String TEMPLATE = "file";
@@ -70,13 +74,13 @@ public class File extends UIBean {
String encType = (String) form.getParameters().get("enctype");
if (!"multipart/form-data".equals(encType)) {
// uh oh, this isn't good! Let's warn the developer
log.warn("Struts has detected a file upload UI tag (s:file) being used without a form set to enctype 'multipart/form-data'. This is probably an error!");
LOG.warn("Struts has detected a file upload UI tag (s:file) being used without a form set to enctype 'multipart/form-data'. This is probably an error!");
}
String method = (String) form.getParameters().get("method");
if (!"post".equalsIgnoreCase(method)) {
// uh oh, this isn't good! Let's warn the developer
log.warn("Struts has detected a file upload UI tag (s:file) being used without a form set to method 'POST'. This is probably an error!");
LOG.warn("Struts has detected a file upload UI tag (s:file) being used without a form set to method 'POST'. This is probably an error!");
}
}
@@ -20,26 +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;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.RuntimeConfiguration;
@@ -48,11 +28,18 @@ 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.validator.ActionValidatorManagerFactory;
import com.opensymphony.xwork2.validator.ActionValidatorManager;
import com.opensymphony.xwork2.validator.FieldValidator;
import com.opensymphony.xwork2.validator.ValidationInterceptor;
import com.opensymphony.xwork2.validator.Validator;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import java.util.Set;
/**
* <!-- START SNIPPET: javadoc -->
@@ -93,7 +80,11 @@ import com.opensymphony.xwork2.validator.Validator;
* </pre>
*
*/
@StrutsTag(name="form", tldTagClass="org.apache.struts2.views.jsp.ui.FormTag", description="Renders an input form")
@StrutsTag(
name="form",
tldTagClass="org.apache.struts2.views.jsp.ui.FormTag",
description="Renders an input form",
allowDynamicAttributes=true)
public class Form extends ClosingUIBean {
public static final String OPEN_TEMPLATE = "form";
public static final String TEMPLATE = "form-close";
@@ -116,6 +107,7 @@ public class Form extends ClosingUIBean {
protected Configuration configuration;
protected ObjectFactory objectFactory;
protected UrlRenderer urlRenderer;
protected ActionValidatorManager actionValidatorManager;
public Form(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
super(stack, request, response);
@@ -152,6 +144,11 @@ public class Form extends ClosingUIBean {
public void setUrlRenderer(UrlRenderer urlRenderer) {
this.urlRenderer = urlRenderer;
}
@Inject
public void setActionValidatorManager(ActionValidatorManager mgr) {
this.actionValidatorManager = mgr;
}
/*
@@ -222,32 +219,26 @@ public class Form extends ClosingUIBean {
* </ol>
*/
protected void populateComponentHtmlId(Form form) {
boolean isAjax = "ajax".equalsIgnoreCase(this.theme);
String action = null;
if (this.action != null) {
// if it isn't specified, we'll make somethig up
action = findString(this.action);
}
if (id != null) {
addParameter("id", escape(id));
}
// if no id given, it will be tried to generate it from the action attribute
// by the urlRenderer implementation
urlRenderer.renderFormUrl(this);
}
/**
* @param isAjax
* @param namespace
* @param action
* Evaluate client side JavaScript Enablement.
* @param actionName the actioName to check for
* @param namespace the namespace to check for
* @param actionMethod the method to ckeck for
*/
protected void evaluateClientSideJsEnablement(String actionName, String namespace, String actionMethod) {
// 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);
@@ -255,9 +246,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();
@@ -280,10 +270,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 = actionValidatorManager.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)) {
@@ -311,7 +300,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;
}
@@ -342,7 +331,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;
}
@@ -24,7 +24,6 @@ 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 com.opensymphony.xwork2.inject.Inject;
@@ -49,7 +49,11 @@ import com.opensymphony.xwork2.util.ValueStack;
* </pre>
*
*/
@StrutsTag(name="hidden", tldTagClass="org.apache.struts2.views.jsp.ui.HiddenTag", description="Render a hidden input field")
@StrutsTag(
name="hidden",
tldTagClass="org.apache.struts2.views.jsp.ui.HiddenTag",
description="Render a hidden input field",
allowDynamicAttributes=true)
public class Hidden extends UIBean {
final public static String TEMPLATE = "hidden";
@@ -26,13 +26,13 @@ import java.util.ResourceBundle;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
import org.apache.struts2.StrutsException;
import org.apache.struts2.dispatcher.Dispatcher;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.LocaleProvider;
import com.opensymphony.xwork2.TextProviderFactory;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.LocalizedTextUtil;
import com.opensymphony.xwork2.util.ValueStack;
@@ -86,10 +86,16 @@ import com.opensymphony.xwork2.util.ValueStack;
public class I18n extends Component {
protected boolean pushed;
protected String name;
protected Container container;
public I18n(ValueStack stack) {
super(stack);
}
@Inject
public void setContainer(Container container) {
this.container = container;
}
public boolean start(Writer writer) {
boolean result = super.start(writer);
@@ -105,7 +111,7 @@ public class I18n extends Component {
if (bundle != null) {
final Locale locale = (Locale) getStack().getContext().get(ActionContext.LOCALE);
TextProviderFactory tpf = new TextProviderFactory();
Dispatcher.getInstance().getContainer().inject(tpf);
container.inject(tpf);
getStack().push(tpf.createInstance(bundle, new LocaleProvider() {
public Locale getLocale() {
return locale;
@@ -129,7 +135,7 @@ public class I18n extends Component {
return super.end(writer, body);
}
@StrutsTagAttribute(description="Name of ressource bundle to use (eg foo/bar/customBundle)", required=true, defaultValue="String")
@StrutsTagAttribute(description="Name of resource bundle to use (eg foo/bar/customBundle)", required=true, defaultValue="String")
public void setName(String name) {
this.name = name;
}
@@ -24,7 +24,6 @@ import java.io.Writer;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
import com.opensymphony.xwork2.util.ValueStack;
@@ -40,17 +40,16 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
import org.apache.struts2.RequestUtils;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.util.FastByteArrayOutputStream;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* <!-- START SNIPPET: javadoc -->
@@ -98,7 +97,7 @@ import com.opensymphony.xwork2.util.ValueStack;
"(result of servlet or a JSP page)")
public class Include extends Component {
private static final Log _log = LogFactory.getLog(Include.class);
private static final Logger LOG = LoggerFactory.getLogger(Include.class);
private static String encoding;
private static boolean encodingDefined = true;
@@ -115,7 +114,7 @@ public class Include extends Component {
}
@Inject(StrutsConstants.STRUTS_I18N_ENCODING)
public static void setDefaultEncoding(String encoding) {
public void setDefaultEncoding(String encoding) {
defaultEncoding = encoding;
}
@@ -148,7 +147,7 @@ public class Include extends Component {
try {
urlBuf.append(URLEncoder.encode(values.get(i).toString(), "UTF-8"));
} catch (Exception e) {
_log.warn("unable to url-encode "+values.get(i).toString()+", it will be ignored");
LOG.warn("unable to url-encode "+values.get(i).toString()+", it will be ignored");
}
concat = "&";
@@ -162,7 +161,7 @@ public class Include extends Component {
try {
include(result, writer, req, res);
} catch (Exception e) {
LogFactory.getLog(getClass()).warn("Exception thrown during include of " + result, e);
LOG.warn("Exception thrown during include of " + result, e);
}
return super.end(writer, body);
@@ -20,16 +20,18 @@
*/
package org.apache.struts2.components;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.opensymphony.xwork2.util.ValueStack;
import java.util.LinkedHashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
import java.util.LinkedHashMap;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* <!-- START SNIPPET: javadoc -->
@@ -72,7 +74,7 @@ import java.util.LinkedHashMap;
@StrutsTag(name="inputtransferselect", tldTagClass="org.apache.struts2.views.jsp.ui.InputTransferSelectTag", description="Renders an input form")
public class InputTransferSelect extends ListUIBean {
private static final Log _log = LogFactory.getLog(InputTransferSelect.class);
private static final Logger LOG = LoggerFactory.getLogger(InputTransferSelect.class);
private static final String TEMPLATE = "inputtransferselect";
@@ -198,7 +200,7 @@ public class InputTransferSelect extends ListUIBean {
}
else {
_log.warn("form enclosing inputtransferselect "+this+" not found, auto select upon form submit of inputtransferselect will not work");
LOG.warn("form enclosing inputtransferselect "+this+" not found, auto select upon form submit of inputtransferselect will not work");
}
}
@@ -137,7 +137,7 @@ import com.opensymphony.xwork2.util.ValueStack;
*
* </p> The next example iterates over a an action collection and passes every iterator value to another action. The
* trick here lies in the use of the '[0]' operator. It takes the current iterator value and passes it on to the edit
* action. Using the '[0]' operator has the same effect as using &gt;s:property /&gt;. (The latter, however, does not
* action. Using the '[0]' operator has the same effect as using &lt;s:property /&gt;. (The latter, however, does not
* work from inside the param tag). </p>
*
* <!-- END SNIPPET: example4description -->
@@ -53,8 +53,11 @@ import com.opensymphony.xwork2.util.ValueStack;
* </pre>
*
*/
@StrutsTag(name="label", tldTagClass="org.apache.struts2.views.jsp.ui.LabelTag", description="Render a label that displays" +
" read-only information")
@StrutsTag(
name="label",
tldTagClass="org.apache.struts2.views.jsp.ui.LabelTag",
description="Render a label that displays read-only information",
allowDynamicAttributes=true)
public class Label extends UIBean {
final public static String TEMPLATE = "label";
@@ -25,15 +25,15 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.components.Param.UnnamedParametric;
import org.apache.struts2.util.MakeIterator;
import org.apache.struts2.util.MergeIteratorFilter;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* <!-- START SNIPPET: javadoc -->
@@ -132,7 +132,7 @@ import com.opensymphony.xwork2.util.ValueStack;
"of a list of iterators into one iterator")
public class MergeIterator extends ContextBean implements UnnamedParametric {
private static final Log _log = LogFactory.getLog(MergeIterator.class);
private static final Logger LOG = LoggerFactory.getLogger(MergeIterator.class);
private MergeIteratorFilter mergeIteratorFilter = null;
private List _parameters;
@@ -154,7 +154,7 @@ public class MergeIterator extends ContextBean implements UnnamedParametric {
for (Iterator parametersIterator = _parameters.iterator(); parametersIterator.hasNext(); ) {
Object iteratorEntryObj = parametersIterator.next();
if (! MakeIterator.isIterable(iteratorEntryObj)) {
_log.warn("param with value resolved as "+iteratorEntryObj+" cannot be make as iterator, it will be ignored and hence will not appear in the merged iterator");
LOG.warn("param with value resolved as "+iteratorEntryObj+" cannot be make as iterator, it will be ignored and hence will not appear in the merged iterator");
continue;
}
mergeIteratorFilter.setSource(MakeIterator.convert(iteratorEntryObj));
@@ -27,15 +27,14 @@ import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* <!-- START SNIPPET: javadoc -->
@@ -71,12 +70,16 @@ import com.opensymphony.xwork2.util.ValueStack;
* </pre>
*
*/
@StrutsTag(name="optgroup", tldTagClass="org.apache.struts2.views.jsp.ui.OptGroupTag", description="Renders a Select Tag's OptGroup Tag")
@StrutsTag(
name="optgroup",
tldTagClass="org.apache.struts2.views.jsp.ui.OptGroupTag",
description="Renders a Select Tag's OptGroup Tag",
allowDynamicAttributes=true)
public class OptGroup extends Component {
public static final String INTERNAL_LIST_UI_BEAN_LIST_PARAMETER_KEY = "optGroupInternalListUiBeanList";
private static Log _log = LogFactory.getLog(OptGroup.class);
private static Logger LOG = LoggerFactory.getLogger(OptGroup.class);
protected HttpServletRequest req;
protected HttpServletResponse res;
@@ -102,7 +105,7 @@ public class OptGroup extends Component {
public boolean end(Writer writer, String body) {
Select select = (Select) findAncestor(Select.class);
if (select == null) {
_log.error("incorrect use of OptGroup component, this component must be used within a Select component",
LOG.error("incorrect use of OptGroup component, this component must be used within a Select component",
new IllegalStateException("incorrect use of OptGroup component, this component must be used within a Select component"));
return false;
}
@@ -26,12 +26,12 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* <!-- START SNIPPET: javadoc -->
@@ -95,7 +95,7 @@ import com.opensymphony.xwork2.util.ValueStack;
@StrutsTag(name="optiontransferselect", tldTagClass="org.apache.struts2.views.jsp.ui.OptionTransferSelectTag", description="Renders an input form")
public class OptionTransferSelect extends DoubleListUIBean {
private static final Log _log = LogFactory.getLog(OptionTransferSelect.class);
private static final Logger LOG = LoggerFactory.getLogger(OptionTransferSelect.class);
private static final String TEMPLATE = "optiontransferselect";
@@ -331,7 +331,7 @@ public class OptionTransferSelect extends DoubleListUIBean {
}
else {
_log.warn("form enclosing optiontransferselect "+this+" not found, auto select upon form submit of optiontransferselect will not work");
LOG.warn("form enclosing optiontransferselect "+this+" not found, auto select upon form submit of optiontransferselect will not work");
}
}
@@ -24,7 +24,6 @@ import java.io.Writer;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
import org.apache.struts2.StrutsException;
import com.opensymphony.xwork2.util.ValueStack;
@@ -46,7 +46,11 @@ import com.opensymphony.xwork2.util.ValueStack;
* </pre>
*
*/
@StrutsTag(name="password", tldTagClass="org.apache.struts2.views.jsp.ui.PasswordTag", description="Render an HTML input tag of type password")
@StrutsTag(
name="password",
tldTagClass="org.apache.struts2.views.jsp.ui.PasswordTag",
description="Render an HTML input tag of type password",
allowDynamicAttributes=true)
public class Password extends TextField {
final public static String TEMPLATE = "password";
@@ -23,14 +23,13 @@ package org.apache.struts2.components;
import java.io.IOException;
import java.io.Writer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.TextUtils;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* <!-- START SNIPPET: javadoc -->
@@ -90,7 +89,7 @@ import com.opensymphony.xwork2.util.TextUtils;
@StrutsTag(name="property", tldBodyContent="empty", tldTagClass="org.apache.struts2.views.jsp.PropertyTag",
description="Print out expression which evaluates against the stack")
public class Property extends Component {
private static final Log LOG = LogFactory.getLog(Property.class);
private static final Logger LOG = LoggerFactory.getLogger(Property.class);
public Property(ValueStack stack) {
super(stack);
@@ -24,7 +24,6 @@ import java.io.Writer;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
import com.opensymphony.xwork2.util.ValueStack;
@@ -56,7 +56,11 @@ import com.opensymphony.xwork2.util.ValueStack;
* </pre>
*
*/
@StrutsTag(name="reset", tldTagClass="org.apache.struts2.views.jsp.ui.ResetTag", description="Render a reset button")
@StrutsTag(
name="reset",
tldTagClass="org.apache.struts2.views.jsp.ui.ResetTag",
description="Render a reset button",
allowDynamicAttributes=true)
public class Reset extends FormButton {
final public static String TEMPLATE = "reset";
@@ -47,6 +47,7 @@ import com.opensymphony.xwork2.util.ValueStack;
* multiple="true"
* size="3"
* required="true"
* value="%{petDao.pets.{id}}"
* /&gt;
*
* &lt;s:select label="Months"
@@ -77,7 +78,11 @@ import com.opensymphony.xwork2.util.ValueStack;
* <!-- END SNIPPET: exnote -->
*
*/
@StrutsTag(name="select", tldTagClass="org.apache.struts2.views.jsp.ui.SelectTag", description="Render a select element")
@StrutsTag(
name="select",
tldTagClass="org.apache.struts2.views.jsp.ui.SelectTag",
description="Render a select element",
allowDynamicAttributes=true)
public class Select extends ListUIBean {
final public static String TEMPLATE = "select";
@@ -132,8 +137,8 @@ public class Select extends ListUIBean {
}
@StrutsTagAttribute(description=" Creates a multiple select. The tag will pre-select multiple values" +
" if the values are passed as an Array (of appropriate types) via the value attribute. Passing " +
"a Collection may work too? Haven't tested this.", type="Boolean", defaultValue="false")
" if the values are passed as an Array or a Collection(of appropriate types) via the value attribute. If one of the keys equals" +
" one of the values in the Collection or Array it wil be selected", type="Boolean", defaultValue="false")
public void setMultiple(String multiple) {
this.multiple = multiple;
}
@@ -1,3 +1,23 @@
/*
* $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.components;
import java.io.IOException;
@@ -10,12 +30,19 @@ import org.apache.struts2.views.util.UrlHelper;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* Implementation of the {@link UrlRenderer} interface that creates URLs suitable in a servlet environment.
*
*/
public class ServletUrlRenderer implements UrlRenderer {
/**
* Provide a logging instance.
*/
private static final Logger LOG = LoggerFactory.getLogger(ServletUrlRenderer.class);
/**
* {@inheritDoc}
@@ -29,7 +56,7 @@ public class ServletUrlRenderer implements UrlRenderer {
String result;
if (urlComponent.value == null && urlComponent.action != null) {
result = urlComponent.determineActionURL(urlComponent.action, urlComponent.namespace, urlComponent.method, urlComponent.req, urlComponent.res, urlComponent.parameters, scheme, urlComponent.includeContext, urlComponent.encode);
result = urlComponent.determineActionURL(urlComponent.action, urlComponent.namespace, urlComponent.method, urlComponent.req, urlComponent.res, urlComponent.parameters, scheme, urlComponent.includeContext, urlComponent.encode, urlComponent.forceAddSchemeHostAndPort, urlComponent.escapeAmp);
} else {
String _value = urlComponent.value;
@@ -38,7 +65,7 @@ public class ServletUrlRenderer implements UrlRenderer {
if (_value != null && _value.indexOf("?") > 0) {
_value = _value.substring(0, _value.indexOf("?"));
}
result = UrlHelper.buildUrl(_value, urlComponent.req, urlComponent.res, urlComponent.parameters, scheme, urlComponent.includeContext, urlComponent.encode);
result = UrlHelper.buildUrl(_value, urlComponent.req, urlComponent.res, urlComponent.parameters, scheme, urlComponent.includeContext, urlComponent.encode, urlComponent.forceAddSchemeHostAndPort, urlComponent.escapeAmp);
}
if ( urlComponent.anchor != null && urlComponent.anchor.length() > 0 ) {
result += '#' + urlComponent.anchor;
@@ -66,13 +93,11 @@ public class ServletUrlRenderer implements UrlRenderer {
public void renderFormUrl(Form formComponent) {
String namespace = formComponent.determineNamespace(formComponent.namespace, formComponent.getStack(),
formComponent.request);
String action = null;
String action;
if(formComponent.action != null) {
action = formComponent.findString(formComponent.action);
}
if (formComponent.action == null) {
} else {
// no action supplied? ok, then default to the current request
// (action or general URL)
ActionInvocation ai = (ActionInvocation) formComponent.getStack().getContext().get(
@@ -127,15 +152,19 @@ public class ServletUrlRenderer implements UrlRenderer {
}
// if the id isn't specified, use the action name
if (formComponent.getId() == null) {
formComponent.addParameter("id", action);
if (formComponent.getId() == null && action!=null ) {
formComponent.addParameter("id", formComponent.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
// form is submitting to.
// assume 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, formComponent.request, formComponent.response, null);
formComponent.addParameter("action", result);
@@ -165,9 +194,7 @@ public class ServletUrlRenderer implements UrlRenderer {
// WW-1284
// evaluate if client-side js is to be enabled. (if validation
// interceptor
// does allow validation eg. method is not filtered out)
// interceptor does allow validation eg. method is not filtered out)
formComponent.evaluateClientSideJsEnablement(actionName, namespace, actionMethod);
}
}
@@ -25,12 +25,12 @@ import java.io.Writer;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* <!-- START SNIPPET: javadoc -->
@@ -45,10 +45,14 @@ import com.opensymphony.xwork2.util.ValueStack;
* text shown on the button face, but has issues with Microsoft Internet Explorer at least up to 6.0
* <!-- END SNIPPET: javadoc -->
*/
@StrutsTag(name="submit", tldTagClass="org.apache.struts2.views.jsp.ui.SubmitTag", description="Render a submit button")
@StrutsTag(
name="submit",
tldTagClass="org.apache.struts2.views.jsp.ui.SubmitTag",
description="Render a submit button",
allowDynamicAttributes=true)
public class Submit extends FormButton {
private static final Log LOG = LogFactory.getLog(Submit.class);
private static final Logger LOG = LoggerFactory.getLogger(Submit.class);
final public static String TEMPLATE = "submit";
protected String src;
@@ -27,14 +27,14 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import com.opensymphony.xwork2.TextProvider;
import com.opensymphony.xwork2.util.TextUtils;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.TextProvider;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* <!-- START SNIPPET: javadoc -->
@@ -113,9 +113,13 @@ import com.opensymphony.xwork2.TextProvider;
* @see Param
*
*/
@StrutsTag(name="text", tldTagClass="org.apache.struts2.views.jsp.TextTag", description="Render a I18n text message")
@StrutsTag(
name="text",
tldTagClass="org.apache.struts2.views.jsp.TextTag",
description="Render a I18n text message",
allowDynamicAttributes=true)
public class Text extends ContextBean implements Param.UnnamedParametric {
private static final Log LOG = LogFactory.getLog(Text.class);
private static final Logger LOG = LoggerFactory.getLogger(Text.class);
protected List values = Collections.EMPTY_LIST;
protected String actualName;
@@ -44,7 +44,11 @@ import com.opensymphony.xwork2.util.ValueStack;
* @see TabbedPanel
*
*/
@StrutsTag(name="textarea", tldTagClass="org.apache.struts2.views.jsp.ui.TextareaTag", description="Render HTML textarea tag.")
@StrutsTag(
name="textarea",
tldTagClass="org.apache.struts2.views.jsp.ui.TextareaTag",
description="Render HTML textarea tag.",
allowDynamicAttributes=true)
public class TextArea extends UIBean {
final public static String TEMPLATE = "textarea";
@@ -51,7 +51,11 @@ import com.opensymphony.xwork2.util.ValueStack;
* </pre>
*/
@StrutsTag(name="textfield", tldTagClass="org.apache.struts2.views.jsp.ui.TextFieldTag", description="Render an HTML input field of type text")
@StrutsTag(
name="textfield",
tldTagClass="org.apache.struts2.views.jsp.ui.TextFieldTag",
description="Render an HTML input field of type text",
allowDynamicAttributes=true)
public class TextField extends UIBean {
/**
* The name of the default template for the TextFieldTag
@@ -21,6 +21,7 @@
package org.apache.struts2.components;
import java.io.Writer;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
@@ -29,19 +30,19 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.components.template.Template;
import org.apache.struts2.components.template.TemplateEngine;
import org.apache.struts2.components.template.TemplateEngineManager;
import org.apache.struts2.components.template.TemplateRenderingContext;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.views.util.ContextUtil;
import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* UIBean is the standard superclass of all Struts UI componentns.
@@ -310,7 +311,7 @@ import com.opensymphony.xwork2.util.ValueStack;
*
*
* <!-- START SNIPPET: tooltipdescription -->
* <b>tooltipConfig is deprecated, use individual tooltip configuration attributes instead </>
* <b>tooltipConfig is deprecated, use individual tooltip configuration attributes instead </b>
*
* Every Form UI component (in xhtml / css_xhtml or any other that extends them) can
* have tooltips assigned to them. The Form component's tooltip related attribute, once
@@ -400,7 +401,7 @@ import com.opensymphony.xwork2.util.ValueStack;
*
*/
public abstract class UIBean extends Component {
private static final Log LOG = LogFactory.getLog(UIBean.class);
private static final Logger LOG = LoggerFactory.getLogger(UIBean.class);
protected HttpServletRequest request;
protected HttpServletResponse response;
@@ -465,6 +466,9 @@ public abstract class UIBean extends Component {
protected String tooltipDelay;
protected String tooltipCssClass;
protected String tooltipIconPath;
// dynamic attributes
protected Map<String,Object> dynamicAttributes = new HashMap<String,Object>();
protected String defaultTemplateDir;
protected String defaultUITheme;
@@ -760,9 +764,6 @@ public abstract class UIBean extends Component {
}
// tooltip & tooltipConfig
if (tooltipConfig != null) {
addParameter("tooltipConfig", findValue(tooltipConfig));
@@ -821,8 +822,10 @@ public abstract class UIBean extends Component {
}
evaluateExtraParams();
addParameter("dynamicAttributes", dynamicAttributes);
evaluateExtraParams();
}
protected String escape(String name) {
@@ -902,7 +905,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>
@@ -914,21 +918,24 @@ 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));
}
/**
* Get's the id for referencing element.
* @return the id for referencing element.
@@ -968,7 +975,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;
}
@@ -1133,4 +1140,8 @@ public abstract class UIBean extends Component {
public void setTooltipIconPath(String tooltipIconPath) {
this.tooltipIconPath = tooltipIconPath;
}
public void setDynamicAttributes(Map<String,Object> dynamicAttributes) {
this.dynamicAttributes = dynamicAttributes;
}
}

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