Compare commits

...

179 Commits

Author SHA1 Message Date
Wesley Wannemacher 8e5327eaae [maven-release-plugin] copy for tag STRUTS_2_1_7
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7@786190 13f79535-47bb-0310-9956-ffa450edef68
2009-06-18 18:08:29 +00:00
Wesley Wannemacher 87321e8d2b [maven-release-plugin] prepare release STRUTS_2_1_7
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@786189 13f79535-47bb-0310-9956-ffa450edef68
2009-06-18 18:07:01 +00:00
Wesley Wannemacher 08d9774e7b WW-3100, still trying to get manual build process working for release
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@786184 13f79535-47bb-0310-9956-ffa450edef68
2009-06-18 17:53:41 +00:00
Wesley Wannemacher 66b2b0f145 WW-3100, still trying to get manual build process working for release
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@786182 13f79535-47bb-0310-9956-ffa450edef68
2009-06-18 17:51:24 +00:00
Wesley Wannemacher 5d3bbc29c1 WW-3100, pointing docs to local directory so that I can use a cwiki export
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@786088 13f79535-47bb-0310-9956-ffa450edef68
2009-06-18 14:39:12 +00:00
Wesley Wannemacher 3dbd0294e8 WW-3163, fixing NPE, but throwing StrutsException instead, not a great fix, but when I get a chance to work closer with JBoss, I will come back to this
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@786061 13f79535-47bb-0310-9956-ffa450edef68
2009-06-18 13:35:03 +00:00
Wesley Wannemacher d8e5ea68d9 WW-3162, properly supporting inheritance for ParentPackage annotation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@786050 13f79535-47bb-0310-9956-ffa450edef68
2009-06-18 13:21:57 +00:00
Wesley Wannemacher 4e8bd6f09b Fixed comment, removed unused import WW-3100
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@783012 13f79535-47bb-0310-9956-ffa450edef68
2009-06-09 14:15:54 +00:00
Wesley Wannemacher a319344a9a Updating core to support pluggable upload capabilities WW-3100
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@783008 13f79535-47bb-0310-9956-ffa450edef68
2009-06-09 14:12:23 +00:00
Musachy Barroso 55fdb0e0f3 rname file(agrrr)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@781887 13f79535-47bb-0310-9956-ffa450edef68
2009-06-05 02:06:13 +00:00
Musachy Barroso 7953458fc0 rname file(did my cat walk on the keyboard?)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@781886 13f79535-47bb-0310-9956-ffa450edef68
2009-06-05 02:05:35 +00:00
Wesley Wannemacher 1b19830293 More NPE possible in TokenSessionStoreInterceptor, updated unit tests again WW-3150
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@781838 13f79535-47bb-0310-9956-ffa450edef68
2009-06-04 19:38:07 +00:00
Wesley Wannemacher ee1b9aac9b making unit test match environment that caused NPE in WW-3150
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@781805 13f79535-47bb-0310-9956-ffa450edef68
2009-06-04 17:33:00 +00:00
Wesley Wannemacher bc6d4bb804 Fixing NPE in token processing WW-3150, thanks James Peltzer
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@781798 13f79535-47bb-0310-9956-ffa450edef68
2009-06-04 17:08:35 +00:00
Wesley Wannemacher 6deb1d5ea8 Giving myself some room to inherit, enhance and conquer WW-3100
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@781501 13f79535-47bb-0310-9956-ffa450edef68
2009-06-03 18:34:05 +00:00
Musachy Barroso db349486d7 change some javadocs and method visibility
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@781447 13f79535-47bb-0310-9956-ffa450edef68
2009-06-03 15:59:27 +00:00
Wesley Wannemacher 47fa0c6635 trying to make bamboo happy
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@781096 13f79535-47bb-0310-9956-ffa450edef68
2009-06-02 17:47:00 +00:00
Wesley Wannemacher 6862e2a5c5 WW-3107, fixing NPE, good catch Andrey Vasenin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@781086 13f79535-47bb-0310-9956-ffa450edef68
2009-06-02 17:26:17 +00:00
Wesley Wannemacher 4f91ad5ecb WW-3143 lowering log level for file upload messages
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@781032 13f79535-47bb-0310-9956-ffa450edef68
2009-06-02 13:50:54 +00:00
Wesley Wannemacher 5e2e644b10 WW-3122, pointing to the right tiles dtd file
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@780099 13f79535-47bb-0310-9956-ffa450edef68
2009-05-29 20:32:38 +00:00
Wesley Wannemacher e9978d5c29 WW-3128, thanks Brian!
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@780096 13f79535-47bb-0310-9956-ffa450edef68
2009-05-29 20:22:09 +00:00
Wesley Wannemacher e3ae1d0131 WW-3129, now, using DynamicMethodInvocation=false really means false :)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@780092 13f79535-47bb-0310-9956-ffa450edef68
2009-05-29 20:15:14 +00:00
Wesley Wannemacher c6a6442447 WW-3137 adding consistency by making DefaultActionMapper understand redirectAction rather than redirect-action
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@780066 13f79535-47bb-0310-9956-ffa450edef68
2009-05-29 18:52:29 +00:00
Wesley Wannemacher 9d70aa85c5 WW-3097, allowing s:reset to render disabled button
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@780000 13f79535-47bb-0310-9956-ffa450edef68
2009-05-29 14:40:42 +00:00
Wesley Wannemacher 281a3a8cbd WW-3110 using newer UrlSet constructor, patch from Jordi Albert, thanks!
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@779950 13f79535-47bb-0310-9956-ffa450edef68
2009-05-29 12:58:15 +00:00
Rainer Hermanns d836603c9b Updating xwork version to 2.1.4
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@779762 13f79535-47bb-0310-9956-ffa450edef68
2009-05-28 20:39:38 +00:00
Rainer Hermanns 4ae3847628 Fixing test failures for locales other than US
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@779761 13f79535-47bb-0310-9956-ffa450edef68
2009-05-28 20:34:35 +00:00
Rainer Hermanns 6a0830a0fa navigation fix for ajax showcase
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@779744 13f79535-47bb-0310-9956-ffa450edef68
2009-05-28 19:51:10 +00:00
Musachy Barroso e97d30adf6 WW-3135 OVal Plugin doesn't add field errors for "subfields"
patch provided by rdk@

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@777502 13f79535-47bb-0310-9956-ffa450edef68
2009-05-22 12:58:29 +00:00
Musachy Barroso c282bc85f5 WW-3124 make IoC dependency not required
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@773903 13f79535-47bb-0310-9956-ffa450edef68
2009-05-12 13:59:48 +00:00
Musachy Barroso 4a56baf819 WW-3123 Add constant to Convention to prevent mapping default action to execute if other mappings exist on the same class
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@773894 13f79535-47bb-0310-9956-ffa450edef68
2009-05-12 13:44:17 +00:00
René Gielen ef0eca1083 WW-3121:
Print a helpful message when a container's virtual filesystem architecture prevents the reloading classloader to work correctly. Afterwards exception is rethrown

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@772776 13f79535-47bb-0310-9956-ffa450edef68
2009-05-07 21:15:45 +00:00
Musachy Barroso a428f78471 fix xwork reference
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@772764 13f79535-47bb-0310-9956-ffa450edef68
2009-05-07 20:33:13 +00:00
Wesley Wannemacher 8db92e0097 WW-3117, no space between attachment and filename, oops, thanks again Dale
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@772264 13f79535-47bb-0310-9956-ffa450edef68
2009-05-06 13:52:53 +00:00
Wesley Wannemacher d59d784ef0 anticipating xwork 2.1.4 release, fixing javadoc in StreamResult, WW-3100
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@772175 13f79535-47bb-0310-9956-ffa450edef68
2009-05-06 12:27:42 +00:00
Wesley Wannemacher 59c236a583 WW-3117, fixing docs, good catch Dale Newfield
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@772174 13f79535-47bb-0310-9956-ffa450edef68
2009-05-06 12:27:12 +00:00
Rainer Hermanns a3d11038eb WW-3116 Update sitemesh-plugin to use version 2.4.2 (GAE compliancy)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@771849 13f79535-47bb-0310-9956-ffa450edef68
2009-05-05 15:53:49 +00:00
Wesley Wannemacher 6ccf7b21c6 WW-3114, working around GAE class loader incompatibilities, patch from Leonard Broman, thanks!
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@771772 13f79535-47bb-0310-9956-ffa450edef68
2009-05-05 15:09:45 +00:00
Wesley Wannemacher f64557a7bc WW-3103, patch from Jordi Albert, fixing emptyOption param, thanks!
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@771753 13f79535-47bb-0310-9956-ffa450edef68
2009-05-05 14:43:54 +00:00
Musachy Barroso 38d0a2f54e WW-2757 Stacks defaultStack & paramsPrepareParamsStack are not synced
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@770438 13f79535-47bb-0310-9956-ffa450edef68
2009-04-30 20:40:43 +00:00
Wesley Wannemacher f699fd2c23 WW-3100 updating poms that are pointing to unencrypted http for developerConnection
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@769390 13f79535-47bb-0310-9956-ffa450edef68
2009-04-28 13:28:43 +00:00
Wesley Wannemacher 670c0f31bc WW-3102 minor changes per findbugs analysis
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@768855 13f79535-47bb-0310-9956-ffa450edef68
2009-04-27 02:09:35 +00:00
Wesley Wannemacher 9d8e0c2826 WW-3100 changing to point to xwork 2.1.3 release in anticipation of struts 2.1.7 release
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@768854 13f79535-47bb-0310-9956-ffa450edef68
2009-04-27 02:08:17 +00:00
Musachy Barroso 790073ebf5 WW-3101 @Action and @Actions should be able to be applied to classes, the method will be determined at runtime by Dynamic Action invocation mechanism
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@768826 13f79535-47bb-0310-9956-ffa450edef68
2009-04-26 22:58:17 +00:00
Nils-Helge Garli 28f40ede15 WW-3087 Using session to store location.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@768803 13f79535-47bb-0310-9956-ffa450edef68
2009-04-26 21:34:45 +00:00
Nils-Helge Garli 23be5b9bfe WW-3087 Using session to store location.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@768802 13f79535-47bb-0310-9956-ffa450edef68
2009-04-26 21:34:14 +00:00
Wesley Wannemacher 0bc49d5b0c added apache headers
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@768664 13f79535-47bb-0310-9956-ffa450edef68
2009-04-26 06:09:07 +00:00
Wesley Wannemacher 6834ba7a91 WW-3090, patch from Denis Cabasson, having s:url w/o parameters refer back to called action
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@768659 13f79535-47bb-0310-9956-ffa450edef68
2009-04-26 05:45:28 +00:00
René Gielen 0cc39af7b1 WW-3017 - Making it possible to have a configurable list of uri-patterns telling struts not to handle the request
- consistent constant naming

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@768544 13f79535-47bb-0310-9956-ffa450edef68
2009-04-25 15:09:32 +00:00
René Gielen 85bf223e44 WW-3017 - Making it possible to have a configurable list of uri-patterns telling struts not to handle the request
- applied patch provided by Andreas Joseph Krogh
- made some refactoring to eliminate duplicate code and unneeded method calls
- added integration test

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@768529 13f79535-47bb-0310-9956-ffa450edef68
2009-04-25 13:49:50 +00:00
Nils-Helge Garli 15ac7fe985 WW-2863 Appending the user's 'onchange' to the default.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@768476 13f79535-47bb-0310-9956-ffa450edef68
2009-04-25 06:07:58 +00:00
Musachy Barroso 9ea8a2a74d Add version option to properties
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@768377 13f79535-47bb-0310-9956-ffa450edef68
2009-04-24 17:29:40 +00:00
Rainer Hermanns c6e09bf395 WW-2742 Paramters not being set in JFreeChart Plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@768217 13f79535-47bb-0310-9956-ffa450edef68
2009-04-24 08:08:43 +00:00
Musachy Barroso bcef9830de fix runlevels loading
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@768048 13f79535-47bb-0310-9956-ffa450edef68
2009-04-23 20:48:57 +00:00
Wesley Wannemacher 03819dd759 adding profile to disable assembly module
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@768002 13f79535-47bb-0310-9956-ffa450edef68
2009-04-23 18:20:39 +00:00
Musachy Barroso 5ea573404c Add support for runlevels
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@767967 13f79535-47bb-0310-9956-ffa450edef68
2009-04-23 16:39:23 +00:00
Rainer Hermanns cecc5375d2 WW-2809 doubleselect ignores preselection of a multiple subselect
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@767529 13f79535-47bb-0310-9956-ffa450edef68
2009-04-22 14:05:52 +00:00
Rainer Hermanns efd35b5e9a WW-3009 Extensibility Improvements to javatemplates plugin - patch (project scope)
submitted by Eric Chijioke

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@767518 13f79535-47bb-0310-9956-ffa450edef68
2009-04-22 13:37:01 +00:00
Rainer Hermanns b84fc5b6bc WWW-2884 Support for report JDBC connection
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@767507 13f79535-47bb-0310-9956-ffa450edef68
2009-04-22 13:09:32 +00:00
Wesley Wannemacher 4527907b71 @Override not allowed on interface methods (how did this work before?)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@766577 13f79535-47bb-0310-9956-ffa450edef68
2009-04-20 05:27:18 +00:00
Wesley Wannemacher 69825466c4 WW-2993, making sure to evaluate attribute
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@766574 13f79535-47bb-0310-9956-ffa450edef68
2009-04-20 05:02:57 +00:00
Musachy Barroso 2ca83697ff WW-3092 Rename bean from "named-variable" to "namedVariable"
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@766401 13f79535-47bb-0310-9956-ffa450edef68
2009-04-18 22:30:48 +00:00
Musachy Barroso 28fd86aa16 WW-2951 Add a default "name" to form, when it is not set (same as the "id")
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@766376 13f79535-47bb-0310-9956-ffa450edef68
2009-04-18 18:48:47 +00:00
Musachy Barroso 149d112b1d WW-3075 StrutsPrepareAndExecuteFilter accesses request parameters before setting request encoding
patch provided by Roman Shevchenko

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@766360 13f79535-47bb-0310-9956-ffa450edef68
2009-04-18 17:23:53 +00:00
Musachy Barroso 41fbefa44f WW-3000 force StrutsPrepareAndExecuteFilter to always lookup action mapping, to prevent infinite recursion when the filter is applied to FORWARD
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@766357 13f79535-47bb-0310-9956-ffa450edef68
2009-04-18 17:09:01 +00:00
Musachy Barroso aed6555d88 add bundles to default modules
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@766105 13f79535-47bb-0310-9956-ffa450edef68
2009-04-17 18:05:46 +00:00
Musachy Barroso b7778152e7 WW-308 PackageBasedActionConfigBuilder.buildUrlSet() does not find actions when ReloadingClassLoader is used
Patch from Lukasz Racon

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@766104 13f79535-47bb-0310-9956-ffa450edef68
2009-04-17 18:03:05 +00:00
Musachy Barroso b5a4d4df29 add bundles to assembly
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@766074 13f79535-47bb-0310-9956-ffa450edef68
2009-04-17 16:24:46 +00:00
Musachy Barroso 3b4961066b Fix bundles
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@765784 13f79535-47bb-0310-9956-ffa450edef68
2009-04-16 22:01:56 +00:00
Musachy Barroso 71ceffdd95 move demo bundle to trunk
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@765777 13f79535-47bb-0310-9956-ffa450edef68
2009-04-16 21:47:17 +00:00
Musachy Barroso 5a3e61c67f move admin bundle to trunk
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@765776 13f79535-47bb-0310-9956-ffa450edef68
2009-04-16 21:46:33 +00:00
Musachy Barroso f444a8601a Add OSGi bundles dir
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@765775 13f79535-47bb-0310-9956-ffa450edef68
2009-04-16 21:43:24 +00:00
Musachy Barroso c0f69392df Add struts 1 link. make links mor readable
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@765292 13f79535-47bb-0310-9956-ffa450edef68
2009-04-15 18:12:12 +00:00
Musachy Barroso 481c1b83d4 Move OSGi plugin to trunk from the sandbox, fix assembly descriptors
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@765215 13f79535-47bb-0310-9956-ffa450edef68
2009-04-15 14:32:48 +00:00
Musachy Barroso cf37766728 Move the OSGi plugin to trunk, from the sandbox
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@765209 13f79535-47bb-0310-9956-ffa450edef68
2009-04-15 14:15:55 +00:00
Musachy Barroso a39dd7d145 add OVal plugin to assembly
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@765206 13f79535-47bb-0310-9956-ffa450edef68
2009-04-15 14:07:56 +00:00
Musachy Barroso 57a03379d9 update OVal pom
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@765196 13f79535-47bb-0310-9956-ffa450edef68
2009-04-15 13:43:15 +00:00
Musachy Barroso c1e05a3585 Rename OVal plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@765192 13f79535-47bb-0310-9956-ffa450edef68
2009-04-15 13:38:59 +00:00
Musachy Barroso 7887ffd30a Move the OVal plugin to trunk, from the sandbox
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@765189 13f79535-47bb-0310-9956-ffa450edef68
2009-04-15 13:36:50 +00:00
Musachy Barroso bd09bac0b0 WW-3083 fix how packages and actions are scanned for annotations
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@764310 13f79535-47bb-0310-9956-ffa450edef68
2009-04-12 18:16:43 +00:00
Musachy Barroso 5089d17588 Lower log level. Patch from Lukasz Racon
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@763792 13f79535-47bb-0310-9956-ffa450edef68
2009-04-09 20:30:06 +00:00
Musachy Barroso 096e0dafd3 Remove line setting ServletContext into ActionContext (not needed)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@763229 13f79535-47bb-0310-9956-ffa450edef68
2009-04-08 13:00:09 +00:00
Musachy Barroso 0851ba55d8 Make @Action available for methods only. Update plugin xml
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@762877 13f79535-47bb-0310-9956-ffa450edef68
2009-04-07 17:58:19 +00:00
Musachy Barroso 5eb6a30c4a WW-3076 Add an "order" attribute to the "struts" configuration element
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@762875 13f79535-47bb-0310-9956-ffa450edef68
2009-04-07 17:56:30 +00:00
Musachy Barroso 081d136083 Use ClassLoaderInterface for resource finding and class loading
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@762186 13f79535-47bb-0310-9956-ffa450edef68
2009-04-05 23:45:49 +00:00
Musachy Barroso 6a7808325c Fix import of StringEscapeUtils
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@761694 13f79535-47bb-0310-9956-ffa450edef68
2009-04-03 14:31:59 +00:00
Musachy Barroso 2b100aaf19 WW-3026 Log exceptions when initialization fails
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@761381 13f79535-47bb-0310-9956-ffa450edef68
2009-04-02 19:12:19 +00:00
Musachy Barroso 1e8e03611a WW-3071 API adjustment: cannot override DefaultResultMapBuilder.createResultConfig due to limited DefaultResultMapBuilder.ResultInfo visibility
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@761314 13f79535-47bb-0310-9956-ffa450edef68
2009-04-02 14:41:57 +00:00
Musachy Barroso f0d11d7c1d WW-3068 Make ExecAndWait interceptor create a FreeMarkerResult and use it to render the temporary page, instead of adding a fake result to the config (which causes an exception)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@760997 13f79535-47bb-0310-9956-ffa450edef68
2009-04-01 18:20:01 +00:00
Musachy Barroso a880ec036e WW-2367 Call converter in select tag values
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@760523 13f79535-47bb-0310-9956-ffa450edef68
2009-03-31 16:57:56 +00:00
Musachy Barroso a22db3e117 WW-2996 Fix emory Leak when SlashesInActionNames is enabled and wildcards are used in actionnames
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@760103 13f79535-47bb-0310-9956-ffa450edef68
2009-03-30 18:57:28 +00:00
Musachy Barroso cc39485416 WW-3067 Add a configuration constant to turn on/off the logging of missing properties by OGNL
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@760099 13f79535-47bb-0310-9956-ffa450edef68
2009-03-30 18:48:38 +00:00
Musachy Barroso 6a48be21dd WW-3067 Add a configuration constant to turn on/off the logging of missing properties by OGNL
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@760071 13f79535-47bb-0310-9956-ffa450edef68
2009-03-30 17:58:42 +00:00
Musachy Barroso 2f3deb06b2 XW-620 Cleanup all ThreadLocal references on context shutdown
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@759279 13f79535-47bb-0310-9956-ffa450edef68
2009-03-27 17:40:48 +00:00
Musachy Barroso 4b77bc27b0 WW-3054 Broken FreeMarker template for double validation. Test added.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@759162 13f79535-47bb-0310-9956-ffa450edef68
2009-03-27 14:49:39 +00:00
Nils-Helge Garli 6ac190693f WW-2997 MultiPart parameters was not passed to the action mapping lookup.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@759140 13f79535-47bb-0310-9956-ffa450edef68
2009-03-27 13:51:52 +00:00
Musachy Barroso 50ee5556b4 WW-2850 paramsPrepareParams stack should execute checkbox interceptor earlier
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@759137 13f79535-47bb-0310-9956-ffa450edef68
2009-03-27 13:47:22 +00:00
Nils-Helge Garli a1388bcfb3 WW-2955 Added PortletConfigAware interface.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@759073 13f79535-47bb-0310-9956-ffa450edef68
2009-03-27 09:40:17 +00:00
Musachy Barroso f416924773 Update failing tests (update Easymock expected method calls)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@758299 13f79535-47bb-0310-9956-ffa450edef68
2009-03-25 15:14:17 +00:00
Wesley Wannemacher c127e0a150 WW-3045 fixing compile errors from removing TextUtils
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@758298 13f79535-47bb-0310-9956-ffa450edef68
2009-03-25 15:11:24 +00:00
Musachy Barroso 444efd988c Fix failing test, escaping "/" in javascript is recommended but not required by the spec
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@758287 13f79535-47bb-0310-9956-ffa450edef68
2009-03-25 14:58:53 +00:00
Musachy Barroso 7ca2ad4340 WW-3045 Replace TextUtils String methods. Add direct dependency to core.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@758259 13f79535-47bb-0310-9956-ffa450edef68
2009-03-25 13:52:03 +00:00
Musachy Barroso 854426215a WW-3045 Remove html encode method from StrutsUtils
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@758258 13f79535-47bb-0310-9956-ffa450edef68
2009-03-25 13:50:03 +00:00
Wesley Wannemacher 05a8b23a92 WW-3045 fixing compile errors from removing TextUtils
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@757842 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 15:22:40 +00:00
Wesley Wannemacher 1057e64778 WW-3045 fixing compile errors from removing TextUtils
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@757834 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 15:14:07 +00:00
Wesley Wannemacher 0573be6e12 WW-3045 fixing compile errors from removing TextUtils
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@757826 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 14:53:29 +00:00
Musachy Barroso 4eb444806e Removed unused constant
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@756478 13f79535-47bb-0310-9956-ffa450edef68
2009-03-20 14:19:46 +00:00
Musachy Barroso 107f9c58a1 Use StringEscapeUtils
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@756461 13f79535-47bb-0310-9956-ffa450edef68
2009-03-20 13:40:51 +00:00
Musachy Barroso f815fe9648 WW-3051 Throw exceptions when an EL expression fails due to an exception or because a property is missing
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@756301 13f79535-47bb-0310-9956-ffa450edef68
2009-03-20 02:03:03 +00:00
René Gielen 41e6fd0aad WW-3050:
- make Spring dependency versions consistent
- added toplevel struts2.springPlatformVersion property
- upgraded deps to 2.5.6

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@756291 13f79535-47bb-0310-9956-ffa450edef68
2009-03-20 01:33:44 +00:00
René Gielen 751b92ea7d WW-3050:
- make Spring dependency versions consistent
- added toplevel struts2.springPlatformVersion property
- upgraded deps to 2.5.6

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@756289 13f79535-47bb-0310-9956-ffa450edef68
2009-03-20 01:16:45 +00:00
Musachy Barroso 30c95e8129 WW-3044 Replace code by similar code in commons lang
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@755679 13f79535-47bb-0310-9956-ffa450edef68
2009-03-18 18:00:45 +00:00
Musachy Barroso e6cfa82cd0 WW-3044 Replace code by similar code in commons lang
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@755607 13f79535-47bb-0310-9956-ffa450edef68
2009-03-18 14:41:00 +00:00
Musachy Barroso 526580cc2d WW-3046 Make "redirect" result support params (passed from <param>), like "redirectAction" does
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@755605 13f79535-47bb-0310-9956-ffa450edef68
2009-03-18 14:36:33 +00:00
Musachy Barroso 62d9bcfc25 Remove TextUtil(not used)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@755412 13f79535-47bb-0310-9956-ffa450edef68
2009-03-17 21:53:14 +00:00
Musachy Barroso a2d87bd21f WW-3045 Replace TextUtils String methods
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@755410 13f79535-47bb-0310-9956-ffa450edef68
2009-03-17 21:50:59 +00:00
Musachy Barroso 21ccc48d9e WW-3045 Replace TextUtils String methods
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@755408 13f79535-47bb-0310-9956-ffa450edef68
2009-03-17 21:42:43 +00:00
Musachy Barroso 32316d22e4 WW-3043 Result annotations at the method level should overwrite result annotations at the class level in the Convention plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@755382 13f79535-47bb-0310-9956-ffa450edef68
2009-03-17 20:24:26 +00:00
Musachy Barroso 120e5a4667 WW-3033 This change rollsback WW-2351. The id should not be change (it break backward compatibility and it is not a good idea), instead the name of the generated function is the one that should be changed
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@754994 13f79535-47bb-0310-9956-ffa450edef68
2009-03-16 20:09:51 +00:00
Musachy Barroso 649ce30681 WW-3037 Anchor tag should be able to build URLs like the URL tag does
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@753015 13f79535-47bb-0310-9956-ffa450edef68
2009-03-12 21:00:23 +00:00
Musachy Barroso 148e3a3b39 WW-3032 Set character encoding to UTF-8 for ajax validation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@752628 13f79535-47bb-0310-9956-ffa450edef68
2009-03-11 21:31:51 +00:00
Musachy Barroso 730fe82ba1 WW-3032 Set character encoding to UTF-8 for ajax validation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@752623 13f79535-47bb-0310-9956-ffa450edef68
2009-03-11 21:25:45 +00:00
Wesley Wannemacher 7a00f156ca We advertise this attribute being available, but we really didn't have it
WW-3031

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@752123 13f79535-47bb-0310-9956-ffa450edef68
2009-03-10 14:46:22 +00:00
Musachy Barroso cb9b2e56ae WW-3029 Fix backward compatible problem in the Label tag
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@751799 13f79535-47bb-0310-9956-ffa450edef68
2009-03-09 19:28:20 +00:00
René Gielen 64470c7357 WW-3028:
- fix CRUD showcase example misses localized form data for Double value
- fix missing en Resourcebundles, keeping de_* users setting Browser locale to en_* to see English messages

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@751693 13f79535-47bb-0310-9956-ffa450edef68
2009-03-09 14:39:22 +00:00
Musachy Barroso 5f133f1e98 WW-3023 Use ClassLoaderUtils to resolve the class in ConcentionServiceImpl
thanks to Travis Rein for the patch



