Compare commits

...

105 Commits

Author SHA1 Message Date
Ted Nathan Husted fe62eb0347 WW-1705 Tag r509051 as Struts 2.0.6
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_6@509057 13f79535-47bb-0310-9956-ffa450edef68
2007-02-19 01:56:17 +00:00
Ted Nathan Husted 611f7cf2c4 WW-1685 Tag r509051 as Struts 2.0.6
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_6@509053 13f79535-47bb-0310-9956-ffa450edef68
2007-02-19 01:34:29 +00:00
Ted Nathan Husted f13243a2bf WW-1705 Update POMs for 2.0.6 tag.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@509051 13f79535-47bb-0310-9956-ffa450edef68
2007-02-19 01:33:07 +00:00
Ted Nathan Husted b2496a566c WW-1685 Restore Tiles as a "mainstream" example.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@509048 13f79535-47bb-0310-9956-ffa450edef68
2007-02-19 01:26:47 +00:00
Ted Nathan Husted 756c2f58d5 WW-1685 Playtest Showcase and adjust status of verious examples.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@509047 13f79535-47bb-0310-9956-ffa450edef68
2007-02-19 01:22:52 +00:00
Ted Nathan Husted cac778c170 WW-1685 Playtest Showcase and adjust status of verious examples.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@509034 13f79535-47bb-0310-9956-ffa450edef68
2007-02-19 00:03:37 +00:00
Ted Nathan Husted 66479bc36e WW-1548 Remove continuation support from 2.0.x, which had been classified "sandbox" code.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@509029 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 23:26:15 +00:00
Ted Nathan Husted fbd8a0a328 WW-1685 Add development menu to Struts 2 area.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@509026 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 23:08:22 +00:00
Thomas Schneider 554a1b5ffc WW-1699 added J2EE 5 compatibility to the StrutsMockServletContext
Contributor: Stepan Koltsov
Reviewed By: Tom Schneider

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508917 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 16:55:20 +00:00
Thomas Schneider e023f033af WW-1699 added J2EE 5 compatibility to the StrutsMockServletContext
Contributor: Stepan Koltsov
Reviewed By: Tom Schneider

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

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

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

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508612 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 22:03:55 +00:00
Musachy Barroso dd200c173c - Add README file to META-INF
- Change path of generated TLD to target/classes/META-INF

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508608 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 22:00:17 +00:00
Musachy Barroso d8ea187a2a WW-1729 Add "templateCssPath" attribute to DateTimePicker
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508605 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 21:56:50 +00:00
Musachy Barroso d7189a6648 WW-1729 Add "templateCssPath" attribute DateTimePicker
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508602 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 21:53:54 +00:00
Musachy Barroso 0534ae35d8 WW-1688 Add "templateCssPath" attribute to tabbedPanel
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508575 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 20:46:49 +00:00
Musachy Barroso 2cab82fafc WW-1688 Add "templateCssPath" attribute to tabbedPanel
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508570 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 20:42:17 +00:00
Musachy Barroso bfa0d22c8c WW-1730 The refreshOnShow attribute in tabbedPanel does not work
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508557 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 20:18:30 +00:00
Musachy Barroso 1472a49a0f WW-1730 The refreshOnShow attribute in tabbedPanel does not work
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508556 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 20:15:05 +00:00
Rainer Hermanns 5e3464d467 select tag: current option is not selected if actual value to check is no String (aka: nameValue resolves to type other than String)
o added additional unit test submitted by Stuart Piltch 

WW-1711

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508509 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 17:35:12 +00:00
Rainer Hermanns 63be3b2a41 select tag: current option is not selected if actual value to check is no String (aka: nameValue resolves to type other than String)
o added additional unit test submitted by Stuart Piltch 

WW-1711

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

WW-1711

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

