Compare commits

...

108 Commits

Author SHA1 Message Date
Donald J. Brown 2a4ea6dce4 retagging 2.0.1
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_1@462597 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 22:03:04 +00:00
Ted Nathan Husted b0413aa7d4 Tag r462587 as Struts 2.0.1 (again)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_1@462588 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 21:40:12 +00:00
Donald J. Brown cbfd45460c Reverted setters to not return self, ognl won't recognize them
WW-1463


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@462586 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 21:35:35 +00:00
Ted Nathan Husted f747b13cfc Tag r462570 as Struts 2.0.1
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_1@462573 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 21:18:47 +00:00
Ted Nathan Husted a5f0d67553 WW-1453 Update POMs so as to tag 2.0.1.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@462570 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 21:16:01 +00:00
James Mitchell d3ce53b64f WW-1453 align the showcase web.xml with servlet 2.4
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@462568 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 21:12:33 +00:00
Ted Nathan Husted e49bcb5115 WW-1453 Struts-Blank: Update localization.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@462563 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 21:01:50 +00:00
Ted Nathan Husted 2c907e7211 WW-1453 Struts-MailReader - Update to DAO GA.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@462536 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 20:00:35 +00:00
Ted Nathan Husted d0c4f04779 WW-1453 Struts-Blank: Add build.bat
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@462534 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 19:55:56 +00:00
Donald J. Brown 907a22c610 Added context destroyed for servlet context holder
WW-1466


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@462530 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 19:48:19 +00:00
Donald J. Brown 94ef6de048 Fixed config to extend Struts test case
WW-1453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@462526 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 19:43:59 +00:00
Donald J. Brown 82487cbff9 Added proper struts config files
WW-1453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@462522 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 19:42:16 +00:00
Donald J. Brown 1239fd8605 Nuking unused readme
WW-1453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@462514 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 19:30:50 +00:00
Donald J. Brown 0551c2f16e Took out include of struts-default config file
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454857 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 18:14:29 +00:00
Donald J. Brown 4a7c9de9d5 Fixed loading of config files
WW-1453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454856 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 18:06:01 +00:00
Ted Nathan Husted 174191c5c0 WW-1453 Struts-Blank: Add localization and build.bat file.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454751 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 14:34:58 +00:00
Toby Jee 8fa51a5cae WW-727
- added profiling to FreeMarkerPageFilter



git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454721 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 12:33:25 +00:00
Toby Jee 91b7b0fcdf WW-727
- added profiling to FilterDispatcher and ActionContextCleanUp
  



git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454720 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 12:31:52 +00:00
Ted Nathan Husted 38807e735e WW-1453 Struts-Blank: Add localization.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454651 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 07:13:11 +00:00
Ted Nathan Husted a3ba834c2e WW-1453 Struts-Blank: Add missing Register.jsp. Dispatcher: Move default file list to default.properties.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454642 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 06:52:49 +00:00
James Mitchell 98deff1591 WW-1453
- fixing mailreader to correctly load the database.xml file from WEB-INF
 - fix the pom.xml to correctly use src/main/java as the resource path for *.xml and *.properties




git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454616 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 04:58:51 +00:00
Donald J. Brown c3e16315e8 Fixed problem report when column number < 3
WW-1453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454614 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 04:39:48 +00:00
Wendy Smoak 53e64b8115 Include files in src/main/resources in the webapp.
WW-1453

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454611 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 04:29:33 +00:00
Ted Nathan Husted 7e4da1fabd WW-1489 POM updates.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454597 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 03:50:09 +00:00
James Mitchell e39baa8282 WW-1453
Simple cleanup items
  - remove unused variables
  - change static access to static call



git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454571 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 00:22:09 +00:00
James Mitchell 0ea3fc17c7 WW-1453
Simple cleanup items
  - remove duplicate and/or unused imports
  - change static access to class, not instance





git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454565 13f79535-47bb-0310-9956-ffa450edef68
2006-10-10 00:02:56 +00:00
James Mitchell 13955f5329 WW-1453
- Remove (per Don) the portlet plugin attempt
 - Add the correct modules to build the -all- jar





git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454518 13f79535-47bb-0310-9956-ffa450edef68
2006-10-09 21:22:56 +00:00
Donald J. Brown 5f00880992 Slightly optimize servlet request wrapper
WW-1453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454501 13f79535-47bb-0310-9956-ffa450edef68
2006-10-09 20:49:26 +00:00
Donald J. Brown 7ef2355aa1 Adding missing tiles config file
WW-1464


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454473 13f79535-47bb-0310-9956-ffa450edef68
2006-10-09 19:50:21 +00:00
Donald J. Brown f925e95f05 Adding more friendly result constructors and setters, changed
xwork dep to beta 1
WW-1463 WW-1453



git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454455 13f79535-47bb-0310-9956-ffa450edef68
2006-10-09 18:49:38 +00:00
Wendy Smoak 6e730e7ca1 Set the snapshot repository URL. This can be removed once struts-master v4 is released.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454447 13f79535-47bb-0310-9956-ffa450edef68
2006-10-09 18:12:06 +00:00
Donald J. Brown d69b1eaf65 Fixing jfreechart api link
WW-1453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454290 13f79535-47bb-0310-9956-ffa450edef68
2006-10-09 05:35:57 +00:00
Donald J. Brown 656c9b20ae Screw it, going back to a simple, single-module website
WW-1453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454282 13f79535-47bb-0310-9956-ffa450edef68
2006-10-09 04:34:00 +00:00
Ted Nathan Husted e3b622845d WW-1462 Break out toolbox into QuickStart and SiteGraph plugins.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454265 13f79535-47bb-0310-9956-ffa450edef68
2006-10-09 03:19:57 +00:00
Donald J. Brown e26e6fc92e Further tweak the api
WW-1462


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454259 13f79535-47bb-0310-9956-ffa450edef68
2006-10-09 02:56:33 +00:00
Donald J. Brown 1099cc48b7 Tweaked poms
WW-1462


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454257 13f79535-47bb-0310-9956-ffa450edef68
2006-10-09 02:50:35 +00:00
Donald J. Brown 7337cb598d Change the website to use artifact ids (required for proper site
inheritance)
WW-1453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454256 13f79535-47bb-0310-9956-ffa450edef68
2006-10-09 02:47:14 +00:00
Ted Nathan Husted 25d413a3f8 WW-1462 Break out toolbox into QuickStart and SiteGraph plugins.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454251 13f79535-47bb-0310-9956-ffa450edef68
2006-10-09 02:10:57 +00:00
Ted Nathan Husted 0d8693bb05 WW-1462 Break out toolbox into QuickStart and SiteGraph plugins.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454250 13f79535-47bb-0310-9956-ffa450edef68
2006-10-09 02:08:06 +00:00
Donald J. Brown fc529db4d9 Working on the public struts 2 site
WW-1453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454246 13f79535-47bb-0310-9956-ffa450edef68
2006-10-09 00:40:14 +00:00
Ted Nathan Husted c3d819d372 Remove obsolete references to extras and uber directories.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454244 13f79535-47bb-0310-9956-ffa450edef68
2006-10-09 00:22:54 +00:00
Toby Jee eca7d9eba2 WW-1453
- add example5 link



git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454146 13f79535-47bb-0310-9956-ffa450edef68
2006-10-08 14:08:26 +00:00
Toby Jee 67527d61d8 WW-1453
- added an ajax validation example using tabpanel
 - its basically a tabbedpanel having in it a remote (ajax) form that does ajax-style validation as there's a question being posted in the forum related to this.



git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@454144 13f79535-47bb-0310-9956-ffa450edef68
2006-10-08 13:59:49 +00:00
Donald J. Brown 56ae735b31 Added toolbox to default profile
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@453803 13f79535-47bb-0310-9956-ffa450edef68
2006-10-06 23:07:34 +00:00
Ted Nathan Husted 10a7f74f78 WW-1453 Remove some residual references to the extras module.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@453795 13f79535-47bb-0310-9956-ffa450edef68
2006-10-06 22:29:41 +00:00
Donald J. Brown 108321f869 Creating new 'toolbox' project for client tools
WW-1462


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@452920 13f79535-47bb-0310-9956-ffa450edef68
2006-10-04 15:55:08 +00:00
Donald J. Brown 4f148cb793 Renaming from uber to all
WW-1453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@452735 13f79535-47bb-0310-9956-ffa450edef68
2006-10-04 05:09:58 +00:00
Donald J. Brown 5b168b43b5 Renamed uber to all, created 'all' profile with all optional modules
WW-1453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@452722 13f79535-47bb-0310-9956-ffa450edef68
2006-10-04 04:29:18 +00:00
Donald J. Brown 30ce87e5bd Fixing struts all jar (might not be the proper "Maven" way, but it works)
WW-1453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@452721 13f79535-47bb-0310-9956-ffa450edef68
2006-10-04 04:24:14 +00:00
Donald J. Brown c56df08c13 Removing unused ant build
WW-1453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@452708 13f79535-47bb-0310-9956-ffa450edef68
2006-10-04 03:18:13 +00:00
Donald J. Brown 0955d27477 Minor cleanups for problem report and debugging handler
WW-1453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@452707 13f79535-47bb-0310-9956-ffa450edef68
2006-10-04 03:15:14 +00:00
Toby Jee 1398d651fd WW-420
- fix failing test cases due to undefined result and result not found following changes made to WW-420
  - test should now run ok

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451943 13f79535-47bb-0310-9956-ffa450edef68
2006-10-02 10:10:07 +00:00
Donald J. Brown 64c8865f68 Better handle when no result, probably due to an error
WW-1453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451869 13f79535-47bb-0310-9956-ffa450edef68
2006-10-02 03:54:36 +00:00
Donald J. Brown 0cb2cf9996 Minor error message change for XW-420, minor formatting on error report
WW-1453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451867 13f79535-47bb-0310-9956-ffa450edef68
2006-10-02 03:53:59 +00:00
Toby Jee e0e6d1804a WW-1457
- when introducing plugin, extra is being break into jasperreports and jfreechart plugins, but their package name remain the same "extra-default" causing problem with both jars are in the classpath



git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451759 13f79535-47bb-0310-9956-ffa450edef68
2006-10-01 15:26:22 +00:00
Donald J. Brown ee478f28c2 Added a view source capability to the showcase
WW-1461


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451738 13f79535-47bb-0310-9956-ffa450edef68
2006-10-01 11:02:46 +00:00
Donald J. Brown 6b393a1b26 Turning off xml output when viewing debug console, exposing result
location information, storing action mapping in context for later
retrieval
WW-1459


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451737 13f79535-47bb-0310-9956-ffa450edef68
2006-10-01 11:00:04 +00:00
Toby Jee f7f738ecbe WW-1453
- removed duplicated import statement



git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451724 13f79535-47bb-0310-9956-ffa450edef68
2006-10-01 08:39:39 +00:00
Donald J. Brown 92547b6b71 Fixed execute and wait interceptor to not _require_ validation to work
WW-1453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451709 13f79535-47bb-0310-9956-ffa450edef68
2006-10-01 01:52:25 +00:00
Donald J. Brown 968f56b4f4 Adding activation interceptor, and added profiling hook in dispatcher
WW-1460


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451703 13f79535-47bb-0310-9956-ffa450edef68
2006-10-01 00:48:24 +00:00
Donald J. Brown 7eaa07887c Upgraded jetty plugin, fixed jsf support
WW-1453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451696 13f79535-47bb-0310-9956-ffa450edef68
2006-09-30 23:26:04 +00:00
Toby Jee 12cb68ffbd WW-1453
- added example into show case demonstrating :-
    - populating a List of Pojos in action class
    - populating a Set of Pojos in action class
    - populating a List of Tiger 5 Enum in action class