git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@750965 13f79535-47bb-0310-9956-ffa450edef68
2009-03-06 16:36:22 +00:00
René Gielen 703faa0af8 WW-2881 - Generic ActionMapping.param
- applied patch by Mathias Bogaert

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@747124 13f79535-47bb-0310-9956-ffa450edef68
2009-02-23 20:15:45 +00:00
René Gielen 50fd30b972 WW-2886 - CookiesAware and CookieInterceptor are not generic
- applied patch by Mathias Bogaert

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@747075 13f79535-47bb-0310-9956-ffa450edef68
2009-02-23 16:38:47 +00:00
René Gielen 7cf25fa8d4 WW-2883 StrutsXmlConfigurationProvider generics fix
- applied patch submitted by Mathias Bogaert

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@747073 13f79535-47bb-0310-9956-ffa450edef68
2009-02-23 16:36:02 +00:00
René Gielen eb1ad0aec6 WW-2883 StrutsXmlConfigurationProvider generics fix
- applied patch submitted by Mathias Bogaert

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@747065 13f79535-47bb-0310-9956-ffa450edef68
2009-02-23 16:21:12 +00:00
René Gielen 92e9bc92f4 WW-2886 - CookiesAware and CookieInterceptor are not generic
- applied patch by Mathias Bogaert

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@747064 13f79535-47bb-0310-9956-ffa450edef68
2009-02-23 16:20:44 +00:00
René Gielen 32bee13a05 WW-2883 StrutsXmlConfigurationProvider generics fix
- applied patch submitted by Mathias Bogaert

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@747063 13f79535-47bb-0310-9956-ffa450edef68
2009-02-23 16:20:19 +00:00
Musachy Barroso 370a35fa1f Pass the file protocols to ClassFinder constructor
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@747050 13f79535-47bb-0310-9956-ffa450edef68
2009-02-23 15:33:11 +00:00
Musachy Barroso 7330d6124b Update xwork dep to 2.1.3-SNAPSHOT
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@747047 13f79535-47bb-0310-9956-ffa450edef68
2009-02-23 15:28:30 +00:00
René Gielen 7de5f6a382 WW-2883 StrutsXmlConfigurationProvider generics fix
- applied patch submitted by Mathias Bogaert

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@747046 13f79535-47bb-0310-9956-ffa450edef68
2009-02-23 15:22:05 +00:00
René Gielen 1ac171221a WW-2883 StrutsXmlConfigurationProvider generics fix
- applied patch submitted by Mathias Bogaert

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@747044 13f79535-47bb-0310-9956-ffa450edef68
2009-02-23 15:21:47 +00:00
Musachy Barroso 5d40839f77 WW-3003 The "name" attribute in @Result (Convention plugin) should default to "success"
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@745559 13f79535-47bb-0310-9956-ffa450edef68
2009-02-18 16:26:29 +00:00
Musachy Barroso 5b9665f5f6 Update javadoc
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@744170 13f79535-47bb-0310-9956-ffa450edef68
2009-02-13 16:39:30 +00:00
Musachy Barroso db9a9587b1 Add missing javadoc tags, remove unused code and add some logging
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@744139 13f79535-47bb-0310-9956-ffa450edef68
2009-02-13 15:04:51 +00:00
Musachy Barroso f5903ef2b4 Log classes that will be ignored because they failed the instantiation test
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@744133 13f79535-47bb-0310-9956-ffa450edef68
2009-02-13 14:51:43 +00:00
Musachy Barroso c30364dfcc WW-2983 exclude anonymous classes
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@744125 13f79535-47bb-0310-9956-ffa450edef68
2009-02-13 14:30:38 +00:00
Musachy Barroso 96b3827d29 Set svn Id property
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@743911 13f79535-47bb-0310-9956-ffa450edef68
2009-02-12 22:39:16 +00:00
Musachy Barroso 09871d7da2 Cleanup some warnings
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@743883 13f79535-47bb-0310-9956-ffa450edef68
2009-02-12 21:06:41 +00:00
Musachy Barroso 3334651a89 Add a setting so file protocols can be set by a constant
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@743831 13f79535-47bb-0310-9956-ffa450edef68
2009-02-12 18:45:14 +00:00
Musachy Barroso cf7b322bd5 WW-2990 support result inheritance
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@743811 13f79535-47bb-0310-9956-ffa450edef68
2009-02-12 17:13:21 +00:00
Musachy Barroso 9a1aa35714 WW-2775 refactor class instantiation decision to a protected method
Thanks to Richard Wallace for patch

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@743781 13f79535-47bb-0310-9956-ffa450edef68
2009-02-12 15:37:19 +00:00
Musachy Barroso 585d84bc2a WW-2982 add jspx files as a possible view to Convention plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@743777 13f79535-47bb-0310-9956-ffa450edef68
2009-02-12 15:19:05 +00:00
Musachy Barroso b5f0f9b30c WW-2994 Add extension points for Convention plugin classes
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@743366 13f79535-47bb-0310-9956-ffa450edef68
2009-02-11 15:53:17 +00:00
Musachy Barroso 291cce91bd WW-2992 Add Cookie interceptor to struts-default.xml
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@742998 13f79535-47bb-0310-9956-ffa450edef68
2009-02-10 15:37:21 +00:00
Musachy Barroso b7bdc8bab6 WW-2988 Tags actionerror, actionmessage and fielderror do not set the "id" attribute on the generated ul tag
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@742758 13f79535-47bb-0310-9956-ffa450edef68
2009-02-09 21:57:05 +00:00
Musachy Barroso 77da451ab1 WW-2984 update doc
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@742757 13f79535-47bb-0310-9956-ffa450edef68
2009-02-09 21:56:11 +00:00
Musachy Barroso 01d4b36e90 WW-2984 Add test cases for negative step and no end on iterator tag
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@741310 13f79535-47bb-0310-9956-ffa450edef68
2009-02-05 21:47:54 +00:00
Musachy Barroso 851d8d0c9a WW-2984 Improve iterator tag to support "begin", "end" and "step" attributes
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@741183 13f79535-47bb-0310-9956-ffa450edef68
2009-02-05 17:12:08 +00:00
Musachy Barroso c69727c4bb WW-2984 Improve iterator tag to support "begin", "end" and "step" attributes
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@741179 13f79535-47bb-0310-9956-ffa450edef68
2009-02-05 16:55:14 +00:00
Musachy Barroso 2ce8b01734 Use compressed dojo profile for ajax validation page
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@740027 13f79535-47bb-0310-9956-ffa450edef68
2009-02-02 16:35:45 +00:00
Musachy Barroso 79cec0d488 Add a name to bean definition for UnknownHandler
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@738909 13f79535-47bb-0310-9956-ffa450edef68
2009-01-29 16:14:41 +00:00
Musachy Barroso 5c48dc9150 WW-2966 ToolTips do not render correctly
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@738624 13f79535-47bb-0310-9956-ffa450edef68
2009-01-28 21:12:12 +00:00
Musachy Barroso b8971321eb WW-2765 add setting for autowire=no
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@735096 13f79535-47bb-0310-9956-ffa450edef68
2009-01-16 19:37:42 +00:00
Wesley Wannemacher c6f015cd2c making wget download docs from the site, requires wget, but removes other dependencies WW-2958
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@735051 13f79535-47bb-0310-9956-ffa450edef68
2009-01-16 16:37:11 +00:00
Musachy Barroso 06123025dc add username as a parameter for doc generation(remote ssh exec)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@734777 13f79535-47bb-0310-9956-ffa450edef68
2009-01-15 18:43:28 +00:00
Musachy Barroso 5298ca9666 add doc.zip generation to the assembly process
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@734599 13f79535-47bb-0310-9956-ffa450edef68
2009-01-15 03:06:14 +00:00
Musachy Barroso 0f83cf8533 Define a bean for "NamedVariablePatternMatcher"
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@733777 13f79535-47bb-0310-9956-ffa450edef68
2009-01-12 15:10:11 +00:00
Musachy Barroso f75b36c16a fix bad formatting
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@733409 13f79535-47bb-0310-9956-ffa450edef68
2009-01-11 02:13:51 +00:00
Musachy Barroso c312a6b562 Replace ant 'get' task by 'exec' task calling wget
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@733408 13f79535-47bb-0310-9956-ffa450edef68
2009-01-11 02:11:22 +00:00
Musachy Barroso 745cc03734 [maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@731670 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 19:57:47 +00:00
Musachy Barroso af624777ad [maven-release-plugin] prepare release STRUTS_2_1_6
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@731668 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 19:56:32 +00:00
Musachy Barroso 45d5c756c8 Remove comment
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@731128 13f79535-47bb-0310-9956-ffa450edef68
2009-01-03 23:58:12 +00:00
Musachy Barroso 415f08e575 Minor change to makig logging consistent
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@731127 13f79535-47bb-0310-9956-ffa450edef68
2009-01-03 23:49:51 +00:00
Jeromy Evans 92ab09649e WW-2947 added LOG.warn()'s for includeJars patterns that fail to match any jars
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@731124 13f79535-47bb-0310-9956-ffa450edef68
2009-01-03 23:15:34 +00:00
Musachy Barroso f11b40aa46 WW-2947 Remove convention's "excludeJars" and add "includeJars" instead
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@731070 13f79535-47bb-0310-9956-ffa450edef68
2009-01-03 19:36:36 +00:00
Musachy Barroso e2a7c4c183 WW-2947 Remove convention's "excludeJars" and add "includeJars" instead
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@731063 13f79535-47bb-0310-9956-ffa450edef68
2009-01-03 18:59:19 +00:00
Musachy Barroso ed3e6e2458 WW-2946 Update struts 1 dependency to 1.3.10
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@731031 13f79535-47bb-0310-9956-ffa450edef68
2009-01-03 17:25:10 +00:00
Musachy Barroso 6756f368f5 Remove annoying warning
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@731023 13f79535-47bb-0310-9956-ffa450edef68
2009-01-03 16:58:42 +00:00
Musachy Barroso 85da3b3b1a [maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@730774 13f79535-47bb-0310-9956-ffa450edef68
2009-01-02 16:28:44 +00:00
Musachy Barroso ed28964bce [maven-release-plugin] prepare release STRUTS_2_1_5
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@730771 13f79535-47bb-0310-9956-ffa450edef68
2009-01-02 16:27:28 +00:00
Musachy Barroso 53e37edc78 WW-2944 when action is not found, use the specified "action" attribute, instead of the action name
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@730743 13f79535-47bb-0310-9956-ffa450edef68
2009-01-02 14:39:46 +00:00
Musachy Barroso 52a77d3656 make the version in Download button dynamic
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@730440 13f79535-47bb-0310-9956-ffa450edef68
2008-12-31 18:33:08 +00:00
Musachy Barroso 056fc323e5 [maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@729969 13f79535-47bb-0310-9956-ffa450edef68
2008-12-29 18:57:01 +00:00
Musachy Barroso 0ba89c502b [maven-release-plugin] prepare release STRUTS_2_1_4
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@729967 13f79535-47bb-0310-9956-ffa450edef68
2008-12-29 18:56:15 +00:00
341 changed files with 11873 additions and 1777 deletions
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.1.4-SNAPSHOT</version>
<version>2.1.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-blank</artifactId>
@@ -34,9 +34,9 @@
<name>Blank Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/apps/blank/</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/blank/</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/apps/blank/</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps/blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps/blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/apps/blank</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.1.4-SNAPSHOT</version>
<version>2.1.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-mailreader</artifactId>
@@ -34,9 +34,9 @@
<name>Starter Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/apps/mailreader/</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/mailreader/</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/apps/mailreader/</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps/mailreader</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps/mailreader</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/apps/mailreader</url>
</scm>
<dependencies>
+6 -6
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.1.4-SNAPSHOT</version>
<version>2.1.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
@@ -41,9 +41,9 @@
</modules>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/apps/</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/apps/</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/apps</url>
</scm>
<distributionManagement>
@@ -225,8 +225,8 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-mock</artifactId>
<version>2.0.7</version>
<artifactId>spring-test</artifactId>
<version>${struts2.springPlatformVersion}</version>
<scope>test</scope>
</dependency>
</dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.1.4-SNAPSHOT</version>
<version>2.1.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-portlet</artifactId>
@@ -34,9 +34,9 @@
<name>Portlet Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/apps/portlet/</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/portlet/</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/apps/portlet/</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/apps/portlet</url>
</scm>
<profiles>
+2 -2
View File
@@ -26,13 +26,13 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.1.4-SNAPSHOT</version>
<version>2.1.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-rest-showcase</artifactId>
<packaging>war</packaging>
<version>2.1.4-SNAPSHOT</version>
<version>2.1.7</version>
<name>Struts 2 Rest Showcase Example</name>
<description>Struts 2 Rest Showcase Example</description>
+5 -5
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.1.4-SNAPSHOT</version>
<version>2.1.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-showcase</artifactId>
@@ -34,9 +34,9 @@
<name>Showcase Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/apps/showcase/</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/showcase/</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/apps/showcase/</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps/showcase</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps/showcase</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/apps/showcase</url>
</scm>
@@ -148,7 +148,7 @@
<dependency>
<groupId>opensymphony</groupId>
<artifactId>sitemesh</artifactId>
<version>2.3</version>
<version>2.4.2</version>
</dependency>
<dependency>
<groupId>uk.ltd.getahead</groupId>
@@ -1,3 +1,5 @@
format.number = {0,number,#0.0##}
save=Save
item.edit=Edit {0}
@@ -58,26 +58,27 @@
<div class="wrapper">
<h2 class="accessibility">Navigation</h2>
<ul class="clearfix">
<li><a href="<s:url value="/showcase.jsp"/>">Home</a></li>
<li><a href="<s:url value="/ajax/index.jsp"/>">Ajax</a></li>
<li><a href="<s:url value="/chat/index.jsp"/>">Ajax Chat</a></li>
<li><a href="<s:url action="actionChain1!input" namespace="/actionchaining" includeParams="none" />">Action Chaining</a></li>
<li><a href="<s:url action="index" namespace="/config-browser" includeParams="none" />">Config Browser</a></li>
<li><a href="<s:url value="/conversion/index.jsp"/>">Conversion</a></li>
<li><a href="<s:url value="/empmanager/index.jsp"/>">CRUD</a></li>
<li><a href="<s:url value="/wait/index.jsp"/>">Execute & Wait</a></li>
<li><a href="<s:url value="/filedownload/index.jsp"/>">File Download</a></li>
<li><a href="<s:url value="/fileupload/index.jsp" />">File Upload</a></li>
<li><a href="<s:url value="/freemarker/index.jsp"/>">Freemarker</a>
<li><a href="<s:url action="hangmanMenu" namespace="/hangman"/>">Hangman</a></li>
<li><a href="<s:url value="/jsf/index.jsp"/>">JavaServer Faces</a></li>
<li><a href="<s:url value="/tags/index.jsp"/>">Tags</a></li>
<li><a href="<s:url value="/tiles/index.action" />">Tiles</a></li>
<li><a href="<s:url value="/token/index.jsp"/>">Token</a></li>
<li><a href="<s:url value="/validation/index.jsp"/>">Validation</a></li>
<li><a href="<s:url value="/interactive/index.jsp"/>">Interactive Demo</a></li>
<li><a href="<s:url value="/person/index.jsp"/>">Person Manager</a></li>
<li class="last"><a href="<s:url value="/help.jsp"/>">Help</a></li>
<li><s:a value="/showcase.jsp">Home</s:a></li>
<li><s:a value="/ajax/index.jsp">Ajax</s:a></li>
<li><s:a value="/chat/index.jsp">Ajax Chat</s:a></li>
<li><s:a action="actionChain1!input" namespace="/actionchaining" includeParams="none">Action Chaining</s:a></li>
<li><s:a action="index" namespace="/config-browser" includeParams="none">Config Browser</s:a></li>
<li><s:a value="/conversion/index.jsp">Conversion</s:a></li>
<li><s:a value="/empmanager/index.jsp">CRUD</s:a></li>
<li><s:a value="/wait/index.jsp">Execute & Wait</s:a></li>
<li><s:a value="/filedownload/index.jsp">File Download</s:a></li>
<li><s:a value="/fileupload/index.jsp">File Upload</s:a></li>
<li><s:a value="/freemarker/index.jsp">Freemarker</s:a></li>
<li><s:a action="hangmanMenu" namespace="/hangman">Hangman</s:a></li>
<li><s:a value="/jsf/index.jsp">JavaServer Faces</s:a></li>
<li><s:a value="/tags/index.jsp">Tags</s:a></li>
<li><s:a value="/tiles/index.action">Tiles</s:a></li>
<li><s:a value="/token/index.jsp">Token</s:a></li>
<li><s:a value="/validation/index.jsp">Validation</s:a></li>
<li><s:a value="/interactive/index.jsp">Interactive Demo</s:a></li>
<li><s:a value="/person/index.jsp">Person Manager</s:a></li>
<li><s:a value="/integration/editGangster">Struts 1 Integration</s:a></li>
<li class="last"><s:a value="/help.jsp">Help</s:a></li>
</ul>
</div>
<hr/>
@@ -23,7 +23,7 @@
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
"http://struts.apache.org/dtds/tiles-config_2_0.dtd">
"http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
<tiles-definitions>
@@ -2,7 +2,7 @@
<hr/>
<s:url var="backToAjaxExamples" value=".." />
<s:url var="backToAjaxExamples" value="../index.jsp" />
<s:a href="%{backToAjaxExamples}">Back To AJAX Examples</s:a>&nbsp;
@@ -26,7 +26,7 @@
<s:textfield label="%{getText('employee.firstName')}" name="currentEmployee.firstName"/>
<s:textfield label="%{getText('employee.lastName')}" name="currentEmployee.lastName"/>
<sx:datetimepicker label="Birthdate" name="currentEmployee.birthDate"/>
<s:textfield label="Salary" name="currentEmployee.salary"/>
<s:textfield label="Salary" name="currentEmployee.salary" value="%{getText('format.number',{currentEmployee.salary})}" />
<s:checkbox fieldValue="true" label="Married" name="currentEmployee.married"/>
<s:combobox list="availablePositions" label="Position" name="currentEmployee.position"/>
<s:select list="#skillAction.availableItems" listKey="name" label="Main Skill"
@@ -6,7 +6,7 @@
<html>
<head>
<title>Validation - Ajax</title>
<sx:head cache="false" compressed="false"/>
<sx:head cache="true" compressed="true"/>
</head>
<s:url var="url" namespace="/validation" action="quizAjax"/>
+65 -11
View File
@@ -11,13 +11,13 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.1.4-SNAPSHOT</version>
<version>2.1.7</version>
</parent>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/assembly</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/assembly</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/assembly</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/assembly</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/assembly</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/assembly</url>
</scm>
<profiles>
@@ -71,8 +71,8 @@
<dependency>
<groupId>com.opensymphony</groupId>
<artifactId>xwork</artifactId>
<version>2.1.2</version>
<artifactId>xwork-core</artifactId>
<version>2.1.4</version>
<type>jar</type>
<classifier>jdk14</classifier>
<scope>runtime</scope>
@@ -161,6 +161,20 @@
<version>${version}</version>
<classifier>jdk14</classifier>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-oval-plugin</artifactId>
<version>${version}</version>
<classifier>jdk14</classifier>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-plugin</artifactId>
<version>${version}</version>
<classifier>jdk14</classifier>
</dependency>
</dependencies>
</profile>
</profiles>
@@ -220,7 +234,7 @@
</configuration>
</execution>
<execution>
<id>xwork-javadoc</id>
<id>xwork-core-javadoc</id>
<phase>package</phase>
<goals>
<goal>unpack</goal>
@@ -229,9 +243,9 @@
<artifactItems>
<artifactItem>
<groupId>com.opensymphony</groupId>
<artifactId>xwork</artifactId>
<artifactId>xwork-core</artifactId>
<classifier>javadoc</classifier>
<version>2.1.2</version>
<version>2.1.4</version>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/xwork-apidocs</outputDirectory>
@@ -248,8 +262,24 @@
<configuration>
<tasks>
<mkdir dir="${project.build.directory}/cwiki" />
<get src="http://struts.apache.org/2.x/docs.zip" dest="${project.build.directory}/docs.zip" ignoreerrors="false" />
<!--
<exec executable="ssh" failonerror="true" >
<arg line="${username}@people.apache.org /www/struts.apache.org/2.x/docs-zip2.sh" />
</exec>
<unzip src="${project.build.directory}/docs.zip" dest="${project.build.directory}/cwiki" />
<exec executable="wget">
<arg value="-erobots=off" />
<arg value="-nH" />
<arg value="-nv" />
<arg value="-E" />
<arg value="-L" />
<arg value="-r" />
<arg value="http://struts.apache.org/2.x/docs/" />
</exec>
-->
<copy todir="${project.build.directory}/cwiki">
<fileset dir="${docsDir}" />
</copy>
</tasks>
</configuration>
<goals>
@@ -406,7 +436,31 @@
<artifactId>struts2-tiles-plugin</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-oval-plugin</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-plugin</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-admin-bundle</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-demo-bundle</artifactId>
<version>${version}</version>
</dependency>
</dependencies>
</project>
</project>
+27
View File
@@ -86,6 +86,14 @@
<include>ANTLR-LICENSE.txt</include>
</includes>
</fileSet>
<fileSet>
<directory>../plugins/oval/src/main/resources</directory>
<outputDirectory></outputDirectory>
<includes>
<include>OVAL-LICENSE.txt</include>
<include>XSTREAM-LICENSE.txt</include>
</includes>
</fileSet>
<fileSet>
<directory>target/apps</directory>
<outputDirectory>apps</outputDirectory>
@@ -203,6 +211,25 @@
<directory>../plugins/tiles/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-tiles-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/oval/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-oval-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/osgi/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-osgi-plugin</outputDirectory>
</fileSet>
<!-- bundles -->
<fileSet>
<directory>../bundles/admin/target/site</directory>
<outputDirectory>docs/struts2-bundles/admin</outputDirectory>
</fileSet>
<fileSet>
<directory>../bundles/demo/target/site</directory>
<outputDirectory>docs/struts2-bundles/demo</outputDirectory>
</fileSet>
<!-- Include the source code in the assembly -->
<fileSet>
+8
View File
@@ -127,6 +127,14 @@
<directory>../plugins/tiles/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-tiles-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/oval/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-oval-plugin</outputDirectory>
</fileSet>
<fileSet>
<directory>../plugins/osgi/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-osgi-plugin</outputDirectory>
</fileSet>
</fileSets>
</assembly>
+8
View File
@@ -86,5 +86,13 @@
<include>ANTLR-LICENSE.txt</include>
</includes>
</fileSet>
<fileSet>
<directory>../plugins/oval/src/main/resources</directory>
<outputDirectory></outputDirectory>
<includes>
<include>OVAL-LICENSE.txt</include>
<include>XSTREAM-LICENSE.txt</include>
</includes>
</fileSet>
</fileSets>
</assembly>
+8
View File
@@ -128,6 +128,14 @@
<exclude>target/**</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>../bundles</directory>
<outputDirectory>src/bundles</outputDirectory>
<excludes>
<exclude>*/target/**</exclude>
<exclude>target/**</exclude>
</excludes>
</fileSet>
</fileSets>
</assembly>
+47
View File
@@ -0,0 +1,47 @@
<?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-osgi-bundles</artifactId>
<version>2.1.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-admin-bundle</artifactId>
<packaging>bundle</packaging>
<name>Struts 2 OSGi Admin Bundle</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/bundles/admin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/bundles/admin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/bundles/admin</url>
</scm>
<dependencies>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<version>2.0.0</version>
<configuration>
<instructions>
<manifestLocation>META-INF</manifestLocation>
<Struts2-Enabled>true</Struts2-Enabled>
<Import-Package>*,com.opensymphony.xwork2</Import-Package>
<Export-Package>org.apache.struts2.osgi.admin*</Export-Package>
<Spring-Context>*;create-asynchronously:=false</Spring-Context>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,208 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.osgi.admin.actions;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.struts2.osgi.BundleAccessor;
import org.apache.struts2.osgi.OsgiHost;
import org.apache.struts2.osgi.StrutsOsgiListener;
import org.apache.struts2.osgi.OsgiConfigurationProvider;
import org.apache.struts2.util.ServletContextAware;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
import javax.servlet.ServletContext;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Collections;
import java.util.Comparator;
import java.util.Map;
import java.util.HashMap;
import java.util.Enumeration;
import java.util.Dictionary;
public class BundlesAction extends ActionSupport implements ServletContextAware {
private String id;
private BundleAccessor bundleAccessor;
private Configuration configuration;
private OsgiHost osgiHost;
public BundlesAction() {
}
public String index() {
return SUCCESS;
}
public String view() {
return SUCCESS;
}
public String start() throws BundleException {
Bundle bundle = osgiHost.getBundles().get(id);
try {
bundle.start();
//start() fires a BundleEvent.STARTED, which loads the config
//we need to wait until the config is loaded from that bundle but
//there no easy way/elegant way to know if the bundle was processed already
Thread.sleep(1000);
} catch (Exception e) {
addActionError(e.toString());
}
return view();
}
public String stop() throws BundleException {
Bundle bundle = osgiHost.getBundles().get(id);
try {
bundle.stop();
} catch (Exception e) {
addActionError(e.toString());
}
return view();
}
public String update() throws BundleException {
Bundle bundle = osgiHost.getBundles().get(id);
try {
bundle.update();
} catch (Exception e) {
addActionError(e.toString());
}
return view();
}
public boolean isStrutsEnabled(Bundle bundle) {
return "true".equalsIgnoreCase((String) bundle.getHeaders().get(OsgiHost.OSGI_HEADER_STRUTS_ENABLED));
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Bundle getBundle() {
return osgiHost.getBundles().get(id);
}
public List<PackageConfig> getPackages() {
List<PackageConfig> pkgs = new ArrayList<PackageConfig>();
Bundle bundle = getBundle();
if (bundle.getState() == Bundle.ACTIVE) {
for (String name : bundleAccessor.getPackagesByBundle(bundle)) {
PackageConfig packageConfig = configuration.getPackageConfig(name);
if (packageConfig != null)
pkgs.add(packageConfig);
}
}
return pkgs;
}
public ArrayList<String> getHeaderKeys() {
return Collections.list(getBundle().getHeaders().keys());
}
public Collection<Bundle> getBundles() {
List<Bundle> bundles = new ArrayList(osgiHost.getBundles().values());
Collections.sort(bundles, new Comparator<Bundle>() {
public int compare(Bundle bundle1, Bundle bundle2) {
boolean bundle1StrutsEnabled = isStrutsEnabled(bundle1);
boolean bundle2StrutsEnabled = isStrutsEnabled(bundle2);
if ((bundle1StrutsEnabled && bundle2StrutsEnabled) || (!bundle1StrutsEnabled && !bundle2StrutsEnabled))
return bundle1.getSymbolicName().compareTo(bundle2.getSymbolicName());
else {
return bundle1StrutsEnabled ? -1 : 1;
}
}
});
return bundles;
}
public String displayProperty(Object obj) {
if (obj.getClass().isArray()) {
return Arrays.asList((Object[])obj).toString();
} else {
return obj.toString();
}
}
public String getBundleState(Bundle bundle) {
switch (bundle.getState()) {
case Bundle.ACTIVE : return "Active";
case Bundle.INSTALLED : return "Installed";
case Bundle.RESOLVED : return "Resolved";
case Bundle.STARTING : return "Starting";
case Bundle.STOPPING : return "Stopping";
case Bundle.UNINSTALLED : return "Uninstalled";
default : throw new IllegalStateException("Invalid state");
}
}
public boolean isAllowedAction(Bundle bundle, String val) {
int state = -1;
try {
state = bundle.getState();
} catch (Exception e) {
addActionError("Unable to determine bundle state: " + e.getMessage());
return false;
}
if ("start".equals(val)) {
return state == Bundle.RESOLVED;
} else if ("stop".equals(val)) {
return state == Bundle.ACTIVE;
} else if ("update".equals(val)) {
return state == Bundle.ACTIVE || state == Bundle.INSTALLED
|| state == Bundle.RESOLVED;
}
throw new IllegalArgumentException("Invalid state");
}
@Inject
public void setConfiguration(Configuration configuration) {
this.configuration = configuration;
}
@Inject
public void setBundleAccessor(BundleAccessor bundleAccessor) {
this.bundleAccessor = bundleAccessor;
}
public void setServletContext(ServletContext servletContext) {
osgiHost = (OsgiHost) servletContext.getAttribute(StrutsOsgiListener.OSGI_HOST);
}
}
@@ -0,0 +1,91 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.osgi.admin.actions;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import org.apache.struts2.osgi.DefaultBundleAccessor;
import org.apache.felix.shell.ShellService;
import org.osgi.framework.ServiceReference;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;
/**
* This action executes commands on the Felix Shell
*/
public class ShellAction extends ActionSupport {
private String command;
private String output;
public String execute() {
// get service
ByteArrayOutputStream outByteStream = new ByteArrayOutputStream();
ByteArrayOutputStream errByteStream = new ByteArrayOutputStream();
PrintStream outStream = new PrintStream(outByteStream);
PrintStream errStream = new PrintStream(errByteStream);
String outString = null;
String errString = null;
try {
executeCommand(command, outStream, errStream);
outString = outByteStream.toString().trim();
errString = errByteStream.toString().trim();
} catch (Exception e) {
errString = e.getMessage();
} finally {
outStream.close();
errStream.close();
}
output = errString != null && errString.length() > 0 ? errString : outString;
return Action.SUCCESS;
}
public String getCommand() {
return command;
}
public void setCommand(String command) {
this.command = command;
}
public String getOutput() {
return output;
}
public void executeCommand(String commandLine, PrintStream out, PrintStream err) throws Exception {
ShellService shellService = getShellService();
if (shellService != null)
shellService.executeCommand(commandLine, out, err);
else
err.println("Apache Felix Shell service is not installed");
}
private ShellService getShellService() {
//bundle can be de-activated, so keeping a reference aorund is not a good idea
DefaultBundleAccessor bundleAcessor = DefaultBundleAccessor.getInstance();
ServiceReference ref = bundleAcessor.getServiceReference(ShellService.class.getName());
return (ShellService) bundleAcessor.getService(ref);
}
}
@@ -0,0 +1,25 @@
Copyright (c) 2009 Paul Bakaus, http://jqueryui.com/
This software consists of voluntary contributions made by many
individuals (AUTHORS.txt, http://jqueryui.com/about) For exact
contribution history, see the revision history and logs, available
at http://jquery-ui.googlecode.com/svn/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,174 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
@@ -0,0 +1,8 @@
Apache Struts
Copyright 2000-2007 The Apache Software Foundation
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
The binary distributions includes the following third party software:
JQuery (http://jquery.com/).
@@ -0,0 +1 @@
${output!}
@@ -0,0 +1,62 @@
<!--
/*
* $Id: webconsole.html 590812 2007-10-31 20:32:54Z apetrelli $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<html>
<head>
<title>OSGi Console</title>
<link rel="stylesheet" type="text/css" href="<@s.url value="/static/css/shell.css" />" />
<link rel="stylesheet" type="text/css" href="<@s.url value="/static/css/main.css" />" />
<link rel="stylesheet" type="text/css" href="<@s.url value="/static/css/redmond/jquery-ui-1.7.1.custom.css" />" />
<script src="<@s.url value="/static/js/shell.js" />"></script>
<script src="<@s.url value="/static/js/jquery-1.3.2.min.js" />"></script>
<script src="<@s.url value="/static/js/jquery-ui-1.7.1.custom.min.js" />"></script>
</head>
<body>
<div class="menu">
<div style="float:right;">
<@s.url var="bundlesUrl" namespace="/osgi/admin" action="bundles" includeParams="none" />
<@s.url var="osgiShellUrl" namespace="/osgi/admin" action="shell" includeParams="none" />
<a href="${bundlesUrl}" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
<span class="ui-icon ui-icon-bullet"></span>
Bundles
</a>
<a href="${osgiShellUrl}" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
<span class="ui-icon ui-icon-transferthick-e-w"></span>
OSGi Shell
</a>
</div>
</div>
<div id="shell" >
<form onsubmit="return false" id="wc-form">
<div class="wc-results" id="wc-result">
Welcome to the OSGi console! Type 'help' to see the list of available commands.
<br />
</div>
<@s.url var="execUrl" namespace="/osgi/admin" action="execCommand" />
<label for"command">Command:</label>
<input name="command" onkeyup="keyEvent(event, '${execUrl}')" class="wc-command" id="wc-command" type="text" />
</form>
</div>
</body>
</html>
@@ -0,0 +1,147 @@
<html>
<head>
<title>${bundle.symbolicName!}</title>
<link rel="stylesheet" type="text/css" href="<@s.url value="/static/css/main.css" />" />
<link rel="stylesheet" type="text/css" href="<@s.url value="/static/css/redmond/jquery-ui-1.7.1.custom.css" />" />
<script src="<@s.url value="/static/js/jquery-1.3.2.min.js" />"></script>
<script src="<@s.url value="/static/js/jquery-ui-1.7.1.custom.min.js" />"></script>
<script type="text/javascript">
$(function() {
$("#tabs").tabs();
});
</script>
</head>
<body>
<div class="menu">
<div style="float:left;">
<#if action.isAllowedAction(bundle, "start")>
<a href="bundle_${bundle.symbolicName}!start.action" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
<span class="ui-icon ui-icon-play"></span>
Start
</a>
</#if>
<#if action.isAllowedAction(bundle, "stop")>
<a href="bundle_${bundle.symbolicName}!stop.action" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
<span class="ui-icon ui-icon-stop"></span>
Stop
</a>
</#if>
<#if action.isAllowedAction(bundle, "update")>
<a href="bundle_${bundle.symbolicName}!update.action" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
<span class="ui-icon ui-icon-refresh"></span>
Update
</a>
</#if>
</div>
<div style="float:right;">
<@s.url var="bundlesUrl" namespace="/osgi/admin" action="bundles" includeParams="none" />
<@s.url var="osgiShellUrl" namespace="/osgi/admin" action="shell" includeParams="none" />
<a href="${bundlesUrl}" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
<span class="ui-icon ui-icon-bullet"></span>
Bundles
</a>
<a href="${osgiShellUrl}" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
<span class="ui-icon ui-icon-transferthick-e-w"></span>
OSGi Shell
</a>
</div>
</div>
<@s.actionerror />
<div id="tabs" class="tabs">
<ul>
<li><a href="#tabs-1">OSGi Metadata</a></li>
<li><a href="#tabs-2">Resgistered Services</a></li>
<li><a href="#tabs-3">Services in Use</a></li>
<li><a href="#tabs-4">Packages</a></li>
<li><a href="#tabs-5">Headers</a></li>
</ul>
<div id="tabs-1">
<table class="properties">
<tr>
<td class="name">Id</td>
<td>${bundle.bundleId!}</td>
</tr>
<tr>
<td class="name">Name</td>
<td>${bundle.symbolicName!}</td>
</tr>
<tr>
<td class="name">Location</td>
<td>${bundle.location!}</td>
</tr>
<tr>
<td class="name">Status</td>
<td>${action.getBundleState(bundle)}</td>
</tr>
</table>
</div>
<div id="tabs-2">
<#list (bundle.registeredServices)! as service>
<table class="properties">
<#list (service.propertyKeys)! as key >
<tr>
<td class="name">${key}</td>
<td>${action.displayProperty(service.getProperty(key))}</td>
</tr>
</#list>
</table>
<br/>
</#list>
</div>
<div id="tabs-3">
<#list (bundle.servicesInUse)! as service>
<table class="properties">
<#list (service.propertyKeys)! as key >
<tr>
<td class="name">${key}</td>
<td>${action.displayProperty(service.getProperty(key))!}</td>
</tr>
</#list>
</table>
<br/>
</#list>
</div>
<div id="tabs-4">
<#list packages! as pkg>
<table class="properties">
<tr>
<td class="name">Name</td>
<td>${pkg.name}</td>
</tr>
<tr>
<td class="name">Actions</td>
<td>
<ul>
<#list (pkg.actionConfigs.keySet())! as name >
<li>${name}</li>
</#list>
</ul>
</td>
</tr>
</table>
<br/>
</#list>
</div>
<div id="tabs-5">
<table class="properties">
<#list headerKeys as header>
<tr>
<td class="name">${header}</td>
<td><div class="propertyValue">${bundle.headers.get(header)}</div> </td>
</tr>
</#list>
</table>
</div>
</div>
</body>
</html>
@@ -0,0 +1,71 @@
<html>
<head>
<title>OSGi Bundles</title>
<link rel="stylesheet" type="text/css" href="<@s.url value="/static/css/main.css" />" />
<link rel="stylesheet" type="text/css" href="<@s.url value="/static/css/redmond/jquery-ui-1.7.1.custom.css" />" />
<script src="<@s.url value="/static/js/jquery-1.3.2.min.js" />"></script>
<script src="<@s.url value="/static/js/jquery-ui-1.7.1.custom.min.js" />"></script>
</head>
<body>
<div class="menu">
<div style="float:right;">
<@s.url var="bundlesUrl" namespace="/osgi/admin" action="bundles" includeParams="none" />
<@s.url var="osgiShellUrl" namespace="/osgi/admin" action="shell" includeParams="none" />
<a href="${bundlesUrl}" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
<span class="ui-icon ui-icon-bullet"></span>
Bundles
</a>
<a href="${osgiShellUrl}" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
<span class="ui-icon ui-icon-transferthick-e-w"></span>
OSGi Shell
</a>
</div>
</div>
<table class="properties" style="clear:both; width:700px">
<thead>
<tr>
<th>Name</th>
<th>Status</th>
<th>Struts Bundle</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<#list bundles as bundle>
<tr>
<td>
<a href="bundle_${bundle.symbolicName}!view.action">${bundle.symbolicName}</a>
</td>
<td>${action.getBundleState(bundle)}</td>
<td>${action.isStrutsEnabled(bundle)?string("yes", "no")}</td>
<td style="width:200px">
<#if action.isAllowedAction(bundle, "start")>
<a href="bundle_${bundle.symbolicName}!start.action" class="ui-state-default ui-corner-all fg-button-small fg-button-icon-left">
<span class="ui-icon ui-icon-play"></span>
Start
</a>
</#if>
<#if action.isAllowedAction(bundle, "stop")>
<a href="bundle_${bundle.symbolicName}!stop.action" class="ui-state-default ui-corner-all fg-button-small fg-button-icon-left">
<span class="ui-icon ui-icon-stop"></span>
Stop
</a>
</#if>
<#if action.isAllowedAction(bundle, "update")>
<a href="bundle_${bundle.symbolicName}!update.action" class="ui-state-default ui-corner-all fg-button-small fg-button-icon-left">
<span class="ui-icon ui-icon-refresh"></span>
Update
</a>
</#if>
</td>
</tr>
</#list>
</tbody>
</table>
</body>
</html>
@@ -0,0 +1,103 @@
.right {
clear: both;
float: right;
}
.left {
clear: both;
float: left;
}
.bundleDetails td {
border: 1px solid #C8C8C8;
}
.rowTitle {
width: 141px;
font-weight: bold;
vertical-align: top;
}
table.properties {
border-style: solid;
border-width: 1px;
border-color: #3366CC;
}
table.properties td {
border-style: solid;
border-width: 1px;
border-color: #3366CC;
}
table.properties td.name {
background-color: #C3D9FF;
vertical-align: top;
}
table.properties th {
background-color: #C3D9FF;
}
img {
border-style: none;
}
.fg-button {
outline: 0;
margin: 0 4px 0 0;
padding: .4em 1em;
text-decoration: none !important;
cursor: pointer;
position: relative;
text-align: center;
zoom: 1;
}
.fg-button .ui-icon {
margin-left: -3px;
margin-top: -8px;
position: absolute;
top: 50%;
}
.fg-button-small {
outline: 0;
margin: 0 4px 0 0;
padding: 0em 1em;
text-decoration: none !important;
cursor: pointer;
position: relative;
text-align: center;
}
.fg-button-small .ui-icon {
margin-left: -3px;
margin-top: -8px;
position: absolute;
top: 50%;
}
.fg-button-icon-left .ui-icon {
left: 0em;
margin-left: 0;
right: auto;
}
.menu {
clear: both;
padding-bottom: 10px;
height:25px;
}
.tabs {
clear: both;
}
.propertyValue {
width: 600px;
overflow: auto;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

@@ -0,0 +1,404 @@
/*
* jQuery UI CSS Framework
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
*/
/* Layout helpers
----------------------------------*/
.ui-helper-hidden { display: none; }
.ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.ui-helper-clearfix { display: inline-block; }
/* required comment for clearfix to work in Opera \*/
* html .ui-helper-clearfix { height:1%; }
.ui-helper-clearfix { display:block; }
/* end clearfix */
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
/* Interaction Cues
----------------------------------*/
.ui-state-disabled { cursor: default !important; }
/* Icons
----------------------------------*/
/* states and images */
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
/* Misc visuals
----------------------------------*/
/* Overlays */
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
/*
* jQuery UI CSS Framework
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Lucida%20Grande,%20Lucida%20Sans,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=5px&bgColorHeader=5c9ccc&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=55&borderColorHeader=4297d7&fcHeader=ffffff&iconColorHeader=d8e7f3&bgColorContent=fcfdfd&bgTextureContent=06_inset_hard.png&bgImgOpacityContent=100&borderColorContent=a6c9e2&fcContent=222222&iconColorContent=469bdd&bgColorDefault=dfeffc&bgTextureDefault=02_glass.png&bgImgOpacityDefault=85&borderColorDefault=c5dbec&fcDefault=2e6e9e&iconColorDefault=6da8d5&bgColorHover=d0e5f5&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=79b7e7&fcHover=1d5987&iconColorHover=217bc0&bgColorActive=f5f8f9&bgTextureActive=06_inset_hard.png&bgImgOpacityActive=100&borderColorActive=79b7e7&fcActive=e17009&iconColorActive=f9bd01&bgColorHighlight=fbec88&bgTextureHighlight=01_flat.png&bgImgOpacityHighlight=55&borderColorHighlight=fad42e&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
*/
/* Component containers
----------------------------------*/
.ui-widget { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1.1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1em; }
.ui-widget-content { border: 1px solid #a6c9e2; background: #fcfdfd url(images/ui-bg_inset-hard_100_fcfdfd_1x100.png) 50% bottom repeat-x; color: #222222; }
.ui-widget-content a { color: #222222; }
.ui-widget-header { border: 1px solid #4297d7; background: #5c9ccc url(images/ui-bg_gloss-wave_55_5c9ccc_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
.ui-widget-header a { color: #ffffff; }
/* Interaction states
----------------------------------*/
.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #c5dbec; background: #dfeffc url(images/ui-bg_glass_85_dfeffc_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #2e6e9e; outline: none; }
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #2e6e9e; text-decoration: none; outline: none; }
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #79b7e7; background: #d0e5f5 url(images/ui-bg_glass_75_d0e5f5_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1d5987; outline: none; }
.ui-state-hover a, .ui-state-hover a:hover { color: #1d5987; text-decoration: none; outline: none; }
.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #79b7e7; background: #f5f8f9 url(images/ui-bg_inset-hard_100_f5f8f9_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #e17009; outline: none; }
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #e17009; outline: none; text-decoration: none; }
/* Interaction Cues
----------------------------------*/
.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fad42e; background: #fbec88 url(images/ui-bg_flat_55_fbec88_40x100.png) 50% 50% repeat-x; color: #363636; }
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; }
.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
.ui-state-error a, .ui-widget-content .ui-state-error a { color: #cd0a0a; }
.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0a0a; }
.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; }
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
/* Icons
----------------------------------*/
/* states and images */
.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_469bdd_256x240.png); }
.ui-widget-content .ui-icon {background-image: url(images/ui-icons_469bdd_256x240.png); }
.ui-widget-header .ui-icon {background-image: url(images/ui-icons_d8e7f3_256x240.png); }
.ui-state-default .ui-icon { background-image: url(images/ui-icons_6da8d5_256x240.png); }
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_217bc0_256x240.png); }
.ui-state-active .ui-icon {background-image: url(images/ui-icons_f9bd01_256x240.png); }
.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
/* positioning */
.ui-icon-carat-1-n { background-position: 0 0; }
.ui-icon-carat-1-ne { background-position: -16px 0; }
.ui-icon-carat-1-e { background-position: -32px 0; }
.ui-icon-carat-1-se { background-position: -48px 0; }
.ui-icon-carat-1-s { background-position: -64px 0; }
.ui-icon-carat-1-sw { background-position: -80px 0; }
.ui-icon-carat-1-w { background-position: -96px 0; }
.ui-icon-carat-1-nw { background-position: -112px 0; }
.ui-icon-carat-2-n-s { background-position: -128px 0; }
.ui-icon-carat-2-e-w { background-position: -144px 0; }
.ui-icon-triangle-1-n { background-position: 0 -16px; }
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
.ui-icon-triangle-1-e { background-position: -32px -16px; }
.ui-icon-triangle-1-se { background-position: -48px -16px; }
.ui-icon-triangle-1-s { background-position: -64px -16px; }
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
.ui-icon-triangle-1-w { background-position: -96px -16px; }
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
.ui-icon-arrow-1-n { background-position: 0 -32px; }
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
.ui-icon-arrow-1-e { background-position: -32px -32px; }
.ui-icon-arrow-1-se { background-position: -48px -32px; }
.ui-icon-arrow-1-s { background-position: -64px -32px; }
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
.ui-icon-arrow-1-w { background-position: -96px -32px; }
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
.ui-icon-arrow-4 { background-position: 0 -80px; }
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
.ui-icon-extlink { background-position: -32px -80px; }
.ui-icon-newwin { background-position: -48px -80px; }
.ui-icon-refresh { background-position: -64px -80px; }
.ui-icon-shuffle { background-position: -80px -80px; }
.ui-icon-transfer-e-w { background-position: -96px -80px; }
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
.ui-icon-folder-collapsed { background-position: 0 -96px; }
.ui-icon-folder-open { background-position: -16px -96px; }
.ui-icon-document { background-position: -32px -96px; }
.ui-icon-document-b { background-position: -48px -96px; }
.ui-icon-note { background-position: -64px -96px; }
.ui-icon-mail-closed { background-position: -80px -96px; }
.ui-icon-mail-open { background-position: -96px -96px; }
.ui-icon-suitcase { background-position: -112px -96px; }
.ui-icon-comment { background-position: -128px -96px; }
.ui-icon-person { background-position: -144px -96px; }
.ui-icon-print { background-position: -160px -96px; }
.ui-icon-trash { background-position: -176px -96px; }
.ui-icon-locked { background-position: -192px -96px; }
.ui-icon-unlocked { background-position: -208px -96px; }
.ui-icon-bookmark { background-position: -224px -96px; }
.ui-icon-tag { background-position: -240px -96px; }
.ui-icon-home { background-position: 0 -112px; }
.ui-icon-flag { background-position: -16px -112px; }
.ui-icon-calendar { background-position: -32px -112px; }
.ui-icon-cart { background-position: -48px -112px; }
.ui-icon-pencil { background-position: -64px -112px; }
.ui-icon-clock { background-position: -80px -112px; }
.ui-icon-disk { background-position: -96px -112px; }
.ui-icon-calculator { background-position: -112px -112px; }
.ui-icon-zoomin { background-position: -128px -112px; }
.ui-icon-zoomout { background-position: -144px -112px; }
.ui-icon-search { background-position: -160px -112px; }
.ui-icon-wrench { background-position: -176px -112px; }
.ui-icon-gear { background-position: -192px -112px; }
.ui-icon-heart { background-position: -208px -112px; }
.ui-icon-star { background-position: -224px -112px; }
.ui-icon-link { background-position: -240px -112px; }
.ui-icon-cancel { background-position: 0 -128px; }
.ui-icon-plus { background-position: -16px -128px; }
.ui-icon-plusthick { background-position: -32px -128px; }
.ui-icon-minus { background-position: -48px -128px; }
.ui-icon-minusthick { background-position: -64px -128px; }
.ui-icon-close { background-position: -80px -128px; }
.ui-icon-closethick { background-position: -96px -128px; }
.ui-icon-key { background-position: -112px -128px; }
.ui-icon-lightbulb { background-position: -128px -128px; }
.ui-icon-scissors { background-position: -144px -128px; }
.ui-icon-clipboard { background-position: -160px -128px; }
.ui-icon-copy { background-position: -176px -128px; }
.ui-icon-contact { background-position: -192px -128px; }
.ui-icon-image { background-position: -208px -128px; }
.ui-icon-video { background-position: -224px -128px; }
.ui-icon-script { background-position: -240px -128px; }
.ui-icon-alert { background-position: 0 -144px; }
.ui-icon-info { background-position: -16px -144px; }
.ui-icon-notice { background-position: -32px -144px; }
.ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; }
.ui-icon-radio-off { background-position: -96px -144px; }
.ui-icon-radio-on { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; }
.ui-icon-pause { background-position: -16px -160px; }
.ui-icon-seek-next { background-position: -32px -160px; }
.ui-icon-seek-prev { background-position: -48px -160px; }
.ui-icon-seek-end { background-position: -64px -160px; }
.ui-icon-seek-first { background-position: -80px -160px; }
.ui-icon-stop { background-position: -96px -160px; }
.ui-icon-eject { background-position: -112px -160px; }
.ui-icon-volume-off { background-position: -128px -160px; }
.ui-icon-volume-on { background-position: -144px -160px; }
.ui-icon-power { background-position: 0 -176px; }
.ui-icon-signal-diag { background-position: -16px -176px; }
.ui-icon-signal { background-position: -32px -176px; }
.ui-icon-battery-0 { background-position: -48px -176px; }
.ui-icon-battery-1 { background-position: -64px -176px; }
.ui-icon-battery-2 { background-position: -80px -176px; }
.ui-icon-battery-3 { background-position: -96px -176px; }
.ui-icon-circle-plus { background-position: 0 -192px; }
.ui-icon-circle-minus { background-position: -16px -192px; }
.ui-icon-circle-close { background-position: -32px -192px; }
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
.ui-icon-circle-zoomin { background-position: -176px -192px; }
.ui-icon-circle-zoomout { background-position: -192px -192px; }
.ui-icon-circle-check { background-position: -208px -192px; }
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
.ui-icon-circlesmall-close { background-position: -32px -208px; }
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
.ui-icon-squaresmall-close { background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
/* Misc visuals
----------------------------------*/
/* Corner radius */
.ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; }
.ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; }
.ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; }
.ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; }
.ui-corner-top { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; }
.ui-corner-bottom { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; }
.ui-corner-right { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; }
.ui-corner-left { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; }
.ui-corner-all { -moz-border-radius: 5px; -webkit-border-radius: 5px; }
/* Overlays */
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; }/* Accordion
----------------------------------*/
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
.ui-accordion .ui-accordion-li-fix { display: inline; }
.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; }
.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; }
.ui-accordion .ui-accordion-content-active { display: block; }/* Datepicker
----------------------------------*/
.ui-datepicker { width: 17em; padding: .2em .2em 0; }
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
.ui-datepicker .ui-datepicker-prev { left:2px; }
.ui-datepicker .ui-datepicker-next { right:2px; }
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; }
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year { width: 49%;}
.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; }
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
.ui-datepicker td { border: 0; padding: 1px; }
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi { width:auto; }
.ui-datepicker-multi .ui-datepicker-group { float:left; }
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
.ui-datepicker-row-break { clear:both; width:100%; }
/* RTL support */
.ui-datepicker-rtl { direction: rtl; }
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
.ui-datepicker-cover {
display: none; /*sorry for IE5*/
display/**/: block; /*sorry for IE5*/
position: absolute; /*must have*/
z-index: -1; /*must have*/
filter: mask(); /*must have*/
top: -4px; /*must have*/
left: -4px; /*must have*/
width: 200px; /*must have*/
height: 200px; /*must have*/
}/* Dialog
----------------------------------*/
.ui-dialog { position: relative; padding: .2em; width: 300px; }
.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; }
.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; }
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; }
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
.ui-draggable .ui-dialog-titlebar { cursor: move; }
/* Progressbar
----------------------------------*/
.ui-progressbar { height:2em; text-align: left; }
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/* Resizable
----------------------------------*/
.ui-resizable { position: relative;}
.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; }
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; }
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; }
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; }
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Slider
----------------------------------*/
.ui-slider { position: relative; text-align: left; }
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; }
.ui-slider-horizontal { height: .8em; }
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
.ui-slider-vertical { width: .8em; height: 100px; }
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs
----------------------------------*/
.ui-tabs { padding: .2em; zoom: 1; }
.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; }
.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; }
.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; }
.ui-tabs .ui-tabs-hide { display: none !important; }
@@ -0,0 +1,43 @@
/*
* $Id: webconsole.css 590812 2007-10-31 20:32:54Z apetrelli $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#shell {
clear: both;
}
.wc-results {
overflow: auto;
margin: 0px;
padding: 5px;
font-family: courier;
color: white;
background-color: black;
height: 400px;
}
.wc-results pre {
display: inline;
}
.wc-command {
margin: 0px;
font-family: courier;
color: white;
background-color: black;
width: 100%;
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,83 @@
/*
* $Id: webconsole.js 590812 2007-10-31 20:32:54Z apetrelli $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
function printResult(result_string)
{
var result_div = $('#wc-result')[0];
var result_array = result_string.split('\n');
var new_command = $('#wc-command').val();
result_div.appendChild(document.createTextNode('$ ' + new_command));
result_div.appendChild(document.createElement('br'));
for (var line_index in result_array) {
var result_wrap = document.createElement('pre')
line = document.createTextNode(result_array[line_index]);
result_wrap.appendChild(line);
result_div.appendChild(result_wrap);
result_div.appendChild(document.createElement('br'));
}
result_div.scrollTop = result_div.scrollHeight;
$('#wc-command').val('');
}
function keyEvent(event, url)
{
switch(event.keyCode){
case 13:
var the_shell_command = $('#wc-command').val();
if (the_shell_command) {
commands_history[commands_history.length] = the_shell_command;
history_pointer = commands_history.length;
$.ajax({
type: "GET",
url: url,
data: $("#wc-command").serialize(),
success: function (data, textStatus) {
printResult(data);
},
error: function (request, textStatus) {
printResult(textStatus);
}
});
}
break;
case 38: // this is the arrow up
if (history_pointer > 0) {
history_pointer--;
$('#wc-command').val(commands_history[history_pointer]);
}
break;
case 40: // this is the arrow down
if (history_pointer < commands_history.length - 1 ) {
history_pointer++;
$('#wc-command').val(commands_history[history_pointer]);
}
break;
default:
break;
}
}
var commands_history = new Array();
var history_pointer;
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
~ $Id$
~
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="bundle-admin" namespace="/osgi/admin" extends="struts-default">
<default-action-ref name="bundles" />
<action name="bundle_*!*" class="org.apache.struts2.osgi.admin.actions.BundlesAction" method="{2}">
<param name="id">{1}</param>
<result type="freemarker">viewBundle.ftl</result>
</action>
<action name="bundles" class="org.apache.struts2.osgi.admin.actions.BundlesAction" method="index">
<result type="freemarker">viewBundles.ftl</result>
</action>
<action name="execCommand" class="org.apache.struts2.osgi.admin.actions.ShellAction">
<result type="freemarker">commandResult.ftl</result>
</action>
<action name="shell">
<result type="freemarker">shell.ftl</result>
</action>
</package>
</struts>
+78
View File
@@ -0,0 +1,78 @@
<?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-osgi-bundles</artifactId>
<version>2.1.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-demo-bundle</artifactId>
<packaging>bundle</packaging>
<name>Struts 2 OSGi Demo Bundle</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/bundles/demo</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/bundles/demo</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/bundles/demo</url>
</scm>
<dependencies>
<dependency>
<groupId>velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>velocity-tools</groupId>
<artifactId>velocity-tools</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>${pom.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<version>2.0.0</version>
<configuration>
<instructions>
<manifestLocation>META-INF</manifestLocation>
<Import-Package>*,com.opensymphony.xwork2</Import-Package>
<Spring-Context>*;create-asynchronously:=false</Spring-Context>
<Struts2-Enabled>true</Struts2-Enabled>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,47 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package actions.osgi;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Bundle;
import org.apache.struts2.osgi.interceptor.BundleContextAware;
import org.apache.struts2.osgi.interceptor.ServiceAware;
import org.apache.struts2.convention.annotation.ResultPath;
import java.util.List;
import com.opensymphony.xwork2.ActionSupport;
/**
* This action shows how to interact with the OSGi container, using the OSGi interceptor
*/
@ResultPath("/content")
public class BundlesAction extends ActionSupport implements BundleContextAware {
private BundleContext bundleContext;
public void setBundleContext(BundleContext bundleContext) {
this.bundleContext = bundleContext;
}
public Bundle[] getBundles() {
return bundleContext.getBundles();
}
}
@@ -0,0 +1,39 @@
package actions.osgi;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.ResultPath;
import org.apache.struts2.osgi.interceptor.BundleContextAware;
import org.apache.struts2.osgi.interceptor.ServiceAware;
import org.osgi.framework.BundleContext;
import java.util.List;
@ResultPath("/content")
public class HelloWorldAction extends ActionSupport {
private Message message;
@Action("hello-convention")
public String execute() {
return SUCCESS;
}
public Message getMessage() {
return message;
}
public void setMessage(Message message) {
this.message = message;
}
public String getSimpleMessage() {
return "Hello!!!";
}
public String toString() {
StringBuilder sb = new StringBuilder("{message:");
sb.append(message != null ? message.getText() : "null");
sb.append("}");
return sb.toString();
}
}
@@ -0,0 +1,37 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package actions.osgi;
public class Message {
private String text;
public Message(String text) {
this.text = text;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
}
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<bean class="actions.osgi.Message" id="message">
<constructor-arg type="java.lang.String" value="Welcome to the OSGi plugin. You can checkout any time you like, but can never leave"/>
</bean>
<bean class="actions.osgi.HelloWorldAction" id="helloWorldAction" scope="prototype">
<property name="message" ref="message" />
</bean>
</beans>
@@ -0,0 +1,18 @@
<html>
<head>
<title>OSGi integration</title>
</head>
<body>
This action was mapped by <b>Convention</b>, and shows how to get access to the <b>BundleContext</b>
and registered services
<br />
Spring Application Contexts: ${applicationContextsCount!}
<br>
Bundles List:
<ul>
<#list bundles as bundle>
<li>${bundle.symbolicName!}</li>
</#list>
</ul>
</body>
</html>
@@ -0,0 +1,10 @@
<html>
<head>
<title>Action mapped by the Convention plugin</title>
</head>
<body>
This is an action mapped by the Convention plugin, using a FreeMarker result.
<br />
Message from Action: ${simpleMessage}
</body>
</html>
@@ -0,0 +1,10 @@
<html>
<head>
<title>Action mapped by the XML configurationn</title>
</head>
<body>
This is an action mapped by XML configuration, using a <b>FreeMarker</b> result.
<br />
Message from Action: ${message.text}
</body>
</html>
@@ -0,0 +1,10 @@
<html>
<head>
<title>Action mapped by the XML configurationn</title>
</head>
<body>
This is an action mapped by XML configuration, using a <b>Velocity</b> result.
<br />
Message from Action: $message.text
</body>
</html>
@@ -0,0 +1,14 @@
<html>
<head>
<title>OSGi Demo Bundle</title>
</head>
<body>
This demo contains actions that will be packaged into an OSGi bundle and loaded by the Struts 2 OSGi plugin.
<br />
<ul>
<li><@s.a namespace="/osgi" action="hello-convention">Action mapped by the Convention plugin, with FreeMarker result</@s.a></li>
<li><@s.a namespace="/osgi" action="hello-freemarker">Action mapped by XML, with FreeMarker result</@s.a></li>
<li><@s.a namespace="/osgi" action="hello-velocity">Action mapped by XML, with Velocity result</@s.a></li>
</ul>
</body>
</html>
@@ -0,0 +1,20 @@
<?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="bundle-demo" namespace="/osgi" extends="osgi-default">
<default-action-ref name="home" />
<action name="hello-velocity" class="helloWorldAction">
<result type="velocity">/content/osgi/hello.vm</result>
</action>
<action name="hello-freemarker" class="helloWorldAction">
<result type="freemarker">/content/osgi/hello.ftl</result>
</action>
<action name="home">
<result type="freemarker">/content/osgi/home.ftl</result>
</action>
</package>
</struts>
+93
View File
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* $Id: pom.xml 765215 2009-04-15 14:32:48Z musachy $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.1.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
<packaging>pom</packaging>
<name>Struts OSGi Bundles</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/bundles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/bundles</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/bundles</url>
</scm>
<modules>
<module>admin</module>
<module>demo</module>
</modules>
<dependencies>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>${pom.version}</version>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>compile</scope>
<version>3.8.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
</dependencies>
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rat-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<configuration>
<includes>
<include>pom.xml</include>
<include>src/**</include>
</includes>
<excludes>
<exclude>src/main/resources/*LICENSE.txt</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
+11 -11
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.1.4-SNAPSHOT</version>
<version>2.1.7</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Core</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/core/</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/core/</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/core/</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/core</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/core</url>
</scm>
<build>
@@ -55,8 +55,8 @@
<artifactItems>
<artifactItem>
<groupId>com.opensymphony</groupId>
<artifactId>xwork</artifactId>
<version>2.1.2</version>
<artifactId>xwork-core</artifactId>
<version>2.1.4</version>
<classifier>sources</classifier>
</artifactItem>
</artifactItems>
@@ -228,8 +228,8 @@
<dependencies>
<dependency>
<groupId>com.opensymphony</groupId>
<artifactId>xwork</artifactId>
<version>2.1.2</version>
<artifactId>xwork-core</artifactId>
<version>2.1.4</version>
</dependency>
<!--<dependency>-->
@@ -300,8 +300,8 @@
<!-- Mocks for unit testing (by Spring) -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-mock</artifactId>
<version>2.0.8</version>
<artifactId>spring-test</artifactId>
<version>${struts2.springPlatformVersion}</version>
<scope>test</scope>
</dependency>
@@ -408,7 +408,7 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.0.8</version>
<version>${struts2.springPlatformVersion}</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
@@ -44,6 +44,9 @@ public final class StrutsConstants {
/** The URL extension to use to determine if the request is meant for a Struts action */
public static final String STRUTS_ACTION_EXTENSION = "struts.action.extension";
/** Comma separated list of patterns (java.util.regex.Pattern) to be excluded from Struts2-processing */
public static final String STRUTS_ACTION_EXCLUDE_PATTERN = "struts.action.excludePattern";
/** Whether to use the alterative syntax for the tags or not */
public static final String STRUTS_TAG_ALTSYNTAX = "struts.tag.altSyntax";
@@ -112,6 +115,11 @@ public final class StrutsConstants {
/** The directory to use for storing uploaded files */
public static final String STRUTS_MULTIPART_SAVEDIR = "struts.multipart.saveDir";
/**
* The name of the bean that will handle multipart requests
*/
public static final String STRUTS_MULTIPART_HANDLER = "struts.multipart.handler";
/**
* The org.apache.struts2.dispatcher.multipart.MultiPartRequest parser implementation
* for a multipart request (file upload)
@@ -195,4 +203,10 @@ public final class StrutsConstants {
/** The {@link com.opensymphony.xwork2.UnknownHandlerManager} implementation class */
public static final String STRUTS_UNKNOWN_HANDLER_MANAGER = "struts.unknownHandlerManager";
/** Throw RuntimeException when a property is not found, or the evaluation of the espression fails*/
public static final String STRUTS_EL_THROW_EXCEPTION = "struts.el.throwExceptionOnFailure";
/** Logs properties that are not found (very verbose) **/
public static final String STRUTS_LOG_MISSING_PROPERTIES = "struts.ognl.logMissingProperties";
}
@@ -128,7 +128,6 @@ public class ActionComponent extends ContextBean {
protected ValueStackFactory valueStackFactory;
protected ActionProxyFactory actionProxyFactory;
protected ActionProxy proxy;
protected ActionMapper actionMapper;
protected String name;
protected String namespace;
protected boolean executeResult;
@@ -21,22 +21,31 @@
package org.apache.struts2.components;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.commons.lang.xwork.StringUtils;
import com.opensymphony.xwork2.util.ValueStack;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Map;
import java.util.LinkedHashMap;
/**
* <!-- START SNIPPET: javadoc -->
*
* A tag that creates a HTML &lt;a &gt;.<p/>
* <p/>
* A tag that creates a HTML &lt;a &gt;.This tag supports the same attributes as the "url" tag,
* including nested parameters using the "param" tag.<p/>
* <!-- END SNIPPET: javadoc -->
*
* <p/>
* <p/> <b>Examples</b>
*
* <p/>
* <pre>
* <!-- START SNIPPET: example1 -->
* &lt;s:a id="link1" theme="ajax" href="/DoIt.action"&gt;
@@ -45,22 +54,32 @@ import com.opensymphony.xwork2.util.ValueStack;
* &lt;/s:a&gt;
* <!-- END SNIPPET: example1 -->
* </pre>
*
*/
@StrutsTag(
name="a",
tldTagClass="org.apache.struts2.views.jsp.ui.AnchorTag",
description="Render a HTML href element that when clicked can optionally call a URL via remote XMLHttpRequest and updates its targets",
allowDynamicAttributes=true)
name = "a",
tldTagClass = "org.apache.struts2.views.jsp.ui.AnchorTag",
description = "Render a HTML href element that when clicked can optionally call a URL via remote XMLHttpRequest and updates its targets",
allowDynamicAttributes = true)
public class Anchor extends ClosingUIBean {
private static final Logger LOG = LoggerFactory.getLogger(Anchor.class);
public static final String OPEN_TEMPLATE = "a";
public static final String TEMPLATE = "a-close";
public static final String COMPONENT_NAME = Anchor.class.getName();
protected String href;
protected UrlProvider urlProvider;
protected UrlRenderer urlRenderer;
protected boolean processingTagBody = false;
//these params are passed by the Param tag
protected Map urlParameters = new LinkedHashMap();
public Anchor(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
super(stack, request, response);
urlProvider = new ComponentUrlProvider(this, this.urlParameters);
urlProvider.setHttpServletRequest(request);
urlProvider.setHttpServletResponse(response);
}
public String getDefaultOpenTemplate() {
@@ -70,16 +89,172 @@ public class Anchor extends ClosingUIBean {
protected String getDefaultTemplate() {
return TEMPLATE;
}
public void evaluateExtraParams() {
public boolean usesBody() {
return true;
}
@Override
protected void evaluateExtraParams() {
super.evaluateExtraParams();
if (href != null)
addParameter("href", ensureAttributeSafelyNotEscaped(findString(href)));
else {
//no href, build it from URL attributes
StringWriter sw = new StringWriter();
urlRenderer.beforeRenderUrl(urlProvider);
urlRenderer.renderUrl(sw, urlProvider);
String builtHref = sw.toString();
if (StringUtils.isNotEmpty(builtHref))
addParameter("href", ensureAttributeSafelyNotEscaped(builtHref));
}
}
@StrutsTagAttribute(description="The URL.")
@Inject(StrutsConstants.STRUTS_URL_INCLUDEPARAMS)
public void setUrlIncludeParams(String urlIncludeParams) {
urlProvider.setUrlIncludeParams(urlIncludeParams);
}
@Inject
public void setUrlRenderer(UrlRenderer urlRenderer) {
urlProvider.setUrlRenderer(urlRenderer);
this.urlRenderer = urlRenderer;
}
@Inject(required=false)
public void setExtraParameterProvider(ExtraParameterProvider provider) {
urlProvider.setExtraParameterProvider(provider);
}
@Override
public boolean start(Writer writer) {
boolean result = super.start(writer);
this.processingTagBody = true;
return result;
}
/**
* Overrides to be able to render body in a template rather than always before the template
*/
public boolean end(Writer writer, String body) {
this.processingTagBody = false;
evaluateParams();
try {
addParameter("body", body);
mergeTemplate(writer, buildTemplateName(template, getDefaultTemplate()));
} catch (Exception e) {
LOG.error("error when rendering", e);
}
finally {
popComponentStack();
}
return false;
}
public void addParameter(String key, Object value) {
/*
the parameters added by this method are used in the template. this method is also
called by Param to add params into ancestestor. This tag needs to keep both set of parameters
separated (You gotta keep 'em separated!)
*/
if (processingTagBody) {
this.urlParameters.put(key, value);
} else
super.addParameter(key, value);
}
@Override
public void addAllParameters(Map params) {
/*
the parameters added by this method are used in the template. this method is also
called by Param to add params into ancestestor. This tag needs to keep both set of parameters
separated (You gotta keep 'em separated!)
*/
if (processingTagBody) {
this.urlParameters.putAll(params);
} else
super.addAllParameters(params);
}
public UrlProvider getUrlProvider() {
return urlProvider;
}
@StrutsTagAttribute(description = "The URL.")
public void setHref(String href) {
this.href = href;
}
@StrutsTagAttribute(description = "The includeParams attribute may have the value 'none', 'get' or 'all'", defaultValue = "none")
public void setIncludeParams(String includeParams) {
urlProvider.setIncludeParams(includeParams);
}
@StrutsTagAttribute(description = "Set scheme attribute")
public void setScheme(String scheme) {
urlProvider.setScheme(scheme);
}
@StrutsTagAttribute(description = "The target value to use, if not using action")
public void setValue(String value) {
urlProvider.setValue(value);
}
@StrutsTagAttribute(description = "The action to generate the URL for, if not using value")
public void setAction(String action) {
urlProvider.setAction(action);
}
@StrutsTagAttribute(description = "The namespace to use")
public void setNamespace(String namespace) {
urlProvider.setNamespace(namespace);
}
@StrutsTagAttribute(description = "The method of action to use")
public void setMethod(String method) {
urlProvider.setMethod(method);
}
@StrutsTagAttribute(description = "Whether to encode parameters", type = "Boolean", defaultValue = "true")
public void setEncode(boolean encode) {
urlProvider.setEncode(encode);
}
@StrutsTagAttribute(description = "Whether actual context should be included in URL", type = "Boolean", defaultValue = "true")
public void setIncludeContext(boolean includeContext) {
urlProvider.setIncludeContext(includeContext);
}
@StrutsTagAttribute(description = "The resulting portlet mode")
public void setPortletMode(String portletMode) {
urlProvider.setPortletMode(portletMode);
}
@StrutsTagAttribute(description = "The resulting portlet window state")
public void setWindowState(String windowState) {
urlProvider.setWindowState(windowState);
}
@StrutsTagAttribute(description = "Specifies if this should be a portlet render or action URL. Default is \"render\". To create an action URL, use \"action\".")
public void setPortletUrlType(String portletUrlType) {
urlProvider.setPortletUrlType(portletUrlType);
}
@StrutsTagAttribute(description = "The anchor for this URL")
public void setAnchor(String anchor) {
urlProvider.setAnchor(anchor);
}
@StrutsTagAttribute(description = "Specifies whether to escape ampersand (&amp;) to (&amp;amp;) or not", type = "Boolean", defaultValue = "true")
public void setEscapeAmp(boolean escapeAmp) {
urlProvider.setEscapeAmp(escapeAmp);
}
@StrutsTagAttribute(description = "Specifies whether to force the addition of scheme, host and port or not", type = "Boolean", defaultValue = "false")
public void setForceAddSchemeHostAndPort(boolean forceAddSchemeHostAndPort) {
urlProvider.setForceAddSchemeHostAndPort(forceAddSchemeHostAndPort);
}
}
@@ -97,7 +97,7 @@ import com.opensymphony.xwork2.util.reflection.ReflectionProvider;
@StrutsTag(name="bean", tldTagClass="org.apache.struts2.views.jsp.BeanTag",
description="Instantiate a JavaBean and place it in the context")
public class Bean extends ContextBean {
protected static Logger LOG = LoggerFactory.getLogger(Bean.class);
protected static final Logger LOG = LoggerFactory.getLogger(Bean.class);
protected Object bean;
protected String name;
@@ -33,6 +33,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.StrutsException;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.dispatcher.mapper.ActionMapper;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import org.apache.struts2.util.FastByteArrayOutputStream;
@@ -56,6 +57,7 @@ public class Component {
protected ValueStack stack;
protected Map parameters;
protected ActionMapper actionMapper;
protected boolean throwExceptionOnELFailure;
/**
* Constructor.
@@ -84,6 +86,11 @@ public class Component {
public void setActionMapper(ActionMapper mapper) {
this.actionMapper = mapper;
}
@Inject(StrutsConstants.STRUTS_EL_THROW_EXCEPTION)
public void setThrowExceptionsOnELFailure(String throwException) {
this.throwExceptionOnELFailure = "true".equals(throwException);
}
/**
* Gets the OGNL value stack assoicated with this component.
@@ -245,7 +252,7 @@ public class Component {
expr = stripExpressionIfAltSyntax(expr);
return getStack().findValue(expr);
return getStack().findValue(expr, throwExceptionOnELFailure);
}
/**
@@ -372,7 +379,7 @@ public class Component {
} else {
expr = stripExpressionIfAltSyntax(expr);
return getStack().findValue(expr, toType);
return getStack().findValue(expr, toType, throwExceptionOnELFailure);
}
}
@@ -396,7 +403,7 @@ public class Component {
boolean includeContext, boolean encodeResult, boolean forceAddSchemeHostAndPort,
boolean escapeAmp) {
String finalAction = findString(action);
String finalMethod = method != null ? findString(method) : method;
String finalMethod = method != null ? findString(method) : null;
String finalNamespace = determineNamespace(namespace, getStack(), req);
ActionMapping mapping = new ActionMapping(finalAction, finalNamespace, finalMethod, parameters);
String uri = actionMapper.getUriFromActionMapping(mapping);
@@ -0,0 +1,252 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.components;
import com.opensymphony.xwork2.util.ValueStack;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/**
* Default implementation of UrlProvider
*/
public class ComponentUrlProvider implements UrlProvider {
protected HttpServletRequest httpServletRequest;
protected HttpServletResponse httpServletResponse;
protected String includeParams;
protected String scheme;
protected String value;
protected String action;
protected String namespace;
protected String method;
protected boolean encode = true;
protected boolean includeContext = true;
protected boolean escapeAmp = true;
protected String portletMode;
protected String windowState;
protected String portletUrlType;
protected String anchor;
protected boolean forceAddSchemeHostAndPort;
protected String urlIncludeParams;
protected ExtraParameterProvider extraParameterProvider;
protected UrlRenderer urlRenderer;
protected Component component;
private Map parameters;
/**
*
* @param component The component used to delagete some calls to
* @param parameters parameters passed from <param...>
*/
public ComponentUrlProvider(Component component, Map parameters) {
this.component = component;
this.parameters = parameters;
}
public String determineActionURL(String action, String namespace, String method, HttpServletRequest req, HttpServletResponse res, Map parameters, String scheme, boolean includeContext, boolean encodeResult, boolean forceAddSchemeHostAndPort, boolean escapeAmp) {
return component.determineActionURL(action, namespace, method, req, res, parameters, scheme, includeContext, encodeResult, forceAddSchemeHostAndPort, escapeAmp);
}
public String determineNamespace(String namespace, ValueStack stack, HttpServletRequest req) {
return component.determineNamespace(namespace, stack, req);
}
public String findString(String expr) {
return component.findString(expr);
}
public Map getParameters() {
return parameters;
}
public HttpServletRequest getHttpServletRequest() {
return httpServletRequest;
}
public void setHttpServletRequest(HttpServletRequest httpServletRequest) {
this.httpServletRequest = httpServletRequest;
}
public HttpServletResponse getHttpServletResponse() {
return httpServletResponse;
}
public void setHttpServletResponse(HttpServletResponse httpServletResponse) {
this.httpServletResponse = httpServletResponse;
}
public String getIncludeParams() {
return includeParams;
}
public void setIncludeParams(String includeParams) {
this.includeParams = includeParams;
}
public String getScheme() {
return scheme;
}
public void setScheme(String scheme) {
this.scheme = scheme;
}
public boolean isPutInContext() {
return component instanceof ContextBean;
}
public String getVar() {
return isPutInContext() ? ((ContextBean)component).getVar() : null;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public String getNamespace() {
return namespace;
}
public void setNamespace(String namespace) {
this.namespace = namespace;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public boolean isEncode() {
return encode;
}
public void setEncode(boolean encode) {
this.encode = encode;
}
public boolean isIncludeContext() {
return includeContext;
}
public void setIncludeContext(boolean includeContext) {
this.includeContext = includeContext;
}
public boolean isEscapeAmp() {
return escapeAmp;
}
public void setEscapeAmp(boolean escapeAmp) {
this.escapeAmp = escapeAmp;
}
public String getPortletMode() {
return portletMode;
}
public void setPortletMode(String portletMode) {
this.portletMode = portletMode;
}
public String getWindowState() {
return windowState;
}
public void setWindowState(String windowState) {
this.windowState = windowState;
}
public String getPortletUrlType() {
return portletUrlType;
}
public ValueStack getStack() {
return component.getStack();
}
public void setPortletUrlType(String portletUrlType) {
this.portletUrlType = portletUrlType;
}
public String getAnchor() {
return anchor;
}
public void setAnchor(String anchor) {
this.anchor = anchor;
}
public boolean isForceAddSchemeHostAndPort() {
return forceAddSchemeHostAndPort;
}
public void setForceAddSchemeHostAndPort(boolean forceAddSchemeHostAndPort) {
this.forceAddSchemeHostAndPort = forceAddSchemeHostAndPort;
}
public void putInContext(String result) {
if (isPutInContext()) {
((ContextBean)component).putInContext(result);
}
}
public String getUrlIncludeParams() {
return urlIncludeParams;
}
public void setUrlIncludeParams(String urlIncludeParams) {
this.urlIncludeParams = urlIncludeParams;
}
public ExtraParameterProvider getExtraParameterProvider() {
return extraParameterProvider;
}
public void setExtraParameterProvider(ExtraParameterProvider extraParameterProvider) {
this.extraParameterProvider = extraParameterProvider;
}
public UrlRenderer getUrlRenderer() {
return urlRenderer;
}
public void setUrlRenderer(UrlRenderer urlRenderer) {
this.urlRenderer = urlRenderer;
}
}
@@ -274,7 +274,6 @@ public class Date extends ContextBean {
public boolean end(Writer writer, String body) {
String msg = null;
ValueStack stack = getStack();
java.util.Date date = null;
// find the name on the valueStack
try {
@@ -182,7 +182,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
// this check is needed for backwards compatibility with 2.1.x
addParameter("doubleId", findStringIfAltSyntax(doubleId));
} else if (form != null) {
addParameter("doubleId", form.getParameters().get("id") + "_" +escape(this.doubleName));
addParameter("doubleId", form.getParameters().get("id") + "_" +escape(doubleName !=null ? findString(doubleName) : null));
} else {
addParameter("doubleId", escape(doubleName != null ? findString(doubleName) : null));
}
@@ -24,6 +24,7 @@ package org.apache.struts2.components;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.xwork.StringUtils;
import org.apache.struts2.views.annotations.StrutsTag;
import com.opensymphony.xwork2.util.ValueStack;
@@ -59,8 +60,12 @@ public class DoubleSelect extends DoubleListUIBean {
public void evaluateExtraParams() {
super.evaluateExtraParams();
StringBuilder onchangeParam = new StringBuilder();
onchangeParam.append(getParameters().get("id")).append("Redirect(this.options.selectedIndex)");
if(StringUtils.isNotEmpty(this.onchange)) {
onchangeParam.append(";").append(this.onchange);
}
// force the onchange parameter
addParameter("onchange", getParameters().get("id") + "Redirect(this.options.selectedIndex)");
addParameter("onchange", onchangeParam.toString());
}
}
@@ -88,7 +88,7 @@ public class ElseIf extends Component {
if (answer.booleanValue()) {
stack.getContext().put(If.ANSWER, answer);
}
return answer != null && answer.booleanValue();
return answer.booleanValue();
}
public boolean end(Writer writer, String body) {
@@ -0,0 +1,27 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.components;
import java.util.Map;
public interface ExtraParameterProvider {
public Map getExtraParameters();
}
@@ -36,6 +36,7 @@ import com.opensymphony.xwork2.validator.Validator;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.commons.lang.xwork.StringUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -153,28 +154,18 @@ public class Form extends ClosingUIBean {
*/
protected void evaluateExtraParams() {
super.evaluateExtraParams();
//boolean isAjax = "ajax".equalsIgnoreCase(this.theme);
if (validate != null) {
addParameter("validate", findValue(validate, Boolean.class));
}
// calculate the action and namespace
/*String action = null;
if (this.action != null) {
// if it isn't specified, we'll make somethig up
action = findString(this.action);
if (name == null) {
//make the name the same as the id
String id = (String) getParameters().get("id");
if (StringUtils.isNotEmpty(id)) {
addParameter("name", id);
}
}
if (Dispatcher.getInstance().isPortletSupportActive() && PortletActionContext.isPortletRequest()) {
evaluateExtraParamsPortletRequest(namespace, action);
} else {
String namespace = determineNamespace(this.namespace, getStack(),
request);
evaluateExtraParamsServletRequest(action, namespace, isAjax);
}*/
if (onsubmit != null) {
addParameter("onsubmit", findString(onsubmit));
}
@@ -44,7 +44,6 @@ public abstract class FormButton extends ClosingUIBean {
protected String method;
protected String align;
protected String type;
protected ActionMapper actionMapper;
public FormButton(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
super(stack, request, response);
@@ -23,6 +23,8 @@ package org.apache.struts2.components;
import java.io.Writer;
import java.util.Iterator;
import java.util.List;
import java.util.Arrays;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
@@ -30,6 +32,8 @@ import org.apache.struts2.util.MakeIterator;
import org.apache.struts2.views.jsp.IteratorStatus;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* <!-- START SNIPPET: javadoc -->
@@ -49,6 +53,13 @@ import com.opensymphony.xwork2.util.ValueStack;
* <li>id (String) - if specified the current iteration object will be place with this id in Struts stack's context
* scope</li>
*
* <li>begin (Integer) - if specified the iteration will start on that index</li>
*
* <li>end (Integer) - if specified the iteration will end on that index(inclusive)</li>
*
* <li>step (Integer) - if specified the iteration index will be increased by this value on each iteration. It can be a negative
* value, in which case 'begin' must be greater than 'end'</li>
*
* </ul>
*
* <!-- END SNIPPET: params -->
@@ -162,19 +173,14 @@ import com.opensymphony.xwork2.util.ValueStack;
*
* <!-- START SNIPPET: example5description -->
*
* </p>To simulate a simple loop with iterator tag, the following could be done.
* It does the loop 5 times.
* </p>A loop that iterates 5 times
*
* <!-- END SNIPPET: example5description -->
*
* <pre>
* <!-- START SNIPPET: example5code -->
*
* &lt;s:iterator status="stat" value="{1,2,3,4,5}" &gt;
* &lt;!-- grab the index (start with 0 ... ) --&gt;
* &lt;s:property value="#stat.index" /&gt;
*
* &lt;!-- grab the top of the stack which should be the --&gt;
* &lt;s:iterator var="counter" begin="1" end="5" &gt;
* &lt;!-- current iteration value (1, ... 5) --&gt;
* &lt;s:property value="top" /&gt;
* &lt;/s:iterator&gt;
@@ -201,15 +207,39 @@ import com.opensymphony.xwork2.util.ValueStack;
* <!-- END SNIPPET: example6code -->
* </pre>
*
* <!-- START SNIPPET: example7description -->
*
* </p>A loop that iterates over a partial list
*
* <!-- END SNIPPET: example7description -->
*
* <pre>
* <!-- START SNIPPET: example7code -->
*
* &lt;s:iterator value="{1,2,3,4,5}" begin="2" end="4" &gt;
* &lt;!-- current iteration value (2,3,4) --&gt;
* &lt;s:property value="top" /&gt;
* &lt;/s:iterator&gt;
*
* <!-- END SNIPPET: example7code -->
* </pre>
*/
@StrutsTag(name="iterator", tldTagClass="org.apache.struts2.views.jsp.IteratorTag", description="Iterate over a iterable value")
public class IteratorComponent extends ContextBean {
private static final Logger LOG = LoggerFactory.getLogger(IteratorComponent.class);
protected Iterator iterator;
protected IteratorStatus status;
protected Object oldStatus;
protected IteratorStatus.StatusState statusState;
protected String statusAttr;
protected String value;
protected String beginStr;
protected Integer begin;
protected String endStr;
protected Integer end;
protected String stepStr;
protected Integer step;
public IteratorComponent(ValueStack stack) {
super(stack);
@@ -222,12 +252,50 @@ public class IteratorComponent extends ContextBean {
status = new IteratorStatus(statusState);
}
if (beginStr != null)
begin = (Integer) findValue(beginStr, Integer.class);
if (endStr != null)
end = (Integer) findValue(endStr, Integer.class);
if (stepStr != null)
step = (Integer) findValue(stepStr, Integer.class);
ValueStack stack = getStack();
if (value == null) {
if (value == null && begin == null && end == null) {
value = "top";
}
iterator = MakeIterator.convert(findValue(value));
Object iteratorTarget = findValue(value);
iterator = MakeIterator.convert(iteratorTarget);
if (begin != null) {
//default step to 1
if (step == null)
step = 1;
if (iterator == null) {
//classic for loop from 'begin' to 'end'
iterator = new CounterIterator(begin, end, step, null);
} else if (iterator != null) {
//only arrays and lists are supported
if (iteratorTarget.getClass().isArray()) {
Object[] values = (Object[]) iteratorTarget;
if (end == null)
end = step > 0 ? values.length - 1 : 0;
iterator = new CounterIterator(begin, end, step, Arrays.asList(values));
} else if (iteratorTarget instanceof List) {
List values = (List) iteratorTarget;
if (end == null)
end = step > 0 ? values.size() - 1 : 0;
iterator = new CounterIterator(begin, end, step, values);
} else {
//so the iterator is not based on an array or a list
LOG.error("Incorrect use of the iterator tag. When 'begin' is set, 'value' must be" +
" an Array or a List, or not set at all. 'begin', 'end' and 'step' will be ignored");
}
}
}
// get the first
if ((iterator != null) && iterator.hasNext()) {
@@ -289,6 +357,44 @@ public class IteratorComponent extends ContextBean {
}
}
class CounterIterator implements Iterator<Object> {
private int step;
private int end;
private int currentIndex;
private List<Object> values;
CounterIterator(Integer begin, Integer end, Integer step, List<Object> values) {
this.end = end;
if (step != null)
this.step = step;
this.currentIndex = begin - this.step;
this.values = values;
}
public boolean hasNext() {
int next = peekNextIndex();
return step > 0 ? next <= end : next >= end;
}
public Object next() {
if (hasNext()) {
int nextIndex = peekNextIndex();
currentIndex += step;
return value != null ? values.get(nextIndex) : nextIndex;
} else {
throw new IndexOutOfBoundsException("Index " + ( currentIndex + step) + " must be less than or equal to " + end);
}
}
private int peekNextIndex() {
return currentIndex + step;
}
public void remove() {
throw new UnsupportedOperationException("Values cannot be removed from this iterator");
}
}
@StrutsTagAttribute(description="If specified, an instanceof IteratorStatus will be pushed into stack upon each iteration",
type="Boolean", defaultValue="false")
public void setStatus(String status) {
@@ -300,4 +406,20 @@ public class IteratorComponent extends ContextBean {
this.value = value;
}
@StrutsTagAttribute(description="if specified the iteration will start on that index", type="Integer", defaultValue="0")
public void setBegin(String begin) {
this.beginStr = begin;
}
@StrutsTagAttribute(description="if specified the iteration will end on that index(inclusive)", type="Integer",
defaultValue="Size of the 'values' List or array, or 0 if 'step' is negative")
public void setEnd(String end) {
this.endStr = end;
}
@StrutsTagAttribute(description="if specified the iteration index will be increased by this value on each iteration. It can be a negative " +
"value, in which case 'begin' must be greater than 'end'", type="Integer", defaultValue="1")
public void setStep(String step) {
this.stepStr = step;
}
}
@@ -84,9 +84,12 @@ public class Label extends UIBean {
if (value != null) {
addParameter("nameValue", findString(value));
} else if (key != null) {
// get the label from a TextProvider (default value is the key)
String providedLabel = TextProviderHelper.getText(key, key, stack);
addParameter("nameValue", providedLabel);
Object nameValue = parameters.get("nameValue");
if (nameValue == null || nameValue.toString().length() == 0) {
// get the label from a TextProvider (default value is the key)
String providedLabel = TextProviderHelper.getText(key, key, stack);
addParameter("nameValue", providedLabel);
}
} else if (name != null) {
String expr = completeExpressionIfAltSyntax(name);
addParameter("nameValue", findString(expr));
@@ -108,7 +108,7 @@ public class Param extends Component {
String name = findString(this.name);
if (name == null) {
throw new StrutsException("No name found for following expression: " + name);
throw new StrutsException("No name found for following expression: " + this.name);
}
Object value = findValue(this.value);
@@ -26,11 +26,13 @@ import java.io.Writer;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.StrutsConstants;
import org.apache.commons.lang.xwork.StringEscapeUtils;
import com.opensymphony.xwork2.util.TextUtils;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import com.opensymphony.xwork2.inject.Inject;
/**
* <!-- START SNIPPET: javadoc -->
@@ -136,7 +138,7 @@ public class Property extends Component {
// exception: don't call findString(), since we don't want the
// expression parsed in this one case. it really
// doesn't make sense, in fact.
actualValue = (String) getStack().findValue(value, String.class);
actualValue = (String) getStack().findValue(value, String.class, throwExceptionOnELFailure);
try {
if (actualValue != null) {
@@ -154,10 +156,10 @@ public class Property extends Component {
private String prepare(String value) {
String result = value;
if (escape) {
result = TextUtils.htmlEncode(result);
result = StringEscapeUtils.escapeHtml(result);
}
if (escapeJavaScript) {
result = TextUtils.escapeJavaScript(result);
result = StringEscapeUtils.escapeJavaScript(result);
}
return result;
}
@@ -21,6 +21,18 @@
package org.apache.struts2.components;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.StrutsException;
import org.apache.struts2.dispatcher.mapper.ActionMapper;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import org.apache.struts2.views.util.UrlHelper;
import org.apache.commons.lang.xwork.StringUtils;
import java.io.IOException;
import java.io.Writer;
import java.util.Collections;
@@ -28,18 +40,6 @@ import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import org.apache.struts2.StrutsException;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import org.apache.struts2.dispatcher.mapper.ActionMapper;
import org.apache.struts2.views.util.UrlHelper;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* Implementation of the {@link UrlRenderer} interface that creates URLs suitable in a servlet environment.
*
@@ -61,44 +61,59 @@ public class ServletUrlRenderer implements UrlRenderer {
/**
* {@inheritDoc}
*/
public void renderUrl(Writer writer, URL urlComponent) {
String scheme = urlComponent.req.getScheme();
public void renderUrl(Writer writer, UrlProvider urlComponent) {
String scheme = urlComponent.getHttpServletRequest().getScheme();
if (urlComponent.scheme != null) {
scheme = urlComponent.scheme;
if (urlComponent.getScheme() != null) {
scheme = urlComponent.getScheme();
}
String result;
if (urlComponent.value == null && urlComponent.action != null) {
result = urlComponent.determineActionURL(urlComponent.action, urlComponent.namespace, urlComponent.method, urlComponent.req, urlComponent.res, urlComponent.parameters, scheme, urlComponent.includeContext, urlComponent.encode, urlComponent.forceAddSchemeHostAndPort, urlComponent.escapeAmp);
ActionInvocation ai = (ActionInvocation) ActionContext.getContext().get(ActionContext.ACTION_INVOCATION);
if (urlComponent.getValue() == null && urlComponent.getAction() != null) {
result = urlComponent.determineActionURL(urlComponent.getAction(), urlComponent.getNamespace(), urlComponent.getMethod(), urlComponent.getHttpServletRequest(), urlComponent.getHttpServletResponse(), urlComponent.getParameters(), scheme, urlComponent.isIncludeContext(), urlComponent.isEncode(), urlComponent.isForceAddSchemeHostAndPort(), urlComponent.isEscapeAmp());
} else if (urlComponent.getValue() == null && urlComponent.getAction() == null && ai != null) {
// both are null, we will default to the current action
final String action = ai.getProxy().getActionName();
final String namespace = ai.getProxy().getNamespace();
result = urlComponent.determineActionURL(action, namespace, urlComponent.getMethod(),urlComponent.getHttpServletRequest(), urlComponent.getHttpServletResponse(), urlComponent.getParameters(), scheme, urlComponent.isIncludeContext(), urlComponent.isEncode(), urlComponent.isForceAddSchemeHostAndPort(), urlComponent.isEscapeAmp());
} else {
String _value = urlComponent.value;
String _value = urlComponent.getValue();
// We don't include the request parameters cause they would have been
// prioritised before this [in start(Writer) method]
if (_value != null && _value.indexOf("?") > 0) {
_value = _value.substring(0, _value.indexOf("?"));
}
result = UrlHelper.buildUrl(_value, urlComponent.req, urlComponent.res, urlComponent.parameters, scheme, urlComponent.includeContext, urlComponent.encode, urlComponent.forceAddSchemeHostAndPort, urlComponent.escapeAmp);
result = UrlHelper.buildUrl(_value, urlComponent.getHttpServletRequest(), urlComponent.getHttpServletResponse(), urlComponent.getParameters(), scheme, urlComponent.isIncludeContext(), urlComponent.isEncode(), urlComponent.isForceAddSchemeHostAndPort(), urlComponent.isEscapeAmp());
}
if ( urlComponent.anchor != null && urlComponent.anchor.length() > 0 ) {
result += '#' + urlComponent.findString(urlComponent.anchor);
String anchor = urlComponent.getAnchor();
if (StringUtils.isNotEmpty(anchor)) {
result += '#' + urlComponent.findString(anchor);
}
String var = urlComponent.getVar();
if (urlComponent.isPutInContext()) {
String var = urlComponent.getVar();
if (StringUtils.isNotEmpty(var)) {
urlComponent.putInContext(result);
if (var != null) {
urlComponent.putInContext(result);
// add to the request and page scopes as well
urlComponent.req.setAttribute(var, result);
} else {
try {
writer.write(result);
} catch (IOException e) {
throw new StrutsException("IOError: " + e.getMessage(), e);
}
}
// add to the request and page scopes as well
urlComponent.getHttpServletRequest().setAttribute(var, result);
} else {
try {
writer.write(result);
} catch (IOException e) {
throw new StrutsException("IOError: " + e.getMessage(), e);
}
}
} else {
try {
writer.write(result);
} catch (IOException e) {
throw new StrutsException("IOError: " + e.getMessage(), e);
}
}
}
/**
@@ -160,7 +175,7 @@ public class ServletUrlRenderer implements UrlRenderer {
if (formComponent.getId() == null && actionName!=null ) {
formComponent.addParameter("id", formComponent.escape(actionName));
}
} else if (actionName != null) {
} else if (action != null) {
// Since we can't find an action alias in the configuration, we just
// assume the action attribute supplied is the path to be used as
// the URI this form is submitting to.
@@ -171,7 +186,7 @@ public class ServletUrlRenderer implements UrlRenderer {
LOG.warn("No configuration found for the specified action: '" + actionName + "' in namespace: '" + namespace + "'. Form action defaulting to 'action' attribute's literal value.");
}
String result = UrlHelper.buildUrl(actionName, formComponent.request, formComponent.response, null);
String result = UrlHelper.buildUrl(action, formComponent.request, formComponent.response, null);
formComponent.addParameter("action", result);
// namespace: cut out anything between the start and the last /
@@ -204,57 +219,57 @@ public class ServletUrlRenderer implements UrlRenderer {
}
public void beforeRenderUrl(URL urlComponent) {
if (urlComponent.value != null) {
urlComponent.value = urlComponent.findString(urlComponent.value);
public void beforeRenderUrl(UrlProvider urlComponent) {
if (urlComponent.getValue() != null) {
urlComponent.setValue(urlComponent.findString(urlComponent.getValue()));
}
// no explicit url set so attach params from current url, do
// this at start so body params can override any of these they wish.
try {
// ww-1266
String includeParams = (urlComponent.urlIncludeParams != null ? urlComponent.urlIncludeParams.toLowerCase() : URL.GET);
String includeParams = (urlComponent.getUrlIncludeParams() != null ? urlComponent.getUrlIncludeParams().toLowerCase() : UrlProvider.GET);
if (urlComponent.includeParams != null) {
includeParams = urlComponent.findString(urlComponent.includeParams);
if (urlComponent.getIncludeParams() != null) {
includeParams = urlComponent.findString(urlComponent.getIncludeParams());
}
if (URL.NONE.equalsIgnoreCase(includeParams)) {
mergeRequestParameters(urlComponent.value, urlComponent.parameters, Collections.EMPTY_MAP);
} else if (URL.ALL.equalsIgnoreCase(includeParams)) {
mergeRequestParameters(urlComponent.value, urlComponent.parameters, urlComponent.req.getParameterMap());
if (UrlProvider.NONE.equalsIgnoreCase(includeParams)) {
mergeRequestParameters(urlComponent.getValue(), urlComponent.getParameters(), Collections.EMPTY_MAP);
} else if (UrlProvider.ALL.equalsIgnoreCase(includeParams)) {
mergeRequestParameters(urlComponent.getValue(), urlComponent.getParameters(), urlComponent.getHttpServletRequest().getParameterMap());
// for ALL also include GET parameters
includeGetParameters(urlComponent);
includeExtraParameters(urlComponent);
} else if (URL.GET.equalsIgnoreCase(includeParams) || (includeParams == null && urlComponent.value == null && urlComponent.action == null)) {
} else if (UrlProvider.GET.equalsIgnoreCase(includeParams) || (includeParams == null && urlComponent.getValue() == null && urlComponent.getAction() == null)) {
includeGetParameters(urlComponent);
includeExtraParameters(urlComponent);
} else if (includeParams != null) {
LOG.warn("Unknown value for includeParams parameter to URL tag: " + includeParams);
}
} catch (Exception e) {
LOG.warn("Unable to put request parameters (" + urlComponent.req.getQueryString() + ") into parameter map.", e);
LOG.warn("Unable to put request parameters (" + urlComponent.getHttpServletRequest().getQueryString() + ") into parameter map.", e);
}
}
private void includeExtraParameters(URL urlComponent) {
if (urlComponent.extraParameterProvider != null) {
mergeRequestParameters(urlComponent.value, urlComponent.parameters, urlComponent.extraParameterProvider.getExtraParameters());
private void includeExtraParameters(UrlProvider urlComponent) {
if (urlComponent.getExtraParameterProvider() != null) {
mergeRequestParameters(urlComponent.getValue(), urlComponent.getParameters(), urlComponent.getExtraParameterProvider().getExtraParameters());
}
}
private void includeGetParameters(URL urlComponent) {
private void includeGetParameters(UrlProvider urlComponent) {
String query = extractQueryString(urlComponent);
mergeRequestParameters(urlComponent.value, urlComponent.parameters, UrlHelper.parseQueryString(query));
mergeRequestParameters(urlComponent.getValue(), urlComponent.getParameters(), UrlHelper.parseQueryString(query));
}
private String extractQueryString(URL urlComponent) {
private String extractQueryString(UrlProvider urlComponent) {
// Parse the query string to make sure that the parameters come from the query, and not some posted data
String query = urlComponent.req.getQueryString();
String query = urlComponent.getHttpServletRequest().getQueryString();
if (query == null) {
query = (String) urlComponent.req.getAttribute("javax.servlet.forward.query_string");
query = (String) urlComponent.getHttpServletRequest().getAttribute("javax.servlet.forward.query_string");
}
if (query != null) {
@@ -293,8 +308,6 @@ public class ServletUrlRenderer implements UrlRenderer {
// where the parameters specified in value attribute takes priority.
if (value != null && value.trim().length() > 0 && value.indexOf("?") > 0) {
mergedParams = new LinkedHashMap();
String queryString = value.substring(value.indexOf("?")+1);
mergedParams = UrlHelper.parseQueryString(queryString);
@@ -30,8 +30,8 @@ import java.util.List;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.util.TextProviderHelper;
import org.apache.commons.lang.xwork.StringUtils;
import com.opensymphony.xwork2.util.TextUtils;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
@@ -151,7 +151,7 @@ public class Text extends ContextBean implements Param.UnnamedParametric {
public boolean end(Writer writer, String body) {
actualName = findString(name, "name", "You must specify the i18n key. Example: welcome.header");
String defaultMessage;
if (TextUtils.stringSet(body)) {
if (StringUtils.isNotEmpty(body)) {
defaultMessage = body;
} else {
defaultMessage = actualName;
@@ -859,7 +859,7 @@ public abstract class UIBean extends Component {
protected String escape(String name) {
// escape any possible values that can make the ID painful to work with in JavaScript
if (name != null) {
return name.replaceAll("[^a-zA-Z0-9_]", "_");
return name.replaceAll("[\\/\\.\\[\\]]", "_");
} else {
return "";
}
@@ -22,10 +22,6 @@
package org.apache.struts2.components;
import java.io.Writer;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -33,7 +29,6 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.views.util.UrlHelper;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ValueStack;
@@ -118,144 +113,118 @@ import com.opensymphony.xwork2.util.logging.LoggerFactory;
@StrutsTag(name="url", tldTagClass="org.apache.struts2.views.jsp.URLTag", description="This tag is used to create a URL")
public class URL extends ContextBean {
private static final Logger LOG = LoggerFactory.getLogger(URL.class);
/**
* The includeParams attribute may have the value 'none', 'get' or 'all'.
* It is used when the url tag is used without a value attribute.
* Its value is looked up on the ValueStack
* If no includeParams is specified then 'get' is used.
* none - include no parameters in the URL
* get - include only GET parameters in the URL (default)
* all - include both GET and POST parameters in the URL
*/
public static final String NONE = "none";
public static final String GET = "get";
public static final String ALL = "all";
protected HttpServletRequest req;
protected HttpServletResponse res;
protected String includeParams;
protected String scheme;
protected String value;
protected String action;
protected String namespace;
protected String method;
protected boolean encode = true;
protected boolean includeContext = true;
protected boolean escapeAmp = true;
protected String portletMode;
protected String windowState;
protected String portletUrlType;
protected String anchor;
protected boolean forceAddSchemeHostAndPort;
protected String urlIncludeParams;
protected ExtraParameterProvider extraParameterProvider;
protected UrlRenderer urlRenderer;
private UrlProvider urlProvider;
private UrlRenderer urlRenderer;
public URL(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
super(stack);
this.req = req;
this.res = res;
urlProvider = new ComponentUrlProvider(this, this.parameters);
urlProvider.setHttpServletRequest(req);
urlProvider.setHttpServletResponse(res);
}
@Inject(StrutsConstants.STRUTS_URL_INCLUDEPARAMS)
public void setUrlIncludeParams(String urlIncludeParams) {
this.urlIncludeParams = urlIncludeParams;
urlProvider.setUrlIncludeParams(urlIncludeParams);
}
@Inject
public void setUrlRenderer(UrlRenderer urlRenderer) {
this.urlRenderer = urlRenderer;
urlProvider.setUrlRenderer(urlRenderer);
this.urlRenderer = urlRenderer;
}
@Inject(required=false)
public void setExtraParameterProvider(ExtraParameterProvider provider) {
this.extraParameterProvider = provider;
urlProvider.setExtraParameterProvider(provider);
}
public boolean start(Writer writer) {
boolean result = super.start(writer);
urlRenderer.beforeRenderUrl(this);
urlRenderer.beforeRenderUrl(urlProvider);
return result;
}
public boolean end(Writer writer, String body) {
urlRenderer.renderUrl(writer, this);
urlRenderer.renderUrl(writer, urlProvider);
return super.end(writer, body);
}
public String findString(String expr) {
return super.findString(expr);
}
public UrlProvider getUrlProvider() {
return urlProvider;
}
@StrutsTagAttribute(description="The includeParams attribute may have the value 'none', 'get' or 'all'", defaultValue="none")
public void setIncludeParams(String includeParams) {
this.includeParams = includeParams;
urlProvider.setIncludeParams(includeParams);
}
@StrutsTagAttribute(description="Set scheme attribute")
public void setScheme(String scheme) {
this.scheme = scheme;
urlProvider.setScheme(scheme);
}
@StrutsTagAttribute(description="The target value to use, if not using action")
public void setValue(String value) {
this.value = value;
urlProvider.setValue(value);
}
@StrutsTagAttribute(description="The action to generate the URL for, if not using value")
public void setAction(String action) {
this.action = action;
urlProvider.setAction(action);
}
@StrutsTagAttribute(description="The namespace to use")
public void setNamespace(String namespace) {
this.namespace = namespace;
urlProvider.setNamespace(namespace);
}
@StrutsTagAttribute(description="The method of action to use")
public void setMethod(String method) {
this.method = method;
urlProvider.setMethod(method);
}
@StrutsTagAttribute(description="Whether to encode parameters", type="Boolean", defaultValue="true")
public void setEncode(boolean encode) {
this.encode = encode;
urlProvider.setEncode(encode);
}
@StrutsTagAttribute(description="Whether actual context should be included in URL", type="Boolean", defaultValue="true")
public void setIncludeContext(boolean includeContext) {
this.includeContext = includeContext;
urlProvider.setIncludeContext(includeContext);
}
@StrutsTagAttribute(description="The resulting portlet mode")
public void setPortletMode(String portletMode) {
this.portletMode = portletMode;
urlProvider.setPortletMode(portletMode);
}
@StrutsTagAttribute(description="The resulting portlet window state")
public void setWindowState(String windowState) {
this.windowState = windowState;
urlProvider.setWindowState(windowState);
}
@StrutsTagAttribute(description="Specifies if this should be a portlet render or action URL. Default is \"render\". To create an action URL, use \"action\".")
public void setPortletUrlType(String portletUrlType) {
this.portletUrlType = portletUrlType;
urlProvider.setPortletUrlType(portletUrlType);
}
@StrutsTagAttribute(description="The anchor for this URL")
public void setAnchor(String anchor) {
this.anchor = anchor;
urlProvider.setAnchor(anchor);
}
@StrutsTagAttribute(description="Specifies whether to escape ampersand (&amp;) to (&amp;amp;) or not", type="Boolean", defaultValue="true")
public void setEscapeAmp(boolean escapeAmp) {
this.escapeAmp = escapeAmp;
urlProvider.setEscapeAmp(escapeAmp);
}
@StrutsTagAttribute(description="Specifies whether to force the addition of scheme, host and port or not", type="Boolean", defaultValue="false")
public void setForceAddSchemeHostAndPort(boolean forceAddSchemeHostAndPort) {
this.forceAddSchemeHostAndPort = forceAddSchemeHostAndPort;
}
public static interface ExtraParameterProvider {
public Map getExtraParameters();
urlProvider.setForceAddSchemeHostAndPort(forceAddSchemeHostAndPort);
}
}
@@ -0,0 +1,135 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.components;
import com.opensymphony.xwork2.util.ValueStack;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/**
* Implemntations of this interface can be used to build a URL
*/
public interface UrlProvider {
/**
* The includeParams attribute may have the value 'none', 'get' or 'all'.
* It is used when the url tag is used without a value attribute.
* Its value is looked up on the ValueStack
* If no includeParams is specified then 'get' is used.
* none - include no parameters in the URL
* get - include only GET parameters in the URL (default)
* all - include both GET and POST parameters in the URL
*/
public static final String NONE = "none";
public static final String GET = "get";
public static final String ALL = "all";
boolean isPutInContext();
String getVar();
String getValue();
String findString(String value);
void setValue(String string);
String getUrlIncludeParams();
String getIncludeParams();
Map getParameters();
HttpServletRequest getHttpServletRequest();
String getAction();
ExtraParameterProvider getExtraParameterProvider();
String getScheme();
String getNamespace();
String getMethod();
HttpServletResponse getHttpServletResponse();
boolean isIncludeContext();
boolean isEncode();
boolean isForceAddSchemeHostAndPort();
boolean isEscapeAmp();
String getPortletMode();
String getWindowState();
String determineActionURL(String action, String namespace, String method, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Map parameters, String scheme, boolean includeContext, boolean encode, boolean forceAddSchemeHostAndPort, boolean escapeAmp);
String determineNamespace(String namespace, ValueStack stack, HttpServletRequest req);
String getAnchor();
String getPortletUrlType();
ValueStack getStack();
void setUrlIncludeParams(String urlIncludeParams);
void setHttpServletRequest(HttpServletRequest req);
void setHttpServletResponse(HttpServletResponse res);
void setUrlRenderer(UrlRenderer urlRenderer);
void setExtraParameterProvider(ExtraParameterProvider provider);
void setIncludeParams(String includeParams);
void setScheme(String scheme);
void setAction(String action);
void setPortletMode(String portletMode);
void setNamespace(String namespace);
void setMethod(String method);
void setEncode(boolean encode);
void setIncludeContext(boolean includeContext);
void setWindowState(String windowState);
void setPortletUrlType(String portletUrlType);
void setAnchor(String anchor);
void setEscapeAmp(boolean escapeAmp);
void setForceAddSchemeHostAndPort(boolean forceAddSchemeHostAndPort);
void putInContext(String result);
}
@@ -34,14 +34,14 @@ public interface UrlRenderer {
* Preprocessing step
* @param urlComponent
*/
void beforeRenderUrl(URL urlComponent);
void beforeRenderUrl(UrlProvider provider);
/**
* Render a URL.
* @param writer A writer that the implementation can use to write the result to.
* @param urlComponent The {@link URL} component that "owns" this renderer.
* @param urlComponent The {@link UrlProvider} component that "owns" this renderer.
*/
void renderUrl(Writer writer, URL urlComponent);
void renderUrl(Writer writer, UrlProvider provider);
/**
* Render a Form URL.
@@ -228,6 +228,9 @@ public class BeanSelectionProvider implements ConfigurationProvider {
props.setProperty("devMode", "false");
}
if (props.containsKey(StrutsConstants.STRUTS_LOG_MISSING_PROPERTIES))
props.setProperty("logMissingProperties", props.getProperty(StrutsConstants.STRUTS_LOG_MISSING_PROPERTIES));
String val = props.getProperty(StrutsConstants.STRUTS_ALLOW_STATIC_METHOD_ACCESS);
if (val != null) {
props.setProperty("allowStaticMethodAccess", val);
@@ -78,6 +78,7 @@ public class StrutsXmlConfigurationProvider extends XmlConfigurationProvider {
Map<String,String> dtdMappings = new HashMap<String,String>(getDtdMappings());
dtdMappings.put("-//Apache Software Foundation//DTD Struts Configuration 2.0//EN", "struts-2.0.dtd");
dtdMappings.put("-//Apache Software Foundation//DTD Struts Configuration 2.1//EN", "struts-2.1.dtd");
dtdMappings.put("-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN", "struts-2.1.7.dtd");
setDtdMappings(dtdMappings);
File file = new File(filename);
if (file.getParent() != null) {
@@ -91,11 +92,10 @@ public class StrutsXmlConfigurationProvider extends XmlConfigurationProvider {
@Override
public void register(ContainerBuilder containerBuilder, LocatableProperties props) throws ConfigurationException {
if (servletContext != null && !containerBuilder.contains(ServletContext.class)) {
containerBuilder.factory(ServletContext.class, new Factory() {
public Object create(Context context) throws Exception {
containerBuilder.factory(ServletContext.class, new Factory<ServletContext>() {
public ServletContext create(Context context) throws Exception {
return servletContext;
}
});
}
super.register(containerBuilder, props);
@@ -148,7 +148,7 @@ public class StrutsXmlConfigurationProvider extends XmlConfigurationProvider {
}
if (file.exists()) {
try {
url = file.toURL();
url = file.toURI().toURL();
} catch (MalformedURLException e) {
throw new IOException("Unable to convert "+file+" to a URL");
}
@@ -173,6 +173,4 @@ public class StrutsXmlConfigurationProvider extends XmlConfigurationProvider {
public String toString() {
return ("Struts XML configuration provider ("+filename+")");
}
}
@@ -86,6 +86,9 @@ public class ApplicationMap extends AbstractMap implements Serializable {
final Object value = context.getAttribute(key);
entries.add(new Map.Entry() {
public boolean equals(Object obj) {
if (!(obj instanceof Map.Entry)) {
return false;
}
Map.Entry entry = (Map.Entry) obj;
return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
@@ -119,6 +122,9 @@ public class ApplicationMap extends AbstractMap implements Serializable {
final Object value = context.getInitParameter(key);
entries.add(new Map.Entry() {
public boolean equals(Object obj) {
if (!(obj instanceof Map.Entry)) {
return false;
}
Map.Entry entry = (Map.Entry) obj;
return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
@@ -170,7 +170,7 @@ public class DefaultStaticContentLoader implements StaticContentLoader {
String pathEnding = buildPath(name, pathPrefix);
if (resourceUrl.getFile().endsWith(pathEnding))
is = resourceUrl.openStream();
} catch (Exception ex) {
} catch (IOException ex) {
// just ignore it
continue;
}
@@ -41,6 +41,7 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.StrutsException;
import org.apache.struts2.config.BeanSelectionProvider;
import org.apache.struts2.config.DefaultPropertiesProvider;
import org.apache.struts2.config.LegacyPropertiesConfigurationProvider;
@@ -133,6 +134,11 @@ public class Dispatcher {
*/
private String multipartSaveDir;
/**
* Stores the value of StrutsConstants.STRUTS_MULTIPART_HANDLER setting
*/
private String multipartHandlerName;
/**
* Provide list of default configuration files.
*/
@@ -236,6 +242,11 @@ public class Dispatcher {
multipartSaveDir = val;
}
@Inject(StrutsConstants.STRUTS_MULTIPART_HANDLER)
public void setMultipartHandler(String val) {
multipartHandlerName = val;
}
@Inject
public void setValueStackFactory(ValueStackFactory valueStackFactory) {
this.valueStackFactory = valueStackFactory;
@@ -287,6 +298,9 @@ public class Dispatcher {
interceptor.destroy();
}
//cleanup action context
ActionContext.setContext(null);
// clean up configuration
configurationManager.destroyConfiguration();
configurationManager = null;
@@ -393,22 +407,28 @@ public class Dispatcher {
configurationManager = new ConfigurationManager(BeanSelectionProvider.DEFAULT_BEAN_NAME);
}
init_DefaultProperties(); // [1]
init_TraditionalXmlConfigurations(); // [2]
init_LegacyStrutsProperties(); // [3]
init_CustomConfigurationProviders(); // [5]
init_FilterInitParameters() ; // [6]
init_AliasStandardObjects() ; // [7]
try {
init_DefaultProperties(); // [1]
init_TraditionalXmlConfigurations(); // [2]
init_LegacyStrutsProperties(); // [3]
init_CustomConfigurationProviders(); // [5]
init_FilterInitParameters() ; // [6]
init_AliasStandardObjects() ; // [7]
Container container = init_PreloadConfiguration();
container.inject(this);
init_CheckConfigurationReloading(container);
init_CheckWebLogicWorkaround(container);
Container container = init_PreloadConfiguration();
container.inject(this);
init_CheckConfigurationReloading(container);
init_CheckWebLogicWorkaround(container);
if (!dispatcherListeners.isEmpty()) {
for (DispatcherListener l : dispatcherListeners) {
l.dispatcherInitialized(this);
if (!dispatcherListeners.isEmpty()) {
for (DispatcherListener l : dispatcherListeners) {
l.dispatcherInitialized(this);
}
}
} catch (Exception ex) {
if (LOG.isErrorEnabled())
LOG.error("Dispatcher initialization failed", ex);
throw new StrutsException(ex);
}
}
@@ -592,7 +612,20 @@ public class Dispatcher {
File multipartSaveDir = new File(saveDir);
if (!multipartSaveDir.exists()) {
multipartSaveDir.mkdir();
if (multipartSaveDir.mkdir() == false) {
String logMessage;
try {
logMessage = "Could not find create multipart save directory '"+multipartSaveDir.getCanonicalPath()+"'.";
} catch (IOException e) {
logMessage = "Could not find create multipart save directory '"+multipartSaveDir.toString()+"'.";
}
if(devMode) {
LOG.error(logMessage);
}
else {
LOG.warn(logMessage);
}
}
}
}
@@ -659,8 +692,20 @@ public class Dispatcher {
String content_type = request.getContentType();
if (content_type != null && content_type.indexOf("multipart/form-data") != -1) {
MultiPartRequest multi = getContainer().getInstance(MultiPartRequest.class);
request = new MultiPartRequestWrapper(multi, request, getSaveDir(servletContext));
MultiPartRequest mpr = null;
//check for alternate implementations of MultiPartRequest
Set<String> multiNames = getContainer().getInstanceNames(MultiPartRequest.class);
if (multiNames != null) {
for (String multiName : multiNames) {
if (multiName.equals(multipartHandlerName)) {
mpr = getContainer().getInstance(MultiPartRequest.class, multiName);
}
}
}
if (mpr == null ) {
mpr = getContainer().getInstance(MultiPartRequest.class);
}
request = new MultiPartRequestWrapper(mpr, request, getSaveDir(servletContext));
} else {
request = new StrutsRequestWrapper(request);
}
@@ -80,6 +80,9 @@ public class RequestMap extends AbstractMap implements Serializable {
final Object value = request.getAttribute(key);
entries.add(new Entry() {
public boolean equals(Object obj) {
if (!(obj instanceof Entry)) {
return false;
}
Entry entry = (Entry) obj;
return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
@@ -131,9 +131,6 @@ public class ServletActionRedirectResult extends ServletRedirectResult implement
protected String actionName;
protected String namespace;
protected String method;
protected boolean supressEmptyParameters = false;
private Map<String, String> requestParameters = new LinkedHashMap<String, String>();
public ServletActionRedirectResult() {
super();
@@ -154,9 +151,6 @@ public class ServletActionRedirectResult extends ServletRedirectResult implement
this.method = method;
}
protected List<String> prohibitedResultParam = Arrays.asList(new String[] {
DEFAULT_PARAM, "namespace", "method", "encode", "parse", "location",
"prependServletContext", "supressEmptyParameters" });
/**
* @see com.opensymphony.xwork2.Result#execute(com.opensymphony.xwork2.ActionInvocation)
@@ -175,27 +169,7 @@ public class ServletActionRedirectResult extends ServletRedirectResult implement
method = conditionalParse(method, invocation);
}
String resultCode = invocation.getResultCode();
if (resultCode != null) {
ResultConfig resultConfig = invocation.getProxy().getConfig().getResults().get(
resultCode);
Map resultConfigParams = resultConfig.getParams();
for (Iterator i = resultConfigParams.entrySet().iterator(); i.hasNext(); ) {
Map.Entry e = (Map.Entry) i.next();
if (! prohibitedResultParam.contains(e.getKey())) {
requestParameters.put(e.getKey().toString(),
e.getValue() == null ? "":
conditionalParse(e.getValue().toString(), invocation));
String potentialValue = e.getValue() == null ? "": conditionalParse(e.getValue().toString(), invocation);
if (!supressEmptyParameters || ((potentialValue != null) && (potentialValue.length() > 0))) {
requestParameters.put(e.getKey().toString(), potentialValue);
}
}
}
}
StringBuilder tmpLocation = new StringBuilder(actionMapper.getUriFromActionMapping(new ActionMapping(actionName, namespace, method, null)));
UrlHelper.buildParametersString(requestParameters, tmpLocation, "&");
setLocation(tmpLocation.toString());
@@ -229,29 +203,9 @@ public class ServletActionRedirectResult extends ServletRedirectResult implement
this.method = method;
}
/**
* Sets the supressEmptyParameters option
*
* @param suppress The new value for this option
*/
public void setSupressEmptyParameters(boolean supressEmptyParameters) {
this.supressEmptyParameters = supressEmptyParameters;
protected List<String> getProhibitedResultParams() {
return Arrays.asList(new String[]{
DEFAULT_PARAM, "namespace", "method", "encode", "parse", "location",
"prependServletContext", "supressEmptyParameters"});
}
/**
* Adds a request parameter to be added to the redirect url
*
* @param key The parameter name
* @param value The parameter value
*/
public ServletActionRedirectResult addParameter(String key, Object value) {
requestParameters.put(key, String.valueOf(value));
return this;
}
public void handle(ReflectionException ex) {
// Only log as debug as they are probably parameters to be appended to the url
LOG.debug(ex.getMessage(), ex);
}
}
@@ -26,16 +26,25 @@ import javax.servlet.http.HttpServletResponse;
import static javax.servlet.http.HttpServletResponse.*;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.views.util.UrlHelper;
import org.apache.struts2.dispatcher.mapper.ActionMapper;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.config.entities.ResultConfig;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import com.opensymphony.xwork2.util.reflection.ReflectionException;
import com.opensymphony.xwork2.util.reflection.ReflectionExceptionHandler;
import java.io.IOException;
import java.util.Map;
import java.util.LinkedHashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Arrays;
/**
@@ -81,7 +90,7 @@ import java.io.IOException;
* <!-- END SNIPPET: example --></pre>
*
*/
public class ServletRedirectResult extends StrutsResultSupport {
public class ServletRedirectResult extends StrutsResultSupport implements ReflectionExceptionHandler {
private static final long serialVersionUID = 6316947346435301270L;
@@ -93,6 +102,10 @@ public class ServletRedirectResult extends StrutsResultSupport {
protected int statusCode = SC_FOUND;
protected boolean supressEmptyParameters = false;
protected Map<String, String> requestParameters = new LinkedHashMap<String, String>();
public ServletRedirectResult() {
super();
}
@@ -153,7 +166,28 @@ public class ServletRedirectResult extends StrutsResultSupport {
finalLocation = request.getContextPath() + finalLocation;
}
finalLocation = response.encodeRedirectURL(finalLocation);
ResultConfig resultConfig = invocation.getProxy().getConfig().getResults().get(invocation.getResultCode());
if (resultConfig != null ) {
Map resultConfigParams = resultConfig.getParams();
for (Iterator i = resultConfigParams.entrySet().iterator(); i.hasNext();) {
Map.Entry e = (Map.Entry) i.next();
if (!getProhibitedResultParams().contains(e.getKey())) {
requestParameters.put(e.getKey().toString(),
e.getValue() == null ? "" :
conditionalParse(e.getValue().toString(), invocation));
String potentialValue = e.getValue() == null ? "" : conditionalParse(e.getValue().toString(), invocation);
if (!supressEmptyParameters || ((potentialValue != null) && (potentialValue.length() > 0))) {
requestParameters.put(e.getKey().toString(), potentialValue);
}
}
}
}
StringBuilder tmpLocation = new StringBuilder(finalLocation);
UrlHelper.buildParametersString(requestParameters, tmpLocation, "&");
finalLocation = response.encodeRedirectURL(tmpLocation.toString());
}
if (LOG.isDebugEnabled()) {
@@ -163,6 +197,13 @@ public class ServletRedirectResult extends StrutsResultSupport {
sendRedirect(response, finalLocation);
}
protected List<String> getProhibitedResultParams() {
return Arrays.asList(new String[]{
DEFAULT_PARAM, "namespace", "method", "encode", "parse", "location",
"prependServletContext", "supressEmptyParameters"});
}
/**
* Sends the redirection. Can be overridden to customize how the redirect is handled (i.e. to use a different
* status code)
@@ -189,4 +230,29 @@ public class ServletRedirectResult extends StrutsResultSupport {
// either before the port, or after the protocol
return (url.indexOf(':') == -1);
}
/**
* Sets the supressEmptyParameters option
*
* @param supressEmptyParameters The new value for this option
*/
public void setSupressEmptyParameters(boolean supressEmptyParameters) {
this.supressEmptyParameters = supressEmptyParameters;
}
/**
* Adds a request parameter to be added to the redirect url
*
* @param key The parameter name
* @param value The parameter value
*/
public ServletRedirectResult addParameter(String key, Object value) {
requestParameters.put(key, String.valueOf(value));
return this;
}
public void handle(ReflectionException ex) {
// Only log as debug as they are probably parameters to be appended to the url
LOG.debug(ex.getMessage(), ex);
}
}
@@ -117,6 +117,9 @@ public class SessionMap<K, V> extends AbstractMap<K,V> implements Serializable {
final Object value = session.getAttribute(key);
entries.add(new Map.Entry<K,V>() {
public boolean equals(Object obj) {
if (!(obj instanceof Map.Entry)) {
return false;
}
Map.Entry<K, V> entry = (Map.Entry<K, V>) obj;
return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
@@ -53,7 +53,7 @@ import com.opensymphony.xwork2.util.ValueStack;
*
* <li><b>contentDisposition</b> - the content disposition header value for
* specifing the file name (default = <code>inline</code>, values are typically
* <i>filename="document.pdf"</i>.</li>
* <i>attachment;filename="document.pdf"</i>.</li>
*
* <li><b>inputName</b> - the name of the InputStream property from the chained
* action (default = <code>inputStream</code>).</li>
@@ -76,7 +76,7 @@ import com.opensymphony.xwork2.util.ValueStack;
* &lt;result name="success" type="stream"&gt;
* &lt;param name="contentType"&gt;image/jpeg&lt;/param&gt;
* &lt;param name="inputName"&gt;imageStream&lt;/param&gt;
* &lt;param name="contentDisposition"&gt;filename="document.pdf"&lt;/param&gt;
* &lt;param name="contentDisposition"&gt;attachment;filename="document.pdf"&lt;/param&gt;
* &lt;param name="bufferSize"&gt;1024&lt;/param&gt;
* &lt;/result&gt;
* <!-- END SNIPPET: example --></pre>
@@ -38,7 +38,7 @@ public class ActionMapping {
private String namespace;
private String method;
private String extension;
private Map params;
private Map<String, Object> params;
private Result result;
/**
@@ -63,7 +63,7 @@ public class ActionMapping {
* @param method The method
* @param params The extra parameters
*/
public ActionMapping(String name, String namespace, String method, Map params) {
public ActionMapping(String name, String namespace, String method, Map<String, Object> params) {
this.name = name;
this.namespace = namespace;
this.method = method;
@@ -87,7 +87,7 @@ public class ActionMapping {
/**
* @return The extra parameters
*/
public Map getParams() {
public Map<String, Object> getParams() {
return params;
}
@@ -147,7 +147,7 @@ public class ActionMapping {
/**
* @param params The extra parameters for this mapping
*/
public void setParams(Map params) {
public void setParams(Map<String, Object> params) {
this.params = params;
}
@@ -58,7 +58,7 @@ import com.opensymphony.xwork2.inject.Container;
*
* <li>Redirect prefix - <i>redirect:cancel.jsp</i></li>
*
* <li>Redirect-action prefix - <i>redirect-action:cancel</i></li>
* <li>Redirect-action prefix - <i>redirectAction:cancel</i></li>
*
* </ul>
*
@@ -151,7 +151,7 @@ import com.opensymphony.xwork2.inject.Container;
* &lt;s:form action=&quot;baz&quot;&gt;
* &lt;s:textfield label=&quot;Enter your name&quot; name=&quot;person.name&quot;/&gt;
* &lt;s:submit value=&quot;Create person&quot;/&gt;
* &lt;s:submit name=&quot;redirect-action:dashboard&quot; value=&quot;Cancel&quot;/&gt;
* &lt;s:submit name=&quot;redirectAction:dashboard&quot; value=&quot;Cancel&quot;/&gt;
* &lt;/s:form&gt;
* &lt;!-- END SNIPPET: redirect-action-example --&gt;
* </pre>
@@ -165,7 +165,7 @@ public class DefaultActionMapper implements ActionMapper {
protected static final String REDIRECT_PREFIX = "redirect:";
protected static final String REDIRECT_ACTION_PREFIX = "redirect-action:";
protected static final String REDIRECT_ACTION_PREFIX = "redirectAction:";
protected boolean allowDynamicMethodCalls = true;
@@ -184,9 +184,10 @@ public class DefaultActionMapper implements ActionMapper {
{
put(METHOD_PREFIX, new ParameterAction() {
public void execute(String key, ActionMapping mapping) {
mapping
.setMethod(key
.substring(METHOD_PREFIX.length()));
if (allowDynamicMethodCalls) {
mapping.setMethod(key.substring(
METHOD_PREFIX.length()));
}
}
});
@@ -356,7 +357,7 @@ public class DefaultActionMapper implements ActionMapper {
if (key.endsWith(".x") || key.endsWith(".y")) {
key = key.substring(0, key.length() - 2);
}
// Ensure a parameter doesn't get processed twice
if (!uniqueParameters.contains(key)) {
ParameterAction parameterAction = (ParameterAction) prefixTrie
@@ -110,7 +110,6 @@ public class Restful2ActionMapper extends DefaultActionMapper {
* @see org.apache.struts2.dispatcher.mapper.ActionMapper#getMapping(javax.servlet.http.HttpServletRequest)
*/
public ActionMapping getMapping(HttpServletRequest request, ConfigurationManager configManager) {
if (!isSlashesInActionNames()) {
throw new IllegalStateException("This action mapper requires the setting 'slashesInActionNames' to be set to 'true'");
}
@@ -122,16 +121,16 @@ public class Restful2ActionMapper extends DefaultActionMapper {
String actionName = mapping.getName();
int lastSlashPos = actionName.lastIndexOf('/');
String id = null;
if (lastSlashPos > -1 && actionName != null) {
id = actionName.substring(lastSlashPos+1);
}
// Only try something if the action name is specified
if (actionName != null && actionName.length() > 0) {
int lastSlashPos = actionName.lastIndexOf('/');
if (lastSlashPos > -1) {
id = actionName.substring(lastSlashPos+1);
}
// If a method hasn't been explicitly named, try to guess using ReST-style patterns
if (mapping.getMethod() == null) {
@@ -174,7 +173,7 @@ public class Restful2ActionMapper extends DefaultActionMapper {
if (idParameterName != null && id != null) {
if (mapping.getParams() == null) {
mapping.setParams(new HashMap());
mapping.setParams(new HashMap<String, Object>());
}
mapping.getParams().put(idParameterName, id);
}
@@ -206,7 +205,7 @@ public class Restful2ActionMapper extends DefaultActionMapper {
}
if (parameters.size() > 0) {
if (mapping.getParams() == null) {
mapping.setParams(new HashMap());
mapping.setParams(new HashMap<String, Object>());
}
mapping.getParams().putAll(parameters);
}
@@ -252,7 +251,4 @@ public class Restful2ActionMapper extends DefaultActionMapper {
public void setIdParameterName(String idParameterName) {
this.idParameterName = idParameterName;
}
}

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