WW-1711

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

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


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508465 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 16:12:32 +00:00
Rainer Hermanns fbedbdedbe Updated deps:
o OGNL 2.6.10
o XWork 2.0.1
Issue Number: WW-1615


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


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508440 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 15:10:29 +00:00
Musachy Barroso 8b32755ba1 Remove redundant tag attribute annotation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508296 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 03:10:38 +00:00
Musachy Barroso 1a2bd58e65 Remove redundant tag attribute annotation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508293 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 03:03:30 +00:00
Musachy Barroso 9872cc64db WW-1570 Add "showLoading" attribute to ajax tags
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@508285 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 02:42:24 +00:00
Musachy Barroso 421ff8d068 WW-1570:
Add "showLoading" attribute to ajax tags

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

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@506198 13f79535-47bb-0310-9956-ffa450edef68
2007-02-12 00:57:44 +00:00
Ted Nathan Husted 75b379d5d4 WW-1705 Branching at 2_0_5 tag (again)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@506174 13f79535-47bb-0310-9956-ffa450edef68
2007-02-11 23:34:04 +00:00
Bob Lee 5ae4898a5d Removed dependency from core on the new api. We can bring it back when we're ready.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@505490 13f79535-47bb-0310-9956-ffa450edef68
2007-02-09 20:50:24 +00:00
Antonio Petrelli 522961d993 WW-1724
The request context for Struts 2 - Tiles 2 integration tries to dispatch the request if possible.
It includes it only if the response has been committed, or if it is a FreeMarker request (this must be fixed).

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

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

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@504142 13f79535-47bb-0310-9956-ffa450edef68
2007-02-06 14:06:46 +00:00
Ted Nathan Husted 017537f20a WW-1685 Update site.xml for 2.0.6. Fix link to FAQ.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@503774 13f79535-47bb-0310-9956-ffa450edef68
2007-02-05 17:13:01 +00:00
Ted Nathan Husted 80d3f05fe7 WW-1685 Update POMs for the next shapshot.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@503763 13f79535-47bb-0310-9956-ffa450edef68
2007-02-05 16:48:39 +00:00
Ted Nathan Husted cb580fe614 WW-1685 Tag r503710 as Struts 2.0.5
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_5@503722 13f79535-47bb-0310-9956-ffa450edef68
2007-02-05 15:33:40 +00:00
Ted Nathan Husted 6489ffdafb WW-1685 Update POMs for 2.0.5 tag.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@503710 13f79535-47bb-0310-9956-ffa450edef68
2007-02-05 14:57:11 +00:00
Ted Nathan Husted ae58ad2a2d WW-1680 Undo move pending a refactoring of the StrutsObjectFactory.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@502453 13f79535-47bb-0310-9956-ffa450edef68
2007-02-02 02:49:11 +00:00
Ted Nathan Husted aafaf20539 WW-1680 Move "new API" into the sandbox for the time being. The "new API" may be revisited for 2.1 and refined to utilize the latest version of Guice.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@502436 13f79535-47bb-0310-9956-ffa450edef68
2007-02-02 01:38:43 +00:00
Niall Kegan Pemberton fcbdb848f2 WW-1698 - Add missing License Headers (and a few missing "svn" properties)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@502296 13f79535-47bb-0310-9956-ffa450edef68
2007-02-01 17:33:39 +00:00
Niall Kegan Pemberton 47403b9e22 add missing svn properties - no actual changes
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@502294 13f79535-47bb-0310-9956-ffa450edef68
2007-02-01 17:28:00 +00:00
René Gielen f31faacc4a WW-1696:
Refactored PrincipalProxy to interface and provided a servlet and a portlet based implementation

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@502196 13f79535-47bb-0310-9956-ffa450edef68
2007-02-01 11:28:57 +00:00
Donald J. Brown 41786a83eb Changed plexus dep to not be optional
WW-1685


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@501930 13f79535-47bb-0310-9956-ffa450edef68
2007-01-31 18:09:20 +00:00
Donald J. Brown 307669fdde Added rendering of submit button body within tag rather than before
WW-1677


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@501762 13f79535-47bb-0310-9956-ffa450edef68
2007-01-31 08:25:24 +00:00
Donald J. Brown 88df0924af Used id instead of name for Javascript method prefixes
WW-1618


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@501758 13f79535-47bb-0310-9956-ffa450edef68
2007-01-31 07:56:28 +00:00
Donald J. Brown 8d22794130 Fixed wrong name for freemarker datetimepicker tag
WW-1684


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@501750 13f79535-47bb-0310-9956-ffa450edef68
2007-01-31 07:06:47 +00:00
Donald J. Brown 9ebc53c4f0 Fixed missing type attribute from script elements
WW-1627


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@501749 13f79535-47bb-0310-9956-ffa450edef68
2007-01-31 06:59:58 +00:00
Donald J. Brown 8d4d13147d Fixed optgroup throwing NPE, added file missing from commit fixing servlet action redirect
WW-1670 WW-1662


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@501746 13f79535-47bb-0310-9956-ffa450edef68
2007-01-31 06:22:43 +00:00
Donald J. Brown 4a55d03e9a Fixing servlet action redirect not passing injected mapper to super class
WW-1662

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@501736 13f79535-47bb-0310-9956-ffa450edef68
2007-01-31 05:38:02 +00:00
Donald J. Brown 508bd982c2 Added control header and footer to datetimepicker in css_xhtml theme
WW-1689

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@501734 13f79535-47bb-0310-9956-ffa450edef68
2007-01-31 05:14:16 +00:00
Donald J. Brown 7187a6d04b Fixed custom parent packages not inherited properly with namespace annotation, fixed problem report when single exception
WW-1679 WW-1687

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@501717 13f79535-47bb-0310-9956-ffa450edef68
2007-01-31 03:51:11 +00:00
Donald J. Brown 8dc11480ef Fixed class name
WW-1692


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@501683 13f79535-47bb-0310-9956-ffa450edef68
2007-01-31 01:34:42 +00:00
Donald J. Brown 43ed192645 Fixed embarrasing lack of faith in the "if" statement
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@501618 13f79535-47bb-0310-9956-ffa450edef68
2007-01-30 22:46:48 +00:00
Joseph Lad Germuska 723a14798c switch Tiles dependency to new TLP location
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@501513 13f79535-47bb-0310-9956-ffa450edef68
2007-01-30 18:47:55 +00:00
Ted Nathan Husted 4e4376535b WW-1686 Update Freemarker dependency to 2.3.8.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@501048 13f79535-47bb-0310-9956-ffa450edef68
2007-01-29 13:48:56 +00:00
Ted Nathan Husted 47f1e838f0 WW-1650 Update site for 2.0.5-SNAPSHOT.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@501047 13f79535-47bb-0310-9956-ffa450edef68
2007-01-29 13:47:05 +00:00
Ted Nathan Husted ac8b7404f1 Update POMs for Struts 2.0.5 SNAPSHOT.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@500934 13f79535-47bb-0310-9956-ffa450edef68
2007-01-29 03:51:53 +00:00
Ted Nathan Husted 238abc3d12 WW-1650 Update POMs for 2.0.4 release.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@500931 13f79535-47bb-0310-9956-ffa450edef68
2007-01-29 03:38:40 +00:00
Donald J. Brown 543095e202 Fixed sitegraph not working due to new default properties provider
WW-1650


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@500925 13f79535-47bb-0310-9956-ffa450edef68
2007-01-29 02:41:07 +00:00
Donald J. Brown 8622e46762 Adding notice and license files to all artifacts that will go into Maven
WW-1650


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@500893 13f79535-47bb-0310-9956-ffa450edef68
2007-01-28 21:36:41 +00:00
Donald J. Brown 981c80147b Exposed several freemarker tag model methods to subclasses
WW-1650


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@500745 13f79535-47bb-0310-9956-ffa450edef68
2007-01-28 05:38:24 +00:00
Ted Nathan Husted 152fe60914 WW-1650 Update retrotranslator
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@499748 13f79535-47bb-0310-9956-ffa450edef68
2007-01-25 11:43:04 +00:00
Ted Nathan Husted 84d7f4628b WW-1650 Update retrotranslator
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@499747 13f79535-47bb-0310-9956-ffa450edef68
2007-01-25 11:42:28 +00:00
Donald J. Brown 2818f9218b Added interceptor for portlet apps that injects the portlet preferences.
A simple stub for servlet environment testing will be used if needed.
WW-1676


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@499708 13f79535-47bb-0310-9956-ffa450edef68
2007-01-25 09:23:21 +00:00
Donald J. Brown 3f96219877 Fixed classpath configuration parameters not able to be defined
in files other than struts.properties
WW-1650


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@499707 13f79535-47bb-0310-9956-ffa450edef68
2007-01-25 09:17:38 +00:00
Donald J. Brown 35d43292cd Fixed when custom i18n props not specified
WW-1668


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@499704 13f79535-47bb-0310-9956-ffa450edef68
2007-01-25 08:57:59 +00:00
Donald J. Brown bc6d851439 Moved processing of localization files from struts.properties to any usual properties setting
technique (web.xml, struts.properties, struts.xml)
WW-1668


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@499294 13f79535-47bb-0310-9956-ffa450edef68
2007-01-24 07:33:24 +00:00
Ted Nathan Husted c3cf9d5ec8 WW-1650 Add link to migration guide and restore AJAX bullet, since they are becoming FAQs.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@498588 13f79535-47bb-0310-9956-ffa450edef68
2007-01-22 11:46:20 +00:00
René Gielen f13f6186cf WW-1392:
As discussed, add a struts-annotations profile for local development similar to xwork profile. Works fine AFAIK.
I assumed a directory organization like we have in the svn repository, so that we have the maven repository checked out besides struts2 repository, which means the reference in pom.xml goes to ../maven/struts-aanotations. Another solution would be to just assume the struts annotations module is found besides struts2 repo. So that point might to be discussed.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@498262 13f79535-47bb-0310-9956-ffa450edef68
2007-01-21 10:03:52 +00:00
Donald J. Brown 03745a49ae Split properties loading so that struts.properties can override plugin properties
WW-1666


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@498215 13f79535-47bb-0310-9956-ffa450edef68
2007-01-20 23:59:10 +00:00
Donald J. Brown 4449472577 Adding @SkipValidation annotation and associated interceptor
WW-1664


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@498203 13f79535-47bb-0310-9956-ffa450edef68
2007-01-20 22:55:16 +00:00
Donald J. Brown efcdc32d9b Removing unused properties
WW-1650


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@498186 13f79535-47bb-0310-9956-ffa450edef68
2007-01-20 21:59:04 +00:00
Wendy Smoak 9fa46b3e20 Revert r498071 and put struts-annotations back in compile scope, but mark it optional to exclude it from transitive dependency resolution. Thanks to Musachy Barroso for catching this.
WW-1650

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@498147 13f79535-47bb-0310-9956-ffa450edef68
2007-01-20 18:07:15 +00:00
Ted Nathan Husted 026ac13cd7 WW-1650 Update release notes for Struts 2.0.4
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@498115 13f79535-47bb-0310-9956-ffa450edef68
2007-01-20 14:49:03 +00:00
Donald J. Brown ed9b875afc Improved the portlet dispatching to use the configured action mapper. This means
that the special prefixes like method: will now work for submitted forms among other
things
WW-1653


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@498097 13f79535-47bb-0310-9956-ffa450edef68
2007-01-20 10:15:15 +00:00
Donald J. Brown 3951b6833c Fixed parsing of name for ognl when no id is specified and using name value
WW-1617


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@498091 13f79535-47bb-0310-9956-ffa450edef68
2007-01-20 08:44:14 +00:00
Donald J. Brown c0513c0e07 Fixed double slash when portlet namespace is defined
WW-1641


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@498090 13f79535-47bb-0310-9956-ffa450edef68
2007-01-20 08:33:19 +00:00
Donald J. Brown 4cf46d99a9 Fixed problem in error report when error occurs deeper than action level
WW-1660


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@498088 13f79535-47bb-0310-9956-ffa450edef68
2007-01-20 08:24:28 +00:00
Donald J. Brown 9ed7fce11a Fixed NPE when action mapper for current request is null
WW-1662


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@498087 13f79535-47bb-0310-9956-ffa450edef68
2007-01-20 08:21:22 +00:00
Donald J. Brown 02424af910 Adding support for selecting unknown namespaces for codebehind plugin
WW-1663


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@498085 13f79535-47bb-0310-9956-ffa450edef68
2007-01-20 08:13:11 +00:00
Wendy Smoak bb29a91df7 Eliminate the compile-time dependency on struts-annotations. It is only required at build time, so configure it as a build extension.
WW-1650

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@498071 13f79535-47bb-0310-9956-ffa450edef68
2007-01-20 05:08:12 +00:00
Ted Nathan Husted bce0209ecc WW-1588 Update POMs for 2.0.4-SNAPSHOT (once again).
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@498062 13f79535-47bb-0310-9956-ffa450edef68
2007-01-20 03:49:06 +00:00
230 changed files with 6065 additions and 12456 deletions
-54
View File
@@ -1,54 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.0.3</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-api</artifactId>
<packaging>jar</packaging>
<name>Struts 2 API</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/api/</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/api/</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/api/</url>
</scm>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
<!-- has to be compile for StrutsTestCase, which is part of the base package so others can write unit tests -->
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<scope>test</scope>
<version>2.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<showPackage>false</showPackage>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -1,45 +0,0 @@
package org.apache.struts2;
/**
* Default action interface. Provided purely for user convenience. Struts does not require actions to implement any
* interfaces. Actions need only implement a public, no argument method which returns {@code String}. If a user does
* not specify a method name, Struts defaults to {@code execute()}.
*
* <p>For example:
*
* <pre>
* static import ResultNames.*;
*
* public class MyAction <b>implements Action</b> {
*
* public String execute() {
* return SUCCESS;
* }
* }
* </pre>
*
* <p>is equivalent to:
*
* <pre>
* static import ResultNames.*;
*
* public class MyAction {
*
* public String execute() {
* return SUCCESS;
* }
* }
* </pre>
*
* @author crazybob@google.com (Bob Lee)
*/
public interface Action {
/**
* Executes this action.
*
* @return result name which matches a result name from the action mapping in the configuration file. See {@link
* ResultNames} for common suggestions.
*/
String execute();
}
@@ -1,41 +0,0 @@
package org.apache.struts2;
/**
* Implemented by actions which may need to record errors or messages.
*
* <pre>
* static import ResultNames.*;
*
* public class SetName implements MessageAware {
*
* Messages messages;
* String name;
*
* public String execute() {
* return SUCCESS;
* }
*
* public void setName(String name) {
* if ("".equals(name))
* messages.forField("name").addError("name.required");
*
* this.name = name;
* }
*
* public void setMessages(Messages messages) {
* this.messages = messages;
* }
* }
* </pre>
*
* @author crazybob@google.com (Bob Lee)
*/
public interface MessageAware {
/**
* Sets messages.
*
* @param messages messages
*/
void setMessages(Messages messages);
}
@@ -1,196 +0,0 @@
package org.apache.struts2;
import java.util.List;
import java.util.Set;
import java.util.Map;
/**
* Collection of messages. Supports nesting messages by field name.
*
* <p>Uses keys when adding instead of actual messages to decouple code from messages.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface Messages {
// TODO: Use Object[] for args instead of String[].
/**
* Message severity.
*/
public enum Severity {
/**
* Informational messages.
*/
INFO,
/**
* Warning messages.
*/
WARN,
/**
* Error messages.
*/
ERROR,
}
/**
* Gets nested messages for the given field.
*
* <p>Supports dot notation to represent nesting. For example:
*
* <pre>
* messages.forField("foo").forField("bar") == messages.forField("foo.bar")
* </pre>
*
* @param fieldName name of the field
* @return nested {@code Messages} for given field name
*/
Messages forField(String fieldName);
/**
* Gets map of field name to messages for that field.
*
* @return map of field name to {@code Messages}
*/
Map<String, Messages> forFields();
/**
* Adds informational message.
*
* @param key message key
* @see Severity.INFO
*/
void addInformation(String key);
/**
* Adds informational message.
*
* @param key message key
* @param arguments message arguments
* @see Severity.INFO
*/
void addInformation(String key, String... arguments);
/**
* Adds warning message.
*
* @param key message key
* @see Severity.WARN
*/
void addWarning(String key);
/**
* Adds warning message.
*
* @param key message key
* @param arguments message arguments
* @see Severity.WARN
*/
void addWarning(String key, String... arguments);
/**
* Adds error message.
*
* @param key message key
* @see Severity.ERROR
*/
void addError(String key);
/**
* Adds error message.
*
* @param key message key
* @param arguments message arguments
* @see Severity.ERROR
*/
void addError(String key, String... arguments);
/**
* Adds message.
*
* @param severity message severity
* @param key message key
*/
void add(Severity severity, String key);
/**
* Adds request-scoped message.
*
* @param severity message severity
* @param key message key
* @param arguments message arguments
*/
void add(Severity severity, String key, String... arguments);
/**
* Gets set of severities for which this {@code Messages} instance has messages. Not recursive.
*
* @return unmodifiable set of {@link Severity} sorted from least to most severe
*/
Set<Severity> getSeverities();
/**
* Gets message strings for the given severity. Not recursive.
*
* @param severity message severity
* @return unmodifiable list of messages
*/
List<String> forSeverity(Severity severity);
/**
* Gets error message strings for this {@code Messages} instance. Not recursive.
*
* @return unmodifiable list of messages
*/
List<String> getErrors();
/**
* Gets error message strings for this {@code Messages} instance. Not recursive.
*
* @return unmodifiable list of messages
*/
List<String> getWarnings();
/**
* Gets informational message strings for this {@code Messages} instance. Not recursive.
*
* @return unmodifiable list of messages
*/
List<String> getInformation();
/**
* Returns true if this or a nested {@code Messages} instance has error messages.
*
* @see Severity.ERROR
*/
boolean hasErrors();
/**
* Returns true if this or a nested {@code Messages} instance has warning messages.
*
* @see Severity.WARN
*/
boolean hasWarnings();
/**
* Returns true if this or a nested {@code Messages} instance has informational messages.
*
* @see Severity.INFO
*/
boolean hasInformation();
/**
* Returns true if this and all nested {@code Messages} instances have no messages.
*/
boolean isEmpty();
/**
* Returns true if this and all nested {@code Messages} instances have no messages for the given severity.
*
* @param severity message severity
*/
boolean isEmpty(Severity severity);
}
@@ -1,36 +0,0 @@
package org.apache.struts2;
/**
* Commonly used result names returned by action methods.
*
* @author crazybob@google.com (Bob Lee)
*/
public final class ResultNames {
private ResultNames() {}
/**
* The action executed successfully.
*/
public static final String SUCCESS = "success";
/**
* The action requires more input, i.e.&nbsp;a validation error occurred.
*/
public static final String INPUT = "input";
/**
* The action requires the user to log in before executing.
*/
public static final String LOGIN = "login";
/**
* The action execution failed irrecoverably.
*/
public static final String ERROR = "error";
/**
* The action executed successfully, but do not execute a result.
*/
public static final String NONE = "none";
}
@@ -1,17 +0,0 @@
package org.apache.struts2;
import org.apache.struts2.MessageAware;
/**
* Implemented by actions which wish to execute some validation logic before their action method. Useful for
* cross-field validations.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface Validatable extends MessageAware {
/**
* Validates input. Executes before action method.
*/
public void validate();
}
@@ -1,18 +0,0 @@
package org.apache.struts2.servlet;
import java.util.Map;
/**
* Implemented by actions which need direct access to the request parameters.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface ParameterAware {
/**
* Sets parameters.
*
* @param parameters map of parameter name to parameter values
*/
void setParameters(Map<String, String[]> parameters);
}
@@ -1,18 +0,0 @@
package org.apache.struts2.servlet;
import javax.servlet.http.HttpServletRequest;
/**
* Implemented by actions which need direct access to the servlet request.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface ServletRequestAware {
/**
* Sets the servlet request.
*
* @param request servlet request.
*/
void setServletRequest(HttpServletRequest request);
}
@@ -1,18 +0,0 @@
package org.apache.struts2.servlet;
import javax.servlet.http.HttpServletResponse;
/**
* Implemented by actions which need direct access to the servlet response.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface ServletResponseAware {
/**
* Sets the servlet response.
*
* @param response servlet response
*/
void setServletResponse(HttpServletResponse response);
}
@@ -1,59 +0,0 @@
package org.apache.struts2.spi;
import java.lang.reflect.Method;
/**
* Context of an action execution.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface ActionContext {
/**
* Gets action instance.
*/
Object getAction();
/**
* Gets action method.
*/
Method getMethod();
/**
* Gets action name.
*/
String getActionName();
/**
* Gets the path for the action's namespace.
*/
String getNamespacePath();
/**
* Gets the {@link Result} instance for the action.
*
* @return {@link Result} instance or {@code null} if we don't have a result yet.
*/
Result getResult();
/**
* Adds a result interceptor for the action. Enables executing code before and after a result, executing an
* alternate result, etc.
*/
void addResultInterceptor(Result interceptor);
/**
* Gets context of action which chained to us.
*
* @return context of previous action or {@code null} if this is the first action in the chain
*/
ActionContext getPrevious();
/**
* Gets context of action which this action chained to.
*
* @return context of next action or {@code null} if we haven't chained to another action yet or this is the last
* action in the chain.
*/
ActionContext getNext();
}
@@ -1,16 +0,0 @@
package org.apache.struts2.spi;
/**
* Intercepts an action request.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface Interceptor {
/**
* Intercepts an action request.
*
* @param requestContext current request context
*/
String intercept(RequestContext requestContext) throws Exception;
}
@@ -1,101 +0,0 @@
package org.apache.struts2.spi;
import org.apache.struts2.Messages;
import javax.servlet.ServletContext;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Locale;
import java.util.Map;
/**
* Request context. A single request may span multiple actions with action chaining.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface RequestContext {
/**
* Gets context of the currently executing action.
*
* @return current action context
*/
ActionContext getActionContext();
/**
* Convenience method.&nbsp;Equivalent to {@code getActionContext().getAction()}.
*
* @return currently executing action
*/
Object getAction();
/**
* Gets map of request parameters.
*/
Map<String, String[]> getParameterMap();
/**
* Gets map of request attributes.
*/
Map<String, Object> getAttributeMap();
/**
* Gets map of session attributes.
*/
Map<String, Object> getSessionMap();
/**
* Gets map of application (servlet context) attributes.
*/
Map<String, Object> getApplicationMap();
/**
* Finds cookies with the given name,
*/
List<Cookie> findCookiesForName(String name);
/**
* Gets locale.
*/
Locale getLocale();
/**
* Sets locale. Stores the locale in the session for future requests.
*/
void setLocale(Locale locale);
/**
* Gets messages.
*/
Messages getMessages();
/**
* Gets the servlet request.
*/
HttpServletRequest getServletRequest();
/**
* Gets the servlet response.
*/
HttpServletResponse getServletResponse();
/**
* Gets the servlet context.
*/
ServletContext getServletContext();
/**
* Gets the value stack.
*/
ValueStack getValueStack();
/**
* Invokes the next interceptor or the action method if no more interceptors remain.
*
* @return result name
* @throws IllegalStateException if already invoked or called from the action
*/
String proceed() throws Exception;
}
@@ -1,19 +0,0 @@
package org.apache.struts2.spi;
import org.apache.struts2.spi.RequestContext;
/**
* Implemented by actions that need access to the current {@link org.apache.struts2.spi.RequestContext}. Use
* judiciously.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface RequestContextAware {
/**
* Sets {@link org.apache.struts2.spi.RequestContext}.
*
* @param requestContext
*/
void setRequestContext(RequestContext requestContext);
}
@@ -1,18 +0,0 @@
package org.apache.struts2.spi;
import org.apache.struts2.spi.RequestContext;
/**
* The result of an action request. Struts creates a new {@code Result} instance for each request.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface Result {
/**
* Executes result.
*
* @param requestContext
*/
void execute(RequestContext requestContext) throws Exception;
}
@@ -1,93 +0,0 @@
package org.apache.struts2.spi;
/**
* A central fixture of the Struts framework, the {@code ValueStack} is a stack which contains the actions
* which have executed in addition to other objects. Users can get and set values on the stack using expressions. The
* {@code ValueStack} will search down the stack starting with the most recent objects until it finds an object to
* which the expression can apply.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface ValueStack extends Iterable<Object> {
/**
* Gets the top, most recent object from the stack without changing the stack.
*
* @return the top object
*/
Object peek();
/**
* Removes the top, most recent object from the stack.
*
* @return the top object
*/
Object pop();
/**
* Pushes an object onto the stack.
*
* @param o
*/
void push(Object o);
/**
* Creates a shallow copy of this stack.
*
* @return a new stack which contains the same objects as this one
*/
ValueStack clone();
/**
* Queries the stack. Starts with the top, most recent object. If the expression can apply to the object, this
* method returns the result of evaluating the expression. If the expression does not apply, this method moves
* down the stack to the next object and repeats. Returns {@code null} if the expression doesn't apply to any
* objects.
*
* @param expression
* @return the evaluation of the expression against the first applicable object in the stack
*/
Object get(String expression);
/**
* Queries the stack and converts the result to the specified type. Starts with the top, most recent object. If
* the expression can apply to the object, this method returns the result of evaluating the expression converted
* to the specified type. If the expression does not apply, this method moves down the stack to the next object
* and repeats. Returns {@code null} if the expression doesn't apply to any objects.
*
* @param expression
* @param asType the type to convert the result to
* @return the evaluation of the expression against the first applicable object in the stack converted to the
* specified type
*/
<T> T get(String expression, Class<T> asType);
/**
* Queries the stack and converts the result to a {@code String}. Starts with the top, most recent object. If the
* expression can apply to the object, this method returns the result of evaluating the expression converted to a
* {@code String}. If the expression does not apply, this method moves down the stack to the next object and
* repeats. Returns {@code null} if the expression doesn't apply to any objects.
*
* @param expression
* @return the evaluation of the expression against the first applicable object in the stack converted to a {@code
* String}
*/
String getString(String expression);
/**
* Sets a value on an object from the stack. This method starts at the top, most recent object. If the expression
* applies to that object, this methods sets the given value on that object using the expression and converting
* the type as necessary. If the expression does not apply, this method moves to the next object and repeats.
*
* @param expression
* @param value
*/
void set(String expression, Object value);
/**
* Returns the number of object on the stack.
*
* @return size of stack
*/
int size();
}
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.0.3</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-blank</artifactId>
+174
View File
@@ -0,0 +1,174 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
+5
View File
@@ -0,0 +1,5 @@
Apache Struts
Copyright 2000-2007 The Apache Software Foundation
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
+3 -3
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.0.3</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-mailreader</artifactId>
@@ -19,7 +19,7 @@
</scm>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
@@ -38,7 +38,7 @@
</dependency>
</dependencies>
<build>
<resources>
<resource>
@@ -0,0 +1,174 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
@@ -0,0 +1,5 @@
Apache Struts
Copyright 2000-2007 The Apache Software Foundation
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
+10 -10
View File
@@ -1,14 +1,14 @@
<?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.
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.0.3</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
@@ -37,7 +37,7 @@
<module>portlet</module>
<module>showcase</module>
</modules>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/apps/</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/</developerConnection>
@@ -50,7 +50,7 @@
<url>scp://people.apache.org/www/struts.apache.org/struts2/apps</url>
</site>
</distributionManagement>
<profiles>
<profile>
<id>hostedqa</id>
@@ -173,9 +173,9 @@
</executions>
</plugin>
</plugins>
<finalName>${pom.artifactId}</finalName>
</build>
<dependencies>
@@ -193,5 +193,5 @@
<scope>test</scope>
</dependency>
</dependencies>
</project>
+2 -2
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.0.3</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-portlet</artifactId>
@@ -29,7 +29,7 @@
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
+174
View File
@@ -0,0 +1,174 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
@@ -0,0 +1,5 @@
Apache Struts
Copyright 2000-2007 The Apache Software Foundation
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
+8 -14
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.0.3</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-showcase</artifactId>
@@ -17,7 +17,7 @@
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/showcase/</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/apps/showcase/</url>
</scm>
<profiles>
<profile>
@@ -31,7 +31,7 @@
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-struts1-plugin</artifactId>
@@ -55,16 +55,10 @@
<artifactId>struts2-sitemesh-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-tiles-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-continuations-plugin</artifactId>
<artifactId>struts2-tiles-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
@@ -79,14 +73,14 @@
<artifactId>struts2-spring-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<!-- Velocity -->
<dependency>
<groupId>velocity</groupId>
@@ -137,9 +131,9 @@
<version>1.1.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
@@ -1,71 +0,0 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.showcase;
import java.util.Random;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;
import com.uwyn.rife.continuations.ContinuableObject;
// START SNIPPET: example
public class Guess extends ActionSupport implements Preparable, ContinuableObject {
int guess;
public void prepare() throws Exception {
// We clear the error message state before the action.
// That is because with continuations, the original (or cloned) action is being
// executed, which will still have the old errors and potentially cause problems,
// such as with the workflow interceptor
clearErrorsAndMessages();
}
public String execute() throws Exception {
int answer = new Random().nextInt(100) + 1;
int tries = 5;
while (answer != guess && tries > 0) {
pause(Action.SUCCESS);
if (guess > answer) {
addFieldError("guess", "Too high!");
} else if (guess < answer) {
addFieldError("guess", "Too low!");
}
tries--;
}
if (answer == guess) {
addActionMessage("You got it!");
} else {
addActionMessage("You ran out of tries, the answer was " + answer);
}
return Action.SUCCESS;
}
public void setGuess(int guess) {
this.guess = guess;
}
}
// END SNIPPET: example
@@ -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.showcase.freemarker;
import com.opensymphony.xwork2.ActionSupport;
@@ -0,0 +1,174 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
@@ -0,0 +1,5 @@
Apache Struts
Copyright 2000-2007 The Apache Software Foundation
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
@@ -1,10 +0,0 @@
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="continuations" extends="struts-default" namespace="/continuations">
<action name="guess" class="org.apache.struts2.showcase.Guess">
<result type="freemarker">guess.ftl</result>
</action>
</package>
</struts>
+14 -16
View File
@@ -8,15 +8,13 @@
<struts>
<include file="struts-chat.xml" />
<include file="struts-hangman.xml" />
<include file="struts-continuations.xml"/>
<include file="struts-tags.xml"/>
<include file="struts-validation.xml" />
<include file="struts-actionchaining.xml" />
<include file="struts-ajax.xml" />
@@ -26,19 +24,19 @@
<include file="struts-person.xml" />
<include file="struts-wait.xml" />
<include file="struts-jsf.xml" />
<include file="struts-token.xml" />
<include file="struts-model-driven.xml" />
<include file="struts-integration.xml" />
<include file="struts-filedownload.xml" />
<include file="struts-conversion.xml" />
<include file="struts-freemarker.xml" />
<include file="struts-tiles.xml" />
@@ -48,17 +46,17 @@
<package name="default" extends="struts-default">
<interceptors>
<interceptor-stack name="crudStack">
<interceptor-ref name="checkbox" />
<interceptor-ref name="checkbox" />
<interceptor-ref name="params" />
<interceptor-ref name="static-params" />
<interceptor-ref name="static-params" />
<interceptor-ref name="defaultStack" />
</interceptor-stack>
</interceptors>
<action name="showcase">
<result>showcase.jsp</result>
</action>
<action name="viewSource" class="org.apache.struts2.showcase.source.ViewSourceAction">
<result>viewSource.jsp</result>
</action>
@@ -99,7 +97,7 @@
<interceptor-ref name="basicStack"/>
</action>
<action name="edit-*" class="org.apache.struts2.showcase.action.EmployeeAction">
<param name="empId">{1}</param>
<param name="empId">{1}</param>
<result>/empmanager/editEmployee.jsp</result>
<interceptor-ref name="crudStack"><param name="validation.excludeMethods">execute</param></interceptor-ref>
</action>
@@ -5,7 +5,7 @@
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
// Calculate the view sources url
String sourceUrl = request.getContextPath()+"/viewSource.action";
com.opensymphony.xwork2.ActionInvocation inv = com.opensymphony.xwork2.ActionContext.getContext().getActionInvocation();
@@ -14,9 +14,9 @@
com.opensymphony.xwork2.util.location.Location loc = inv.getProxy().getConfig().getLocation();
sourceUrl += "?config="+(loc != null ? loc.getURI()+":"+loc.getLineNumber() : "");
sourceUrl += "&className="+inv.getProxy().getConfig().getClassName();
if (inv.getResult() != null && inv.getResult() instanceof org.apache.struts2.dispatcher.StrutsResultSupport) {
sourceUrl += "&page="+mapping.getNamespace()+"/"+((org.apache.struts2.dispatcher.StrutsResultSupport)inv.getResult()).getLastFinalLocation();
sourceUrl += "&page="+mapping.getNamespace()+"/"+((org.apache.struts2.dispatcher.StrutsResultSupport)inv.getResult()).getLastFinalLocation();
}
} else {
sourceUrl += "?page="+request.getServletPath();
@@ -104,11 +104,11 @@
</div><!-- end content -->
<div>
<p>
<a href="<%=sourceUrl %>">View Sources</a>
</p>
</div>
<div>
<p>
<a href="<%=sourceUrl %>">View Sources</a>
</p>
</div>
<div id="footer" class="clearfix">
<p>Copyright &copy; 2003-<s:property value="#dateAction.now.year + 1900" /> The Apache Software Foundation.</p>
</div><!-- end footer -->
+2 -2
View File
@@ -15,9 +15,9 @@ Note: The Ajax tags are experimental. These examples have only been tested under
<li><a href="remotediv">Remote div tag</a></li>
<li><a href="remotelink">Remote link tag</a></li>
<li><a href="tabbedpanel">Tabbed panel</a></li>
<li><a href="widgets">Widgets </a> (may not work in all browsers!)
<li><a href="widgets">Widgets </a> (may not work in all browsers!)
see the <a href="http://www.dojotoolkit.org">dojo website</a> for more information</li>
<li>(broken) <a href="remoteforms">Remote forms</a></li>
<li><a href="remoteforms">Remote forms</a></li>
</ul>
</body>
</html>
@@ -1,18 +0,0 @@
<!-- START SNIPPET: example -->
<html>
<head>
<title></title>
</head>
<body>
<#list actionMessages as msg>
${msg}
</#list>
<@s.form action="guess" method="post">
<@s.textfield label="Guess" name="guess"/>
<@s.submit value="Guess"/>
</@s.form>
</body>
</html>
<!-- END SNIPPET: example -->
@@ -11,7 +11,7 @@
</li>
<li>
<@s.url id="url" action="hangmanAjax" namespace="/hangman" />
<@s.a href="%{#url}">Hangman (Ajax - Experimental)</@s.a>
(broken) <@s.a href="%{#url}">Hangman (Ajax - Experimental)</@s.a>
</li>
</ul>
</body>
+3 -12
View File
@@ -1,6 +1,6 @@
<%--
<%--
showcase.jsp
@version $Date$ $Id$
--%>
@@ -32,7 +32,7 @@
<p>
<%-- THIS LIST IS MAINTAINED IN WEB-INF/decorators/main.jsp TO CREATE THE MENU BAR -- EDIT THERE AND COPY HERE --%>
<ul>
<li><a href="<s:url value="/showcase.jsp"/>">Home</a></li>
<li><a href="<s:url value="/showcase.jsp"/>">Home</a></li>
<li><a href="<s:url value="/ajax/index.jsp" />">Ajax Theme for Struts Tags</a></li>
<li><a href="<s:url value="/chat/index.jsp"/>">Ajax Chat</a>
<li><a href="<s:url action="actionChain1!input" namespace="/actionchaining" includeParams="none" />">Action Chaining</a></li>
@@ -52,15 +52,6 @@
<li><a href="<s:url value="/validation/index.jsp"/>">Validation</a></li>
<li class="last"><a href="<s:url value="/help.jsp"/>">Help</a></li>
</ul>
<h2>Sandbox</h2>
<p>
These examples are under development and may not be fully operational.
</p>
<ul>
<li><a href="<s:url action="guess" namespace="/continuations" />">Continuations</a></li>
</ul>
</p>
</body>
@@ -1,4 +1,4 @@
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%-- Show usage; Used in Header --%>
@@ -6,10 +6,10 @@
<html>
<head><title><tiles:getAsString name="title"/></title></head>
<body>
<tiles:attribute name="header"/>
<tiles:insertAttribute name="header"/>
<p id="body">
<tiles:attribute name="body"/>
<tiles:insertAttribute name="body"/>
</p>
</body>
</html>
+21 -21
View File
@@ -1,14 +1,14 @@
<?xml version="1.0"?>
<!--
/*
/*
* Copyright 2005-2006 The Apache Software Foundation.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -33,7 +33,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.0.3</version>
<version>2.0.6</version>
</parent>
<scm>
@@ -155,12 +155,13 @@
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-api</artifactId>
<artifactId>struts2-core</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<artifactId>struts2-codebehind-plugin</artifactId>
<version>${version}</version>
</dependency>
@@ -192,37 +193,43 @@
<groupId>org.apache.struts</groupId>
<artifactId>struts2-pell-multipart-plugin</artifactId>
<version>${version}</version>
</dependency>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plexus-plugin</artifactId>
<version>${version}</version>
</dependency>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitegraph-plugin</artifactId>
<version>${version}</version>
</dependency>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitemesh-plugin</artifactId>
<version>${version}</version>
</dependency>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-struts1-plugin</artifactId>
<version>${version}</version>
</dependency>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-tiles-plugin</artifactId>
<version>${version}</version>
</dependency>
</dependency>
<!-- Include optional dependencies -->
@@ -416,7 +423,7 @@
<version>1.2.8</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>myfaces</groupId>
@@ -425,13 +432,6 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.rifers</groupId>
<artifactId>rife-continuations</artifactId>
<version>0.0.2</version>
<scope>provided</scope>
</dependency>
<!-- Exclude transitive dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
+1 -1
View File
@@ -1,7 +1,7 @@
Retrotranslator: a Java bytecode transformer that translates Java classes
compiled with JDK 5.0 into classes that can be run on JVM 1.4.
Copyright (c) 2005, 2006 Taras Puchko
Copyright (c) 2005 - 2007 Taras Puchko
All rights reserved.
Redistribution and use in source and binary forms, with or without
+207 -172
View File
@@ -64,15 +64,15 @@ and concurrency utilities
Compile your classes with JDK 5.0 and put them into some directory, e.g. <code>myclasses</code>.
</li>
<li>
Go to the unzipped directory <code>Retrotranslator-<i>n.n.n</i>-bin</code> and execute:<br>
Go to the unzipped directory and execute:<br>
<code>java -jar retrotranslator-transformer-<i>n.n.n</i>.jar -srcdir myclasses</code>
</li>
<li>
If you use Java 5 API put <code>retrotranslator-runtime-<i>n.n.n</i>.jar</code> and
<code>backport-util-concurrent.jar</code> into the classpath of your application.
<code>backport-util-concurrent-<i>n.n</i>.jar</code> into the classpath of your application.
</li>
<li>
Run or debug the application as usual on any JVM 1.4, preferably JRE 1.4.2.
Run or debug the application as usual on J2SE 1.4.x, preferably 1.4.2.
</li>
</ol>
@@ -84,24 +84,74 @@ and concurrency utilities
<tr><th>Option</th><th>Description</th><th>Default</th></tr>
<tr>
<td nowrap><code>-srcdir</code></td>
<td>Directory with classes compiled using JDK 5.0 (may be specified several times).</td>
<td>The directory with classes that should be translated (may be specified several times).</td>
<td>-</td>
</tr>
<tr>
<td nowrap><code>-srcjar</code></td>
<td>JAR file with classes compiled using JDK 5.0 (may be specified several times).</td>
<td>The directory with classes that should be translated (may be specified several times).</td>
<td>-</td>
</tr>
<tr>
<td nowrap><code>-destdir</code></td>
<td>Directory to place classes compatible with J2SE 1.4.</td>
<td>The directory to place translated classes.</td>
<td>Location of sources</td>
</tr>
<tr>
<td nowrap><code>-destjar</code></td>
<td>JAR file to place classes compatible with J2SE 1.4.</td>
<td>The JAR file to place translated classes.</td>
<td>Location of sources</td>
</tr>
<tr>
<td nowrap><a name="option_advanced"><code>-advanced</code></a></td>
<td>Whether to use alternative implementations of Java 1.4 classes and methods for better Java 5 compatibility.</td>
<td>Off</td>
</tr>
<tr>
<td nowrap><code>-verify</code></td>
<td>Asks the translator to examine translated bytecode for references to classes, methods, or fields
that cannot be found in the provided classpath.</td>
<td>Off</td>
</tr>
<tr>
<td nowrap><code>-classpath</code></td>
<td>The classpath for verification including <code>rt.jar</code>, <code>jce.jar</code>,
<code>jsse.jar</code> (from JRE 1.4), <code>retrotranslator-runtime-<i>n.n.n</i>.jar</code>,
and <code>backport-util-concurrent-<i>n.n</i>.jar</code>.</td>
<td>Current classpath</td>
</tr>
<tr>
<td nowrap><code>-srcmask</code></td>
<td>The wildcard pattern specifying files that should be translated (either bytecode or UTF-8 text),
e.g. "<code>*.class;*.tld</code>". There are three special characters: "<code>*?;</code>".
</td>
<td>*.class</td>
</tr>
<tr>
<td nowrap><code>-embed</code></td>
<td>Package name for a private copy of <code>retrotranslator-runtime-<i>n.n.n</i>.jar</code> and
<code>backport-util-concurrent-<i>n.n</i>.jar</code> to be put into <code>-destdir</code> or <code>-destjar</code>.
This makes your application independent of other versions of Retrotranslator present in the classpath.
</td>
<td>-</td>
</tr>
<tr>
<td nowrap><a name="option_backport"><code>-backport</code></a></td>
<td>Informs the translator about <a href="#extension">user-defined</a> backport packages.
Package names should be separated by semicolons.</td>
<td>-</td>
</tr>
<tr>
<td nowrap><code>-target</code></td>
<td>To make Java 6 classes compatible with Java 5 set this option to 1.5 and supply
<a href="#extension">user-defined</a> backport packages via the <code>backport</code> option.</td>
<td>1.4</td>
</tr>
<tr>
<td nowrap><code>-lazy</code></td>
<td>Asks the translator to only transform classes compiled with a <code>target</code> greater than the current one.</td>
<td>Off</td>
</tr>
<tr>
<td nowrap><code>-stripsign</code></td>
<td>Asks the translator to strip signature (generics) information.</td>
@@ -112,42 +162,6 @@ and concurrency utilities
<td>Asks the translator for verbose output.</td>
<td>Off</td>
</tr>
<tr>
<td nowrap><code>-lazy</code></td>
<td>Asks the translator to transform only Java 5 classes.</td>
<td>Off</td>
</tr>
<tr>
<td nowrap><a name="option_advanced"><code>-advanced</code></a></td>
<td>Allows to override Java 1.4 methods for better Java 5 compatibility.</td>
<td>Off</td>
</tr>
<tr>
<td nowrap><code>-verify</code></td>
<td>Asks the translator for warnings when references to unknown classes, methods, or fields are found.</td>
<td>Off</td>
</tr>
<tr>
<td nowrap><code>-classpath</code></td>
<td>The classpath to use for verification including <code>rt.jar</code>, <code>jce.jar</code>,
<code>jsse.jar</code> (from JRE 1.4), <code>retrotranslator-runtime-<i>n.n.n</i>.jar</code>,
and <code>backport-util-concurrent.jar</code>.</td>
<td>Current classpath</td>
</tr>
<tr>
<td nowrap><code>-srcmask</code></td>
<td>Files to translate (either bytecode or UTF-8 text) , e.g. "<code>*.class;*.tld</code>".
Only three special characters are supported: "<code>*?;</code>".</td>
<td>*.class</td>
</tr>
<tr>
<td nowrap><code>-embed</code></td>
<td>Package name for a private copy of <code>retrotranslator-runtime-<i>n.n.n</i>.jar</code> and
<code>backport-util-concurrent.jar</code> to be put into <code>-destdir</code> or <code>-destjar</code>.
This makes your application independent of other versions of Retrotranslator present in the classpath.
</td>
<td>-</td>
</tr>
<tr>
<td nowrap><code>-retainapi</code></td>
<td>Asks the translator to modify classes for JVM 1.4 compatibility but keep use of Java 5 API.
@@ -161,12 +175,6 @@ and concurrency utilities
<td>Asks the translator to keep Java 5 specific access modifiers.</td>
<td>Off</td>
</tr>
<tr>
<td nowrap><a name="option_backport"><code>-backport</code></a></td>
<td>Informs the translator about <a href="#extension">user-defined</a> backport packages.
Package names should be separated by semicolons.</td>
<td>-</td>
</tr>
</table>
<p>
For example, if you have a Java 5 application <code>myapplication5.jar</code> you can use the following command
@@ -186,24 +194,81 @@ and concurrency utilities
<tr><th>Attribute</th><th>Description</th><th>Default</th></tr>
<tr>
<td><code>srcdir</code></td>
<td>Directory with classes compiled using JDK 5.0.</td>
<td>The directory with classes that should be translated.</td>
<td>-</td>
</tr>
<tr>
<td><code>srcjar</code></td>
<td>JAR file with classes compiled using JDK 5.0.</td>
<td>The directory with classes that should be translated.</td>
<td>-</td>
</tr>
<tr>
<td><code>destdir</code></td>
<td>Directory to place classes compatible with J2SE 1.4.</td>
<td>The directory to place translated classes.</td>
<td>Location of sources</td>
</tr>
<tr>
<td><code>destjar</code></td>
<td>JAR file to place classes compatible with J2SE 1.4.</td>
<td>The JAR file to place translated classes.</td>
<td>Location of sources</td>
</tr>
<tr>
<td><code>advanced</code></td>
<td>Whether to use alternative implementations of Java 1.4 classes and methods for better Java 5 compatibility.</td>
<td>Off</td>
</tr>
<tr>
<td><code>verify</code></td>
<td>Asks the translator to examine translated bytecode for references to classes, methods, or fields
that cannot be found in the provided classpath.</td>
<td>Off</td>
</tr>
<tr>
<td><code>classpath</code></td>
<td>The classpath for the verification, including <code>rt.jar</code>, <code>jce.jar</code>,
<code>jsse.jar</code> (from JRE 1.4), <code>retrotranslator-runtime-<i>n.n.n</i>.jar</code>,
and <code>backport-util-concurrent-<i>n.n</i>.jar</code>.
</td>
<td>Current classpath</td>
</tr>
<tr>
<td><code>classpathref</code></td>
<td>The classpath for the verification, given as a reference to a path defined elsewhere.
</td>
<td>Current classpath</td>
</tr>
<tr>
<td><code>srcmask</code></td>
<td>The wildcard pattern specifying files that should be translated (either bytecode or UTF-8 text),
e.g. "<code>*.class;*.tld</code>". There are three special characters: "<code>*?;</code>".
</td>
<td>*.class</td>
</tr>
<tr>
<td><code>embed</code></td>
<td>Package name for a private copy of <code>retrotranslator-runtime-<i>n.n.n</i>.jar</code> and
<code>backport-util-concurrent-<i>n.n</i>.jar</code> to be put into <code>-destdir</code> or <code>-destjar</code>.
This makes your application independent of other versions of Retrotranslator present in the classpath.
</td>
<td>-</td>
</tr>
<tr>
<td><code>backport</code></td>
<td>Informs the translator about <a href="#extension">user-defined</a> backport packages.
Package names should be separated by semicolons.</td>
<td>-</td>
</tr>
<tr>
<td><code>target</code></td>
<td>Set this option to 1.5 and supply <a href="#extension">user-defined</a> backport packages via
the <code>backport</code> option to make Java 6 classes compatible with Java 5.</td>
<td>1.4</td>
</tr>
<tr>
<td><code>lazy</code></td>
<td>Asks the translator to only transform classes compiled with a <code>target</code> greater than the current one.</td>
<td>Off</td>
</tr>
<tr>
<td><code>stripsign</code></td>
<td>Asks the translator to strip signature (generics) information.</td>
@@ -214,43 +279,6 @@ and concurrency utilities
<td>Asks the translator for verbose output.</td>
<td>Off</td>
</tr>
<tr>
<td><code>lazy</code></td>
<td>Asks the translator to transform only Java 5 classes.</td>
<td>Off</td>
</tr>
<tr>
<td><code>advanced</code></td>
<td>Allows to override Java 1.4 methods for better Java 5 compatibility.</td>
<td>Off</td>
</tr>
<tr>
<td><code>verify</code></td>
<td>Asks the translator for warnings when references to unknown classes, methods, or fields are found.</td>
<td>Off</td>
</tr>
<tr>
<td><code>classpath</code></td>
<td>The classpath to use for verification including <code>rt.jar</code>, <code>jce.jar</code>,
<code>jsse.jar</code> (from JRE 1.4), <code>retrotranslator-runtime-<i>n.n.n</i>.jar</code>,
and <code>backport-util-concurrent.jar</code>.
</td>
<td>Current classpath</td>
</tr>
<tr>
<td><code>srcmask</code></td>
<td>Files to translate (either bytecode or UTF-8 text) , e.g. "<code>*.class;*.tld</code>".
Only three special characters are supported: "<code>*?;</code>".</td>
<td>*.class</td>
</tr>
<tr>
<td><code>embed</code></td>
<td>Package name for a private copy of <code>retrotranslator-runtime-<i>n.n.n</i>.jar</code> and
<code>backport-util-concurrent.jar</code> to be put into <code>-destdir</code> or <code>-destjar</code>.
This makes your application independent of other versions of Retrotranslator present in the classpath.
</td>
<td>-</td>
</tr>
<tr>
<td><code>retainapi</code></td>
<td>Asks the translator to modify classes for JVM 1.4 compatibility but keep use of Java 5 API.
@@ -264,12 +292,6 @@ and concurrency utilities
<td>Asks the translator to keep Java 5 specific access modifiers.</td>
<td>Off</td>
</tr>
<tr>
<td><code>backport</code></td>
<td>Informs the translator about <a href="#extension">user-defined</a> backport packages.
Package names should be separated by semicolons.</td>
<td>-</td>
</tr>
<tr>
<td><code>failonwarning</code></td>
<td>Indicates whether the build will fail when there are verification warnings.</td>
@@ -277,8 +299,8 @@ and concurrency utilities
</tr>
</table>
<p>
You may use nested <code>src</code> elements to specify source directories or JAR files, and nested
<code>classpath</code> elements to specify classpath for verification. For example:
You may use nested <code>fileset</code>, <code>jarfileset</code>, and <code>dirset</code> elements to specify
source files and <code>classpath</code> elements to specify classpath. For example:
</p>
<pre>
&lt;path id="classpath"&gt;
@@ -287,7 +309,8 @@ and concurrency utilities
&lt;taskdef name="retrotranslator" classpathref="classpath"
classname="net.sf.retrotranslator.transformer.RetrotranslatorTask" /&gt;
&lt;retrotranslator destdir="build/classes14" verify="true"&gt;
&lt;src path="build/classes15"/&gt;
&lt;fileset dir="build/classes15" includes="**/*.class"&gt;
&lt;jarfileset dir="build/lib15" includes="**/*.jar"&gt;
&lt;classpath location="${java14_home}/jre/lib/rt.jar"/&gt;
&lt;classpath refid="classpath"/&gt;
&lt;/retrotranslator&gt;
@@ -299,16 +322,16 @@ and concurrency utilities
</p>
<h4><a name="idea">How to use Retrotranslator from IntelliJ IDEA?</a></h4>
<p>
To automatically translate and verify classes compiled by <a href="http://www.jetbrains.com/idea/">IntelliJ IDEA</a>
you may <a href="http://plugins.intellij.net/plugin/?id=145">download a plugin</a>
that generates classes compatible with 1.4 virtual machines from your Java 5 source code.
There is a <a href="http://plugins.intellij.net/plugin/?id=145">plugin</a> to automatically translate and verify
classes compiled by <a href="http://www.jetbrains.com/idea/">IntelliJ IDEA</a>, so you can develop in Java 5 but
run and debug on JRE 1.4.
</p>
<h4><a name="jit">How to use Just-in-Time Retrotranslator?</a></h4>
<p>
JIT Retrotranslator is able to translate at runtime Java classes loaded with any classloader.
It works on J2SE 1.4 from Sun, IBM, BEA, and Apple, but does nothing on J2SE 5.0 and other platforms.
It works on J2SE 1.4 from most JVM vendors like Sun, IBM, BEA, and Apple, but does nothing on J2SE 5.0.
However translation at runtime consumes additional memory and processing resources and it will not
work if your classes make use of Java 5 API but were compiled with "<code>-target 1.4</code>".
</p>
@@ -329,29 +352,25 @@ and concurrency utilities
</li>
</ul>
<p>
JIT Retrotranslator can accept <code>-<a href="#option_advanced">advanced</a></code>
and <code>-<a href="#option_backport">backport</a></code> options.
JIT Retrotranslator can accept the <code><a href="#option_advanced">advanced</a></code>
and <code><a href="#option_backport">backport</a></code> options.
</p>
<h4><a name="supported">What Java 5 classes and methods are supported?</a></h4>
<table border="1" cellspacing="0" cellpadding="5">
<tr><th>Package</th><th>Class</th><th>Methods and fields</th><th>Compatibility notes</th></tr>
<tr><td><code>java.lang.annotation</code></td><td>* (all classes)</td><td>* (all methods)</td><td>&nbsp;</td></tr>
<tr><td><code>java.lang.instrument</code></td><td>* (all classes)</td><td>* (all methods)</td><td>
Bytecode instrumentation is not implemented.</td></tr>
<tr><td><code>java.util.concurrent,<br>java.util.concurrent.atomic,<br>java.util.concurrent.locks</code></td>
<td>almost all classes</td><td>almost all methods</td>
<td>
Supported via the <a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php">
Backport of JSR 166</a>.<br>
The <code>Condition.awaitNanos(long)</code> method is supported with
<td>almost all classes<sup><a href="#1">1</a></sup></td><td>almost all methods</td>
<td>The <code>LockSupport</code> class may be unusable due to poor efficiency.
The <code>Condition.awaitNanos(long)</code> method has
<a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/doc/api/edu/emory/mathcs/backport/java/util/concurrent/helpers/Utils.html#awaitNanos(edu.emory.mathcs.backport.java.util.concurrent.locks.Condition, long)">
very little</a> accuracy guarantees.
</td></tr>
<tr><td rowspan="6"><code>java.io</code></td><td><code>Closeable</code></td><td><code>*</code></td><td>
<code>new Closeable[...]</code> is replaced with <code>new Object[...]</code>
</td></tr>
<tr><td><code>Flushable</code></td><td><code>*</code></td><td>
<code>new Flushable[...]</code> is replaced with <code>new Object[...]</code>
</td></tr>
little</a> accuracy guarantees.</td></tr>
<tr><td rowspan="6"><code>java.io</code></td><td><code>Closeable<sup><a href="#2">2</a></sup></code>
</td><td><code>*</code></td><td>&nbsp;</td></tr>
<tr><td><code>Flushable<sup><a href="#2">2</a></sup></code></td><td><code>*</code></td><td>&nbsp;</td></tr>
<tr><td><code>PrintStream</code></td><td>
* (11 new methods and constructors)
</td><td>&nbsp;</td></tr>
@@ -366,17 +385,16 @@ and concurrency utilities
append(CharSequence, int, int),<br>
append(char)</code>
</td><td>&nbsp;</td></tr>
<tr><td rowspan="24"><code>java.lang</code></td><td><code>Appendable</code></td><td>*
</td><td>
<code>new Appendable[...]</code> is replaced with <code>new Object[...]</code>
</td></tr>
<tr><td rowspan="26"><code>java.lang</code></td><td><code>Appendable<sup><a href="#2">2</a></sup></code></td><td>*
</td><td>&nbsp;</td></tr>
<tr><td><code>Boolean</code></td><td><code>parseBoolean(String),<br>
compareTo(Boolean)</code></td><td>&nbsp;</td></tr>
<tr><td><code>Byte</code></td><td><code>valueOf(byte)</code></td><td>&nbsp;</td></tr>
<tr><td><code>Character</code></td><td><code>valueOf(char)</code></td><td>&nbsp;</td></tr>
<tr><td><code>Class</code></td><td>* (21 new methods)</td><td>
<code>Class.getMethod(String, Class...)</code> and <code>Class.getDeclaredMethod(String, Class...)</code> are
intercepted in advanced mode to better support generics and covariant return types on several JVM implementations.
<code>Class.getMethod(String, Class...)</code> and <code>Class.getDeclaredMethod(String, Class...)</code>
are intercepted to better support generics and covariant return types
on several platforms<sup><a href="#3">3</a></sup>.
</td></tr>
<tr><td><code>Deprecated</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>Double</code></td><td><code>valueOf(double)</code></td><td>&nbsp;</td></tr>
@@ -387,20 +405,17 @@ and concurrency utilities
<tr><td><code>IllegalStateException</code></td><td><code>IllegalStateException(String, Throwable),<br>
IllegalStateException(Throwable)</code></td><td>&nbsp;</td></tr>
<tr><td><code>Integer</code></td><td><code>valueOf(int), signum(int)</code></td><td>&nbsp;</td></tr>
<tr><td><code>Iterable</code></td><td>*</td><td>
<code>new Iterable[...]</code> is replaced with <code>new Object[...]</code>
</td></tr>
<tr><td><code>Iterable<sup><a href="#2">2</a></sup></code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>Long</code></td><td><code>valueOf(long), signum(long)</code></td><td>&nbsp;</td></tr>
<tr><td><code>Package</code></td><td>* (4 new methods)</td><td>&nbsp;</td></tr>
<tr><td><code>Readable</code></td><td>*</td><td>
<code>new Readable[...]</code> is replaced with <code>new Object[...]</code>
</td></tr>
<tr><td><code>Readable<sup><a href="#2">2</a></sup></code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>Short</code></td><td><code>valueOf(short)</code></td><td>&nbsp;</td></tr>
<tr><td><code>String</code></td><td><code>contains(CharSequence),<br>
contentEquals(CharSequence),<br>
format(Locale, String, Object...),<br>
format(String, Object...),<br>
replace(CharSequence, CharSequence)
replace(CharSequence, CharSequence),<br>
isEmpty()<sup><a href="#4">4</a></sup>
</code></td><td>&nbsp;</td></tr>
<tr><td><code>StringBuffer</code></td><td><code>
StringBuffer(CharSequence),<br>
@@ -411,12 +426,10 @@ and concurrency utilities
</code></td><td>&nbsp;</td></tr>
<tr><td><code>StringBuilder</code></td><td>
All methods supported in <code>StringBuffer</code>
</td><td><code>StringBuilder</code> is replaced with <code>StringBuffer</code></td></tr>
</td><td><code>StringBuilder</code> is replaced with <code>StringBuffer</code>.</td></tr>
<tr><td><code>SuppressWarnings</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>System</code></td><td><code>nanoTime(),<br> clearProperty(String)</code></td><td>
The <code>System.nanoTime()</code> method is supported via the
<a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php">Backport of JSR 166</a>
and its precision
<tr><td><code>System</code></td><td><code>nanoTime()<sup><a href="#1">1</a></sup>,<br> clearProperty(String)</code></td><td>
The <code>System.nanoTime()</code> method precision
<a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/doc/api/edu/emory/mathcs/backport/java/util/concurrent/helpers/Utils.html#nanoTime()">
may vary</a> on different platforms.
</td></tr>
@@ -424,26 +437,35 @@ and concurrency utilities
</code></td><td>The <code>Thread.getStackTrace()</code>
method returns non-empty stack trace only for the current thread.<br>
The <code>Thread.getId()</code> method does not reflect the order in which threads are created.</td></tr>
<tr><td><code>Thread.State</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>ThreadLocal</code></td><td><code>remove()<sup><a href="#3">3</a></sup></code></td>
<td><code>ThreadLocal</code> and <code>InheritableThreadLocal</code>
are replaced by corresponding classes from the runtime library.<sup><a href="#3">3</a></sup>.</td></tr>
<tr><td><code>TypeNotPresentException</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td rowspan="2"><code>java.lang.ref</code></td>
<td><code>SoftReference</code></td><td>*</td><td>
<code>SoftReference(Object,ReferenceQueue)</code>
supports <code>null</code> for the second parameter
on all platforms<sup><a href="#3">3</a></sup>.
</td></tr>
<tr><td><code>WeakReference</code></td><td>*</td><td>
<code>WeakReference(Object,ReferenceQueue)</code>
supports <code>null</code> for the second parameter
on all platforms<sup><a href="#3">3</a></sup>.
</td></tr>
<tr><td rowspan="13"><code>java.lang.reflect</code></td>
<td><code>AccessibleObject</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>AnnotatedElement</code></td><td>*</td><td>
<code>new AnnotatedElement[...]</code> is replaced with <code>new Object[...]</code>
</td></tr>
<tr><td><code>AnnotatedElement<sup><a href="#2">2</a></sup></code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>Constructor</code></td><td>* (11 new methods)</td><td>&nbsp;</td></tr>
<tr><td><code>Field</code></td><td>* (8 new methods)</td><td>&nbsp;</td></tr>
<tr><td><code>GenericArrayType</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>GenericDeclaration</code></td><td>*</td><td>
<code>new GenericDeclaration[...]</code> is replaced with <code>new Object[...]</code>
</td></tr>
<tr><td><code>GenericDeclaration<sup><a href="#2">2</a></sup></code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>GenericSignatureFormatError</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>MalformedParameterizedTypeException</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>Method</code></td><td>* (14 new methods)</td><td>&nbsp;</td></tr>
<tr><td><code>ParameterizedType</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>Type</code></td><td>*</td><td>
<code>new Type[...]</code> is replaced with <code>new Object[...]</code>
</td></tr>
<tr><td><code>Type<sup><a href="#2">2</a></sup></code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>TypeVariable</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>WildcardType</code></td><td>*</td><td>&nbsp;</td></tr>
@@ -452,48 +474,57 @@ and concurrency utilities
divideToIntegralValue(BigDecimal),<br> pow(int),<br> remainder(BigDecimal),<br>
toPlainString(),<br> valueOf(double),<br>
valueOf(long)</code></td><td>The <code>BigDecimal.setScale(int, int)</code>
method supports negative scales in advanced mode.</td></tr>
method supports negative scales<sup><a href="#3">3</a></sup>.</td></tr>
<tr><td rowspan="3"><code>java.net</code></td><td><code>URL</code></td>
<td><code>openConnection(Proxy)</code>,<br>
<code>toURI()</code>
</td><td>The <code>Proxy</code> is ignored by the <code>openConnection(Proxy)</code> method.</td></tr>
<tr><td><code>Proxy</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>ProxySelector</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td ><code>java.rmi.server</code></td><td><code>RemoteObjectInvocationHandler</code></td>
<td>*</td><td>&nbsp;</td></tr>
<tr><td ><code>java.net</code></td><td><code>URL</code></td>
<td><code>toURI()</code></td><td>&nbsp;</td></tr>
<tr><td ><code>java.text</code></td><td><code>DecimalFormat</code></td>
<td><code>isParseBigDecimal()<sup><a href="#3">3</a></sup>,<br>
setParseBigDecimal(boolean)<sup><a href="#3">3</a></sup></code></td><td>
<code>BigDecimal</code> parsing and formatting precision is limited by
<code>java.lang.Double</code> or <code>java.lang.Long</code> precision.
</td></tr>
<tr><td><code>java.util.nio</code></td><td><code>CharBuffer</code></td><td>
<code>append(CharSequence),<br> append(CharSequence, int, int),<br> append(char),<br> read(CharBuffer)</code>
</td><td>&nbsp;</td></tr>
<tr><td rowspan="10"><code>java.util</code></td><td><code>AbstractQueue</code></td><td>*</td><td>
Supported via the <a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php">
Backport of JSR 166</a>.
</td></tr>
<tr><td rowspan="10"><code>java.util</code></td><td><code>AbstractQueue<sup><a href="#1">1</a></sup></code></td>
<td>*</td><td>&nbsp;</td></tr>
<tr><td><code>Arrays</code></td><td>* (21 new methods)</td><td>&nbsp;</td></tr>
<tr><td><code>Collections</code></td><td>* (13 new methods)</td><td>
Supported via the <a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php">
Backport of JSR 166</a>.
</td></tr>
<tr><td><code>Collections<sup><a href="#1">1</a></sup></code></td><td>* (13 new methods)<br>
newSetFromMap(Map)<sup><a href="#4">4</a></sup>
</td><td>&nbsp;</td></tr>
<tr><td><code>EnumMap</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>EnumSet</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>Formatter</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>LinkedList</code></td><td>* (5 new methods)</td><td>&nbsp;</td></tr>
<tr><td><code>PriorityQueue</code></td><td>*</td><td>
Supported via the <a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php">
Backport of JSR 166</a>.
</td></tr>
<tr><td><code>Queue</code></td><td>*</td><td>
Supported via the <a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php">
Backport of JSR 166</a>.<br>
<code>new Queue[...]</code> is replaced with <code>new Object[...]</code>
</td></tr>
<tr><td><code>PriorityQueue<sup><a href="#1">1</a></sup></code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>Queue<sup><a href="#1">1</a>,<a href="#2">2</a></sup></code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>UUID</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td rowspan="3"><code>java.util.regex</code></td><td><code>Matcher</code></td><td>
<code>quoteReplacement(String),<br> toMatchResult()</code></td><td>&nbsp;</td></tr>
<tr><td><code>MatchResult</code></td><td>*</td><td>
<code>new MatchResult[...]</code> is replaced with <code>new Object[...]</code>
</td></tr>
<tr><td><code>MatchResult<sup><a href="#2">2</a></sup></code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>Pattern</code></td><td><code>quote(String)</code></td><td>&nbsp;</td></tr>
</table>
<p>
<a name="1"><sup>1</sup></a> Supported via the
<a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php"> Backport of JSR 166</a>.<br>
<a name="2"><sup>2</sup></a> In most cases this type is being replaced with it's base type.<br>
<a name="3"><sup>3</sup></a> Supported only in advanced mode, i.e. when
the <code><a href="#option_advanced">advanced</a></code> option is specified.<br>
<a name="4"><sup>4</sup></a> Introduced in Java 6, but available only for 1.4 target.<br>
</p>
<h4><a name="extension">How to write an extension for Retrotranslator?</a></h4>
@@ -504,7 +535,7 @@ and concurrency utilities
<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/EnumSet.html"><code>java.util.EnumSet</code></a>
are replaced with references to
<a href="http://retrotranslator.cvs.sourceforge.net/retrotranslator/Retrotranslator/src/net/sf/retrotranslator/runtime/java/util/EnumSet_.java?view=markup">
<code>net.sf.retrotranslator.runtime.java.util.EnumSet<b>_</b></code></a> (trailing underscore) if the latter can be found.
<code>net.sf.retrotranslator.runtime.java.util.EnumSet<b>_</b></code></a> (optional trailing underscore) if the latter can be found.
But if you replace a whole class that exists in J2SE 1.4 you may encounter interoperability issues with other libraries.
So, for example, support for Java 5 fields, methods, and constructors of
<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigDecimal.html"><code>java.math.BigDecimal</code></a> is placed into
@@ -540,8 +571,12 @@ and concurrency utilities
</p>
<p>
You can put your extensions into packages other than <code>net.sf.retrotranslator.runtime</code>.
For example, to make Retrotranslator use <code>com.mycompany.internal.java.lang._String</code>
just specify <code>-backport com.mycompany.internal</code> at the command line.
For example, specify the following at the command line to make Retrotranslator use
<code>com.mycompany.internal.java.lang._String</code> and to rewrite all references to
<code>com.sun.org.apache.xerces.internal.*</code> with <code>org.apache.xerces.*</code>:<br>
<code>-backport&nbsp;com.mycompany.internal;com.sun.org.apache.xerces.internal:org.apache.xerces</code>
</p>
<p>
If you have written an extension that does not contain copyrighted code, you may send
a <a href="http://sourceforge.net/tracker/?group_id=153566&atid=788281">patch</a>
under the <a href="#license">Retrotranslator license</a>.
@@ -590,7 +625,7 @@ and concurrency utilities
Retrotranslator: a Java bytecode transformer that translates Java classes
compiled with JDK 5.0 into classes that can be run on JVM 1.4.
Copyright (c) 2005, 2006 Taras Puchko
Copyright (c) 2005 - 2007 Taras Puchko
All rights reserved.
Redistribution and use in source and binary forms, with or without
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3 -4
View File
@@ -1,4 +1,3 @@
java -jar retrotranslator-transformer-1.1.0.jar -srcjar ../lib/struts2-core-2.0.3.jar -destjar struts2-core-j4-2.0.3.jar
java -jar retrotranslator-transformer-1.1.0.jar -srcjar ../lib/struts2-api-2.0.3.jar -destjar struts2-api-j4-2.0.3.jar
java -jar retrotranslator-transformer-1.1.0.jar -srcjar ../lib/struts2-extras-2.0.3.jar -destjar struts2-extras-j4-2.0.3.jar
java -jar retrotranslator-transformer-1.1.0.jar -srcjar ../lib/xwork-2.0.0.jar -destjar xwork-j4-2.0.0-RC1.jar
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/struts2-core-2.0.4.jar -destjar struts2-core-j4-2.0.4.jar
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/struts2-api-2.0.4.jar -destjar struts2-api-j4-2.0.4.jar
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/xwork-2.0.0.jar -destjar xwork-j4-2.0.0.jar
+85 -87
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.0.3</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
@@ -20,7 +20,7 @@
<build>
<plugins>
<plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.0-alpha-1-SNAPSHOT</version>
<executions>
@@ -31,25 +31,25 @@
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>opensymphony</groupId>
<artifactId>xwork</artifactId>
<version>2.0.0</version>
<classifier>sources</classifier>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/xwork-sources</outputDirectory>
</configuration>
<artifactItems>
<artifactItem>
<groupId>opensymphony</groupId>
<artifactId>xwork</artifactId>
<version>2.0.1</version>
<classifier>sources</classifier>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/xwork-sources</outputDirectory>
</configuration>
</execution>
</executions>
</executions>
</plugin>
<plugin>
<groupId>org.apache.myfaces.tobago</groupId>
<artifactId>maven-apt-plugin</artifactId>
<configuration>
<A>uri=/struts-tags,tlibVersion=2.2.3,jspVersion=1.2,shortName=s,displayName="Struts Tags",
outFile=${basedir}/src/main/resources/META-INF/struts-tags.tld,
outFile=${basedir}/target/classes/META-INF/struts-tags.tld,
description="To make it easier to access dynamic data;
the Apache Struts framework includes a library of custom tags.
The tags interact with the framework's validation and internationalization features;
@@ -75,14 +75,14 @@
<goal>execute</goal>
</goals>
</execution>
</executions>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.2</version>
<configuration>
@@ -111,68 +111,68 @@
</reporting>
<profiles>
<profile>
<!--
Run the translator for Java 1.4 compatiblity
<profile>
<!--
Run the translator for Java 1.4 compatiblity
Sample:
$ cd struts/struts2/
$ mvn clean install -Papps,j4 -Djava14.jar=$JAVA_HOME/../Classes/classes.jar
Sample:
$ cd struts/struts2/
$ mvn clean install -Papps,j4 -Djava14.jar=$JAVA_HOME/../Classes/classes.jar
-->
<id>j4</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>retrotranslator-maven-plugin</artifactId>
<executions>
<execution>
<id>retrotranslate</id>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>create-j4-jar</id>
<goals><goal>jar</goal></goals>
<configuration>
<classesDirectory>${project.build.directory}/classes-retro</classesDirectory>
<classifier>j4</classifier>
<archive>
<manifestEntries>
<Extension-Name>${project.artifactId}-j4</Extension-Name>
<Specification-Vendor>${project.organization.name}</Specification-Vendor>
<Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
<Implementation-Title>${project.description}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
<Revision>${scm.revision}</Revision>
</manifestEntries>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>sun.jdk</groupId>
<artifactId>rt</artifactId>
<version>1.4.0</version>
<scope>system</scope>
<!-- path to rt.jar (on OSX, it's classes.jar) -->
<systemPath>${java14.jar}</systemPath>
</dependency>
<dependency>
<groupId>net.sf.retrotranslator</groupId>
<artifactId>retrotranslator-runtime</artifactId>
<version>1.0.8</version>
</dependency>
</dependencies>
</profile>
-->
<id>j4</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>retrotranslator-maven-plugin</artifactId>
<executions>
<execution>
<id>retrotranslate</id>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>create-j4-jar</id>
<goals><goal>jar</goal></goals>
<configuration>
<classesDirectory>${project.build.directory}/classes-retro</classesDirectory>
<classifier>j4</classifier>
<archive>
<manifestEntries>
<Extension-Name>${project.artifactId}-j4</Extension-Name>
<Specification-Vendor>${project.organization.name}</Specification-Vendor>
<Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
<Implementation-Title>${project.description}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
<Revision>${scm.revision}</Revision>
</manifestEntries>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>sun.jdk</groupId>
<artifactId>rt</artifactId>
<version>1.4.0</version>
<scope>system</scope>
<!-- path to rt.jar (on OSX, it's classes.jar) -->
<systemPath>${java14.jar}</systemPath>
</dependency>
<dependency>
<groupId>net.sf.retrotranslator</groupId>
<artifactId>retrotranslator-runtime</artifactId>
<version>1.0.8</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>alljars</id>
@@ -252,19 +252,13 @@
<dependency>
<groupId>opensymphony</groupId>
<artifactId>xwork</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-api</artifactId>
<version>${pom.version}</version>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.4</version>
<version>2.3.8</version>
</dependency>
<dependency>
@@ -282,9 +276,9 @@
</dependency>
<dependency>
<groupId>ognl</groupId>
<groupId>opensymphony</groupId>
<artifactId>ognl</artifactId>
<version>2.6.9</version>
<version>2.6.11</version>
</dependency>
<dependency>
@@ -461,12 +455,16 @@
<scope>test</scope>
</dependency>
<!-- struts-annotations must be in compile scope for maven-apt-plugin to
function correctly. Marking it optional to exclude it from transitive
dependency resolution -->
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts-annotations</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
</dependencies>
</project>
@@ -145,4 +145,6 @@ public final class StrutsConstants {
/** The name of the xwork converter implementation */
public static final String STRUTS_XWORKCONVERTER = "struts.xworkConverter";
public static final String STRUTS_ALWAYS_SELECT_FULL_NAMESPACE = "struts.mapper.alwaysSelectFullNamespace";
}
@@ -1,5 +1,5 @@
/*
* $Id: StrutsTestCase.java 476696 2006-11-19 03:56:18Z tmjee $
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -49,6 +49,7 @@ public abstract class AbstractRemoteCallUIBean extends ClosingUIBean implements
protected String notifyTopics;
protected String showErrorTransportText;
protected String indicator;
protected String showLoadingText;
public AbstractRemoteCallUIBean(ValueStack stack, HttpServletRequest request,
HttpServletResponse response) {
@@ -86,6 +87,8 @@ public abstract class AbstractRemoteCallUIBean extends ClosingUIBean implements
addParameter("showErrorTransportText", findValue(showErrorTransportText, Boolean.class));
else
addParameter("showErrorTransportText", true);
if (showLoadingText != null)
addParameter("showLoadingText", findString(showLoadingText));
}
@@ -165,4 +168,8 @@ public abstract class AbstractRemoteCallUIBean extends ClosingUIBean implements
this.indicator = indicator;
}
@StrutsTagAttribute(description="Show loading text on targets", type="Boolean", defaultValue="true")
public void setShowLoadingText(String showLoadingText) {
this.showLoadingText = showLoadingText;
}
}
@@ -71,6 +71,7 @@ import com.opensymphony.xwork2.util.ValueStack;
* 'listenTopics' comma separated list of topics names, that will trigger a request
* 'indicator' element to be shown while the request executing
* 'showErrorTransportText': whether errors should be displayed (on 'targets')</p>
* 'showLoadingText' show loading text on targets</p>
* 'notifyTopics' comma separated list of topics names, that will be published. Three parameters are passed:<p/>
* <ul>
* <li>data: html or json object when type='load' or type='error'</li>
@@ -72,6 +72,9 @@ import com.opensymphony.xwork2.util.ValueStack;
* 'loadMinimumCount' minimum number of characters that will force the content to be loaded<p/>
* 'showDownError' show or hide the down arrow button
* 'searchType' how the search must be performed, options are: "startstring", "startword" and "substring"<p/>
* 'keyName' name of the field to which the selected key will be assigned<p/>
* 'iconPath' path of icon used for the dropdown
* 'templateCssPath' path to css file used to customize Dojo's widget
* 'notifyTopics' comma separated list of topics names, that will be published. Three parameters are passed:<p/>
* <ul>
* <li>data: selected value when type='valuechanged'</li>
@@ -101,7 +104,10 @@ public class Autocompleter extends ComboBox {
protected String loadOnTextChange;
protected String loadMinimumCount;
protected String showDownArrow;
protected String templateCssPath;
protected String iconPath;
protected String keyName;
public Autocompleter(ValueStack stack, HttpServletRequest request,
HttpServletResponse response) {
super(stack, request, response);
@@ -159,11 +165,19 @@ public class Autocompleter extends ComboBox {
addParameter("showDownArrow", findValue(showDownArrow, Boolean.class));
else
addParameter("showDownArrow", Boolean.TRUE);
//get the key value
if(name != null) {
String keyNameExpr = "%{" + name + "Key}";
addParameter("key", findString(keyNameExpr));
if(templateCssPath != null)
addParameter("templateCssPath", findString(templateCssPath));
if(iconPath != null)
addParameter("iconPath", findString(iconPath));
if(keyName != null)
addParameter("keyName", findString(keyName));
else {
keyName = name + "Key";
addParameter("keyName", findString(keyName));
}
String keyNameExpr = "%{" + keyName + "}";
addParameter("key", findString(keyNameExpr));
}
protected Object findListValue() {
@@ -256,4 +270,19 @@ public class Autocompleter extends ComboBox {
public void setList(String list) {
super.setList(list);
}
@StrutsTagAttribute(description="Template css path")
public void setTemplateCssPath(String templateCssPath) {
this.templateCssPath = templateCssPath;
}
@StrutsTagAttribute(description="Path to icon used for the dropdown")
public void setIconPath(String iconPath) {
this.iconPath = iconPath;
}
@StrutsTagAttribute(description="Name of the field to which the selected key will be assigned")
public void setKeyName(String keyName) {
this.keyName = keyName;
}
}
@@ -127,7 +127,7 @@ import com.opensymphony.xwork2.util.ValueStack;
public class DateTimePicker extends UIBean {
final public static String TEMPLATE = "datetimepicker";
final private static SimpleDateFormat RFC3399_FORMAT = new SimpleDateFormat(
final private static SimpleDateFormat RFC3339_FORMAT = new SimpleDateFormat(
"yyyy-MM-dd'T'HH:mm:ss");
final protected static Log LOG = LogFactory.getLog(DateTimePicker.class);
@@ -146,6 +146,7 @@ public class DateTimePicker extends UIBean {
protected String staticDisplay;
protected String dayWidth;
protected String language;
protected String templateCssPath;
public DateTimePicker(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
super(stack, request, response);
@@ -177,7 +178,7 @@ public class DateTimePicker extends UIBean {
if(value != null)
addParameter("value", findString(value));
if(iconPath != null)
addParameter("iconPath", iconPath);
addParameter("iconPath", findString(iconPath));
if(formatLength != null)
addParameter("formatLength", findString(formatLength));
if(displayFormat != null)
@@ -191,7 +192,9 @@ public class DateTimePicker extends UIBean {
addParameter("type", findString(type));
else
addParameter("type", "date");
if(templateCssPath != null)
addParameter("templateCssPath", findString(templateCssPath));
// format the value to RFC 3399
if(parameters.containsKey("value")) {
parameters.put("nameValue", format(parameters.get("value")));
@@ -258,7 +261,7 @@ public class DateTimePicker extends UIBean {
this.formatLength = formatLength;
}
@StrutsTagAttribute(description=" Path to icon used for the dropdown")
@StrutsTagAttribute(description="Path to icon used for the dropdown")
public void setIconPath(String iconPath) {
this.iconPath = iconPath;
}
@@ -279,17 +282,22 @@ public class DateTimePicker extends UIBean {
this.toggleType = toggleType;
}
@StrutsTagAttribute(description="Template css path")
public void setTemplateCssPath(String templateCssPath) {
this.templateCssPath = templateCssPath;
}
private String format(Object obj) {
if(obj == null)
return null;
if(obj instanceof Date) {
return RFC3399_FORMAT.format((Date) obj);
return RFC3339_FORMAT.format((Date) obj);
} else {
// try to parse a date
String dateStr = obj.toString();
if(dateStr.equalsIgnoreCase("today"))
return RFC3399_FORMAT.format(new Date());
return RFC3339_FORMAT.format(new Date());
try {
Date date = null;
@@ -297,7 +305,7 @@ public class DateTimePicker extends UIBean {
SimpleDateFormat format = new SimpleDateFormat(
this.displayFormat);
date = format.parse(dateStr);
return RFC3399_FORMAT.format(date);
return RFC3339_FORMAT.format(date);
} else {
// last resource to assume already in correct/default format
return dateStr;
@@ -76,6 +76,7 @@ import com.opensymphony.xwork2.util.ValueStack;
* 'listenTopics' comma separated list of topics names, that will trigger a request
* 'indicator' element to be shown while the request executing
* 'showErrorTransportText': whether errors should be displayed (on 'targets')</p>
* 'showLoadingText' show loading text on targets</p>
* 'notifyTopics' comma separated list of topics names, that will be published. Three parameters are passed:
* <ul>
* <li>data: html or json object when type='load' or type='error'</li>
@@ -514,7 +514,6 @@ public abstract class DoubleListUIBean extends ListUIBean {
return doubleList;
}
@StrutsTagAttribute(description="Set the list key of the second attribute")
public String getDoubleListKey() {
return doubleListKey;
}
@@ -60,6 +60,6 @@ public class DoubleSelect extends DoubleListUIBean {
super.evaluateExtraParams();
// force the onchange parameter
addParameter("onchange", getParameters().get("name") + "Redirect(this.options.selectedIndex)");
addParameter("onchange", getParameters().get("id") + "Redirect(this.options.selectedIndex)");
}
}
@@ -32,6 +32,8 @@ import org.apache.commons.logging.LogFactory;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ValueStack;
/**
@@ -90,6 +92,11 @@ public class OptGroup extends Component {
}
};
}
@Inject
public void setContainer(Container container) {
container.inject(internalUiBean);
}
public boolean end(Writer writer, String body) {
Select select = (Select) findAncestor(Select.class);
@@ -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;
@@ -27,6 +47,8 @@ public interface RemoteUICallBean {
void setShowErrorTransportText(String showError);
void setShowLoadingText(String showLoadingText);
void setIndicator(String indicator);
}
@@ -20,9 +20,13 @@
*/
package org.apache.struts2.components;
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;
@@ -97,6 +101,7 @@ import com.opensymphony.xwork2.util.ValueStack;
* 'listenTopics' comma separated list of topics names, that will trigger a request
* 'indicator' element to be shown while the request executing
* 'showErrorTransportText': whether errors should be displayed (on 'targets')</p>
* 'showLoadingText' show loading text on targets</p>
* 'notifyTopics' comma separated list of topics names, that will be published. Three parameters are passed:<p/>
* <ul>
* <li>data: html or json object when type='load' or type='error'</li>
@@ -133,6 +138,9 @@ import com.opensymphony.xwork2.util.ValueStack;
*/
@StrutsTag(name="submit", tldTagClass="org.apache.struts2.views.jsp.ui.SubmitTag", description="Render a submit button")
public class Submit extends FormButton implements RemoteUICallBean{
private static final Log LOG = LogFactory.getLog(Submit.class);
final public static String TEMPLATE = "submit";
protected String href;
@@ -147,7 +155,7 @@ public class Submit extends FormButton implements RemoteUICallBean{
protected String notifyTopics;
protected String showErrorTransportText;
protected String indicator;
protected String showLoadingText;
//these two are called "preInvokeJS" and "onLoadJS" on the tld
//Names changed here to keep some consistency
protected String beforeLoading;
@@ -207,6 +215,8 @@ public class Submit extends FormButton implements RemoteUICallBean{
addParameter("indicator", findString(indicator));
if (targets != null)
addParameter("targets", findString(targets));
if (showLoadingText != null)
addParameter("showLoadingText", findString(showLoadingText));
}
/**
@@ -217,6 +227,25 @@ public class Submit extends FormButton implements RemoteUICallBean{
protected boolean supportsImageType() {
return true;
}
/**
* Overrides to be able to render body in a template rather than always before the template
*/
public boolean end(Writer writer, String body) {
evaluateParams();
try {
addParameter("body", body);
mergeTemplate(writer, buildTemplateName(template, getDefaultTemplate()));
} catch (Exception e) {
LOG.error("error when rendering", e);
}
finally {
popComponentStack();
}
return false;
}
@StrutsTagAttribute(description="Topic that will trigger the remote call")
public void setListenTopics(String listenTopics) {
@@ -301,4 +330,9 @@ public class Submit extends FormButton implements RemoteUICallBean{
public void setIndicator(String indicator) {
this.indicator = indicator;
}
@StrutsTagAttribute(description="Show loading text on targets", type="Boolean", defaultValue="true")
public void setShowLoadingText(String showLoadingText) {
this.showLoadingText = showLoadingText;
}
}
@@ -66,6 +66,7 @@ public class TabbedPanel extends ClosingUIBean {
protected String selectedTab;
protected String closeButton;
protected String doLayout ;
protected String templateCssPath;
public TabbedPanel(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
super(stack, request, response);
@@ -89,6 +90,8 @@ public class TabbedPanel extends ClosingUIBean {
addParameter("labelPosition", null);
addParameter("labelPosition", labelPosition);
}
if(templateCssPath != null)
addParameter("templateCssPath", findString(templateCssPath));
}
public String getDefaultOpenTemplate() {
@@ -124,4 +127,9 @@ public class TabbedPanel extends ClosingUIBean {
public void setDoLayout(String doLayout) {
this.doLayout = doLayout;
}
@StrutsTagAttribute(description="Template css path")
public void setTemplateCssPath(String templateCssPath) {
this.templateCssPath = templateCssPath;
}
}
@@ -872,9 +872,10 @@ public abstract class UIBean extends Component {
addParameter("id", id);
}
} else if (form != null) {
addParameter("id", form.getParameters().get("id") + "_" + escape(name));
addParameter("id", form.getParameters().get("id") + "_"
+ escape(name != null ? findString(name) : null));
} else {
addParameter("id", escape(name));
addParameter("id", escape(name != null ? findString(name) : null));
}
}
@@ -21,6 +21,7 @@
package org.apache.struts2.config;
import java.util.Properties;
import java.util.StringTokenizer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -43,6 +44,7 @@ import com.opensymphony.xwork2.inject.Factory;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.inject.Scope;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
import com.opensymphony.xwork2.util.LocalizedTextUtil;
import com.opensymphony.xwork2.util.ObjectTypeDeterminer;
import com.opensymphony.xwork2.util.ObjectTypeDeterminerFactory;
import com.opensymphony.xwork2.util.XWorkConverter;
@@ -162,6 +164,30 @@ public class BeanSelectionProvider implements ConfigurationProvider {
if ("true".equalsIgnoreCase(props.getProperty(StrutsConstants.STRUTS_DEVMODE))) {
props.setProperty(StrutsConstants.STRUTS_I18N_RELOAD, "true");
props.setProperty(StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD, "true");
// Convert struts properties into ones that xwork expects
props.setProperty("devMode", "true");
} else {
props.setProperty("devMode", "false");
}
// TODO: This should be moved to XWork after 2.0.4
// struts.custom.i18n.resources
LocalizedTextUtil.addDefaultResourceBundle("org/apache/struts2/struts-messages");
String bundles = props.getProperty(StrutsConstants.STRUTS_CUSTOM_I18N_RESOURCES);
if (bundles != null && bundles.length() > 0) {
StringTokenizer customBundles = new StringTokenizer(props.getProperty(StrutsConstants.STRUTS_CUSTOM_I18N_RESOURCES), ", ");
while (customBundles.hasMoreTokens()) {
String name = customBundles.nextToken();
try {
LOG.info("Loading global messages from " + name);
LocalizedTextUtil.addDefaultResourceBundle(name);
} catch (Exception e) {
LOG.error("Could not find messages file " + name + ".properties. Skipping");
}
}
}
}
@@ -39,6 +39,7 @@ import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.config.entities.ResultConfig;
import com.opensymphony.xwork2.config.entities.ResultTypeConfig;
import com.opensymphony.xwork2.inject.ContainerBuilder;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
import com.opensymphony.xwork2.util.ResolverUtil;
import com.opensymphony.xwork2.util.TextUtils;
@@ -150,22 +151,6 @@ public class ClasspathConfigurationProvider implements ConfigurationProvider {
*/
public ClasspathConfigurationProvider(String[] pkgs) {
this.packages = pkgs;
if (Settings.isSet(DEFAULT_PARENT_PACKAGE)) {
defaultParentPackage = Settings.get(DEFAULT_PARENT_PACKAGE);
}
if (Settings.isSet(DEFAULT_PAGE_EXTENSION)) {
defaultPageExtension = Settings.get(DEFAULT_PAGE_EXTENSION);
}
if (Settings.isSet(DEFAULT_PAGE_PREFIX)) {
defaultPagePrefix = Settings.get(DEFAULT_PAGE_PREFIX);
}
if (Settings.isSet(FORCE_LOWER_CASE)) {
forceLowerCase = Settings.get(FORCE_LOWER_CASE).equalsIgnoreCase("true");
}
}
/**
@@ -189,6 +174,7 @@ public class ClasspathConfigurationProvider implements ConfigurationProvider {
*
* @param defaultParentPackage the new defaultParentPackage
*/
@Inject(value=DEFAULT_PARENT_PACKAGE, required=false)
public void setDefaultParentPackage(String defaultParentPackage) {
this.defaultParentPackage = defaultParentPackage;
}
@@ -198,6 +184,7 @@ public class ClasspathConfigurationProvider implements ConfigurationProvider {
*
* @param defaultPageExtension the new defaultPageExtension
*/
@Inject(value=DEFAULT_PAGE_EXTENSION, required=false)
public void setDefaultPageExtension(String defaultPageExtension) {
this.defaultPageExtension = defaultPageExtension;
}
@@ -207,9 +194,21 @@ public class ClasspathConfigurationProvider implements ConfigurationProvider {
*
* @param defaultPagePrefix the defaultPagePrefix to set
*/
@Inject(value=DEFAULT_PAGE_PREFIX, required=false)
public void setDefaultPagePrefix(String defaultPagePrefix) {
this.defaultPagePrefix = defaultPagePrefix;
}
/**
* Whether to use a lowercase letter as the initial letter of an action.
*
* @param force If false, actions will retain the initial uppercase letter from the Action class.
* (<code>view.action</code> (true) versus <code>View.action</code> (false)).
*/
@Inject(value=FORCE_LOWER_CASE, required=false)
public void setForceLowerCase(String force) {
this.forceLowerCase = "true".equals(force);
}
/**
* Register a PageLocation to use to scan for server pages.
@@ -290,6 +289,11 @@ public class ClasspathConfigurationProvider implements ConfigurationProvider {
PackageConfig pkgConfig = loadPackageConfig(actionNamespace, actionPackage, cls);
// In case the package changed due to namespace annotation processing
if (!actionPackage.equals(pkgConfig.getName())) {
actionPackage = pkgConfig.getName();
}
Annotation annotation = cls.getAnnotation(ParentPackage.class);
if (annotation != null) {
String parent = ((ParentPackage)annotation).value();
@@ -324,7 +328,6 @@ public class ClasspathConfigurationProvider implements ConfigurationProvider {
actionConfig.setPackageName(actionPackage);
actionConfig.setResults(new ResultMap<String,ResultConfig>(cls, actionName, pkgConfig));
pkgConfig.addActionConfig(actionName, actionConfig);
}
@@ -478,33 +481,6 @@ public class ClasspathConfigurationProvider implements ConfigurationProvider {
return map;
}
/**
* Retrieve ResultConfig from cache.
*
* @param key Name of ResultConfig
* @return ResultConfig correspnding to key
*/
public V get(Object key) {
V result = super.get(key);
if (result != null) {
return result;
} else {
// This code should never actually be called,
// due to how the runtime configuration is created.
String actionPath = pkgConfig.getNamespace() + "/" + actionName;
String fileName = actionPath + "-" + key + defaultPageExtension;
if (pageLocator.locate(defaultPagePrefix + fileName) == null) {
fileName = actionPath + defaultPageExtension;
}
String location = defaultPagePrefix + fileName;
return (V) createResultConfig(key, null, location, null);
}
}
/**
* Creates a default ResultConfig,
* using either the resultClass or the default ResultType for configuration package
@@ -0,0 +1,52 @@
/*
* $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.config;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.inject.ContainerBuilder;
import com.opensymphony.xwork2.util.location.LocatableProperties;
/**
* Loads the default properties, separate from the usual struts.properties loading
*/
public class DefaultPropertiesProvider extends LegacyPropertiesConfigurationProvider {
public void destroy() {
}
public void init(Configuration configuration) throws ConfigurationException {
}
public void register(ContainerBuilder builder, LocatableProperties props)
throws ConfigurationException {
Settings defaultSettings = null;
try {
defaultSettings = new PropertiesSettings("org/apache/struts2/default");
} catch (Exception e) {
throw new ConfigurationException("Could not find or error in org/apache/struts2/default.properties", e);
}
loadSettings(props, defaultSettings);
}
}
@@ -69,12 +69,6 @@ public class DefaultSettings extends Settings {
log.warn("DefaultSettings: Could not find or error in struts.properties", e);
}
try {
list.add(new PropertiesSettings("org/apache/struts2/default"));
} catch (Exception e) {
log.error("DefaultSettings: Could not find or error in org/apache/struts2/default.properties", e);
}
Settings[] settings = new Settings[list.size()];
delegate = new DelegatingSettings(list.toArray(settings));
@@ -100,24 +94,6 @@ public class DefaultSettings extends Settings {
// like the struts.custom.properties, which is commented out
}
// struts.custom.i18n.resources
try {
LocalizedTextUtil.addDefaultResourceBundle("org/apache/struts2/struts-messages");
StringTokenizer customBundles = new StringTokenizer(delegate.getImpl(StrutsConstants.STRUTS_CUSTOM_I18N_RESOURCES), ", ");
while (customBundles.hasMoreTokens()) {
String name = customBundles.nextToken();
try {
log.info("DefaultSettings: Loading global messages from " + name);
LocalizedTextUtil.addDefaultResourceBundle(name);
} catch (Exception e) {
log.error("DefaultSettings: Could not find " + name + ".properties. Skipping");
}
}
} catch (IllegalArgumentException e) {
// Assume it's OK, since many applications do not provide custom resource bundles.
}
}
// See superclass for Javadoc
@@ -66,15 +66,7 @@ public class LegacyPropertiesConfigurationProvider implements ConfigurationProvi
final Settings settings = Settings.getInstance();
for (Iterator i = settings.list(); i.hasNext(); ) {
String name = (String) i.next();
props.setProperty(name, settings.get(name), settings.getLocation(name));
// Convert struts properties into ones that xwork expects
if (StrutsConstants.STRUTS_DEVMODE.equals(name)) {
props.setProperty("devMode", settings.get(name), settings.getLocation(name));
}
}
loadSettings(props, settings);
// Set default locale
final Locale locale = settings.getLocale();
@@ -84,4 +76,16 @@ public class LegacyPropertiesConfigurationProvider implements ConfigurationProvi
}
});
}
/**
* @param props
* @param settings
*/
protected void loadSettings(LocatableProperties props, final Settings settings) {
// We are calling the impl methods to get around the single instance of Settings that is expected
for (Iterator i = settings.listImpl(); i.hasNext(); ) {
String name = (String) i.next();
props.setProperty(name, settings.getImpl(name), settings.getLocationImpl(name));
}
}
}
@@ -1,239 +1,259 @@
package org.apache.struts2.config;
import com.opensymphony.xwork2.config.ConfigurationProvider;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.config.RuntimeConfiguration;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.inject.ContainerBuilder;
import com.opensymphony.xwork2.util.location.LocatableProperties;
import com.opensymphony.xwork2.ObjectFactory;
import java.util.*;
import java.lang.reflect.Method;
/**
* MethodConfigurationProvider creates ActionConfigs for potential action
* methods that lack a corresponding action mapping,
* so that these methods can be invoked without extra or redundant configuration.
* <p/>
* As a dynamic method, the behavior of this class could be represented as:
* <p/>
* <code>
* int bang = name.indexOf('!');
* if (bang != -1) {
* String method = name.substring(bang + 1);
* mapping.setMethod(method);
* name = name.substring(0, bang);
* }
* </code>
* <p/>
* If the action URL is "foo!bar", the the "foo" action is invoked,
* calling "bar" instead of "execute".
* <p/>
* Instead of scanning each request at runtime, the provider creates action mappings
* for each method that could be matched using a dynamic approach.
* Advantages over a dynamic approach are that:
* <p/>
* <ul>
* <ol>The "dynamic" methods are not a special case, but just another action mapping,
* with all the features of a hardcoded mapping.
* <ol>When needed, a manual action can be provided for a method and invoked with the same
* syntax as an automatic action.
* <ol>The ConfigBrowser can display all potential actions.
* </ul>
*/
public class MethodConfigurationProvider implements ConfigurationProvider {
/**
* Stores configuration property.
*/
private Configuration configuration;
/**
* Updates configuration property.
* @param configuration New configuration
*/
public void setConfiguration(Configuration configuration) {
this.configuration = configuration;
}
// See superclass for Javadoc
public void destroy() {
// Override to provide functionality
}
// See superclass for Javadoc
public void init(Configuration configuration) throws ConfigurationException {
setConfiguration(configuration);
configuration.rebuildRuntimeConfiguration();
}
// See superclass for Javadoc
public void register(ContainerBuilder containerBuilder, LocatableProperties locatableProperties) throws ConfigurationException {
// Override to provide functionality
}
// See superclass for Javadoc
public void loadPackages() throws ConfigurationException {
Set namespaces = Collections.EMPTY_SET;
RuntimeConfiguration rc = configuration.getRuntimeConfiguration();
Map allActionConfigs = rc.getActionConfigs();
if (allActionConfigs != null) {
namespaces = allActionConfigs.keySet();
}
if (namespaces.size() == 0) {
throw new ConfigurationException("MethodConfigurationProvider.loadPackages: namespaces.size == 0");
}
boolean added = false;
for (Object namespace : namespaces) {
Map actions = (Map) allActionConfigs.get(namespace);
Set actionNames = actions.keySet();
for (Object actionName : actionNames) {
ActionConfig actionConfig = (ActionConfig) actions.get(actionName);
added = added | addDynamicMethods(actions, (String) actionName, actionConfig);
}
}
reload = added;
}
/**
* Store needsReload property.
*/
boolean reload;
// See superclass for Javadoc
public boolean needsReload() {
return reload;
}
/**
* Stores ObjectFactory property.
*/
ObjectFactory factory;
/**
* Updates ObjectFactory property.
* @param factory
*/
public void setObjectFactory(ObjectFactory factory) {
this.factory = factory;
}
/**
* Provides ObjectFactory property.
* @return
* @throws ConfigurationException if ObjectFactory has not been set.
*/
private ObjectFactory getObjectFactory() throws ConfigurationException {
if (factory == null) {
factory = ObjectFactory.getObjectFactory();
if (factory == null) throw new
ConfigurationException("MethodConfigurationProvider.getObjectFactory: ObjectFactory==null");
}
return factory;
}
/**
* Verifies that character at a String position is upper case.
* @param pos Position to test
* @param string Text containing position
* @return True if character at a String position is upper case
*/
private boolean upperAt(int pos, String string) {
int len = string.length();
if (len < pos) return false;
String ch = string.substring(pos, pos+1);
return ch.equals(ch.toUpperCase());
}
/**
* Scans class for potential Action mehods,
* automatically generating and registering ActionConfigs as needed.
* <p/>
* The system iterates over the set of namespaces and the set of actionNames
* in a Configuration and retrieves each ActionConfig.
* For each ActionConfig that invokes the default "execute" method,
* the provider inspects the className class for other non-void,
* no-argument methods that do not begin with "getX" or "isX".
* For each qualifying method, the provider looks for another actionName in
* the same namespace that equals action.name + "!" + method.name.
* If that actionName is not found, System copies the ActionConfig,
* changes the method property, and adds it to the package configuration
* under the new actionName (action!method).
* <p/>
* The system ignores ActionConfigs with a method property set so as to
* avoid creating alias methods for alias methods.
* The system ignores "getX" and "isX" methods since these would appear to be
* JavaBeans property and would not be intended as action methods.
* (The X represents any upper character or non-letter.)
* @param actions All ActionConfigs in namespace
* @param actionName Name of ActionConfig to analyze
* @param actionConfig ActionConfig corresponding to actionName
*/
protected boolean addDynamicMethods(Map actions, String actionName, ActionConfig actionConfig) throws ConfigurationException {
String configMethod = actionConfig.getMethodName();
boolean hasMethod = (configMethod != null) && (configMethod.length() > 0);
if (hasMethod) return false;
String className = actionConfig.getClassName();
Set actionMethods = new HashSet();
Class actionClass;
ObjectFactory factory = getObjectFactory();
try {
actionClass = factory.getClassInstance(className);
} catch (ClassNotFoundException e) {
throw new ConfigurationException(e);
}
Method[] methods = actionClass.getMethods();
for (Method method : methods) {
String returnString = method.getReturnType().getName();
boolean isString = "java.lang.String".equals(returnString);
if (isString) {
Class[] parameterTypes = method.getParameterTypes();
boolean noParameters = (parameterTypes.length == 0);
String methodString = method.getName();
boolean notGetMethod = !((methodString.startsWith("get")) && upperAt(3, methodString));
boolean notIsMethod = !((methodString.startsWith("is")) && upperAt(2, methodString));
boolean notToString = !("toString".equals(methodString));
boolean notExecute = !("execute".equals(methodString));
boolean qualifies = noParameters && notGetMethod && notIsMethod && notToString && notExecute;
if (qualifies) {
actionMethods.add(methodString);
}
}
}
for (Object actionMethod : actionMethods) {
String methodName = (String) actionMethod;
StringBuilder sb = new StringBuilder();
sb.append(actionName);
sb.append("!"); // TODO: Make "!" a configurable character
sb.append(methodName);
String newActionName = sb.toString();
boolean haveAction = actions.containsKey(newActionName);
if (haveAction) continue;
ActionConfig newActionConfig = new ActionConfig(
newActionName,
actionConfig.getClassName(),
actionConfig.getParams(),
actionConfig.getResults(),
actionConfig.getInterceptors(),
actionConfig.getExceptionMappings());
newActionConfig.setMethodName(methodName);
String packageName = actionConfig.getPackageName();
newActionConfig.setPackageName(packageName);
PackageConfig packageConfig = configuration.getPackageConfig(packageName);
packageConfig.addActionConfig(newActionName, actionConfig);
}
return (actionMethods.size() > 0);
}
}
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.config;
import com.opensymphony.xwork2.config.ConfigurationProvider;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.config.RuntimeConfiguration;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.inject.ContainerBuilder;
import com.opensymphony.xwork2.util.location.LocatableProperties;
import com.opensymphony.xwork2.ObjectFactory;
import java.util.*;
import java.lang.reflect.Method;
/**
* MethodConfigurationProvider creates ActionConfigs for potential action
* methods that lack a corresponding action mapping,
* so that these methods can be invoked without extra or redundant configuration.
* <p/>
* As a dynamic method, the behavior of this class could be represented as:
* <p/>
* <code>
* int bang = name.indexOf('!');
* if (bang != -1) {
* String method = name.substring(bang + 1);
* mapping.setMethod(method);
* name = name.substring(0, bang);
* }
* </code>
* <p/>
* If the action URL is "foo!bar", the the "foo" action is invoked,
* calling "bar" instead of "execute".
* <p/>
* Instead of scanning each request at runtime, the provider creates action mappings
* for each method that could be matched using a dynamic approach.
* Advantages over a dynamic approach are that:
* <p/>
* <ul>
* <ol>The "dynamic" methods are not a special case, but just another action mapping,
* with all the features of a hardcoded mapping.
* <ol>When needed, a manual action can be provided for a method and invoked with the same
* syntax as an automatic action.
* <ol>The ConfigBrowser can display all potential actions.
* </ul>
*/
public class MethodConfigurationProvider implements ConfigurationProvider {
/**
* Stores configuration property.
*/
private Configuration configuration;
/**
* Updates configuration property.
* @param configuration New configuration
*/
public void setConfiguration(Configuration configuration) {
this.configuration = configuration;
}
// See superclass for Javadoc
public void destroy() {
// Override to provide functionality
}
// See superclass for Javadoc
public void init(Configuration configuration) throws ConfigurationException {
setConfiguration(configuration);
configuration.rebuildRuntimeConfiguration();
}
// See superclass for Javadoc
public void register(ContainerBuilder containerBuilder, LocatableProperties locatableProperties) throws ConfigurationException {
// Override to provide functionality
}
// See superclass for Javadoc
public void loadPackages() throws ConfigurationException {
Set namespaces = Collections.EMPTY_SET;
RuntimeConfiguration rc = configuration.getRuntimeConfiguration();
Map allActionConfigs = rc.getActionConfigs();
if (allActionConfigs != null) {
namespaces = allActionConfigs.keySet();
}
if (namespaces.size() == 0) {
throw new ConfigurationException("MethodConfigurationProvider.loadPackages: namespaces.size == 0");
}
boolean added = false;
for (Object namespace : namespaces) {
Map actions = (Map) allActionConfigs.get(namespace);
Set actionNames = actions.keySet();
for (Object actionName : actionNames) {
ActionConfig actionConfig = (ActionConfig) actions.get(actionName);
added = added | addDynamicMethods(actions, (String) actionName, actionConfig);
}
}
reload = added;
}
/**
* Store needsReload property.
*/
boolean reload;
// See superclass for Javadoc
public boolean needsReload() {
return reload;
}
/**
* Stores ObjectFactory property.
*/
ObjectFactory factory;
/**
* Updates ObjectFactory property.
* @param factory
*/
public void setObjectFactory(ObjectFactory factory) {
this.factory = factory;
}
/**
* Provides ObjectFactory property.
* @return
* @throws ConfigurationException if ObjectFactory has not been set.
*/
private ObjectFactory getObjectFactory() throws ConfigurationException {
if (factory == null) {
factory = ObjectFactory.getObjectFactory();
if (factory == null) throw new
ConfigurationException("MethodConfigurationProvider.getObjectFactory: ObjectFactory==null");
}
return factory;
}
/**
* Verifies that character at a String position is upper case.
* @param pos Position to test
* @param string Text containing position
* @return True if character at a String position is upper case
*/
private boolean upperAt(int pos, String string) {
int len = string.length();
if (len < pos) return false;
String ch = string.substring(pos, pos+1);
return ch.equals(ch.toUpperCase());
}
/**
* Scans class for potential Action mehods,
* automatically generating and registering ActionConfigs as needed.
* <p/>
* The system iterates over the set of namespaces and the set of actionNames
* in a Configuration and retrieves each ActionConfig.
* For each ActionConfig that invokes the default "execute" method,
* the provider inspects the className class for other non-void,
* no-argument methods that do not begin with "getX" or "isX".
* For each qualifying method, the provider looks for another actionName in
* the same namespace that equals action.name + "!" + method.name.
* If that actionName is not found, System copies the ActionConfig,
* changes the method property, and adds it to the package configuration
* under the new actionName (action!method).
* <p/>
* The system ignores ActionConfigs with a method property set so as to
* avoid creating alias methods for alias methods.
* The system ignores "getX" and "isX" methods since these would appear to be
* JavaBeans property and would not be intended as action methods.
* (The X represents any upper character or non-letter.)
* @param actions All ActionConfigs in namespace
* @param actionName Name of ActionConfig to analyze
* @param actionConfig ActionConfig corresponding to actionName
*/
protected boolean addDynamicMethods(Map actions, String actionName, ActionConfig actionConfig) throws ConfigurationException {
String configMethod = actionConfig.getMethodName();
boolean hasMethod = (configMethod != null) && (configMethod.length() > 0);
if (hasMethod) return false;
String className = actionConfig.getClassName();
Set actionMethods = new HashSet();
Class actionClass;
ObjectFactory factory = getObjectFactory();
try {
actionClass = factory.getClassInstance(className);
} catch (ClassNotFoundException e) {
throw new ConfigurationException(e);
}
Method[] methods = actionClass.getMethods();
for (Method method : methods) {
String returnString = method.getReturnType().getName();
boolean isString = "java.lang.String".equals(returnString);
if (isString) {
Class[] parameterTypes = method.getParameterTypes();
boolean noParameters = (parameterTypes.length == 0);
String methodString = method.getName();
boolean notGetMethod = !((methodString.startsWith("get")) && upperAt(3, methodString));
boolean notIsMethod = !((methodString.startsWith("is")) && upperAt(2, methodString));
boolean notToString = !("toString".equals(methodString));
boolean notExecute = !("execute".equals(methodString));
boolean qualifies = noParameters && notGetMethod && notIsMethod && notToString && notExecute;
if (qualifies) {
actionMethods.add(methodString);
}
}
}
for (Object actionMethod : actionMethods) {
String methodName = (String) actionMethod;
StringBuilder sb = new StringBuilder();
sb.append(actionName);
sb.append("!"); // TODO: Make "!" a configurable character
sb.append(methodName);
String newActionName = sb.toString();
boolean haveAction = actions.containsKey(newActionName);
if (haveAction) continue;
ActionConfig newActionConfig = new ActionConfig(
newActionName,
actionConfig.getClassName(),
actionConfig.getParams(),
actionConfig.getResults(),
actionConfig.getInterceptors(),
actionConfig.getExceptionMappings());
newActionConfig.setMethodName(methodName);
String packageName = actionConfig.getPackageName();
newActionConfig.setPackageName(packageName);
PackageConfig packageConfig = configuration.getPackageConfig(packageName);
packageConfig.addActionConfig(newActionName, actionConfig);
}
return (actionMethods.size() > 0);
}
}
@@ -284,6 +284,10 @@ public class Dispatcher {
configurationManager = null;
}
private void init_DefaultProperties() {
configurationManager.addConfigurationProvider(new DefaultPropertiesProvider());
}
private void init_LegacyStrutsProperties() {
configurationManager.addConfigurationProvider(new LegacyPropertiesConfigurationProvider());
}
@@ -439,13 +443,14 @@ Caused by: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyExcepti
configurationManager = new ConfigurationManager(BeanSelectionProvider.DEFAULT_BEAN_NAME);
}
init_LegacyStrutsProperties(); // [1]
init_DefaultProperties(); // [1]
init_TraditionalXmlConfigurations(); // [2]
init_ZeroConfiguration(); // [3]
init_CustomConfigurationProviders(); // [4]
init_LegacyStrutsProperties(); // [3]
init_ZeroConfiguration(); // [4]
init_CustomConfigurationProviders(); // [5]
init_MethodConfigurationProvider();
init_FilterInitParameters() ; // [5]
init_AliasStandardObjects() ; // [6]
init_FilterInitParameters() ; // [6]
init_AliasStandardObjects() ; // [7]
Container container = init_PreloadConfiguration();
init_CheckConfigurationReloading(container);
@@ -510,8 +515,7 @@ Caused by: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyExcepti
LOG.error("Could not find action or result", e);
sendError(request, response, context, HttpServletResponse.SC_NOT_FOUND, e);
} catch (Exception e) {
LOG.error("Could not execute action", e);
sendError(request, response, context, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e);
throw new ServletException(e);
} finally {
UtilTimerStack.pop(timerKey);
}
@@ -135,7 +135,6 @@ public class ServletActionRedirectResult extends ServletRedirectResult {
protected String actionName;
protected String namespace;
protected String method;
protected ActionMapper actionMapper;
private Map<String, String> requestParameters = new HashMap<String, String>();
@@ -158,11 +157,6 @@ public class ServletActionRedirectResult extends ServletRedirectResult {
this.method = method;
}
@Inject
public void setActionMapper(ActionMapper mapper) {
this.actionMapper = mapper;
}
protected List<String> prohibitedResultParam = Arrays.asList(new String[] {
DEFAULT_PARAM, "namespace", "method", "encode", "parse", "location",
"prependServletContext" });
@@ -27,6 +27,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.dispatcher.mapper.ActionMapper;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
@@ -84,7 +85,7 @@ public class ServletRedirectResult extends StrutsResultSupport {
protected boolean prependServletContext = true;
private ActionMapper actionMapper;
protected ActionMapper actionMapper;
public ServletRedirectResult() {
super();
@@ -123,8 +124,12 @@ public class ServletRedirectResult extends StrutsResultSupport {
if (isPathUrl(finalLocation)) {
if (!finalLocation.startsWith("/")) {
String namespace = actionMapper.getMapping(
request, Dispatcher.getInstance().getConfigurationManager()).getNamespace();
ActionMapping mapping = actionMapper.getMapping(
request, Dispatcher.getInstance().getConfigurationManager());
String namespace = null;
if (mapping != null) {
namespace = mapping.getNamespace();
}
if ((namespace != null) && (namespace.length() > 0) && (!"/".equals(namespace))) {
finalLocation = namespace + "/" + finalLocation;
@@ -173,6 +173,8 @@ public class DefaultActionMapper implements ActionMapper {
private boolean allowDynamicMethodCalls = true;
private boolean allowSlashesInActionNames = false;
private boolean alwaysSelectFullNamespace = false;
private PrefixTrie prefixTrie = null;
@@ -243,6 +245,11 @@ public class DefaultActionMapper implements ActionMapper {
public void setSlashesInActionNames(String allow) {
allowSlashesInActionNames = "true".equals(allow);
}
@Inject(StrutsConstants.STRUTS_ALWAYS_SELECT_FULL_NAMESPACE)
public void setAlwaysSelectFullNamespace(String val) {
this.alwaysSelectFullNamespace = "true".equals(val);
}
@Inject
public void setContainer(Container container) {
@@ -264,7 +271,7 @@ public class DefaultActionMapper implements ActionMapper {
return null;
}
parseNameAndNamespace(uri, mapping, configManager.getConfiguration());
parseNameAndNamespace(uri, mapping, configManager);
handleSpecialParameters(request, mapping);
@@ -330,7 +337,7 @@ public class DefaultActionMapper implements ActionMapper {
* The action mapping to populate
*/
void parseNameAndNamespace(String uri, ActionMapping mapping,
Configuration config) {
ConfigurationManager configManager) {
String namespace, name;
int lastSlash = uri.lastIndexOf("/");
if (lastSlash == -1) {
@@ -342,7 +349,13 @@ public class DefaultActionMapper implements ActionMapper {
// namespace anyway if not found in root namespace.
namespace = "/";
name = uri.substring(lastSlash + 1);
} else if (alwaysSelectFullNamespace) {
// Simply select the namespace as everything before the last slash
namespace = uri.substring(0, lastSlash);
name = uri.substring(lastSlash + 1);
} else {
// Try to find the namespace in those defined, defaulting to ""
Configuration config = configManager.getConfiguration();
String prefix = uri.substring(0, lastSlash);
namespace = "";
// Find the longest matching namespace, defaulting to the default
@@ -1,84 +0,0 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// Copyright 2006 Google Inc. All Rights Reserved.
package org.apache.struts2.impl;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import org.apache.struts2.spi.ActionContext;
import org.apache.struts2.spi.Result;
import com.opensymphony.xwork2.ActionInvocation;
public class ActionContextImpl implements ActionContext {
final ActionInvocation invocation;
public ActionContextImpl(ActionInvocation invocation) {
this.invocation = invocation;
}
public Object getAction() {
return invocation.getAction();
}
public Method getMethod() {
String methodName = invocation.getProxy().getMethod();
try {
return getAction().getClass().getMethod(methodName);
} catch (NoSuchMethodException e) {
throw new RuntimeException(e);
}
}
public String getActionName() {
return invocation.getProxy().getActionName();
}
public String getNamespacePath() {
return invocation.getProxy().getNamespace();
}
// TODO: Do something with these.
List<Result> resultInterceptors = new ArrayList<Result>();
public void addResultInterceptor(Result interceptor) {
resultInterceptors.add(interceptor);
}
public Result getResult() {
// TODO
throw new UnsupportedOperationException();
}
public ActionContext getPrevious() {
// TODO
throw new UnsupportedOperationException();
}
public ActionContext getNext() {
// TODO
throw new UnsupportedOperationException();
}
}
@@ -1,69 +0,0 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// Copyright 2006 Google Inc. All Rights Reserved.
package org.apache.struts2.impl;
import static org.apache.struts2.impl.RequestContextImpl.ILLEGAL_PROCEED;
import java.util.concurrent.Callable;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;
public class InterceptorAdapter implements Interceptor {
private static final long serialVersionUID = 8020658947818231684L;
final org.apache.struts2.spi.Interceptor delegate;
public InterceptorAdapter(org.apache.struts2.spi.Interceptor delegate) {
this.delegate = delegate;
}
public String intercept(final ActionInvocation invocation) throws Exception {
final RequestContextImpl requestContext = RequestContextImpl.get();
// Save the existing proceed implementation so we can restore it later.
Callable<String> previous = requestContext.getProceed();
requestContext.setProceed(new Callable<String>() {
public String call() throws Exception {
// This proceed implementation is no longer valid past this point.
requestContext.setProceed(ILLEGAL_PROCEED);
try {
return invocation.invoke();
} finally {
// We're valid again.
requestContext.setProceed(this);
}
}
});
try {
return delegate.intercept(requestContext);
} finally {
requestContext.setProceed(previous);
}
}
public void destroy() {}
public void init() {}
}
@@ -1,154 +0,0 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// Copyright 2006 Google Inc. All Rights Reserved.
package org.apache.struts2.impl;
import java.util.ArrayList;
import java.util.Collections;
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.struts2.Messages;
import com.opensymphony.xwork2.DefaultTextProvider;
import com.opensymphony.xwork2.TextProvider;
public class MessagesImpl implements Messages {
final TextProvider textProvider = DefaultTextProvider.INSTANCE;
Map<String, Messages> fieldMap = new HashMap<String, Messages>();
Map<Severity, List<String>> severityMap = new EnumMap<Severity, List<String>>(Severity.class);
public Messages forField(String fieldName) {
Messages forField = fieldMap.get(fieldName);
if (forField == null) {
forField = new MessagesImpl();
fieldMap.put(fieldName, forField);
}
return forField;
}
public Map<String, Messages> forFields() {
return fieldMap;
}
public void addInformation(String key) {
forSeverity(Severity.INFO).add(textProvider.getText(key));
}
public void addInformation(String key, String... arguments) {
forSeverity(Severity.INFO).add(textProvider.getText(key, arguments));
}
public void addWarning(String key) {
forSeverity(Severity.WARN).add(textProvider.getText(key));
}
public void addWarning(String key, String... arguments) {
forSeverity(Severity.WARN).add(textProvider.getText(key, arguments));
}
public void addError(String key) {
forSeverity(Severity.ERROR).add(textProvider.getText(key));
}
public void addError(String key, String... arguments) {
forSeverity(Severity.ERROR).add(textProvider.getText(key, arguments));
}
public void add(Severity severity, String key) {
forSeverity(severity).add(textProvider.getText(key));
}
public void add(Severity severity, String key, String... arguments) {
forSeverity(severity).add(textProvider.getText(key, arguments));
}
public Set<Severity> getSeverities() {
Set<Severity> severities = EnumSet.noneOf(Severity.class);
for (Severity severity : Severity.values()) {
List<String> messages = severityMap.get(severity);
if (messages != null && !messages.isEmpty()) {
severities.add(severity);
}
}
return Collections.unmodifiableSet(severities);
}
public List<String> forSeverity(Severity severity) {
List<String> messages = severityMap.get(severity);
if (messages == null) {
messages = new ArrayList<String>();
severityMap.put(severity, messages);
}
return messages;
}
public List<String> getErrors() {
return forSeverity(Severity.ERROR);
}
public List<String> getWarnings() {
return forSeverity(Severity.WARN);
}
public List<String> getInformation() {
return forSeverity(Severity.INFO);
}
public boolean hasErrors() {
return !isEmpty(Severity.ERROR);
}
public boolean hasWarnings() {
return !isEmpty(Severity.WARN);
}
public boolean hasInformation() {
return !isEmpty(Severity.INFO);
}
public boolean isEmpty() {
for (Severity severity : Severity.values())
if (!isEmpty(severity))
return false;
return true;
}
public boolean isEmpty(Severity severity) {
List<String> messages = severityMap.get(severity);
if (messages != null && !messages.isEmpty()) {
return false;
}
for (Messages fieldMessages : fieldMap.values())
if (!fieldMessages.isEmpty(severity))
return false;
return true;
}
}
@@ -1,197 +0,0 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// Copyright 2006 Google Inc. All Rights Reserved.
package org.apache.struts2.impl;
import static org.apache.struts2.StrutsStatics.HTTP_REQUEST;
import static org.apache.struts2.StrutsStatics.HTTP_RESPONSE;
import static org.apache.struts2.StrutsStatics.SERVLET_CONTEXT;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.Callable;
import javax.servlet.ServletContext;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.Messages;
import org.apache.struts2.dispatcher.RequestMap;
import org.apache.struts2.spi.ActionContext;
import org.apache.struts2.spi.RequestContext;
import org.apache.struts2.spi.ValueStack;
import com.opensymphony.xwork2.ActionInvocation;
public class RequestContextImpl implements RequestContext {
com.opensymphony.xwork2.ActionContext xworkContext;
ActionContext actionContext;
Messages messages = new MessagesImpl();
public static final Callable<String> ILLEGAL_PROCEED = new Callable<String>() {
public String call() throws Exception {
throw new IllegalStateException();
}
};
public RequestContextImpl(com.opensymphony.xwork2.ActionContext xworkContext) {
this.xworkContext = xworkContext;
}
public ActionContext getActionContext() {
return actionContext;
}
public Object getAction() {
return getActionContext().getAction();
}
void setActionContext(ActionContext actionContext) {
this.actionContext = actionContext;
}
public Map<String, String[]> getParameterMap() {
return xworkContext.getParameters();
}
Map<String, Object> attributeMap;
public Map<String, Object> getAttributeMap() {
if (attributeMap == null) {
attributeMap = new RequestMap(getServletRequest());
}
return attributeMap;
}
public Map<String, Object> getSessionMap() {
return xworkContext.getSession();
}
public Map<String, Object> getApplicationMap() {
return xworkContext.getApplication();
}
public List<Cookie> findCookiesForName(String name) {
List<Cookie> cookies = new ArrayList<Cookie>();
for (Cookie cookie : getServletRequest().getCookies())
if (name.equals(cookie.getName()))
cookies.add(cookie);
return cookies;
}
public Locale getLocale() {
return xworkContext.getLocale();
}
public void setLocale(Locale locale) {
xworkContext.setLocale(locale);
}
public Messages getMessages() {
return messages;
}
public HttpServletRequest getServletRequest() {
return (HttpServletRequest) xworkContext.get(HTTP_REQUEST);
}
public HttpServletResponse getServletResponse() {
return (HttpServletResponse) xworkContext.get(HTTP_RESPONSE);
}
public ServletContext getServletContext() {
return (ServletContext) xworkContext.get(SERVLET_CONTEXT);
}
ValueStack valueStack;
public ValueStack getValueStack() {
if (valueStack == null) {
valueStack = new ValueStackAdapter(xworkContext.getValueStack());
}
return valueStack;
}
Callable<String> proceed = ILLEGAL_PROCEED;
public String proceed() throws Exception {
return proceed.call();
}
public void setProceed(Callable<String> proceed) {
this.proceed = proceed;
}
public Callable<String> getProceed() {
return proceed;
}
static ThreadLocal<Object[]> threadLocalRequestContext = new ThreadLocal<Object[]>() {
protected RequestContextImpl[] initialValue() {
return new RequestContextImpl[1];
}
};
/**
* Creates RequestContext if necessary. Always creates a new ActionContext and restores an existing ActionContext
* when finished.
*/
public static String callInContext(ActionInvocation invocation, Callable<String> callable)
throws Exception {
RequestContextImpl[] reference = (RequestContextImpl[])threadLocalRequestContext.get();
if (reference[0] == null) {
// Initial invocation.
reference[0] = new RequestContextImpl(invocation.getInvocationContext());
reference[0].setActionContext(new ActionContextImpl(invocation));
try {
return callable.call();
} finally {
reference[0] = null;
}
} else {
// Nested invocation.
RequestContextImpl requestContext = reference[0];
ActionContext previous = requestContext.getActionContext();
requestContext.setActionContext(new ActionContextImpl(invocation));
try {
return callable.call();
} finally {
requestContext.setActionContext(previous);
}
}
}
public static RequestContextImpl get() {
RequestContextImpl requestContext = ((RequestContextImpl[])threadLocalRequestContext.get())[0];
if (requestContext == null)
throw new IllegalStateException("RequestContext has not been created.");
return requestContext;
}
}
@@ -22,12 +22,11 @@
package org.apache.struts2.impl;
import java.util.Map;
import java.util.concurrent.Callable;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.DefaultActionProxy;
import java.util.Map;
public class StrutsActionProxy extends DefaultActionProxy {
private static final long serialVersionUID = -2434901249671934080L;
@@ -41,11 +40,14 @@ public class StrutsActionProxy extends DefaultActionProxy {
ActionContext previous = ActionContext.getContext();
ActionContext.setContext(invocation.getInvocationContext());
try {
return RequestContextImpl.callInContext(invocation, new Callable<String>() {
public String call() throws Exception {
return invocation.invoke();
}
});
// This is for the new API:
// return RequestContextImpl.callInContext(invocation, new Callable<String>() {
// public String call() throws Exception {
// return invocation.invoke();
// }
// });
return invocation.invoke();
} finally {
if (cleanupContext)
ActionContext.setContext(previous);
@@ -22,9 +22,6 @@
package org.apache.struts2.impl;
import java.util.HashMap;
import java.util.Map;
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.Result;
import com.opensymphony.xwork2.config.ConfigurationException;
@@ -33,6 +30,9 @@ import com.opensymphony.xwork2.config.entities.ResultConfig;
import com.opensymphony.xwork2.interceptor.Interceptor;
import com.opensymphony.xwork2.util.OgnlUtil;
import java.util.HashMap;
import java.util.Map;
public class StrutsObjectFactory extends ObjectFactory {
public Interceptor buildInterceptor(InterceptorConfig interceptorConfig, Map refParams)
@@ -59,8 +59,9 @@ public class StrutsObjectFactory extends ObjectFactory {
return interceptor;
}
if (o instanceof org.apache.struts2.spi.Interceptor)
return new InterceptorAdapter((org.apache.struts2.spi.Interceptor) o);
// This is for the new API:
// if (o instanceof org.apache.struts2.spi.Interceptor)
// return new InterceptorAdapter((org.apache.struts2.spi.Interceptor) o);
throw new ConfigurationException(
"Class [" + className + "] does not implement Interceptor", interceptorConfig);
@@ -96,8 +97,9 @@ public class StrutsObjectFactory extends ObjectFactory {
if (result instanceof Result)
return (Result) result;
if (result instanceof org.apache.struts2.spi.Result)
return new ResultAdapter((org.apache.struts2.spi.Result) result);
// This is for the new API:
// if (result instanceof org.apache.struts2.spi.Result)
// return new ResultAdapter((org.apache.struts2.spi.Result) result);
throw new ConfigurationException(result.getClass().getName() + " does not implement Result.");
}
@@ -1,78 +0,0 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// Copyright 2006 Google Inc. All Rights Reserved.
package org.apache.struts2.impl;
import java.util.Iterator;
import org.apache.struts2.spi.ValueStack;
import com.opensymphony.xwork2.util.ValueStackFactory;
public class ValueStackAdapter implements ValueStack {
final com.opensymphony.xwork2.util.ValueStack delegate;
public ValueStackAdapter(com.opensymphony.xwork2.util.ValueStack delegate) {
this.delegate = delegate;
}
public Object peek() {
return delegate.peek();
}
public Object pop() {
return delegate.pop();
}
public void push(Object o) {
delegate.push(o);
}
public ValueStack clone() {
return new ValueStackAdapter(ValueStackFactory.getFactory().createValueStack(delegate));
}
public Object get(String expr) {
return delegate.findValue(expr);
}
public <T> T get(String expr, Class<T> requiredType) {
return (T) delegate.findValue(expr, requiredType);
}
public String getString(String expr) {
return delegate.findString(expr);
}
public void set(String expr, Object o) {
delegate.set(expr, o);
}
public int size() {
return delegate.size();
}
public Iterator<Object> iterator() {
return delegate.getRoot().iterator();
}
}
@@ -193,12 +193,23 @@ public class ExecuteAndWaitInterceptor extends MethodFilterInterceptor {
return new BackgroundProcess(name + "BackgroundThread", actionInvocation, threadPriority);
}
/**
* Returns the name to associate the background process. Override to change the way background processes
* are mapped to requests.
*
* @param actionInvocation The action invocation
* @return the name of the background thread
*/
protected String getBackgroundProcessName(ActionProxy proxy) {
return proxy.getActionName();
}
/* (non-Javadoc)
* @see com.opensymphony.xwork2.interceptor.MethodFilterInterceptor#doIntercept(com.opensymphony.xwork2.ActionInvocation)
*/
protected String doIntercept(ActionInvocation actionInvocation) throws Exception {
ActionProxy proxy = actionInvocation.getProxy();
String name = proxy.getActionName();
String name = getBackgroundProcessName(proxy);
ActionContext context = actionInvocation.getInvocationContext();
Map session = context.getSession();
@@ -25,21 +25,10 @@ import java.security.Principal;
import javax.servlet.http.HttpServletRequest;
/**
* Proxy class used together with PrincipalAware interface. It allows to get indirect access to
* HttpServletRequest Principal related methods.
*
* Proxy interface used together with PrincipalAware interface. It allows to get indirect access to
* HttpServletRequest or PortletRequest Principal related methods.
*/
public class PrincipalProxy {
private HttpServletRequest request;
/**
* Constructs a proxy
*
* @param request The underlying request
*/
public PrincipalProxy(HttpServletRequest request) {
this.request = request;
}
public interface PrincipalProxy {
/**
* True if the user is in the given role
@@ -47,43 +36,35 @@ public class PrincipalProxy {
* @param role The role
* @return True if the user is in that role
*/
public boolean isUserInRole(String role) {
return request.isUserInRole(role);
}
boolean isUserInRole(String role);
/**
* Gets the user principal
*
* @return The principal
*/
public Principal getUserPrincipal() {
return request.getUserPrincipal();
}
Principal getUserPrincipal();
/**
* Gets the user id
*
* @return The user id
*/
public String getRemoteUser() {
return request.getRemoteUser();
}
String getRemoteUser();
/**
* Is the request using https?
*
* @return True if using https
*/
public boolean isRequestSecure() {
return request.isSecure();
}
boolean isRequestSecure();
/**
* Gets the request
* Gets the request.
*
* @return The request
* @deprecated To obtain the HttpServletRequest in your action, use
* {@link org.apache.struts2.servlet.ServletRequestAware}, since this method will be dropped in future.
*/
public HttpServletRequest getRequest() {
return request;
}
HttpServletRequest getRequest();
}
@@ -25,8 +25,12 @@ import java.util.Map;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.portlet.PortletRequest;
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.servlet.interceptor.ServletPrincipalProxy;
import org.apache.struts2.portlet.PortletActionConstants;
import org.apache.struts2.portlet.interceptor.PortletPrincipalProxy;
import org.apache.struts2.util.ServletContextAware;
import com.opensymphony.xwork2.ActionContext;
@@ -150,7 +154,14 @@ public class ServletConfigInterceptor extends AbstractInterceptor implements Str
if (action instanceof PrincipalAware) {
HttpServletRequest request = (HttpServletRequest) context.get(HTTP_REQUEST);
((PrincipalAware) action).setPrincipalProxy(new PrincipalProxy(request));
Object portletRequest = context.get(PortletActionConstants.REQUEST);
if (portletRequest != null) {
// We are in portlet environment, so principal information resides in PortletRequest
((PrincipalAware) action).setPrincipalProxy(new PortletPrincipalProxy((PortletRequest) portletRequest));
} else {
// We are in servtlet environment, so principal information resides in HttpServletRequest
((PrincipalAware) action).setPrincipalProxy(new ServletPrincipalProxy(request));
}
}
if (action instanceof ServletContextAware) {
ServletContext servletContext = (ServletContext) context.get(SERVLET_CONTEXT);
@@ -0,0 +1,68 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.interceptor.validation;
import java.lang.reflect.Method;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.validator.ValidationInterceptor;
/**
* Extends the xwork validation interceptor to also check for a @SkipValidation
* annotation, and if found, don't validate this action method
*/
public class AnnotationValidationInterceptor extends ValidationInterceptor {
/** Auto-generated serialization id */
private static final long serialVersionUID = 1813272797367431184L;
protected String doIntercept(ActionInvocation invocation) throws Exception {
Object action = invocation.getAction();
if (action != null) {
Method method = getActionMethod(action.getClass(), invocation.getProxy().getMethod());
SkipValidation skip = (SkipValidation) method.getAnnotation(SkipValidation.class);
if (skip != null) {
return invocation.invoke();
}
}
return super.doIntercept(invocation);
}
// FIXME: This is copied from DefaultActionInvocation but should be exposed through the interface
protected Method getActionMethod(Class actionClass, String methodName) throws NoSuchMethodException {
Method method;
try {
method = actionClass.getMethod(methodName, new Class[0]);
} catch (NoSuchMethodException e) {
// hmm -- OK, try doXxx instead
try {
String altMethodName = "do" + methodName.substring(0, 1).toUpperCase() + methodName.substring(1);
method = actionClass.getMethod(altMethodName, new Class[0]);
} catch (NoSuchMethodException e1) {
// throw the original one
throw e;
}
}
return method;
}
}
@@ -18,23 +18,21 @@
* specific language governing permissions and limitations
* under the License.
*/
// Copyright 2006 Google Inc. All Rights Reserved.
package org.apache.struts2.interceptor.validation;
package org.apache.struts2.impl;
import static java.lang.annotation.ElementType.METHOD;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.Result;
import com.opensymphony.xwork2.Action;
public class ResultAdapter implements Result {
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
private static final long serialVersionUID = -5107033078266553554L;
final org.apache.struts2.spi.Result delegate;
public ResultAdapter(org.apache.struts2.spi.Result delegate) {
this.delegate = delegate;
}
public void execute(ActionInvocation invocation) throws Exception {
delegate.execute(RequestContextImpl.get());
}
/**
* Marks an Action method to not be validated
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(METHOD)
public @interface SkipValidation {
}
@@ -40,11 +40,13 @@ import javax.portlet.RenderResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.StrutsException;
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.dispatcher.ApplicationMap;
import org.apache.struts2.dispatcher.Dispatcher;
import org.apache.struts2.dispatcher.RequestMap;
import org.apache.struts2.dispatcher.SessionMap;
import org.apache.struts2.dispatcher.mapper.ActionMapper;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import org.apache.struts2.portlet.PortletActionConstants;
import org.apache.struts2.portlet.PortletApplicationMap;
@@ -52,6 +54,7 @@ import org.apache.struts2.portlet.PortletRequestMap;
import org.apache.struts2.portlet.PortletSessionMap;
import org.apache.struts2.portlet.context.PortletActionContext;
import org.apache.struts2.portlet.context.ServletContextHolderListener;
import org.apache.struts2.portlet.util.HttpServletRequestMock;
import org.apache.struts2.util.AttributeMap;
import com.opensymphony.xwork2.util.FileManager;
@@ -168,6 +171,8 @@ public class Jsr168Dispatcher extends GenericPortlet implements StrutsStatics,
private String portletNamespace = null;
private Dispatcher dispatcherUtils;
private ActionMapper actionMapper;
/**
* Initialize the portlet with the init parameters from <tt>portlet.xml</tt>
@@ -220,6 +225,8 @@ public class Jsr168Dispatcher extends GenericPortlet implements StrutsStatics,
if ("true".equalsIgnoreCase(container.getInstance(String.class, StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD))) {
FileManager.setReloadingConfigs(true);
}
actionMapper = container.getInstance(ActionMapper.class);
}
/**
@@ -246,10 +253,12 @@ public class Jsr168Dispatcher extends GenericPortlet implements StrutsStatics,
}
StringBuffer fullPath = new StringBuffer();
if (TextUtils.stringSet(portletNamespace)) {
fullPath.append(portletNamespace + "/");
fullPath.append(portletNamespace);
}
if (TextUtils.stringSet(namespace)) {
fullPath.append(namespace + "/");
fullPath.append(namespace).append("/");
} else {
fullPath.append("/");
}
fullPath.append(defaultAction);
ActionMapping mapping = new ActionMapping();
@@ -399,6 +408,7 @@ public class Jsr168Dispatcher extends GenericPortlet implements StrutsStatics,
+ ", namespace = " + namespace);
ActionProxy proxy = factory.createActionProxy(namespace,
actionName, extraContext);
proxy.setMethod(mapping.getMethod());
request.setAttribute("struts.valueStack", proxy.getInvocation()
.getStack());
if (PortletActionConstants.RENDER_PHASE.equals(phase)
@@ -453,27 +463,32 @@ public class Jsr168Dispatcher extends GenericPortlet implements StrutsStatics,
* @param request the PortletRequest object.
* @return the namespace of the action.
*/
protected ActionMapping getActionMapping(PortletRequest request) {
ActionMapping mapping = new ActionMapping();
protected ActionMapping getActionMapping(final PortletRequest request) {
ActionMapping mapping = null;
String actionPath = null;
if (resetAction(request)) {
mapping = (ActionMapping) actionMap.get(request.getPortletMode());
} else {
String actionPath = request.getParameter(ACTION_PARAM);
actionPath = request.getParameter(ACTION_PARAM);
if (!TextUtils.stringSet(actionPath)) {
mapping = (ActionMapping) actionMap.get(request
.getPortletMode());
} else {
String namespace = "";
String action = actionPath;
int idx = actionPath.lastIndexOf('/');
if (idx >= 0) {
namespace = actionPath.substring(0, idx);
action = actionPath.substring(idx + 1);
}
mapping.setName(action);
mapping.setNamespace(namespace);
// Use the usual action mapper, but it is expecting an action extension
// on the uri, so we add the default one, which should be ok as the
// portlet is a portlet first, a servlet second
HttpServletRequestMock httpRequest = new HttpServletRequestMock()
.setServletPath(actionPath + ".action")
.setParameterMap(request.getParameterMap());
mapping = actionMapper.getMapping(httpRequest, dispatcherUtils.getConfigurationManager());
}
}
if (mapping == null) {
throw new StrutsException("Unable to locate action mapping for request, probably due to " +
"an invalid action path: "+actionPath);
}
return mapping;
}
@@ -579,4 +594,12 @@ public class Jsr168Dispatcher extends GenericPortlet implements StrutsStatics,
dispatcherUtils.cleanup();
}
}
/**
* @param actionMapper the actionMapper to set
*/
public void setActionMapper(ActionMapper actionMapper) {
this.actionMapper = actionMapper;
}
}
@@ -1,5 +1,5 @@
/*
* $Id: URL.java 474191 2006-11-13 08:30:40Z mrdon $
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -18,15 +18,22 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.continuations;
package org.apache.struts2.portlet.interceptor;
import javax.portlet.PortletPreferences;
import com.uwyn.rife.continuations.ContinuableObject;
/**
* Implementing this interface indicates that the action should not be cloned, but instead should be re-used. This is
* needed when you are using objects, fields, and method variables that cannot be cloned. The downside to using this is
* that the advanced forward/backward historical support that normally automatically comes with continuations is no
* longer available.
* All Actions that want to have access to the portlet preferences should
* implement this interface. If running in a servlet environment, an
* appropriate testing implementation will be provided.
*/
public interface NonCloningContinuableObject extends ContinuableObject {
public interface PortletPreferencesAware {
/**
* Sets the HTTP request object in implementing classes.
*
* @param request the HTTP request.
*/
public void setPortletPreferences(PortletPreferences prefs);
}
@@ -0,0 +1,104 @@
/*
* $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.interceptor;
import javax.portlet.PortletRequest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.portlet.context.PortletActionContext;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
/**
* <!-- START SNIPPET: description -->
*
* An interceptor which provides an implementation of PortletPreferences if the Action implements
* PortletPreferencesAware.
*
* If running in a servlet environment, a testing implementation of PortletPreferences will be
* created and provided, but it should not be used in a production environment.
*
* <!-- END SNIPPET: description -->
*
* <p/> <u>Interceptor parameters:</u>
*
* <!-- START SNIPPET: parameters -->
*
* <ul>
*
* <li>None</li>
*
* </ul>
*
* <!-- END SNIPPET: parameters -->
*
* <p/> <u>Extending the interceptor:</u>
*
* <p/>
*
* <!-- START SNIPPET: extending -->
*
* There are no known extension points for this interceptor.
*
* <!-- END SNIPPET: extending -->
*
* <p/> <u>Example code:</u>
*
* <pre>
* <!-- START SNIPPET: example -->
* &lt;action name="someAction" class="com.examples.SomeAction"&gt;
* &lt;interceptor-ref name="portlet-preferences"/&gt;
* &lt;interceptor-ref name="basicStack"/&gt;
* &lt;result name="success"&gt;good_result.ftl&lt;/result&gt;
* &lt;/action&gt;
* <!-- END SNIPPET: example -->
* </pre>
*
* @see PortletPreferencesAware
*/
public class PortletPreferencesInterceptor extends AbstractInterceptor implements StrutsStatics {
private static final Log LOG = LogFactory.getLog(PortletPreferencesInterceptor.class);
public String intercept(ActionInvocation invocation) throws Exception {
final Object action = invocation.getAction();
final ActionContext context = invocation.getInvocationContext();
if (action instanceof PortletPreferencesAware) {
PortletRequest request = PortletActionContext.getRequest();
PortletPreferencesAware awareAction = (PortletPreferencesAware) action;
// Check if running in a servlet environment
if (request == null) {
LOG.warn("This portlet preferences implementation should only be used during development");
awareAction.setPortletPreferences(new ServletPortletPreferences(ActionContext.getContext().getSession()));
} else {
awareAction.setPortletPreferences(request.getPreferences());
}
}
return invocation.invoke();
}
}
@@ -0,0 +1,73 @@
package org.apache.struts2.portlet.interceptor;
import org.apache.struts2.interceptor.PrincipalProxy;
import javax.portlet.PortletRequest;
import javax.servlet.http.HttpServletRequest;
import java.security.Principal;
/**
* PrincipalProxy implementation for using PortletRequest Principal related methods.
*/
public class PortletPrincipalProxy implements PrincipalProxy {
private PortletRequest request;
/**
* Constructs a proxy
*
* @param request The underlying request
*/
public PortletPrincipalProxy(PortletRequest request) {
this.request = request;
}
/**
* True if the user is in the given role
*
* @param role The role
* @return True if the user is in that role
*/
public boolean isUserInRole(String role) {
return request.isUserInRole(role);
}
/**
* Gets the user principal
*
* @return The principal
*/
public Principal getUserPrincipal() {
return request.getUserPrincipal();
}
/**
* Gets the user id
*
* @return The user id
*/
public String getRemoteUser() {
return request.getRemoteUser();
}
/**
* Is the request using https?
*
* @return True if using https
*/
public boolean isRequestSecure() {
return request.isSecure();
}
/**
* Gets the request.
*
* @return The request
* @throws UnsupportedOperationException not supported in this implementation.
* @deprecated To obtain the HttpServletRequest in your action, use
* {@link org.apache.struts2.servlet.ServletRequestAware}, since this method will be dropped in future.
*/
public HttpServletRequest getRequest() {
throw new UnsupportedOperationException("Usage of getRequest() method is deprecadet and not supported for this implementation");
}
}
@@ -0,0 +1,95 @@
/*
* $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.interceptor;
import java.io.IOException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Vector;
import javax.portlet.PortletPreferences;
import javax.portlet.ReadOnlyException;
import javax.portlet.ValidatorException;
/**
* Simple portlet preferences implementation that uses a map in the Session
* as storage.
*/
public class ServletPortletPreferences implements PortletPreferences {
private Map session;
private String PREFERENCES_KEY = "_portlet-preferences";
public ServletPortletPreferences(Map session) {
this.session = session;
}
public Map getMap() {
Map map = (Map) session.get(PREFERENCES_KEY);
if (map == null) {
map = new HashMap();
session.put(PREFERENCES_KEY, map);
}
return map;
}
public Enumeration getNames() {
return new Vector(getMap().keySet()).elements();
}
public String getValue(String key, String def) {
String val = (String) getMap().get(key);
if (val == null) {
val = def;
}
return val;
}
public String[] getValues(String key, String[] def) {
String[] val = (String[]) getMap().get(key);
if (val == null) {
val = def;
}
return val;
}
public boolean isReadOnly(String arg0) {
return false;
}
public void reset(String arg0) throws ReadOnlyException {
session.put(PREFERENCES_KEY, new HashMap());
}
public void setValue(String key, String value) throws ReadOnlyException {
getMap().put(key, value);
}
public void setValues(String key, String[] value) throws ReadOnlyException {
getMap().put(key, value);
}
public void store() throws IOException, ValidatorException {
}
}
@@ -0,0 +1,278 @@
/*
* $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.util;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.Principal;
import java.util.Enumeration;
import java.util.Locale;
import java.util.Map;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletInputStream;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
/**
* A simple mock class to interact with Struts 2 API's that require a servlet request
*/
public class HttpServletRequestMock implements HttpServletRequest {
private String servletPath;
private Map parameterMap;
public String getAuthType() {
return null;
}
public String getContextPath() {
return null;
}
public Cookie[] getCookies() {
return null;
}
public long getDateHeader(String arg0) {
return 0;
}
public String getHeader(String arg0) {
return null;
}
public Enumeration getHeaderNames() {
return null;
}
public Enumeration getHeaders(String arg0) {
return null;
}
public int getIntHeader(String arg0) {
return 0;
}
public String getMethod() {
return null;
}
public String getPathInfo() {
return null;
}
public String getPathTranslated() {
return null;
}
public String getQueryString() {
return null;
}
public String getRemoteUser() {
return null;
}
public String getRequestURI() {
return null;
}
public StringBuffer getRequestURL() {
return null;
}
public String getRequestedSessionId() {
return null;
}
public String getServletPath() {
return servletPath;
}
public HttpSession getSession() {
return null;
}
public HttpSession getSession(boolean arg0) {
return null;
}
public Principal getUserPrincipal() {
return null;
}
public boolean isRequestedSessionIdFromCookie() {
return false;
}
public boolean isRequestedSessionIdFromURL() {
return false;
}
public boolean isRequestedSessionIdFromUrl() {
return false;
}
public boolean isRequestedSessionIdValid() {
return false;
}
public boolean isUserInRole(String arg0) {
return false;
}
public Object getAttribute(String arg0) {
return null;
}
public Enumeration getAttributeNames() {
return null;
}
public String getCharacterEncoding() {
return null;
}
public int getContentLength() {
return 0;
}
public String getContentType() {
return null;
}
public ServletInputStream getInputStream() throws IOException {
return null;
}
public String getLocalAddr() {
return null;
}
public String getLocalName() {
return null;
}
public int getLocalPort() {
return 0;
}
public Locale getLocale() {
return null;
}
public Enumeration getLocales() {
return null;
}
public String getParameter(String arg0) {
return null;
}
public Map getParameterMap() {
return parameterMap;
}
public Enumeration getParameterNames() {
return null;
}
public String[] getParameterValues(String arg0) {
return null;
}
public String getProtocol() {
return null;
}
public BufferedReader getReader() throws IOException {
return null;
}
public String getRealPath(String arg0) {
return null;
}
public String getRemoteAddr() {
return null;
}
public String getRemoteHost() {
return null;
}
public int getRemotePort() {
return 0;
}
public RequestDispatcher getRequestDispatcher(String arg0) {
return null;
}
public String getScheme() {
return null;
}
public String getServerName() {
return null;
}
public int getServerPort() {
return 0;
}
public boolean isSecure() {
return false;
}
public void removeAttribute(String arg0) {
}
public void setAttribute(String arg0, Object arg1) {
}
public void setCharacterEncoding(String arg0)
throws UnsupportedEncodingException {
}
/**
* @param parameterMap the parameterMap to set
*/
public HttpServletRequestMock setParameterMap(Map parameterMap) {
this.parameterMap = parameterMap;
return this;
}
/**
* @param servletPath the servletPath to set
*/
public HttpServletRequestMock setServletPath(String servletPath) {
this.servletPath = servletPath;
return this;
}
}
@@ -0,0 +1,70 @@
package org.apache.struts2.servlet.interceptor;
import org.apache.struts2.interceptor.PrincipalProxy;
import javax.servlet.http.HttpServletRequest;
import java.security.Principal;
/**
* PrincipalProxy implementation for using HttpServletRequest Principal related methods.
*/
public class ServletPrincipalProxy implements PrincipalProxy {
private HttpServletRequest request;
/**
* Constructs a proxy
*
* @param request The underlying request
*/
public ServletPrincipalProxy(HttpServletRequest request) {
this.request = request;
}
/**
* True if the user is in the given role
*
* @param role The role
* @return True if the user is in that role
*/
public boolean isUserInRole(String role) {
return request.isUserInRole(role);
}
/**
* Gets the user principal
*
* @return The principal
*/
public Principal getUserPrincipal() {
return request.getUserPrincipal();
}
/**
* Gets the user id
*
* @return The user id
*/
public String getRemoteUser() {
return request.getRemoteUser();
}
/**
* Is the request using https?
*
* @return True if using https
*/
public boolean isRequestSecure() {
return request.isSecure();
}
/**
* Gets the request.
*
* @return The request
* @deprecated To obtain the HttpServletRequest in your action, use
* {@link org.apache.struts2.servlet.ServletRequestAware}, since this method will be dropped in future.
*/
public HttpServletRequest getRequest() {
return request;
}
}
@@ -1,5 +1,5 @@
/*
* $Id: StrutsTestCase.java 476696 2006-11-19 03:56:18Z tmjee $
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -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.views;
import java.util.Arrays;
@@ -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.views;
import java.util.List;
@@ -1,5 +1,5 @@
/*
* $Id: $
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -1,5 +1,5 @@
/*
* $Id: $
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -1,5 +1,5 @@
/*
* $Id: ComboBoxModel.java 471756 2006-11-06 15:01:43Z husted $
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -242,7 +242,7 @@ public class StrutsModels {
return date;
}
public DateTimePickerModel getDropdownDateTimePicker() {
public DateTimePickerModel getDateTimePicker() {
if (dateTimePicker == null) {
dateTimePicker = new DateTimePickerModel(stack, req, res);
}
@@ -68,7 +68,7 @@ public abstract class TagModel implements TemplateTransformModel {
protected abstract Component getBean();
private Map convertParams(Map params) {
protected Map convertParams(Map params) {
HashMap map = new HashMap(params.size());
for (Iterator iterator = params.entrySet().iterator(); iterator.hasNext();) {
Map.Entry entry = (Map.Entry) iterator.next();
@@ -80,7 +80,7 @@ public abstract class TagModel implements TemplateTransformModel {
return map;
}
private Map getComplexParams(Map params) {
protected Map getComplexParams(Map params) {
HashMap map = new HashMap(params.size());
for (Iterator iterator = params.entrySet().iterator(); iterator.hasNext();) {
Map.Entry entry = (Map.Entry) iterator.next();
@@ -102,7 +102,7 @@ public abstract class TagModel implements TemplateTransformModel {
return map;
}
private boolean complexType(Object value) {
protected boolean complexType(Object value) {
return value instanceof freemarker.ext.beans.BeanModel
|| value instanceof SimpleNumber
|| value instanceof SimpleSequence;

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