git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451619 13f79535-47bb-0310-9956-ffa450edef68
2006-09-30 17:19:37 +00:00
Donald J. Brown 6bde06ae55 Changed to use XWork ValueStack interface and factory
WW-1459


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451544 13f79535-47bb-0310-9956-ffa450edef68
2006-09-30 05:38:02 +00:00
Donald J. Brown 97a97832c7 Adding tiles plugin
WW-1457


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451511 13f79535-47bb-0310-9956-ffa450edef68
2006-09-30 00:52:36 +00:00
Donald J. Brown d633906b02 Removing tiles result as now in its own plugin
WW-1457


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451505 13f79535-47bb-0310-9956-ffa450edef68
2006-09-30 00:34:48 +00:00
Donald J. Brown 7d4b6449fd Fixed test from unused setting
WW-1453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451502 13f79535-47bb-0310-9956-ffa450edef68
2006-09-30 00:24:33 +00:00
Donald J. Brown 4c46142dd1 Removed unused setting
WW-1453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451491 13f79535-47bb-0310-9956-ffa450edef68
2006-09-29 23:29:52 +00:00
Donald J. Brown b73e5bb5cb Removing unused jsf dependency for core
WW-1457


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451454 13f79535-47bb-0310-9956-ffa450edef68
2006-09-29 21:32:11 +00:00
Donald J. Brown 03604729b4 Removing javadoc package file for deleted package
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451453 13f79535-47bb-0310-9956-ffa450edef68
2006-09-29 21:29:06 +00:00
Donald J. Brown 4ed08511ee Moving the jasperreports javadoc package file over to plugin
WW-1457


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451443 13f79535-47bb-0310-9956-ffa450edef68
2006-09-29 21:15:02 +00:00
Donald J. Brown 92da8e3d55 Backing out accidently committed files
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451439 13f79535-47bb-0310-9956-ffa450edef68
2006-09-29 21:11:27 +00:00
Donald J. Brown 6be545bf8e Moving jsf package javadoc file over to jsf plugin
WW-1457


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451436 13f79535-47bb-0310-9956-ffa450edef68
2006-09-29 21:06:51 +00:00
Donald J. Brown fe494806f2 Updating assembly for plugins
WW-1457


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451141 13f79535-47bb-0310-9956-ffa450edef68
2006-09-29 06:16:46 +00:00
Donald J. Brown cb952a61bc Added plugins to parent pom
WW-1457


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451139 13f79535-47bb-0310-9956-ffa450edef68
2006-09-29 06:07:49 +00:00
Donald J. Brown 654ade729c Moving tiles into its own plugin
WW-1457


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451138 13f79535-47bb-0310-9956-ffa450edef68
2006-09-29 06:01:40 +00:00
Donald J. Brown f41b6e5994 Updated tiles dependency to 2.0-snapshot, added support for tiles and freemarker integration
WW-1418 WW-1450


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451137 13f79535-47bb-0310-9956-ffa450edef68
2006-09-29 05:53:44 +00:00
James Mitchell 2c577937eb Add license (sorry, I couldn't find a suitable JIRA #)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@451096 13f79535-47bb-0310-9956-ffa450edef68
2006-09-29 03:11:01 +00:00
Donald J. Brown 27061b2d33 Moved plexus into its own plugin
WW-1457


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@450490 13f79535-47bb-0310-9956-ffa450edef68
2006-09-27 16:05:05 +00:00
Donald J. Brown 3d56756ccc Moving portlet config file back into core
WW-1457


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@450366 13f79535-47bb-0310-9956-ffa450edef68
2006-09-27 07:39:31 +00:00
Donald J. Brown 93c092de04 Creating sitemesh plugin
WW-1457


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@450363 13f79535-47bb-0310-9956-ffa450edef68
2006-09-27 07:31:21 +00:00
Donald J. Brown ee434f5c6f Backing out the portlet plugin due to a couple of component deps I missed :/
WW-1457


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@450359 13f79535-47bb-0310-9956-ffa450edef68
2006-09-27 07:20:07 +00:00
Donald J. Brown 2539ef98f8 Moved the portlet code into its own plugin
WW-1457


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@450355 13f79535-47bb-0310-9956-ffa450edef68
2006-09-27 06:58:24 +00:00
Donald J. Brown 712c968a42 Moved the config-browser into its own plugin, fixed a minor bug in a template
WW-1457


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@450346 13f79535-47bb-0310-9956-ffa450edef68
2006-09-27 06:36:30 +00:00
Donald J. Brown 8df55aefc2 Moving the JSF code into its own plugin, minor improvement to struts 1 config
WW-1457


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@450338 13f79535-47bb-0310-9956-ffa450edef68
2006-09-27 06:19:05 +00:00
Donald J. Brown d15d905c8e Fixed pom for new modules
WW-1457


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@450331 13f79535-47bb-0310-9956-ffa450edef68
2006-09-27 06:00:36 +00:00
Donald J. Brown 875b87cfd5 First cut at a simple plugin framework. The config files are loaded in the following order:
struts-default.xml, struts-plugin.xml, struts.xml, xwork.xml.  This allows plugins to define
a config file that uses core interceptors, but make their results, interceptors, etc available
to application configurations.  The extras and integration modules have been decomposed into their
own plugins.
WW-1457


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@450330 13f79535-47bb-0310-9956-ffa450edef68
2006-09-27 05:59:22 +00:00
Donald J. Brown 32207e8b65 Making the list of struts config files configurable
WW-1456


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@450297 13f79535-47bb-0310-9956-ffa450edef68
2006-09-27 03:19:54 +00:00
Donald J. Brown dbbc1cd9cf Fixed several url building issues dealing with relative paths - omitted forward slash
and support for Servlet 2.4 forwarding behaviors
Patch provided by Erik Pilz
WW-1302 WW-1301


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@449915 13f79535-47bb-0310-9956-ffa450edef68
2006-09-26 05:48:00 +00:00
Donald J. Brown 2b09ff4b50 Added support for ActionForms that use Commons Validator
WW-1454


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@449584 13f79535-47bb-0310-9956-ffa450edef68
2006-09-25 06:54:57 +00:00
Ted Nathan Husted 3eeeb84c2b Catch a few legacy -> integration stragglers.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@449541 13f79535-47bb-0310-9956-ffa450edef68
2006-09-25 01:28:48 +00:00
Ted Nathan Husted 3d0520b924 Add links to various API docs to core site.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@449472 13f79535-47bb-0310-9956-ffa450edef68
2006-09-24 19:59:55 +00:00
Ted Nathan Husted 2398426d38 WW-1349 Update POM versions for next iteration (2.0.1)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@449470 13f79535-47bb-0310-9956-ffa450edef68
2006-09-24 19:56:59 +00:00
Donald J. Brown 26d9c7c583 Adding back the deleted integration code, finished the legacy -> integration renaming
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@449451 13f79535-47bb-0310-9956-ffa450edef68
2006-09-24 18:22:48 +00:00
Donald J. Brown 655b3bf763 Adding back the deleted integration code
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@449450 13f79535-47bb-0310-9956-ffa450edef68
2006-09-24 18:22:24 +00:00
Donald J. Brown 13424cebd2 Adding back the deleted integration code
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@449449 13f79535-47bb-0310-9956-ffa450edef68
2006-09-24 18:21:07 +00:00
Donald J. Brown 203867655a Adding back the deleted integration code
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@449448 13f79535-47bb-0310-9956-ffa450edef68
2006-09-24 18:20:23 +00:00
Ted Nathan Husted 2868ad5ac9 Rename "legacy" folder to "integration". Since we may also want to do this with other similar codebases, like Spring MVC, we should be more specific with the lower-level package name. For now, I'm changing the folder to "integration" and the package names to "s1" (so that we don't have struts2.struts1 in the import). We might want to roll the integrations classes into the extras module.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@449428 13f79535-47bb-0310-9956-ffa450edef68
2006-09-24 16:32:19 +00:00
Ted Nathan Husted 9fb7820b48 Rename "legacy" folder to "integration". Since we may also want to do this with other similar codebases, like Spring MVC, we should be more specific with the lower-level package name. For now, I'm changing the folder to "integration" and the package names to "s1" (so that we don't have struts2.struts1 in the import). We might want to roll the integrations classes into the extras module.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@449425 13f79535-47bb-0310-9956-ffa450edef68
2006-09-24 16:26:43 +00:00
Donald J. Brown 887e595870 Fixed test
WW-1349


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@449371 13f79535-47bb-0310-9956-ffa450edef68
2006-09-24 06:59:07 +00:00
Donald J. Brown f6661ab957 Reformatting default action mapper
WW-1349


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@449368 13f79535-47bb-0310-9956-ffa450edef68
2006-09-24 06:50:57 +00:00
Donald J. Brown 3f911c05b1 Modified the process of getting the configuration so that it would only look for unmodified
files once per request, and not for static resources.  The problem arose when I modified
the ActionMapper to take into consideration when determining the action mapping (allows
action names with slashes).  The Configuration was being checked before it determined if
the request was for a static file or not.

WW-493


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@449367 13f79535-47bb-0310-9956-ffa450edef68
2006-09-24 06:49:04 +00:00
Donald J. Brown 0714355003 Renaming the xml configuration provider to match the xwork one (not sure why I named it different
to start with...)
WW-1349


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@449363 13f79535-47bb-0310-9956-ffa450edef68
2006-09-24 05:50:01 +00:00
Donald J. Brown 35d72ddd31 Moving the scoped model driven interceptor over to xwork, adding interceptor to default
stack
WW-1452


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@449359 13f79535-47bb-0310-9956-ffa450edef68
2006-09-24 04:46:40 +00:00
Donald J. Brown b99754f5de Adding the legacy module classes (silly local svn problem), minor improvements to support
intelligent defaults, added documentation


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@449350 13f79535-47bb-0310-9956-ffa450edef68
2006-09-24 04:09:38 +00:00
Donald J. Brown 71101b27d1 Adds a legacy library to support Struts 1.3 Actions and ActionForms as is running in Struts
WW-1452


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@449344 13f79535-47bb-0310-9956-ffa450edef68
2006-09-24 02:27:41 +00:00
Toby Jee 7c743dbde9 WW-1449
Select Component does not preselect header




git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@447901 13f79535-47bb-0310-9956-ffa450edef68
2006-09-19 16:36:02 +00:00
Ted Nathan Husted 1bddc95d2e WW-1349 S2 for J4 - Add missing files to "backport" folder. Add retrotranslator-runtime-1.0.8.jar
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@447127 13f79535-47bb-0310-9956-ffa450edef68
2006-09-17 19:47:29 +00:00
Toby Jee 980cd0c949 WW-1349
- fix compilation problem due to missing junit dependency



git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@447084 13f79535-47bb-0310-9956-ffa450edef68
2006-09-17 16:10:03 +00:00
514 changed files with 6795 additions and 2336 deletions
+125
View File
@@ -0,0 +1,125 @@
<?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.1</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-all</artifactId>
<packaging>jar</packaging>
<name>Combined Struts 2 Jar</name>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>dependency-maven-plugin</artifactId>
<executions>
<execution>
<id>unjar-deps</id>
<phase>compile</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>${version}</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-api</artifactId>
<version>${version}</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.struts</groupId>
<artifactId>
struts2-config-browser-plugin
</artifactId>
<version>${version}</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.struts</groupId>
<artifactId>
struts2-jasperreports-plugin
</artifactId>
<version>${version}</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.struts</groupId>
<artifactId>
struts2-jfreechart-plugin
</artifactId>
<version>${version}</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.struts</groupId>
<artifactId>
struts2-jsf-plugin
</artifactId>
<version>${version}</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.struts</groupId>
<artifactId>
struts2-pell-multipart-plugin
</artifactId>
<version>${version}</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.struts</groupId>
<artifactId>
struts2-plexus-plugin
</artifactId>
<version>${version}</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.struts</groupId>
<artifactId>
struts2-quickstart-plugin
</artifactId>
<version>${version}</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.struts</groupId>
<artifactId>
struts2-sitegraph-plugin
</artifactId>
<version>${version}</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.struts</groupId>
<artifactId>
struts2-sitemesh-plugin
</artifactId>
<version>${version}</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.struts</groupId>
<artifactId>
struts2-struts1-plugin
</artifactId>
<version>${version}</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.struts</groupId>
<artifactId>
struts2-tiles-plugin
</artifactId>
<version>${version}</version>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
-5
View File
@@ -1,5 +0,0 @@
name = struts-core
fullname = Struts
version = 2.0.0-SNAPSHOT
status = integration
cvs.tag = struts_2_0_0
-5
View File
@@ -1,5 +0,0 @@
ivy-configure=fr.jayasoft.ivy.ant.IvyConfigure
ivy-resolve=fr.jayasoft.ivy.ant.IvyResolve
ivy-retrieve=fr.jayasoft.ivy.ant.IvyRetrieve
ivy-publish=fr.jayasoft.ivy.ant.IvyPublish
ivy-report=fr.jayasoft.ivy.ant.IvyReport
-153
View File
@@ -1,153 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="http://www.jayasoft.fr/org/ivyrep/ivy-doc.xsl"?>
<ivy-module version="1.0">
<info organisation="apache" module="struts2"
revision="2.0"
status="integration"
publication="20060323000000">
<license name="Apache" url="http://www.apache.org/licenses/LICENSE-2.0.txt"/>
<ivyauthor name="apache" url="http://www.apache.org/"/>
<description homepage="http://struts.apache.org/2.x/">
Struts 2 is a Java web-application development framework. It is built specifically with developer
productivity and code simplicity in mind. Struts 2 is built on
top of XWork, which provides a generic command pattern framework as well as an Inversion of Control
container. In addition to these features, Struts 2 provides
robust support for building reusable UI templates, such as form controls, UI themes, internationalization,
dynamic form parameter mapping to JavaBeans, robust
client and server side validation, and much more.
<br/>
</description>
</info>
<configurations>
<conf name="build" visibility="private"/>
<conf name="default"/>
<conf name="source"/>
<conf name="ajax"/>
<conf name="freemarker" deprecated="20060303000000"/>
<conf name="velocity"/>
<conf name="fileupload"/>
<conf name="fileupload-pell" deprecated="20050831000000"/>
<conf name="sitemesh"/>
<conf name="quickstart"/>
<conf name="jasperreports"/>
<conf name="jfree"/>
<conf name="xslt"/>
<conf name="portlet"/>
<conf name="spring"/>
<conf name="pico"/>
<conf name="plexus"/>
<conf name="xslt"/>
<conf name="tiger"/>
<conf name="cewolf"/>
<conf name="tiles"/>
</configurations>
<publications>
<artifact name="struts2" type="jar" conf="default"/>
</publications>
<dependencies>
<!-- build -->
<dependency org="mockobjects" name="mockobjects-core" rev="0.09" conf="build->*"/>
<dependency org="mockobjects" name="mockobjects-jdk1.3" rev="0.09" conf="build->*"/>
<dependency org="mockobjects" name="mockobjects-alt-jdk1.3" rev="0.09" conf="build->*"/>
<dependency org="mockobjects" name="mockobjects-alt-jdk1.3-j2ee1.3" rev="0.09" conf="build->*"/>
<dependency org="mockobjects" name="mockobjects-jdk1.3-j2ee1.3" rev="0.09" conf="build->*"/>
<dependency org="easymock" name="easymock" rev="2.0" conf="build->*"/>
<!--dependency org="easymock" name="easymockclassextension" rev="1.1" conf="build->*"/-->
<dependency org="clover" name="clover" rev="1.3.11" conf="build->*"/>
<dependency org="junit" name="junit" rev="3.8.1" conf="build->*"/>
<dependency org="jmock" name="jmock" rev="1.0.1" conf="build->*"/>
<dependency org="jmock" name="jmock-cglib" rev="1.0.1" conf="build->*"/>
<dependency org="servletapi" name="servletapi" rev="2.4" conf="build->*"/>
<dependency org="xdoclet" name="xdoclet" rev="1.2.3" conf="build->*"/>
<dependency org="xdoclet" name="xdoclet-web-module" rev="1.2.3" conf="build->*"/>
<dependency org="xjavadoc" name="xjavadoc" rev="1.1" conf="build->*"/>
<!-- default -->
<dependency org="opensymphony" name="xwork" rev="2.0+" conf="default->default"/>
<dependency org="apache" name="commons-logging" rev="1.0.4" conf="default->default"/>
<dependency org="opensymphony" name="xwork" rev="2.0+" conf="source->source"/>
<dependency org="freemarker" name="freemarker" rev="2.3.4" conf="default->default"/>
<!-- ajax -->
<dependency org="dwr" name="dwr" rev="1.1-beta-3" conf="ajax->*"/>
<!-- tiles -->
<dependency org="org.apache.struts.tiles" name="tiles-core" rev="0.2-SNAPSHOT" conf="tiles->default"/>
<dependency org="commons-digester" name="commons-digester" rev="1.7" conf="tiles->default"/>
<!-- velocity -->
<dependency org="apache" name="velocity" rev="1.4" conf="velocity->*"/>
<dependency org="apache" name="velocity-tools" rev="1.1" conf="velocity->view"/>
<dependency org="commons-collections" name="commons-collections" rev="2.1.1" conf="velocity->*"/>
<!-- fileupload -->
<dependency org="apache" name="commons-fileupload" rev="1.1" conf="fileupload->default"/>
<dependency org="apache" name="commons-io" rev="1.0" conf="fileupload->default" />
<!-- fileupload-pell -->
<dependency org="pell" name="multipartrequest" rev="1.19" conf="fileupload-pell->default"/>
<!-- sitemesh -->
<dependency org="opensymphony" name="sitemesh" rev="2.2.1" conf="sitemesh->default"/>
<!-- quickstart -->
<dependency org="jetty" name="org.mortbay.jetty" rev="5.1.4" conf="quickstart->default"/>
<dependency org="ant" name="ant" rev="1.6.5" conf="quickstart->default"/>
<dependency org="tomcat" name="jasper-runtime" rev="5.5.12" conf="quickstart->default"/>
<dependency org="tomcat" name="jasper-compiler" rev="5.5.12" conf="quickstart->default"/>
<dependency org="tomcat" name="jasper-compiler-jdt" rev="5.5.12" conf="quickstart->default"/>
<dependency org="commons-el" name="commons-el" rev="1.0" conf="quickstart->default"/>
<dependency org="commons-io" name="commons-io" rev="1.0" conf="quickstart->default"/>
<dependency org="commons-lang" name="commons-lang" rev="2.1" conf="quickstart->default"/>
<dependency org="servletapi" name="servletapi" rev="2.4" conf="quickstart->*" force="true"/>
<dependency org="jspapi" name="jsp-api" rev="2.0" conf="quickstart->*"/>
<dependency org="log4j" name="log4j" rev="1.2.9" conf="quickstart->*"/>
<dependency org="commons-collections" name="commons-collections" rev="2.1.1" conf="quickstart->default"/>
<dependency org="xstream" name="xstream" rev="1.1.2" conf="quickstart->default"/>
<!-- jasperreports -->
<dependency org="jasperreports" name="jasperreports" rev="1.2.0" conf="jasperreports->default"/>
<dependency org="itext" name="itext" rev="1.3.1" conf="jasperreports->default"/>
<dependency org="poi" name="poi" rev="2.5.1" conf="jasperreports->default"/>
<dependency org="commons-beanutils" name="commons-beanutils" rev="1.7.0" conf="jasperreports->default"/>
<dependency org="commons-digester" name="commons-digester" rev="1.7" conf="jasperreports->default"/>
<dependency org="commons-collections" name="commons-collections" rev="2.1.1" conf="jasperreports->default"/>
<!-- jfree -->
<dependency org="jfree" name="jcommon" rev="1.0.0" conf="jfree->default"/>
<dependency org="jfree" name="jfreechart" rev="1.0.0" conf="jfree->default"/>
<!-- xslt -->
<dependency org="jfree" name="jcommon" rev="1.0.0" conf="xslt->default"/>
<!-- portlet -->
<dependency org="portlet-api" name="portlet-api" rev="1.0" conf="portlet->default"/>
<!-- spring -->
<dependency org="opensymphony" name="xwork" rev="2.0+" conf="spring->spring"/>
<!-- pico -->
<dependency org="picocontainer" name="picocontainer" rev="1.2-RC-2" conf="pico->*"/>
<dependency org="picocontainer" name="picocontainer-gems" rev="1.2-RC-2" conf="pico->*"/>
<dependency org="nanocontainer" name="nanocontainer" rev="1.0-RC-3" conf="pico->*"/>
<dependency org="nanocontainer" name="nanocontainer-nanowar" rev="1.0-RC-3" conf="pico->*"/>
<!-- plexus -->
<dependency org="org.codehaus.plexus" name="plexus-container-default" rev="1.0-alpha-10-20060215.222714-5" conf="plexus->*"/>
<dependency org="org.codehaus.plexus" name="plexus-utils" rev="1.0.4" conf="plexus->*"/>
<dependency org="classworlds" name="classworlds" rev="1.1" conf="plexus->*"/>
<!-- xslt -->
<dependency org="w3c" name="dom" rev="3.0" conf="xslt->*"/>
<!-- tiger -->
<dependency org="opensymphony" name="xwork-tiger" rev="2.0+" conf="tiger->*"/>
<!-- cewolf -->
<dependency org="cewolf" name="cewolf" rev="0.12.0" conf="cewolf->*"/>
</dependencies>
</ivy-module>
-2
View File
@@ -1,2 +0,0 @@
ivy.retrieve.pattern = lib/[conf]/[artifact].[ext]
integration.repository = lib/integration
-30
View File
@@ -1,30 +0,0 @@
<ivyconf>
<properties file="ant-build/ivyconf.properties"/>
<conf defaultResolver="default" checkUpToDate="true"/>
<resolvers>
<chain name="default">
<filesystem name="integration" checkmodified="true">
<ivy pattern="${integration.repository}/[organisation]/[module]/ivy-[revision].xml"/>
<artifact pattern="${integration.repository}/[organisation]/[module]/[artifact]-[revision].[ext]"/>
</filesystem>
<url name="opensymphony" checkmodified="true">
<ivy pattern="http://ivyrep.opensymphony.com/[organisation]/[module]/ivy-[revision].xml"/>
<artifact
pattern="http://ivyrep.opensymphony.com/[organisation]/[module]/[artifact]-[revision].[type]"/>
</url>
<url name="contegix">
<ivy pattern="http://repository.contegix.com/ivyrep/[organisation]/[module]/ivy-[revision].xml"/>
<artifact
pattern="http://repository.contegix.com/ivyrep/[organisation]/[module]/[artifact]-[revision].[type]"/>
</url>
<ivyrep name="ivyrep"/>
<ibiblio name="contegix-maven" root="http://repository.contegix.com/maven"/>
<url name="maven">
<artifact pattern="http://www.ibiblio.org/maven/[organisation]/jars/[module]-[revision].[type]"/>
</url>
<!--url name="maven-mirror">
<artifact pattern="http://ibiblio.lsu.edu/main/pub/packages/maven/[organisation]/jars/[module]-[revision].[type]"/>
</url-->
</chain>
</resolvers>
</ivyconf>
-463
View File
@@ -1,463 +0,0 @@
<project name="common" default="jar" basedir=".">
<!--
OpenSymphony Common Build
=========================
TODO (Introduction)
Layout
=========================
TODO
Overriding
=========================
TODO
Example: <target name="compile" depends="myPreCompile,common.compile,myPostCompile"/>
-->
<!-- NOTE: this property is purely here to make a clear distinction in IDEA where the common build is -->
<property name="------common-properties-below------" value="Common properties below:"/>
<property name="compile.version" value="1.3"/>
<property name="test.compile.version" value="1.3"/>
<dirname property="common.dir" file="${ant.file.common}"/>
<property file="ant-build/build.properties"/>
<property file="ant-build/release.properties"/>
<property file="ant-build/ivyrep.properties"/>
<property name="lib" location="lib"/>
<property name="lib.core" value="${lib}/core"/>
<property name="lib.build" value="${lib}/build"/>
<property name="lib.optional" value="${lib}/optional"/>
<property name="src" location="core/src"/>
<property name="src.java" value="${src}/main/java"/>
<property name="src.test" value="${src}/test/java/"/>
<property name="src.resources" value="${src}/main/resources"/>
<property name="build" location="build"/>
<property name="build.test" value="${build}/test/java"/>
<property name="build.java-test" value="${build}/java-test"/>
<property name="build.java" value="${build}/java"/>
<property name="build.clover" value="${build}/clover"/>
<property name="dist" location="dist"/>
<property name="docs" location="docs"/>
<property name="docs.packages" value="org.apache.struts2.*"/>
<property name="jar.manifest" value="${common.dir}/EMPTY.MF"/>
<property name="jar.excludes" value=""/>
<property name="testcase" value="*"/>
<patternset id="src.test.pattern">
<exclude name="**/Abstract*.java"/>
<include name="**/${testcase}Test.java"/>
<include name="**/${testcase}TestCase.java"/>
</patternset>
<path id="cp">
<fileset dir="lib">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
<exclude name="**/jalopy/**"/>
</fileset>
</path>
<path id="junit.cp">
<pathelement location="${build.java}"/>
<pathelement location="${build.test}"/>
<pathelement location="${src.test}/../resources"/>
<pathelement location="${build.java-test}"/>
<path refid="cp"/>
</path>
<path id="javadoc.path">
<path path="${src.java}"/>
</path>
<available property="junit.available" classname="junit.framework.TestCase"/>
<available property="clover.available" classname="org.apache.tools.ant.taskdefs.CloverCompilerAdapter"/>
<target name="init" depends="init-anthill, init-standalone">
<tstamp/>
</target>
<!-- in Anthill, the docs should be the Intranet copyDir -->
<target name="init-anthill" if="anthill.copyDir">
<property name="dist.docs" value="${anthill.copyDir}"/>
</target>
<!-- when building Standalone, the docs should be the normal place -->
<target name="init-standalone" unless="anthill.copyDir">
<property name="dist.docs" value="${dist}/docs"/>
</target>
<target name="junit-check" depends="init" unless="junit.available">
<fail message="Cannot run test cases. Please copy lib/build/junit.jar to ${ant.home}/lib"/>
</target>
<target name="clover-check" depends="init" unless="clover.available">
<fail message="Cannot run coverage tests. Please copy lib/build/clover.jar and lib/build/clover.license (if it exists) to ${ant.home}/lib"/>
</target>
<target name="clean">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<target name="precompile"/>
<macrodef name="compile">
<attribute name="srcdir"/>
<attribute name="destdir"/>
<attribute name="classpath" default=""/>
<attribute name="classpathref" default="cp"/>
<attribute name="includes" default="**/*.java"/>
<attribute name="excludes" default=""/>
<attribute name="source" default="${compile.version}"/>
<attribute name="target" default="${compile.version}"/>
<sequential>
<mkdir dir="@{destdir}"/>
<javac srcdir="@{srcdir}" destdir="@{destdir}" classpath="@{classpath}" classpathref="@{classpathref}"
debug="on" source="@{source}" target="@{target}" excludes="@{excludes}" />
<copy filtering="no" todir="@{destdir}">
<fileset dir="@{srcdir}">
<exclude name="**/*.java"/>
<exclude name="**/package.html"/>
</fileset>
</copy>
</sequential>
</macrodef>
<target name="compile" depends="init,precompile" description="compile project">
<compile srcdir="${src.java}" destdir="${build.java}" excludes="${optional.sources}" />
<copy filtering="no" todir="${build.java}" includeemptydirs="false">
<fileset dir="${src.resources}" >
<exclude name="java/*"/>
</fileset>
</copy>
</target>
<target name="jar" depends="compile" description="build the project jar file">
<mkdir dir="${build}"/>
<jar basedir="${build.java}" excludes="${jar.excludes}" jarfile="${build}/${name}-${version}.jar">
<manifest>
<attribute name="Implementation-Title" value="${fullname}"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="OpenSymphony"/>
</manifest>
</jar>
<jar basedir="${src.java}" jarfile="${build}/${name}-src-${version}.jar">
<manifest>
<attribute name="Implementation-Title" value="${fullname}"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="OpenSymphony"/>
</manifest>
</jar>
</target>
<target name="src-jar" depends="init" description="build a jar of the project source code">
<mkdir dir="${build}"/>
<jar basedir="${src.java}" jarfile="${build}/${name}-src-${version}.jar">
<manifest>
<attribute name="Implementation-Title" value="${fullname}"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="OpenSymphony"/>
</manifest>
</jar>
</target>
<target name="test-compile" unless="skip.tests">
<compile srcdir="${src.test}" destdir="${build.test}" classpath="${build.java}"
source="${test.compile.version}" target="${test.compile.version}" />
<taskdef resource="clovertasks"/>
<taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
<mkdir dir="${build.clover}"/>
<clover-setup initString="${build.clover}/coverage.db">
<statementContext name="logIsDebugEnabled" regexp="[\s]*if[\s]*\([\s]*(log|_log|LOG|_LOG)\.isDebugEnabled.*"/>
<statementContext name="logDebug" regexp="[\s]*(log|_log|LOG|_LOG)\.debug[\s]*\(.*"/>
<files>
<exclude name="${src.test}/**/*.java"/>
</files>
</clover-setup>
<!-- compile srcdir="${src.java}" destdir="${build.java-test}" / -->
</target>
<target name="test" depends="junit-check, clover-check, compile, test-compile" description="run tests"
unless="skip.tests">
<run-junit />
</target>
<macrodef name="run-junit">
<attribute name="classpathref" default="junit.cp" />
<attribute name="includes" default="**/${testcase}Test.java"/>
<attribute name="excludes" default=""/>
<sequential>
<mkdir dir="${dist.docs}/junit"/>
<junit haltonfailure="no" haltonerror="yes" fork="yes" forkmode="once" failureproperty="test.failure">
<jvmarg value="-Djava.awt.headless=true"/>
<jvmarg value="-Dorg.xml.sax.driver=org.apache.crimson.parser.XMLReaderImpl"/>
<classpath>
<path refid="@{classpathref}"/>
</classpath>
<formatter type="plain" useFile="false"/>
<formatter type="xml"/>
<batchtest todir="${dist.docs}/junit">
<fileset dir="${src.test}">
<exclude name="@{excludes}" />
<patternset refid="src.test.pattern"/>
<include name="@{includes}" />
</fileset>
</batchtest>
</junit>
</sequential>
</macrodef>
<target name="javadocs" description="generate javadocs">
<mkdir dir="${dist.docs}/api"/>
<javadoc sourcepathref="javadoc.path"
destdir="${dist.docs}/api"
packagenames="${docs.packages}"
classpathref="cp"
author="true"
version="true"
overview="${src.java}/overview.html"
windowTitle="${fullname} API - ${version}"
doctitle="${fullname} API (${version})"
footer="&lt;a href=&quot;http://www.opensymphony.com/${name}/&quot; target=&quot;_top&quot;&gt;${fullname} Project Page&lt;/a&gt;"
use="true"
verbose="false"
source="${compile.version}">
<tag name="s.tag" description="s.tag" enabled="false"/>
<tag name="s.tagattribute" description="s.tagattribute" enabled="false"/>
<link href="http://java.sun.com/j2se/${compile.version}/docs/api/"/>
<link href="http://java.sun.com/j2ee/${compile.version}/docs/api/"/>
</javadoc>
<!-- <copy overwrite="yes" file="${docs}/main.css" tofile="${docs}/api/stylesheet.css"/> -->
</target>
<target name="docs.impl">
<copy todir="${dist.docs}">
<fileset dir="${docs}"/>
</copy>
</target>
<target name="reports" depends="junit.report, clover.report, javadocs"
description="generate javadocs and junit and coverage reports"/>
<target name="docs" depends="reports, docs.impl"/>
<target name="clover.report" depends="test" description="generate coverage reports" unless="skip.tests">
<clover-report>
<current outfile="${dist.docs}/clover">
<format type="html" filter="logDebug,logIsDebugEnabled"/>
</current>
</clover-report>
<clover-log filter="logDebug,logIsDebugEnabled"/>
</target>
<target name="clover.historical" depends="clover.report" description="generate coverage historical reports"
unless="skip.tests">
<clover-historypoint historyDir="${build.clover}"/>
<clover-report>
<historical outfile="${dist.docs}/clover" historyDir="${build.clover}">
<format type="html" filter="logDebug,logIsDebugEnabled"/>
</historical>
</clover-report>
<clover-log filter="logDebug,logIsDebugEnabled"/>
</target>
<target name="junit.report" depends="test" description="generate junit reports" unless="skip.tests">
<junitreport todir="${dist.docs}/junit">
<fileset dir="${dist.docs}/junit">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${dist.docs}/junit"/>
</junitreport>
<!-- we fail here (instead of in the test target) so that the reports get generated first) -->
<fail if="test.failure" message="Tests did not all pass, failing!"/>
</target>
<target name="predist"/>
<target name="predist.zip"/>
<target name="dist" depends="jar, docs, predist" description="generate distribution zip file">
<copy todir="${dist}">
<fileset dir="${build}">
<include name="*.jar"/>
</fileset>
</copy>
<copy todir="${dist}/src">
<fileset dir="${src}"/>
</copy>
<mkdir dir="${dist}/lib"/>
<copy todir="${dist}/lib">
<fileset dir="${lib}">
<exclude name="**/no_dist/**"/>
</fileset>
</copy>
<copy todir="${dist}">
<fileset dir="${basedir}">
<include name="build.*"/>
<include name="osbuild.*"/>
<include name="ivy.*"/>
<include name="pom.*"/>
<include name="readme.txt"/>
<include name="license.txt"/>
</fileset>
</copy>
<!-- give a chance for project builds to do more before the zip is made. -->
<antcall target="predist.zip"/>
<zip destfile="${build}/${name}-${version}.zip">
<zipfileset prefix="${name}-${version}" dir="${dist}">
<exclude name="docs/clover/**/*"/>
<exclude name="docs/junit/**/*"/>
</zipfileset>
</zip>
<move file="${build}/${name}-${version}.zip" todir="${dist}" />
</target>
<target name="website" depends="javadocs, docs.impl"/>
<!-- =================================================================== -->
<!-- Fix carriage-return line feeds -->
<!-- =================================================================== -->
<target name="fixcrlf" description="Fixed CR/LF problems">
<echo>Running fixcrlf....</echo>
<fixcrlf eol="lf" srcdir="${basedir}/core/src"
includes="**/*.sh,
**/*.properties,
**/*.sql,
**/*.script,
**/*.java,
**/*.css,
**/*.js,
**/*.jsp,
**/*.ftl,
**/*.txt,
**/*.vm,
**/*.xml,
**/*.dtd,
**/*.xsl,
**/*.xslt,
**/*.html" />
<fixcrlf eol="lf" srcdir="${basedir}/apps"
includes="**/*.sh,
**/*.properties,
**/*.sql,
**/*.script,
**/*.java,
**/*.css,
**/*.js,
**/*.jsp,
**/*.ftl,
**/*.txt,
**/*.vm,
**/*.xml,
**/*.dtd,
**/*.xsl,
**/*.xslt,
**/*.html" />
</target>
<target name="ivyrep" depends="jar, ivyrep.impl"/>
<target name="ivyrep.impl">
<tstamp>
<format property="TIME" pattern="yyyyMMddHHmmss"/>
</tstamp>
<!-- make sure we have the latest -->
<echo>svn update</echo>
<exec executable="svn">
<arg value="update"/>
<arg line="${ivyrep.path}/opensymphony/${name}"/>
</exec>
<!-- delete the old timestamped builds and commit -->
<fileset dir="${ivyrep.path}/opensymphony/${name}" id="filesref">
<include name="${name}-${version}-*"/>
<include name="ivy-${version}-*"/>
</fileset>
<pathconvert property="files" refid="filesref" pathsep=" "/>
<echo>svn delete: ${files}</echo>
<exec executable="svn">
<arg value="delete"/>
<arg line="${files}"/>
</exec>
<!-- copy over the new build and source -->
<copy file="${build}/${name}-${version}.jar"
tofile="${ivyrep.path}/opensymphony/${name}/${name}-${version}-${TIME}.jar"/>
<copy file="${build}/${name}-src-${version}.jar"
tofile="${ivyrep.path}/opensymphony/${name}/${name}-src-${version}-${TIME}.jar"/>
<echo>svn add (jar)</echo>
<exec executable="svn">
<arg value="add"/>
<arg value="${ivyrep.path}/opensymphony/${name}/${name}-${version}-${TIME}.jar"/>
</exec>
<exec executable="svn">
<arg value="add"/>
<arg value="${ivyrep.path}/opensymphony/${name}/${name}-src-${version}-${TIME}.jar"/>
</exec>
<antcall target="ivyrep.copy-ivy"/>
<exec executable="svn">
<arg value="add"/>
<arg value="${ivyrep.path}/opensymphony/${name}/ivy-${version}-${TIME}.xml"/>
</exec>
<!-- now commit everything -->
<echo>svn commit</echo>
<exec executable="svn">
<arg value="commit"/>
<arg value="--username"/>
<arg value="${ivyrep.username}"/>
<arg value="--password"/>
<arg value="${ivyrep.password}"/>
<arg value="--non-interactive"/>
<arg value="-m"/>
<arg value="automatic commit"/>
<arg value="${ivyrep.path}/opensymphony/${name}"/>
</exec>
</target>
<target name="ivyrep.copy-ivy">
<!--
Note: Default implementation does not use Ivy itself to generate these files.
However, Ivy is really the best way to generate these, so projects that
do use Ivy should override this target like so:
<ivy-deliver deliverpattern="${ivyrep.path}/opensymphony/${name}/[artifact]-[revision].[ext]"
pubrevision="${version}-${TIME}" pubdate="${TIME}"/>
Over time as more projects adopt Ivy, this may become built in to the
common build.
-->
<copy file="ivy.xml" tofile="${ivyrep.path}/opensymphony/${name}/ivy-${version}-${TIME}.xml">
<filterset id="ivy.filter">
<filter token="VERSION" value="${version}-${TIME}"/>
<filter token="STATUS" value="${status}"/>
<filter token="PUBLICATION" value="${TIME}"/>
</filterset>
</copy>
</target>
</project>
+2 -2
View File
@@ -5,13 +5,13 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>2.0.1</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-api</artifactId>
<packaging>jar</packaging>
<name>Struts 2 API</name>
<dependencies>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>2.0.1</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-blank</artifactId>
@@ -0,0 +1,3 @@
@echo off
set CLASSPATH=..\..\..\lib\xwork-2.0-beta-1.jar
javac *.java -d ..\..\..\classes
@@ -1,5 +1,5 @@
HelloWorld.message= Struts is up and running ...
requiredstring = ${getText(fieldName)} is required.
password = Password
username = User Name
HelloWorld.message= Struts is up and running ...
Missing.message = This feature is under construction. Please try again in the next interation.
@@ -0,0 +1,5 @@
HelloWorld.message= ¡Struts está bien! ...
requiredstring = ${getText(fieldName)} se requiere.
password = Contraseña
username = Nombre de Usuario
Missing.message = ¡en obras! ¡seguir intentando!
-2
View File
@@ -4,8 +4,6 @@
<struts>
<include file="struts-default.xml"/>
<include file="example.xml"/>
<!-- Add packages here -->
+2 -3
View File
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Struts Blank</display-name>
@@ -2,10 +2,27 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Hello World!</title>
<title><s:text name="HelloWorld.message"/></title>
</head>
<body>
<h2><s:property value="message"/></h2>
<h3>Languages</h3>
<ul>
<li>
<s:url id="url" action="HelloWorld">
<s:param name="request_locale">en</s:param>
</s:url>
<s:a href="%{url}">English</s:a>
</li>
<li>
<s:url id="url" action="HelloWorld">
<s:param name="request_locale">es</s:param>
</s:url>
<s:a href="%{url}">Espanol</s:a>
</li>
</ul>
</body>
</html>
+1 -1
View File
@@ -2,7 +2,7 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Logon</title>
<title>Sign On</title>
</head>
<body>
@@ -0,0 +1,3 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<s:include value="Missing.jsp"/>
+1 -18
View File
@@ -10,26 +10,9 @@
<body>
<h3>Commands</h3>
<ul>
<li><a href="<s:url action="Register"/>">Register</a></li>
<li><a href="<s:url action="Login!input"/>">Sign On</a></li>
</ul>
<h3>Languages</h3>
<ul>
<li>
<s:url id="url" action="Welcome">
<s:param name="request_locale">en</s:param>
</s:url>
<s:a href="%{url}">English</s:a>
</li>
<li>
<s:url id="url" action="Welcome">
<s:param name="request_locale">ja</s:param>
</s:url>
<s:a href="%{url}">Japanese</s:a>
</li>
<li><a href="<s:url action="Register"/>">Register</a></li>
</ul>
</body>
</html>
+1 -1
View File
@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=example/Welcome.action">
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=example/HelloWorld.action">
</head>
<body>
@@ -1,7 +1,6 @@
package example;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.XWorkTestCase;
import com.opensymphony.xwork2.config.RuntimeConfiguration;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.config.entities.ResultConfig;
@@ -10,7 +9,9 @@ import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
import java.util.Map;
import java.util.List;
public class ConfigTest extends XWorkTestCase {
import org.apache.struts2.StrutsTestCase;
public class ConfigTest extends StrutsTestCase {
protected void assertSuccess(String result) throws Exception {
assertTrue("Expected a success result!",
+28 -19
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>2.0.1</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-mailreader</artifactId>
@@ -22,28 +22,37 @@
<dependency>
<groupId>${pom.groupId}</groupId>
<artifactId>struts-mailreader-dao</artifactId>
<version>1.3.5-SNAPSHOT</version>
<version>1.3.5</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty6-plugin</artifactId>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-j2ee_1.4_spec</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty6-plugin</artifactId>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-j2ee_1.4_spec</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
@@ -100,7 +100,7 @@ public final class ApplicationListener implements ServletContextListener {
* <p>The web application resource path of our persistent database storage
* file.</p>
*/
private String pathname = "/WEB-INF/classes/database.xml";
private String pathname = "/WEB-INF/database.xml";
/**
* <p>Return the application resource path to the database.</p>
-2
View File
@@ -5,8 +5,6 @@
<struts>
<include file="struts-default.xml"/>
<include file="mailreader-default.xml"/>
<include file="mailreader-support.xml"/>
+21 -1
View File
@@ -1,11 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* Copyright 2005-2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id$
*/
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>2.0.1</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
+9 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>2.0.1</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-portlet</artifactId>
@@ -18,6 +18,14 @@
<version>1.0</version>
<scope>provided</scope>
</dependency>
<!--
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-portlet-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
-->
<dependency>
<groupId>javax.servlet</groupId>
+74 -6
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>2.0.1</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-showcase</artifactId>
@@ -24,6 +24,36 @@
</profiles>
<dependencies>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-struts1-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jsf-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-config-browser-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<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>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
@@ -31,6 +61,22 @@
<scope>provided</scope>
</dependency>
<!-- Velocity -->
<dependency>
<groupId>velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.4</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>velocity-tools</groupId>
<artifactId>velocity-tools</artifactId>
<version>1.1</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>opensymphony</groupId>
<artifactId>sitemesh</artifactId>
@@ -75,19 +121,41 @@
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.0.0rc3</version>
<version>6.0.1</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-j2ee_1.4_spec</artifactId>
<version>1.0</version>
<scope>provided</scope>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.9</version>
</dependency>
</dependencies>
</plugin>
</plugins>
<resources>
<!-- Include resources under src/main/java in WEB-INF/classes -->
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</resource>
</resources>
</build>
</project>
+1 -2
View File
@@ -12,7 +12,7 @@
users who don't have a single directory in their project that
contains all the libraries they need.
-->
<ideaConfig>../../../xwork/xwork.iml,../../core/struts2-core.iml,../../extras/struts2-extras.iml,struts2-showcase.iml</ideaConfig>
<ideaConfig>../../../xwork/xwork.iml,../../core/struts2-core.iml,struts2-showcase.iml</ideaConfig>
<!-- The context in which to deploy the web application -->
<context>/showcase</context>
@@ -49,7 +49,6 @@
<dir>src/main/resources</dir>
<dir>target/classes</dir>
<dir>../../core/target/classes</dir>
<dir>../../extras/target/classes</dir>
</classDirs>
<!--
@@ -20,7 +20,7 @@ package org.apache.struts2.showcase;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Validateable;
import com.opensymphony.xwork2.util.OgnlValueStack;
import com.opensymphony.xwork2.util.ValueStack;
import java.util.ArrayList;
import java.util.Collections;
@@ -123,7 +123,7 @@ public class UITagExample extends ActionSupport implements Validateable {
}
public List getVehicalSpecificList() {
OgnlValueStack stack = ServletActionContext.getValueStack(ServletActionContext.getRequest());
ValueStack stack = ServletActionContext.getValueStack(ServletActionContext.getRequest());
Object vehicalType = stack.findValue("top");
if (vehicalType != null && vehicalType instanceof VehicalType) {
List l = (List) vehicalSpecificMap.get(vehicalType);
@@ -0,0 +1,23 @@
package org.apache.struts2.showcase.ajax;
import com.opensymphony.xwork2.ActionSupport;
public class Example5Action extends ActionSupport {
private static final long serialVersionUID = 2111967621952300611L;
private String name;
private Integer age;
public String getName() { return name; }
public void setName(String name) { this.name = name; }
public Integer getAge() { return age; }
public void setAge(Integer age) { this.age = age; }
@Override
public String execute() throws Exception {
return SUCCESS;
}
}
@@ -0,0 +1,35 @@
/*
* $Id: Person.java 440597 2006-09-06 03:34:39Z tmjee $
*
* Copyright 2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.struts2.showcase.conversion;
/**
* @version $Date$ $Id$
*/
public class Address {
private String id;
private String address;
public String getId() { return id; }
public void setId(String id) { this.id = id; }
public String getAddress() { return address; }
public void setAddress(String address) { this.address = address; }
}
@@ -0,0 +1,6 @@
KeyProperty_addresses=id
Element_addresses=org.apache.struts2.showcase.conversion.Address
CreateIfNull_addresses=true
@@ -0,0 +1,44 @@
/*
* $Id: Person.java 440597 2006-09-06 03:34:39Z tmjee $
*
* Copyright 2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.struts2.showcase.conversion;
import java.util.LinkedHashSet;
import java.util.Set;
import com.opensymphony.xwork2.ActionSupport;
/**
* @version $Date$ $Id$
*/
public class AddressAction extends ActionSupport {
private Set addresses = new LinkedHashSet();
public Set getAddresses() { return addresses; }
public void setAddresses(Set addresses) { this.addresses = addresses; }
public String input() throws Exception {
return SUCCESS;
}
public String submit() throws Exception {
System.out.println(addresses);
return SUCCESS;
}
}
@@ -0,0 +1,55 @@
/*
* $Id: Person.java 440597 2006-09-06 03:34:39Z tmjee $
*
* Copyright 2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.struts2.showcase.conversion;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.struts2.util.StrutsTypeConverter;
/**
* @version $Date$ $Id$
*/
public class EnumTypeConverter extends StrutsTypeConverter {
@Override
public Object convertFromString(Map context, String[] values, Class toClass) {
List<Enum> result = new ArrayList<Enum>();
for (int a=0; a< values.length; a++) {
Enum e = Enum.valueOf(OperationsEnum.class, values[a]);
if (e != null)
result.add(e);
}
return result;
}
@Override
public String convertToString(Map context, Object o) {
List l = (List) o;
String result ="<";
for (Iterator i = l.iterator(); i.hasNext(); ) {
result = result + "["+ i.next() +"]";
}
result = result+">";
return result;
}
}
@@ -0,0 +1,30 @@
/*
* $Id: Person.java 440597 2006-09-06 03:34:39Z tmjee $
*
* Copyright 2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.struts2.showcase.conversion;
/**
*
* @version $Date$ $Id$
*/
public enum OperationsEnum {
ADD,
MINUS,
DIVIDE,
MULTIPLY,
REMAINDER;
}
@@ -0,0 +1,4 @@
selectedOperations=org.apache.struts2.showcase.conversion.EnumTypeConverter
Element_selectedOperations=org.apache.struts2.showcase.conversion.OperationsEnum
@@ -0,0 +1,53 @@
/*
* $Id: Person.java 440597 2006-09-06 03:34:39Z tmjee $
*
* Copyright 2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.struts2.showcase.conversion;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import com.opensymphony.xwork2.ActionSupport;
/**
*
* @version $Date$ $Id$
*/
public class OperationsEnumAction extends ActionSupport {
private static final long serialVersionUID = -2229489704988870318L;
private List<OperationsEnum> selectedOperations = new LinkedList<OperationsEnum>();
public List<OperationsEnum> getSelectedOperations() { return this.selectedOperations; }
public void setSelectedOperations(List<OperationsEnum> selectedOperations) {
this.selectedOperations = selectedOperations;
}
public List<OperationsEnum> getAvailableOperations() {
return Arrays.asList(OperationsEnum.values());
}
public String input() throws Exception {
return SUCCESS;
}
public String submit() throws Exception {
return SUCCESS;
}
}
@@ -0,0 +1,41 @@
/*
* $Id: Gangster.java 418530 2006-07-01 23:58:13Z mrdon $
*
* Copyright 2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.struts2.showcase.integration;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public class EditGangsterAction extends Action {
/* (non-Javadoc)
* @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
@Override
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
// Some code to load the gangster from the db as necessary
return mapping.findForward("success");
}
}
@@ -0,0 +1,89 @@
package org.apache.struts2.showcase.integration;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.validator.ValidatorForm;
public class GangsterForm extends ValidatorForm {
private String name;
private String age;
private String description;
private boolean bustedBefore;
/* (non-Javadoc)
* @see org.apache.struts.action.ActionForm#reset(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)
*/
@Override
public void reset(ActionMapping arg0, HttpServletRequest arg1) {
bustedBefore = false;
}
/* (non-Javadoc)
* @see org.apache.struts.action.ActionForm#validate(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)
*/
@Override
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
ActionErrors errors = super.validate(mapping, request);
if (name == null || name.length() == 0) {
errors.add("name", new ActionMessage("The name must not be blank"));
}
return errors;
}
/**
* @return the age
*/
public String getAge() {
return age;
}
/**
* @param age the age to set
*/
public void setAge(String age) {
this.age = age;
}
/**
* @return the bustedBefore
*/
public boolean isBustedBefore() {
return bustedBefore;
}
/**
* @param bustedBefore the bustedBefore to set
*/
public void setBustedBefore(boolean bustedBefore) {
this.bustedBefore = bustedBefore;
}
/**
* @return the description
*/
public String getDescription() {
return description;
}
/**
* @param description the description to set
*/
public void setDescription(String description) {
this.description = description;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
}
@@ -0,0 +1,48 @@
/*
* $Id: Gangster.java 418530 2006-07-01 23:58:13Z mrdon $
*
* Copyright 2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.struts2.showcase.integration;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
public class SaveGangsterAction extends Action {
/* (non-Javadoc)
* @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
@Override
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
// Some code to save the gangster to the db as necessary
GangsterForm gform = (GangsterForm) form;
ActionMessages messages = new ActionMessages();
messages.add("msg", new ActionMessage("Gangster "+gform.getName()+" added successfully"));
addMessages(request, messages);
return mapping.findForward("success");
}
}
@@ -0,0 +1,217 @@
/*
* $Id: CreatePerson.java 420385 2006-07-10 00:57:05Z mrdon $
*
* Copyright 2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.struts2.showcase.source;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletContext;
import org.apache.struts2.util.ServletContextAware;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
/**
* Processes configuration, page, and action class paths to create snippets
* of the files for display.
*/
public class ViewSourceAction extends ActionSupport implements ServletContextAware {
private String page;
private String className;
private String config;
private List pageLines;
private List classLines;
private List configLines;
private int configLine;
private int padding = 10;
private ServletContext servletContext;
public String execute() throws MalformedURLException, IOException {
if (page != null) {
InputStream in = ClassLoaderUtil.getResourceAsStream(page.substring(page.indexOf("//")+1), getClass());
page = page.replace("//", "/");
if (in == null) {
in = servletContext.getResourceAsStream(page);
while (in == null && page.indexOf('/', 1) > 0) {
page = page.substring(page.indexOf('/', 1));
in = servletContext.getResourceAsStream(page);
}
}
pageLines = read(in, -1);
}
if (className != null) {
className = "/"+className.replace('.', '/') + ".java";
InputStream in = getClass().getResourceAsStream(className);
if (in == null) {
in = servletContext.getResourceAsStream("/WEB-INF/src"+className);
}
classLines = read(in, -1);
}
if (config != null) {
int pos = config.lastIndexOf(':');
configLine = Integer.parseInt(config.substring(pos+1));
config = config.substring(0, pos).replace("//", "/");
configLines = read(new URL(config).openStream(), configLine);
}
return SUCCESS;
}
/**
* @param className the className to set
*/
public void setClassName(String className) {
this.className = className;
}
/**
* @param config the config to set
*/
public void setConfig(String config) {
this.config = config;
}
/**
* @param page the page to set
*/
public void setPage(String page) {
this.page = page;
}
/**
* @param padding the padding to set
*/
public void setPadding(int padding) {
this.padding = padding;
}
/**
* @return the classLines
*/
public List getClassLines() {
return classLines;
}
/**
* @return the configLines
*/
public List getConfigLines() {
return configLines;
}
/**
* @return the pageLines
*/
public List getPageLines() {
return pageLines;
}
/**
* @return the className
*/
public String getClassName() {
return className;
}
/**
* @return the config
*/
public String getConfig() {
return config;
}
/**
* @return the page
*/
public String getPage() {
return page;
}
/**
* @return the configLine
*/
public int getConfigLine() {
return configLine;
}
/**
* @return the padding
*/
public int getPadding() {
return padding;
}
/**
* Reads in a strea, optionally only including the target line number
* and its padding
*
* @param in The input stream
* @param targetLineNumber The target line number, negative to read all
* @return A list of lines
*/
private List read(InputStream in, int targetLineNumber) {
List snippet = null;
if (in != null) {
snippet = new ArrayList();
int startLine = 0;
int endLine = Integer.MAX_VALUE;
if (targetLineNumber > 0) {
startLine = targetLineNumber - padding;
endLine = targetLineNumber + padding;
}
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
int lineno = 0;
String line;
while ((line = reader.readLine()) != null) {
lineno++;
if (lineno >= startLine && lineno <= endLine) {
snippet.add(line);
}
}
} catch (Exception ex) {
// ignoring as snippet not available isn't a big deal
}
}
return snippet;
}
public void setServletContext(ServletContext arg0) {
this.servletContext = arg0;
}
}
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="name">
<field-validator type="requiredstring">
<message>Name is required</message>
</field-validator>
</field>
<field name="age">
<field-validator type="required">
<message>Age is required</message>
</field-validator>
</field>
</validators>
@@ -5,8 +5,6 @@
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="struts-default.xml" />
<package name="actionchaining" extends="struts-default" namespace="/actionchaining">
<action name="actionChain1" class="org.apache.struts2.showcase.actionchaining.ActionChain1">
<result type="chain">actionChain2</result>
@@ -3,8 +3,6 @@
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="struts-default.xml"/>
<package name="ajax" extends="struts-default">
<action name="AjaxTest" class="org.apache.struts2.showcase.ajax.AjaxTestAction">
<result>/ajax/AjaxResult.jsp</result>
@@ -46,6 +44,10 @@
<result type="freemarker">/ajax/tabbedpanel/example4.ftl</result>
</action>
<action name="example5" class="org.apache.struts2.showcase.ajax.Example5Action">
<result name="input">/ajax/tabbedpanel/example5.jsp</result>
<result>/ajax/tabbedpanel/example5Ok.jsp</result>
</action>
</package>
<package name="ajaxNoDecorate" namespace="/nodecorate" extends="struts-default">
@@ -4,7 +4,6 @@
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="struts-default.xml" />
<package name="chat" extends="struts-default" namespace="/chat">
<interceptors>
<interceptor name="chatAuthentication"
@@ -2,8 +2,6 @@
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="struts-default.xml"/>
<package name="continuations" extends="struts-default" namespace="/continuations">
<action name="guess" class="org.apache.struts2.showcase.Guess">
<result type="freemarker">guess.ftl</result>
@@ -5,9 +5,9 @@
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="struts-default.xml" />
<package name="conversion" namespace="/conversion" extends="struts-default">
<!-- Example populating a List inside an Action -->
<action name="enterPersonsInfo" method="input"
class="org.apache.struts2.showcase.conversion.PersonAction">
<result>enterPersonInfo.jsp</result>
@@ -17,7 +17,7 @@
<result>showPersonInfo.jsp</result>
<result name="input">enterPersonInfo.jsp</result>
</action>
<action name="showJspCode">
<action name="showPersonJspCode">
<result type="plaintext">/conversion/enterPersonInfo.jsp</result>
</action>
<action name="showPersonActionJavaCode">
@@ -26,5 +26,50 @@
<action name="showPersonJavaCode">
<result type="plaintext">/conversion/Person.java.txt</result>
</action>
<!-- Example populating a Set inside an Action -->
<action name="enterAddressesInfo" class="org.apache.struts2.showcase.conversion.AddressAction" method="input">
<result>enterAddressInfo.jsp</result>
</action>
<action name="submitAddressesInfo" class="org.apache.struts2.showcase.conversion.AddressAction" method="submit">
<result>showAddressInfo.jsp</result>
<result name="input">enterAddressInfo.jsp</result>
</action>
<action name="showAddressJspCode">
<result type="plaintext">/conversion/enterAddressInfo.jsp</result>
</action>
<action name="showAddressActionJavaCode">
<result type="plaintext">/conversion/AddressAction.java.txt</result>
</action>
<action name="showAddressJavaCode">
<result type="plaintext">/conversion/Address.java.txt</result>
</action>
<!-- Example populating a List with Tiger 5 Enum -->
<action name="enterOperationEnumInfo" class="org.apache.struts2.showcase.conversion.OperationsEnumAction" method="input">
<result>enterOperations.jsp</result>
</action>
<action name="submitOperationEnumInfo" class="org.apache.struts2.showcase.conversion.OperationsEnumAction" method="submit">
<result>showOperations.jsp</result>
<result name="input">enterOperations.jsp</result>
</action>
<action name="showEnumJspCode">
<result type="plaintext">/conversion/enterOperations.jsp</result>
</action>
<action name="showOperationsEnumJavaCode">
<result type="plaintext">/conversion/OperationsEnum.java.txt</result>
</action>
<action name="showOperationEnumActionJavaCode">
<result type="plaintext">/conversion/OperationsEnumAction.java.txt</result>
</action>
<action name="showEnumTypeConverterJavaCode">
<result type="plaintext">/conversion/EnumTypeConverter.java.txt</result>
</action>
<action name="showOperationsEnumActionConversionProperties">
<result type="plaintext">/conversion/OperationsEnumActionConversion.txt</result>
</action>
</package>
</struts>
@@ -5,8 +5,6 @@
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="struts-default.xml" />
<package name="filedownload" extends="struts-default" namespace="/filedownload">
<default-action-ref name="download"/>
@@ -5,8 +5,6 @@
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="struts-default.xml" />
<package name="fileupload" extends="struts-default" namespace="/fileupload">
<default-action-ref name="upload"/>
@@ -6,8 +6,6 @@
<struts>
<include file="struts-default.xml" />
<package name="freemarker" namespace="/freemarker" extends="struts-default">
<action name="customFreemarkerManagerDemo">
<result type="freemarker">/freemarker/customFreemarkerManagerUsage.ftl</result>
@@ -5,7 +5,6 @@
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="struts-default.xml" />
<package name="hangman" extends="struts-default" namespace="/hangman">
<action name="hangmanMenu">
<result type="freemarker">/hangman/hangmanMenu.ftl</result>
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="integration" extends="struts1-default" namespace="/integration">
<interceptors>
<interceptor name="gangsterForm" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor">
<param name="className">org.apache.struts2.showcase.integration.GangsterForm</param>
<param name="name">gangsterForm</param>
</interceptor>
<interceptor name="gangsterValidation" class="org.apache.struts2.s1.ActionFormValidationInterceptor">
<param name="pathnames">/org/apache/struts/validator/validator-rules.xml,/WEB-INF/validation.xml</param>
</interceptor>
<interceptor-stack name="integration">
<interceptor-ref name="static-params"/>
<interceptor-ref name="gangsterForm"/>
<interceptor-ref name="model-driven"/>
<interceptor-ref name="actionForm-reset"/>
<interceptor-ref name="basicStack"/>
<interceptor-ref name="gangsterValidation"/>
<interceptor-ref name="workflow"/>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="integration" />
<default-action-ref name="editGangster" />
<!-- Diplay entry page that uses Model-Driven technique -->
<action name="editGangster" class="org.apache.struts2.s1.Struts1Action">
<param name="className">org.apache.struts2.showcase.integration.EditGangsterAction</param>
<result>modelDriven.jsp</result>
</action>
<!-- Display the result page whose content is populated using the Model-Driven technique -->
<action name="saveGangster" class="org.apache.struts2.s1.Struts1Action">
<param name="className">org.apache.struts2.showcase.integration.SaveGangsterAction</param>
<param name="validate">true</param>
<result name="input">modelDriven.jsp</result>
<result>modelDrivenResult.jsp</result>
</action>
</package>
</struts>
@@ -2,9 +2,7 @@
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="struts-default.xml"/>
<package name="jsf" extends="struts-default" namespace="/jsf">
<package name="jsf" extends="jsf-default" namespace="/jsf">
<result-types>
<result-type name="jsf" class="org.apache.struts2.jsf.FacesResult" />
@@ -5,8 +5,6 @@
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="struts-default.xml" />
<package name="modelDriven" extends="struts-default" namespace="/modelDriven">
<!-- Diplay entry page that uses Model-Driven technique -->
<action name="modelDriven" class="org.apache.struts2.showcase.modelDriven.ModelDrivenAction" method="input">
@@ -5,8 +5,6 @@
<!-- START SNIPPET: xworkSample -->
<struts>
<include file="struts-default.xml"/>
<package name="person" extends="struts-default" namespace="/person">
<action name="listPeople" class="org.apache.struts2.showcase.person.ListPeople">
<interceptor-ref name="validationWorkflowStack"/>
@@ -4,8 +4,6 @@
<struts>
<include file="struts-default.xml" />
<!-- ================================== -->
<!-- === Package for ActionTag Demo === -->
<!-- ================================== -->
@@ -5,8 +5,6 @@
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="struts-default.xml"/>
<package name="ui-tags" extends="struts-default" namespace="/tags/ui">
<action name="example" class="org.apache.struts2.showcase.UITagExample">
<result>example.jsp</result>
@@ -2,8 +2,6 @@
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="struts-default.xml"/>
<package name="token" extends="struts-default" namespace="/token">
<action name="tokenPrepare!*" class="org.apache.struts2.showcase.token.TokenAction" method="{1}">
@@ -3,8 +3,6 @@
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="struts-default.xml" />
<package name="validation" extends="struts-default" namespace="/validation">
<action name="quizBasic" class="org.apache.struts2.showcase.validation.QuizAction">
<result name="input">quiz-basic.jsp</result>
@@ -2,8 +2,6 @@
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="struts-default.xml"/>
<package name="wait" extends="struts-default" namespace="/wait">
<action name="longProcess1" class="org.apache.struts2.showcase.wait.LongProcessAction">
+6 -5
View File
@@ -5,13 +5,8 @@
"http://struts.apache.org/dtds/struts-2.0.dtd">
<!-- START SNIPPET: xworkSample -->
<struts>
<include file="struts-default.xml"/>
<include file="config-browser.xml"/>
<include file="struts-chat.xml" />
<include file="struts-hangman.xml" />
@@ -38,6 +33,8 @@
<include file="struts-model-driven.xml" />
<include file="struts-integration.xml" />
<include file="struts-filedownload.xml" />
<include file="struts-conversion.xml" />
@@ -57,6 +54,10 @@
<action name="showcase">
<result>showcase.jsp</result>
</action>
<action name="viewSource" class="org.apache.struts2.showcase.source.ViewSourceAction">
<result>viewSource.jsp</result>
</action>
<action name="date" class="org.apache.struts2.showcase.DateAction">
<result name="success">/date.jsp</result>
@@ -5,11 +5,25 @@
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();
org.apache.struts2.dispatcher.mapper.ActionMapping mapping = org.apache.struts2.ServletActionContext.getActionMapping();
if (inv != null) {
sourceUrl += "?config="+inv.getProxy().getConfig().getLocation().getURI()+":"+inv.getProxy().getConfig().getLocation().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();
}
} else {
sourceUrl += "?page="+request.getServletPath();
}
%>
<%@ taglib uri="sitemesh-decorator" prefix="decorator" %>
<%@ taglib uri="sitemesh-page" prefix="page" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" %>
<%@taglib prefix="page" uri="http://www.opensymphony.com/sitemesh/page" %>
<%@taglib prefix="s" uri="/struts-tags" %>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
@@ -89,7 +103,11 @@
</div><!-- end content -->
<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 -->
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.3.0//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_3_0.dtd">
<form-validation>
<!--
This is a minimal Validator form file with a couple of examples.
-->
<global>
<!-- An example global constant
<constant>
<constant-name>postalCode</constant-name>
<constant-value>^\d{5}\d*$</constant-value>
</constant>
end example-->
</global>
<formset>
<!-- An example form -->
<form name="gangsterForm">
<field
property="age"
depends="required">
<msg name="required" key="The age is required" resource="false"/>
</field>
</form>
</formset>
</form-validation>
+3 -13
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Struts Showcase Application</display-name>
@@ -148,14 +148,4 @@
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<taglib>
<taglib-uri>sitemesh-page</taglib-uri>
<taglib-location>/WEB-INF/sitemesh-page.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>sitemesh-decorator</taglib-uri>
<taglib-location>/WEB-INF/sitemesh-decorator.tld</taglib-location>
</taglib>
</web-app>
@@ -0,0 +1,27 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="<s:url value='/struts/tabs.css' />" />
<s:head theme="ajax" />
</head>
<body>
<s:url id="url" action="example5" namespace="/nodecorate" includeContext="false" />
<s:tabbedPanel id="tp" theme="ajax">
<s:panel id="t1" tabName="Tab 1" href="%{#url}">
<s:form action="example5" namespace="" theme="ajax" validate="true" >
<s:textfield label="Name" name="name" theme="ajax" />
<s:textfield label="Age" name="age" theme="ajax" />
<s:submit />
</s:form>
</s:panel>
</s:tabbedPanel>
</body>
</html>
@@ -0,0 +1,9 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<h1>OK</h1>
<s:property value="name" /><br/>
<s:property value="age" /><br/>
@@ -18,6 +18,10 @@
<s:url id="url" action="example4" />
<s:a href="%{#url}">Only remove tabbed panel</s:a>
</li>
<li>
<s:url id="url" value="/ajax/tabbedpanel/example5.jsp" />
<s:a href="%{#url}">Remote form validation inside tabbed panel</s:a>
</li>
</ol>
@@ -0,0 +1,35 @@
/*
* $Id: Person.java 440597 2006-09-06 03:34:39Z tmjee $
*
* Copyright 2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.struts2.showcase.conversion;
/**
* @version $Date$ $Id$
*/
public class Address {
private String id;
private String address;
public String getId() { return id; }
public void setId(String id) { this.id = id; }
public String getAddress() { return address; }
public void setAddress(String address) { this.address = address; }
}
@@ -0,0 +1,44 @@
/*
* $Id: Person.java 440597 2006-09-06 03:34:39Z tmjee $
*
* Copyright 2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.struts2.showcase.conversion;
import java.util.LinkedHashSet;
import java.util.Set;
import com.opensymphony.xwork2.ActionSupport;
/**
* @version $Date$ $Id$
*/
public class AddressAction extends ActionSupport {
private Set addresses = new LinkedHashSet();
public Set getAddresses() { return addresses; }
public void setAddresses(Set addresses) { this.addresses = addresses; }
public String input() throws Exception {
return SUCCESS;
}
public String submit() throws Exception {
System.out.println(addresses);
return SUCCESS;
}
}
@@ -0,0 +1,55 @@
/*
* $Id: Person.java 440597 2006-09-06 03:34:39Z tmjee $
*
* Copyright 2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.struts2.showcase.conversion;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.struts2.util.StrutsTypeConverter;
/**
* @version $Date$ $Id$
*/
public class EnumTypeConverter extends StrutsTypeConverter {
@Override
public Object convertFromString(Map context, String[] values, Class toClass) {
List<Enum> result = new ArrayList<Enum>();
for (int a=0; a< values.length; a++) {
Enum e = Enum.valueOf(OperationsEnum.class, values[a]);
if (e != null)
result.add(e);
}
return result;
}
@Override
public String convertToString(Map context, Object o) {
List l = (List) o;
String result ="<";
for (Iterator i = l.iterator(); i.hasNext(); ) {
result = result + "["+ i.next() +"]";
}
result = result+">";
return result;
}
}
@@ -0,0 +1,30 @@
/*
* $Id: Person.java 440597 2006-09-06 03:34:39Z tmjee $
*
* Copyright 2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.struts2.showcase.conversion;
/**
*
* @version $Date$ $Id$
*/
public enum OperationsEnum {
ADD,
MINUS,
DIVIDE,
MULTIPLY,
REMAINDER;
}
@@ -0,0 +1,53 @@
/*
* $Id: Person.java 440597 2006-09-06 03:34:39Z tmjee $
*
* Copyright 2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.struts2.showcase.conversion;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import com.opensymphony.xwork2.ActionSupport;
/**
*
* @version $Date$ $Id$
*/
public class OperationsEnumAction extends ActionSupport {
private static final long serialVersionUID = -2229489704988870318L;
private List<OperationsEnum> selectedOperations = new LinkedList<OperationsEnum>();
public List<OperationsEnum> getSelectedOperations() { return this.selectedOperations; }
public void setSelectedOperations(List<OperationsEnum> selectedOperations) {
this.selectedOperations = selectedOperations;
}
public List<OperationsEnum> getAvailableOperations() {
return Arrays.asList(OperationsEnum.values());
}
public String input() throws Exception {
return SUCCESS;
}
public String submit() throws Exception {
return SUCCESS;
}
}
@@ -0,0 +1,4 @@
selectedOperations=org.apache.struts2.showcase.conversion.EnumTypeConverter
Element_selectedOperations=org.apache.struts2.showcase.conversion.OperationsEnum
@@ -0,0 +1,48 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Showcase - Conversion - Set</title>
</head>
<body>
<p/>
An example populating a Set of object (Address.java) into Struts' action (AddressAction.java)
<p/>
See the jsp code <s:url id="url" action="showAddressJspCode" namespace="/conversion" /><s:a href="%{#url}">here.</s:a><br/>
See the code for PersonAction.java <s:url id="url" action="showAddressActionJavaCode" namespace="/conversion" /><s:a href="%{#url}">here.</s:a><br/>
See the code for Person.java <s:url id="url" action="showAddressJavaCode" namespace="/conversion" /><s:a href="%{#url}">here.</s:a><br/>
<p/>
<s:form action="submitAddressesInfo" namespace="/conversion">
<s:iterator value="%{new int[3]}" status="stat">
<s:textfield label="%{'Address '+#stat.index}"
name="%{'addresses(\\'id'+#stat.index+'\\').address'}" />
</s:iterator>
<s:submit />
</s:form>
<%--
The following is how its done statically
--%>
<%--
<s:form action="submitAddressInfo" namespace="/conversion">
<s:textfield label="Address 0"
name="addresses('id0')" />
<s:textfield label="Address 1"
name="addresses('id1')" />
<s:textfield label="Address 2"
name="addresses('id2')" />
<s:submit />
</s:form>
--%>
</body>
</html>
@@ -0,0 +1,31 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Showcase - Conversion - Tiger 5 Enum </title>
</head>
<body>
See the jsp code <s:url id="url" action="showEnumJspCode" namespace="/conversion" /><s:a href="%{#url}">here.</s:a><br/>
See the code for OperationsEnum.java <s:url id="url" action="showOperationsEnumJavaCode" namespace="/conversion" /><s:a href="%{#url}">here.</s:a><br/>
See the code for OperationsEnumAction.java <s:url id="url" action="showOperationEnumActionJavaCode" namespace="/conversion" /><s:a href="%{#url}">here.</s:a><br/>
See the code for EnumTypeConverter.java <s:url id="url" action="showEnumTypeConverterJavaCode" namespace="/conversion" /><s:a href="%{#url}">here.</s:a><br/>
See the properties for OperationsEnumAction-conversion.properties <s:url id="url" action="showOperationsEnumActionConversionProperties" namespace="/conversion" /><s:a href="%{#url}">here.</s:a>
<br/>
<br/>
<s:form action="submitOperationEnumInfo" namespace="/conversion">
<s:checkboxlist label="Operations"
name="selectedOperations"
list="%{availableOperations}"
listKey="name()"
listValue="name()"
/>
<s:submit />
</s:form>
</body>
</html>
@@ -11,7 +11,7 @@ An example populating a list of object (Person.java) into Struts' action (Person
<p/>
See the jsp code <s:url id="url" action="showJspCode" namespace="/conversion" /><s:a href="%{#url}">here.</s:a><br/>
See the jsp code <s:url id="url" action="showPersonJspCode" namespace="/conversion" /><s:a href="%{#url}">here.</s:a><br/>
See the code for PersonAction.java <s:url id="url" action="showPersonActionJavaCode" namespace="/conversion" /><s:a href="%{#url}">here.</s:a><br/>
See the code for Person.java <s:url id="url" action="showPersonJavaCode" namespace="/conversion" /><s:a href="%{#url}">here.</s:a><br/>
@@ -8,7 +8,18 @@
<body>
<ul>
<li><s:url id="url" action="enterPersonsInfo" namespace="/conversion" /><s:a href="%{#url}">Populate into the Struts action class a List of Person.java Object</s:a></li>
<li>
<s:url id="url" action="enterPersonsInfo" namespace="/conversion" />
<s:a href="%{#url}">Populate into the Struts action class a List of Person.java Object</s:a>
</li>
<li>
<s:url id="url" action="enterAddressesInfo" namespace="/conversion" />
<s:a href="%{#url}">Populate into Struts action class a Set of Address.java Object</s:a>
</li>
<li>
<s:url id="url" action="enterOperationEnumInfo" namespace="/conversion" />
<s:a href="%{#url}">Populate into Struts action class a List of OperationEnum.java (Java5 Enum)</s:a>
</li>
</ul>
</body>
@@ -0,0 +1,15 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Showcase - Conversion - Set </title>
</head>
<body>
<s:iterator value="%{addresses}">
<s:property value="%{top.id}" /> -> <s:property value="%{top.address}" /><br/>
</s:iterator>
</body>
</html>
@@ -0,0 +1,17 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Showcase - Conversion - Tiger 5 Enum</title>
</head>
<body>
<s:iterator value="%{selectedOperations}" status="stat">
<s:property value="%{top.name()}" /><br/>
</s:iterator>
</body>
</html>
@@ -0,0 +1,31 @@
<%@taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Showcase - Struts 1 Integration Example</title>
<s:head/>
</head>
<body>
<s:form action="saveGangster" namespace="/integration">
<s:textfield
label="Gangster Name"
name="name" />
<s:textfield
label="Gangster Age"
name="age" />
<s:checkbox
label="Gangster Busted Before"
name="bustedBefore" />
<s:textarea
cols="30"
rows="5"
label="Gangster Description"
name="description" />
<s:submit />
</s:form>
</body>
</html>
@@ -0,0 +1,24 @@
<%@taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Showcase - Struts 1 Integration Example</title>
<s:head/>
</head>
<body>
<s:actionmessage />
<s:label
label="Gangster Name"
name="name" /><br/>
<s:label
label="Gangster Age"
name="age" /><br/>
<s:label
label="Busted Before"
name="bustedBefore" /><br/>
<s:label
label="Gangster Description"
name="description" /><br/>
</body>
</html>
@@ -66,6 +66,9 @@
<!-- JavaServer Faces -->
<li><s:url id="url" value="/jsf" /><s:a href="%{#url}">JavaServer Faces Example</s:a></li>
<!-- Integration -->
<li><s:url id="url" action="editGangster" namespace="/integration"/><s:a href="%{#url}">Struts 1.3 Integration Example</s:a></li>
<!-- Chat (AJAX) Example -->
<li><s:url id="url" value="/chat" /><s:a href="%{#url}">Chat (AJAX) Example</s:a></li>
@@ -0,0 +1,53 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>View Sources</title>
<jsp:include page="/ajax/commonInclude.jsp"/>
<link rel="stylesheet" type="text/css" href="<s:url value="/struts/tabs.css"/>">
<link rel="stylesheet" type="text/css" href="<s:url value="/struts/niftycorners/niftyCorners.css"/>">
<link rel="stylesheet" type="text/css" href="<s:url value="/struts/niftycorners/niftyPrint.css"/>" media="print">
<script type="text/javascript" src="<s:url value="/struts/niftycorners/nifty.js"/>"></script>
<script type="text/javascript">
window.onload = function() {
if (!NiftyCheck())
return;
Rounded("li.tab_selected", "top", "white", "transparent", "border #ffffffS");
Rounded("li.tab_unselected", "top", "white", "transparent", "border #ffffffS");
// Rounded("div#tab_header_main li","top","white","transparent","border #ffffffS");
// "white" needs to be replaced with the background color
}
</script>
</head>
<body>
<h1>View Sources</h1>
<s:tabbedPanel id="test" theme="ajax">
<s:panel id="one" tabName="Page" theme="ajax">
<h3>${empty page ? "Unknown page" : page}</h3>
<pre>
<s:iterator value="pageLines" status="row">
${row.count}: <s:property/></s:iterator>
</pre>
</s:panel>
<s:panel id="two" tabName="Configuration" theme="ajax" >
<h3>${empty config ? "Unknown configuration" : config}</h3>
<pre>
<s:iterator value="configLines" status="row"><s:if test="%{(#row.count-1)==(configLines.size()/2)}">
<span style="background-color:yellow">${configLine - padding + row.count - 1}: <s:property/></span></s:if><s:else>
${configLine - padding + row.count - 1}: <s:property/></s:else></s:iterator>
</pre>
</s:panel>
<s:panel id="three" tabName="Java Action" theme="ajax">
<h3>${empty className ? "Unknown or unavailable Action class" : className}</h3>
<pre>
<s:iterator value="classLines" status="row">
${row.count}: <s:property/></s:iterator>
</pre>
</s:panel>
</s:tabbedPanel>
</body>
</html>
+77 -14
View File
@@ -33,7 +33,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>2.0.1</version>
</parent>
<scm>
@@ -63,30 +63,24 @@
<version>${version}</version>
<type>war</type>
</artifactItem>
<artifactItem>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-mailreader</artifactId>
<version>${version}</version>
<type>war</type>
</artifactItem>
<artifactItem>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-portlet</artifactId>
<version>${version}</version>
<type>war</type>
</artifactItem>
<artifactItem>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-shopping-cart</artifactId>
<version>${version}</version>
<type>war</type>
</artifactItem>
<artifactItem>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-showcase</artifactId>
<version>${version}</version>
<type>war</type>
</artifactItem>
<artifactItem>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-starter</artifactId>
<version>${version}</version>
<type>war</type>
</artifactItem>
<artifactItem>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-mailreader</artifactId>
@@ -109,6 +103,7 @@
<groupId>opensymphony</groupId>
<artifactId>xwork</artifactId>
<classifier>javadoc</classifier>
<version>2.0-beta-1</version>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/xwork-apidocs</outputDirectory>
@@ -146,12 +141,80 @@
<artifactId>struts2-core</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-extras</artifactId>
<artifactId>struts2-all</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-config-browser-plugin</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jasperreports-plugin</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jfreechart-plugin</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jsf-plugin</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-pell-multipart-plugin</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plexus-plugin</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-quickstart-plugin</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitegraph-plugin</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitemesh-plugin</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-struts1-plugin</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-tiles-plugin</artifactId>
<version>${version}</version>
</dependency>
<!-- Include optional dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
+52 -21
View File
@@ -31,8 +31,8 @@
</dependencySets>
<fileSets>
<fileSet>
<directory>src/main/resources</directory>
<outputDirectory></outputDirectory>
<directory>src/main/resources</directory>
<outputDirectory></outputDirectory>
<includes>
<include>README*</include>
<include>LICENSE*</include>
@@ -66,9 +66,57 @@
<directory>../core/target/site</directory>
<outputDirectory>docs/struts2-core</outputDirectory>
</fileSet>
<!-- Plugins -->
<!--
<fileSet>
<directory>../extras/target/site</directory>
<outputDirectory>docs/struts2-extras</outputDirectory>
<directory>../plugins/$plugin/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-$plugin-plugin</outputDirectory>
</fileSet>
-->
<fileSet>
<directory>../plugins/config-browser/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-config-browser-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/jasperreports/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-jasperreports-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/jfreechart/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-jfreechart-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/jsf/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-jsf-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/pell-multipart/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-pell-multipart-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/plexus/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-plexus-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/quickstart/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-quickstart-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/struts1/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-struts1-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/sitegraph/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-sitegraph-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/sitemesh/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-sitemesh-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/tiles/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-tiles-plugin</outputDirectory>
</fileSet>
<!-- Include the source code in the assembly -->
@@ -136,22 +184,5 @@
<include>src/</include>
</includes>
</fileSet>
<fileSet>
<directory>../extras</directory>
<outputDirectory>src/extras</outputDirectory>
<includes>
<include>pom.xml</include>
<include>src/</include>
</includes>
</fileSet>
<fileSet>
<directory>../uber</directory>
<outputDirectory>src/uber</outputDirectory>
<includes>
<include>pom.xml</include>
<include>src/</include>
</includes>
</fileSet>
</fileSets>
</assembly>
-16
View File
@@ -116,22 +116,6 @@
<include>src/</include>
</includes>
</fileSet>
<fileSet>
<directory>../extras</directory>
<outputDirectory>src/extras</outputDirectory>
<includes>
<include>pom.xml</include>
<include>src/</include>
</includes>
</fileSet>
<fileSet>
<directory>../uber</directory>
<outputDirectory>src/uber</outputDirectory>
<includes>
<include>pom.xml</include>
<include>src/</include>
</includes>
</fileSet>
</fileSets>
</assembly>
+29
View File
@@ -0,0 +1,29 @@
Retrotranslator: a Java bytecode transformer that translates Java classes
compiled with JDK 5.0 into classes that can be run on JVM 1.4.
Copyright (c) 2005, 2006 Taras Puchko
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
+549
View File
@@ -0,0 +1,549 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Retrotranslator</title>
</head>
<body>
<table border="0" width="98%">
<tr>
<td><h2>Retrotranslator</h2></td>
<td width="125" align="left"><a href="http://sourceforge.net"><img
src="http://sflogo.sourceforge.net/sflogo.php?group_id=153566&amp;type=2"
width="125" height="37" border="0" alt="SourceForge.net Logo"/></a>
</td>
</tr>
</table>
<h4>Contents</h4>
<ol>
<li><a href="#what">What is Retrotranslator?</a></li>
<li><a href="#features">What Java 5 features are supported?</a></li>
<li><a href="#commandline">How to use Retrotranslator from a command line?</a></li>
<li><a href="#ant">How to use Retrotranslator from Apache Ant or Maven?</a></li>
<li><a href="#idea">How to use Retrotranslator from IntelliJ IDEA?</a></li>
<li><a href="#jit">How to use Just-in-Time Retrotranslator?</a></li>
<li><a href="#supported">What Java 5 classes and methods are supported?</a></li>
<li><a href="#extension">How to write an extension for Retrotranslator?</a></li>
<li><a href="#limitations">What are the limitations?</a></li>
<li><a href="#alternative">Alternative tools</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#license">License</a></li>
</ol>
<h4><a name="what">What is Retrotranslator?</a></h4>
<a href="http://sourceforge.net/projects/retrotranslator">Retrotranslator</a> is a Java bytecode transformer
that translates Java classes compiled with JDK 5.0 into classes that can be run on JVM 1.4.
It is a free, open-source tool based on the <a href="http://asm.objectweb.org/">ASM bytecode manipulation framework</a>
and concurrency utilities
<a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php">backported to Java 1.4</a>.
<h4><a name="features">What Java 5 features are supported?</a></h4>
<ul>
<li>Generics (generic types)</li>
<li>Annotations (metadata)</li>
<li>Reflection on generics and annotations</li>
<li>Typesafe enums (enumerated types)</li>
<li>Autoboxing/unboxing</li>
<li>Enhanced for loop (for-each loop)</li>
<li>Varargs (variable arguments)</li>
<li>Covariant return types</li>
<li>Static import</li>
<li>Concurrency utilities</li>
<li>Collections framework enhancements</li>
</ul>
<h4><a name="commandline">How to use Retrotranslator from a command line?</a></h4>
<ol>
<li><a href="http://sourceforge.net/project/showfiles.php?group_id=153566">Download</a>
and unzip the binary distribution file <code>Retrotranslator-<i>n.n.n</i>-bin.zip</code>,
where <i>n.n.n</i> is the latest Retrotranslator release number.
</li>
<li>
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>
<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.
</li>
<li>
Run or debug the application as usual on any JVM 1.4, preferably JRE 1.4.2.
</li>
</ol>
<p>The full command line syntax:<br>
<code>java -jar retrotranslator-transformer-<i>n.n.n</i>.jar &lt;options&gt;</code>
<br>or<br>
<code>java -cp retrotranslator-transformer-<i>n.n.n</i>.jar net.sf.retrotranslator.transformer.Retrotranslator &lt;options&gt;</code></p>
<table border="1" cellspacing="0" cellpadding="5">
<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>-</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>-</td>
</tr>
<tr>
<td nowrap><code>-destdir</code></td>
<td>Directory to place classes compatible with J2SE 1.4.</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>Location of sources</td>
</tr>
<tr>
<td nowrap><code>-stripsign</code></td>
<td>Asks the translator to strip signature (generics) information.</td>
<td>Off</td>
</tr>
<tr>
<td nowrap><code>-verbose</code></td>
<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><code>-advanced</code></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.
References introduced by a compiler will also remain unchanged,
like the use of <code>java.lang.StringBuilder</code> for string concatenation
or the implicit <code>valueOf</code> method call for autoboxing.</td>
<td>Off</td>
</tr>
</table>
<p>
For example, if you have a Java 5 application <code>myapplication5.jar</code> you can use the following command
to produce <code>myapplication4.jar</code> that will run on J2SE 1.4 and is independent of Retrotranslator,
since required classes are added to the translated application with a different package name:
</p>
<p>
<code>java -jar retrotranslator-transformer-<i>n.n.n</i>.jar
-srcjar myapplication5.jar -destjar myapplication4.jar -embed com.mycompany.internal</code><br>
</p>
<h4><a name="ant">How to use Retrotranslator from Apache Ant or Maven?</a></h4>
<p>The distribution contains an integrated <a href="http://ant.apache.org/">Apache Ant</a> task
<code>net.sf.retrotranslator.transformer.RetrotranslatorTask</code>. It has the following syntax:</p>
<table border="1" cellspacing="0" cellpadding="5">
<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>-</td>
</tr>
<tr>
<td><code>srcjar</code></td>
<td>JAR file with classes compiled using JDK 5.0.</td>
<td>-</td>
</tr>
<tr>
<td><code>destdir</code></td>
<td>Directory to place classes compatible with J2SE 1.4.</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>Location of sources</td>
</tr>
<tr>
<td><code>stripsign</code></td>
<td>Asks the translator to strip signature (generics) information.</td>
<td>Off</td>
</tr>
<tr>
<td><code>verbose</code></td>
<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.
References introduced by a compiler will also remain unchanged,
like the use of <code>java.lang.StringBuilder</code> for string concatenation
or the implicit <code>valueOf</code> method call for autoboxing.</td>
<td>Off</td>
</tr>
<tr>
<td><code>failonwarning</code></td>
<td>Indicates whether the build will fail when there are verification warnings.</td>
<td>On</td>
</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:
</p>
<pre>
&lt;path id="classpath"&gt;
&lt;fileset dir="lib" includes="**/*.jar"/&gt;
&lt;/path&gt;
&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;classpath location="${java14_home}/jre/lib/rt.jar"/&gt;
&lt;classpath refid="classpath"/&gt;
&lt;/retrotranslator&gt;
</pre>
<p>
For <a href="http://maven.apache.org/">Maven</a> there is a
<a href="http://mojo.codehaus.org/retrotranslator-maven-plugin/">Retrotranslator plugin</a>
from the <a href="http://mojo.codehaus.org/">Mojo Project</a>.
</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.
</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.
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>
<ul>
<li>
If you want to run a JAR file with the JIT, execute:<br>
<code>java -cp retrotranslator-transformer-<i>n.n.n</i>.jar
net.sf.retrotranslator.transformer.JITRetrotranslator -jar &lt;jarfile&gt; [&lt;args...&gt;]</code>
</li>
<li>
When the first option does not work or if you just want to run a class from your classpath, execute:<br>
<code>java -cp retrotranslator-transformer-<i>n.n.n</i>.jar:&lt;classpath&gt;
net.sf.retrotranslator.transformer.JITRetrotranslator &lt;class&gt; [&lt;args...&gt;]</code>
</li>
<li>
Alternatively you may simply call <code>JITRetrotranslator.install()</code> from some JVM 1.4 compatible class
before Java 5 classes are loaded.
</li>
</ul>
<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.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>
<a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php"> Backport of JSR 166</a><br>
<code>Condition.awaitNanos(long)</code> method is supported but with
<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>
<tr><td><code>PrintStream</code></td><td>
<code>append(CharSequence), append(CharSequence, int, int), append(char)</code>
</td><td>&nbsp;</td></tr>
<tr><td><code>PrintWriter</code></td><td>
<code>PrintWriter(File), PrintWriter(File, String), PrintWriter(String), PrintWriter(String, String)</code>
</td><td>&nbsp;</td></tr>
<tr><td><code>Reader</code></td><td><code>read(CharBuffer)</code></td><td>&nbsp;</td></tr>
<tr><td><code>Writer</code></td><td>
<code>append(CharSequence), append(CharSequence, int, int), 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><code>Boolean</code></td><td><code>parseBoolean(String), 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.
</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>
<tr><td><code>Enum</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>Float</code></td><td><code>valueOf(float)</code></td><td>&nbsp;</td></tr>
<tr><td><code>IllegalArgumentException</code></td><td><code>IllegalArgumentException(String, Throwable),<br>
IllegalArgumentException(Throwable)</code></td><td>&nbsp;</td></tr>
<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)</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>Long</code></td><td><code>valueOf(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>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>
replace(CharSequence, CharSequence)</code></td><td>&nbsp;</td></tr>
<tr><td><code>StringBuffer</code></td><td><code>
StringBuffer(CharSequence), append(CharSequence), append(CharSequence, int, int),
insert(int, CharSequence), insert(int, CharSequence, int, int)
</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>
<tr><td><code>SuppressWarnings</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>System</code></td><td><code>nanoTime(), clearProperty(String)</code></td><td>
<a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php"> Backport of JSR 166</a><br>
<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>
<tr><td><code>Thread</code></td><td><code>getStackTrace(), getId()
</code></td><td><code>Thread.getStackTrace()</code> returns non-empty stack trace only for the current thread;<br>
<code>Thread.getId()</code> does not reflect the order in which threads are created.</td></tr>
<tr><td><code>TypeNotPresentException</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td rowspan="12"><code>java.lang.reflect</code></td><td><code>AnnotatedElement</code></td><td>*</td><td>
<code>new AnnotatedElement[...]</code> is replaced with <code>new Object[...]</code>
</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>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>TypeVariable</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>WildcardType</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td ><code>java.math</code></td><td><code>BigDecimal</code></td><td>
<code>BigDecimal(int), BigDecimal(long), ZERO, ONE, TEN, divideAndRemainder(BigDecimal),
divideToIntegralValue(BigDecimal), pow(int), remainder(BigDecimal), toPlainString(), valueOf(double),
valueOf(long)</code></td><td><code>BigDecimal.setScale(int, int)</code> supports negative scales in advanced mode.</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.util.nio</code></td><td><code>CharBuffer</code></td><td>
<code>append(CharSequence), append(CharSequence, int, int), append(char), read(CharBuffer)</code>
</td><td>&nbsp;</td></tr>
<tr><td rowspan="9"><code>java.util</code></td><td><code>AbstractQueue</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>
<a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php"> Backport of JSR 166</a>
</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>LinkedList</code></td><td>* (5 new methods)</td><td>&nbsp;</td></tr>
<tr><td><code>PriorityQueue</code></td><td>*</td><td>&nbsp;</td></tr>
<tr><td><code>Queue</code></td><td>*</td><td>
<code>new Queue[...]</code> is replaced with <code>new Object[...]</code>
</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), 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>Pattern</code></td><td><code>quote(String)</code></td><td>&nbsp;</td></tr>
</table>
<h4><a name="extension">How to write an extension for Retrotranslator?</a></h4>
<p>
Since most backported classes are discovered by Retrotranslator at translation time,
you may write an extension and simply put it into the Retrotranslator classpath to make it work.
For example, all references to
<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://cvs.sourceforge.net/viewcvs.py/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.
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
<a href="http://cvs.sourceforge.net/viewcvs.py/retrotranslator/Retrotranslator/src/net/sf/retrotranslator/runtime/java/math/_BigDecimal.java?view=markup">
<code>net.sf.retrotranslator.runtime.java.math.<b>_</b>BigDecimal</code></a> (leading underscore):
</p>
<ul>
<li>For a static field there is a public static field with the same name and type.</li>
<li>For a static method there is a public static method with the same signature.</li>
<li>For an instance method there is a public static method with the same signature
but with an additional first parameter representing an instance.</li>
<li>For a constructor there is a public static <code>convertConstructorArguments</code> method that
accepts constructor's arguments an returns an argument for a Java 1.4 constuctor.</li>
</ul>
<p>
However, if the backported methods require access
to non-public methods or fields of the instance, they cannot be fully handled by Retrotranslator.
While you can use reflection to access any data, translated code generally should not depend on security settings.
For example, it is impossible to write an implementation for methods <code>getSource()</code>
and <code>setSource()</code> of <code>java.beans.PropertyEditorSupport</code> that will work in any environment.
Also this approach cannot be used to replace instance field references.
</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>.
</p>
<h4><a name="limitations">What are the limitations?</a></h4>
<p>
Basically, only classes, methods, and fields listed <a href="#supported">above</a> should work, and other features,
like formatted input/output, are not supported. Known issues:
</p>
<ul>
<li>Reflection-based tools may be unable to discover additional classes and methods introduced in Java 5 when running on JRE 1.4.</li>
<li>Translated code running on JRE 5.0 may be incompatible with other Java 5 code when Java 5 API is used.</li>
<li>Reflection on generics and metadata may return incomplete information for dynamically generated classes.</li>
<li>Access modifiers and constants inlined by a compiler are ignored during the verification.</li>
<li>Upcasting may help to translate invocations of inherited methods introduced in Java 5: <br>
<code>&nbsp;((Writer) new FileWriter("file.tmp")).append("Hello").close();</code></li>
<li>Serialized objects produced by translated code may be incompatible with JRE 5.0.</li>
</ul>
<h4><a name="alternative">Alternative tools</a></h4>
<ul>
<li><a href="http://retroweaver.sourceforge.net/">Retroweaver</a>
- a Java bytecode weaver that enables you to take advantage
of the new 1.5 language features in your source code,
while still retaining compatibility with 1.4 virtual machines.</li>
<li><a href="http://tinyurl.com/r8xba">Declawer</a>
- a customized Java compiler which reduces 1.5 Generics to equivalent 1.4 syntax.</li>
</ul>
<h4><a name="contact">Contact</a></h4>
<ul>
<li><a href="http://retrotranslator.sourceforge.net/">Latest documentation</a></li>
<li><a href="http://sourceforge.net/forum/forum.php?forum_id=513539">Open discussion</a></li>
<li><a href="http://sourceforge.net/forum/forum.php?forum_id=513540">Help</a></li>
<li><a href="http://sourceforge.net/tracker/?group_id=153566&atid=788279">Bugs</a></li>
<li><a href="http://sourceforge.net/tracker/?group_id=153566&atid=788282">Feature requests</a></li>
<li><a href="http://sourceforge.net/users/tarasp/">Author</a></li>
</ul>
<h4><a name="license">License</a></h4>
<pre>
Retrotranslator: a Java bytecode transformer that translates Java classes
compiled with JDK 5.0 into classes that can be run on JVM 1.4.
Copyright (c) 2005, 2006 Taras Puchko
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
</pre>
</body>
</html>
Binary file not shown.
Binary file not shown.
+4
View File
@@ -0,0 +1,4 @@
java -jar retrotranslator-transformer-1.0.8.jar -srcjar ../lib/struts2-core-2.0.0.jar -destjar struts2-core-j4-2.0.0.jar
java -jar retrotranslator-transformer-1.0.8.jar -srcjar ../lib/struts2-api-2.0.0.jar -destjar struts2-api-j4-2.0.0.jar
java -jar retrotranslator-transformer-1.0.8.jar -srcjar ../lib/struts2-extras-2.0.0.jar -destjar struts2-extras-j4-2.0.0.jar
java -jar retrotranslator-transformer-1.0.8.jar -srcjar ../lib/xwork-2.0-SNAPSHOT.jar -destjar xwork-j4-2.0-SNAPSHOT.jar
+9 -115
View File
@@ -5,19 +5,13 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>2.0.1</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<packaging>jar</packaging>
<name>Struts 2 - Core</name>
<name>Struts 2 Core</name>
<distributionManagement>
<site>
<id>apache-site</id>
<url>scp://people.apache.org/www/struts.apache.org/2.x/struts-core</url>
</site>
</distributionManagement>
<build>
<plugins>
<plugin>
@@ -42,20 +36,10 @@
<dependencies>
<!-- unreferenced dependencies:
* clover, mockobjects, xdoclet : only needed for build
* cewolf : only used in demos
* quickstart : because i'm lazy, and because it's unlikely to be needed to build a
project using ww
* w3c.dom : needed for the xslt : this is all included in jdk1.5
- classes missing in jdk1.4 are org.w3c.dom.TypeInfo,
org.w3c.dom.UserDataHandler, org.w3c.dom.DOMConfiguration
- this should be configurable with <profiles>
-->
<dependency>
<groupId>opensymphony</groupId>
<artifactId>xwork</artifactId>
<version>2.0-SNAPSHOT</version>
<version>2.0-beta-1</version>
</dependency>
<dependency>
@@ -84,6 +68,12 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ognl</groupId>
<artifactId>ognl</artifactId>
<version>2.6.7</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
@@ -127,65 +117,6 @@
<version>1.1.1</version>
<optional>true</optional>
</dependency>
<!-- Sitemesh -->
<dependency>
<groupId>opensymphony</groupId>
<artifactId>sitemesh</artifactId>
<version>2.2.1</version>
<optional>true</optional>
</dependency>
<!-- Quickstart -->
<dependency>
<groupId>jetty</groupId>
<artifactId>org.mortbay.jetty</artifactId>
<version>5.1.4</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>eclipse</groupId>
<artifactId>jdtcore</artifactId>
<version>3.1.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
<version>1.6.5</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>tomcat</groupId>
<artifactId>jasper-compiler</artifactId>
<version>5.5.12</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>tomcat</groupId>
<artifactId>jasper-runtime</artifactId>
<version>5.5.12</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>tomcat</groupId>
<artifactId>jasper-compiler-jdt</artifactId>
<version>5.5.12</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-el</groupId>
<artifactId>commons-el</artifactId>
<version>1.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
@@ -200,28 +131,6 @@
<optional>true</optional>
</dependency>
<!-- QuickStart -->
<dependency>
<groupId>xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.1.2</version>
<optional>true</optional>
</dependency>
<!-- Tiles -->
<dependency>
<groupId>org.apache.struts.tiles</groupId>
<artifactId>tiles-core</artifactId>
<version>0.2-SNAPSHOT</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
<version>1.7</version>
<optional>true</optional>
</dependency>
<!-- Portlet -->
<dependency>
<groupId>portlet-api</groupId>
@@ -237,14 +146,6 @@
<optional>true</optional>
</dependency>
<!-- Plexus -->
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
<version>1.0-alpha-10-SNAPSHOT</version>
<optional>true</optional>
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
@@ -281,13 +182,6 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>myfaces</groupId>
<artifactId>myfaces-jsf-api</artifactId>
<version>1.0.9</version>
<optional>true</optional>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
-73
View File
@@ -1,73 +0,0 @@
Thanks for trying out Struts:
Java's most cutting edge web development platform.
Struts is brought to you by the Apache Struts team. You can
find out more about Struts and the Apache Struts project at
http://struts.apache.org.
=== Getting started ===
We think the best way to get started with any technology is to try it
out right away. That's why we've made Struts the easiest web
development platform to get started with. You can use the QuickStart
feature (read the docs on QuickStart to learn how you can use this
important tool with your own projects):
* Open a command prompt to the root directory of this distribution
* Using a Java 5 JDK, execute:
java -jar struts-2.0.jar quickstart:showcase
* Open your browser to the URL:
http://localhost:8080/showcase
* Feel free to edit any of the sources (.java, .jsp, etc) in:
apps/showcase
* Reload your browser to see the changes right away
=== Getting help ===
To get help from the Struts developers and community,
please read the instructions at the following URL:
http://struts.apache.org/mail.html
=== Documentation ===
The documentation can be found in HTML and PDF format in the docs
directory:
* HTML format: docs/Documentation.html
* PDF format: docs/docs.pdf
* Javadocs: docs/api/index.html
This documentation has been generated from the Struts wiki at the time
of this release. If you are looking for the absolute latest
documentation, please visit the wiki at:
http://wiki.opensymphony.com/display/WW/Documentation
Note that these docs could include information about features not
included in this release, so take care when referencing the wiki.
=== Building ===
If you'd like to build your own version of Struts, we've included
everything you need in this distribution. The ant script, build.xml,
contains a "jar" task that you can launch to create your own struts
jar. The only thing you must do before hand is set up the proper jars
in the ANT_HOME/lib directory. These jars are:
* lib/bootstrap/clover-license.jar
* lib/build/clover.jar
* lib/build/junit.jar
Once you've copied these three jars in to the ANT_HOME/lib directory,
simply run "ant jar" to create your own version of Struts.
=== Distribution jars ===
The distribution zip file contains in the main dir the Struts jar, named struts-core-<version>.jar.
You can also find in the dist subdirectory a different Struts packaging:
- struts-core-nostatic-<version>.jar: containing only Struts without the static content
- struts-core-static-<version>.zip: containing the required Struts static dependencies
The struts-core-static-<version>.zip content must be included in the war distribution under struts directory,
or a directory mapped to the URL <context_path>/struts.
You must also set in your webapp struts.properties the struts.serve.static property to false.
If these conditions are not fullfilled, Struts may report strange errors.
@@ -24,8 +24,10 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.PageContext;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.util.OgnlValueStack;
import com.opensymphony.xwork2.util.ValueStack;
/**
@@ -38,6 +40,7 @@ public class ServletActionContext extends ActionContext implements StrutsStatics
private static final long serialVersionUID = -666854718275106687L;
public static final String STRUTS_VALUESTACK_KEY = "struts.valueStack";
public static final String ACTION_MAPPING = "struts.actionMapping";
@SuppressWarnings("unused")
private ServletActionContext(Map context) {
@@ -51,7 +54,7 @@ public class ServletActionContext extends ActionContext implements StrutsStatics
* @return The current action context
*/
public static ActionContext getActionContext(HttpServletRequest req) {
OgnlValueStack vs = getValueStack(req);
ValueStack vs = getValueStack(req);
if (vs != null) {
return new ActionContext(vs.getContext());
} else {
@@ -65,8 +68,17 @@ public class ServletActionContext extends ActionContext implements StrutsStatics
* @param req The request
* @return The value stack
*/
public static OgnlValueStack getValueStack(HttpServletRequest req) {
return (OgnlValueStack) req.getAttribute(STRUTS_VALUESTACK_KEY);
public static ValueStack getValueStack(HttpServletRequest req) {
return (ValueStack) req.getAttribute(STRUTS_VALUESTACK_KEY);
}
/**
* Gets the action mapping for this context
*
* @return The action mapping
*/
public static ActionMapping getActionMapping() {
return (ActionMapping) ActionContext.getContext().get(ACTION_MAPPING);
}
/**
@@ -50,10 +50,10 @@ public final class StrutsConstants {
/** The default includeParams method to generate Struts URLs */
public static final String STRUTS_URL_INCLUDEPARAMS = "struts.url.includeParams";
/** The com.opensymphony.xwork.ObjectFactory implementation class */
/** The com.opensymphony.xwork2.ObjectFactory implementation class */
public static final String STRUTS_OBJECTFACTORY = "struts.objectFactory";
/** The com.opensymphony.xwork.util.ObjectTypeDeterminer implementation class */
/** The com.opensymphony.xwork2.util.ObjectTypeDeterminer implementation class */
public static final String STRUTS_OBJECTTYPEDETERMINER = "struts.objectTypeDeterminer";
/** The package containing actions that use Rife continuations */
@@ -127,4 +127,7 @@ public final class StrutsConstants {
/** Allows one to disable dynamic method invocation from the URL */
public static final String STRUTS_ENABLE_DYNAMIC_METHOD_INVOCATION = "struts.enable.DynamicMethodInvocation";
/** A list of configuration files automatically loaded by Struts */
public static final String STRUTS_CONFIGURATION_FILES = "struts.configuration.files";
}
@@ -18,7 +18,7 @@
package org.apache.struts2;
import org.apache.struts2.config.Settings;
import org.apache.struts2.config.StrutsXMLConfigurationProvider;
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
import org.apache.struts2.dispatcher.Dispatcher;
import org.springframework.mock.web.MockServletContext;
@@ -44,7 +44,11 @@ public abstract class StrutsTestCase extends XWorkTestCase {
Dispatcher.setInstance(du);
configurationManager = new ConfigurationManager();
configurationManager.addConfigurationProvider(
new StrutsXMLConfigurationProvider("struts.xml", false));
new StrutsXmlConfigurationProvider("struts-default.xml", false));
configurationManager.addConfigurationProvider(
new StrutsXmlConfigurationProvider("struts-plugin.xml", false));
configurationManager.addConfigurationProvider(
new StrutsXmlConfigurationProvider("struts.xml", false));
du.setConfigurationManager(configurationManager);
}
@@ -39,7 +39,8 @@ import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.ActionProxyFactory;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.util.OgnlValueStack;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.ValueStackFactory;
/**
* <!-- START SNIPPET: javadoc -->
@@ -121,7 +122,7 @@ public class ActionComponent extends Component {
protected boolean executeResult;
protected boolean ignoreContextParams;
public ActionComponent(OgnlValueStack stack, HttpServletRequest req, HttpServletResponse res) {
public ActionComponent(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
super(stack);
this.req = req;
this.res = res;
@@ -175,7 +176,7 @@ public class ActionComponent extends Component {
res,
servletContext);
OgnlValueStack newStack = new OgnlValueStack(stack);
ValueStack newStack = ValueStackFactory.getFactory().createValueStack(stack);
extraContext.put(ActionContext.VALUE_STACK, newStack);
// add page context, such that ServletDispatcherResult will do an include
@@ -225,7 +226,7 @@ public class ActionComponent extends Component {
}
// get the old value stack from the request
OgnlValueStack stack = getStack();
ValueStack stack = getStack();
// execute at this point, after params have been set
try {
Configuration config = Dispatcher.getInstance().getConfigurationManager().getConfiguration();
@@ -20,7 +20,7 @@ package org.apache.struts2.components;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.opensymphony.xwork2.util.OgnlValueStack;
import com.opensymphony.xwork2.util.ValueStack;
/**
* <!-- START SNIPPET: javadoc -->
@@ -51,7 +51,7 @@ public class ActionError extends UIBean {
public static final String TEMPLATE = "actionerror";
public ActionError(OgnlValueStack stack, HttpServletRequest request, HttpServletResponse response) {
public ActionError(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
super(stack, request, response);
}

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