Compare commits

...

242 Commits

Author SHA1 Message Date
Donald J. Brown f633bb8270 Fixing assembly version
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_2@652763 13f79535-47bb-0310-9956-ffa450edef68
2008-05-02 04:51:02 +00:00
Donald J. Brown 424b0df5f7 [maven-release-plugin] copy for tag STRUTS_2_1_2
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_2@652750 13f79535-47bb-0310-9956-ffa450edef68
2008-05-02 03:47:13 +00:00
Donald J. Brown 490a449979 Fixing broken tests due to conflicting file name
WW-1942


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@652737 13f79535-47bb-0310-9956-ffa450edef68
2008-05-02 02:33:03 +00:00
Donald J. Brown 1b9f55a2a6 Fixing locale so it can be set in struts.xml
WW-2068


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@652734 13f79535-47bb-0310-9956-ffa450edef68
2008-05-02 02:29:02 +00:00
Donald J. Brown 1f2a359e0b Fixing xslt test failing when no internet connection available
WW-1942


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@652725 13f79535-47bb-0310-9956-ffa450edef68
2008-05-02 01:00:29 +00:00
Antonio Petrelli cac2ed6cad WW-2147
Restored portuguese messages, that I made them unreadable, sorry!

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@651949 13f79535-47bb-0310-9956-ffa450edef68
2008-04-27 13:55:41 +00:00
Antonio Petrelli 974e051bc5 WW-2147
Fixed license headers where needed.
Re-enabled RAT plugin and fixed its configuration.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@651946 13f79535-47bb-0310-9956-ffa450edef68
2008-04-27 13:41:38 +00:00
Jeromy Evans e9cb4945cf Fix to codebehind's unknown action handler based on Wes' patch
WW-2607


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@651927 13f79535-47bb-0310-9956-ffa450edef68
2008-04-27 11:43:40 +00:00
Jeromy Evans 0a76d80364 Work-around to release threadlocal ActionContext in init and destroy
WW-2167


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@651901 13f79535-47bb-0310-9956-ffa450edef68
2008-04-27 09:26:01 +00:00
Antonio Petrelli a8b3dcab97 WW-2147
Removed license headers in .properties files temporarily to avoid conflicts with the Maven License plugin.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@651682 13f79535-47bb-0310-9956-ffa450edef68
2008-04-25 18:51:00 +00:00
Antonio Petrelli 9dc575f3b4 WW-2147
Removed license headers in .properties files temporarily to avoid conflicts with the Maven License plugin.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@651674 13f79535-47bb-0310-9956-ffa450edef68
2008-04-25 18:09:24 +00:00
David Newton 41e0cf7797 Added reportParameters and exportParameters to the "params" snippet.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@651638 13f79535-47bb-0310-9956-ffa450edef68
2008-04-25 16:18:06 +00:00
David Newton 6e44ec6c00 Removed unused import.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@651635 13f79535-47bb-0310-9956-ffa450edef68
2008-04-25 16:08:56 +00:00
David Newton 61f943d751 WW-2365 - https://issues.apache.org/struts/browse/WW-2365
- Added support for both report and export parameters.

- Minor refactoring:
  - Moved some init and output code out of execute.
  - Normalized PDF reports to be the same as the rest.
  - Resulted in cleaner code, lower cyclometric comp.

Still no tests for this result type.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@651634 13f79535-47bb-0310-9956-ffa450edef68
2008-04-25 16:04:45 +00:00
Nils-Helge Garli be1f09ca17 Removed some imports
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@651596 13f79535-47bb-0310-9956-ffa450edef68
2008-04-25 12:49:45 +00:00
Rainer Hermanns dd4b4c007e WW-2616 Adding missing plugins to assembly
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@651587 13f79535-47bb-0310-9956-ffa450edef68
2008-04-25 12:15:09 +00:00
Nils-Helge Garli 9f6546dec0 WW-1875 Use the namespace of the current action if namespace is not specified. Refactored some tests.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@651586 13f79535-47bb-0310-9956-ffa450edef68
2008-04-25 12:12:24 +00:00
Jeromy Evans 5fc379f510 FreemarkerTemplateEngine no longer swallows freemarker.core.ParseException
WW-2615


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@651562 13f79535-47bb-0310-9956-ffa450edef68
2008-04-25 10:15:55 +00:00
Jeromy Evans 62e0acd2e5 Added more descriptive LOG.error msg for a missing freemarker template
WW-2615


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@651537 13f79535-47bb-0310-9956-ffa450edef68
2008-04-25 08:40:10 +00:00
Nils-Helge Garli ed3b8e5a68 WW-2504 Ignoring the includeParams for portlet urls. Had to extract some more code into the "UrlRenderer".
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@651529 13f79535-47bb-0310-9956-ffa450edef68
2008-04-25 08:16:36 +00:00
Donald J. Brown 11df693e60 Clarifying purpose of struts.ui.templateDir setting
WW-1832

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@651217 13f79535-47bb-0310-9956-ffa450edef68
2008-04-24 10:22:37 +00:00
Donald J. Brown 5f260d482a Adding generics to ApplicationAware
WW-2581


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@650141 13f79535-47bb-0310-9956-ffa450edef68
2008-04-21 13:37:21 +00:00
Donald J. Brown 8ec3792752 Fixing bad links in showcase
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649884 13f79535-47bb-0310-9956-ffa450edef68
2008-04-20 04:40:35 +00:00
Donald J. Brown f3d09a04c1 Adding back accessors as deprecated for xslt result
WW-1550


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649881 13f79535-47bb-0310-9956-ffa450edef68
2008-04-20 03:54:03 +00:00
Donald J. Brown 6078c43b68 Removing the unused matchingPatterns and excludingPatterns parameters
WW-1550


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649880 13f79535-47bb-0310-9956-ffa450edef68
2008-04-20 03:52:37 +00:00
Donald J. Brown 21f3bcbbed Adding correct response type for json validation
WW-2571


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649878 13f79535-47bb-0310-9956-ffa450edef68
2008-04-20 03:38:49 +00:00
Donald J. Brown e584c30992 Use of generics in SessionAware and RequestAware
WW-2581


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649877 13f79535-47bb-0310-9956-ffa450edef68
2008-04-20 03:30:28 +00:00
Donald J. Brown 12d3f3f842 Annotation improvements to the result annotation
WW-2577


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649876 13f79535-47bb-0310-9956-ffa450edef68
2008-04-20 03:26:29 +00:00
Donald J. Brown b02b2424f8 Better error handling for XSLT transform errors
WW-2594


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649874 13f79535-47bb-0310-9956-ffa450edef68
2008-04-20 03:20:57 +00:00
Donald J. Brown f02befcd8f Adding new settings to disable classpath action scanning for the codebehind and rest plugins
WW-2506


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649873 13f79535-47bb-0310-9956-ffa450edef68
2008-04-20 03:09:23 +00:00
Donald J. Brown 787370ffc0 Better handling of disabled checkboxes
WW-2499


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649823 13f79535-47bb-0310-9956-ffa450edef68
2008-04-19 14:55:33 +00:00
Donald J. Brown 3024f72a7e Adding missing test resource
WW-2457


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649822 13f79535-47bb-0310-9956-ffa450edef68
2008-04-19 14:18:54 +00:00
Donald J. Brown 17c6b53a7f Changing return code to 201 when location header is present
WW-2605


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649820 13f79535-47bb-0310-9956-ffa450edef68
2008-04-19 14:15:51 +00:00
Donald J. Brown 872012de45 Fixing improper render of boolean values for xslt result
WW-2457


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649814 13f79535-47bb-0310-9956-ffa450edef68
2008-04-19 14:01:15 +00:00
Donald J. Brown 0c162a4efb Cleaning up the tabs
WW-2572


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649813 13f79535-47bb-0310-9956-ffa450edef68
2008-04-19 13:46:35 +00:00
Donald J. Brown 848b6f03ff Fixing NPE for navigations that don't involve a Struts 2 action
WW-2572


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649812 13f79535-47bb-0310-9956-ffa450edef68
2008-04-19 13:44:32 +00:00
Donald J. Brown ff4c8ede24 Fixing premature closing of xslt output stream
WW-2551


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649806 13f79535-47bb-0310-9956-ffa450edef68
2008-04-19 13:38:33 +00:00
Donald J. Brown 80bcbd0b3e Fixing version, adding missing plugins
WW-2604


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649802 13f79535-47bb-0310-9956-ffa450edef68
2008-04-19 12:14:02 +00:00
Donald J. Brown 3f90a6cbe0 [maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649036 13f79535-47bb-0310-9956-ffa450edef68
2008-04-17 10:01:30 +00:00
Donald J. Brown 81dac44ab4 Commenting out one more rat execution on release
WW-2147


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649033 13f79535-47bb-0310-9956-ffa450edef68
2008-04-17 09:56:53 +00:00
Donald J. Brown a9bf8b8097 Commenting out the other instances of the rat plugin that hold up the release
WW-2147


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649030 13f79535-47bb-0310-9956-ffa450edef68
2008-04-17 09:51:26 +00:00
Donald J. Brown f4cce96c61 Commenting out the rat plugin as it is holding up the release. It shouldn't be
uncommented until it is known to have passed.
WW-2414


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649024 13f79535-47bb-0310-9956-ffa450edef68
2008-04-17 09:39:06 +00:00
Donald J. Brown f9aca40383 Adding back spring, testng, and junit to the compile scope (as optional) to satisfy the
javadoc plugin when processing xwork source
WW-2414


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649020 13f79535-47bb-0310-9956-ffa450edef68
2008-04-17 09:28:00 +00:00
Donald J. Brown e4b442d2eb Fixing dojo annotations version
WW-2421


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649002 13f79535-47bb-0310-9956-ffa450edef68
2008-04-17 08:31:58 +00:00
Donald J. Brown ecd5d84994 Upgrading to struts-annotations 1.0.3
WW-2421


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@649001 13f79535-47bb-0310-9956-ffa450edef68
2008-04-17 08:30:44 +00:00
Donald J. Brown 38d661045e Fixing spring test artifact id
WW-2421


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@648999 13f79535-47bb-0310-9956-ffa450edef68
2008-04-17 08:28:52 +00:00
Donald J. Brown 8403f62e93 Cleaning up POM for spring plugin
WW-2421


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@648993 13f79535-47bb-0310-9956-ffa450edef68
2008-04-17 08:06:33 +00:00
Donald J. Brown e9c6bff01d Adding the version of the apt plugin *shakes fist at Maven*
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@647720 13f79535-47bb-0310-9956-ffa450edef68
2008-04-14 10:10:42 +00:00
Donald J. Brown 581252add3 Adding cargo version to fix broken build
WW-2539


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@647660 13f79535-47bb-0310-9956-ffa450edef68
2008-04-14 04:46:38 +00:00
Jeromy Evans 907fe2b631 The closing I18n tag now throws an exception if it popped an unexpected object from the stack.
WW-2539



git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@647650 13f79535-47bb-0310-9956-ffa450edef68
2008-04-14 02:57:22 +00:00
Jeromy Evans 017fbe724a Added useful WARNs to the TextProviderHelper when a message resource is not found and the default value is
used/evaluated

WW-2592


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@647647 13f79535-47bb-0310-9956-ffa450edef68
2008-04-14 02:10:42 +00:00
Donald J. Brown fb777b5170 Adding OSGi entries in the manifest
WW-2591


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@647442 13f79535-47bb-0310-9956-ffa450edef68
2008-04-12 12:41:34 +00:00
Donald J. Brown 918111b807 Fixing javadoc, minor code improvements
WW-2589


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@647439 13f79535-47bb-0310-9956-ffa450edef68
2008-04-12 12:16:41 +00:00
Donald J. Brown ab99c5fc58 Removing optional from bean loading now that fileupload is required, cleaned up optional notation for freemarker, also required
WW-2590


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@647435 13f79535-47bb-0310-9956-ffa450edef68
2008-04-12 11:48:17 +00:00
Donald J. Brown 75d4b0dc9c * Upgrading commons-fileupload to 1.2.1, now required
* Cleaning up testing so spring's mocks are not in the compile scope
WW-2590 WW-2588


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@647434 13f79535-47bb-0310-9956-ffa450edef68
2008-04-12 11:41:24 +00:00
Donald J. Brown a7ef84b169 Adding appropriate svn ignores
WW-2589


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@647419 13f79535-47bb-0310-9956-ffa450edef68
2008-04-12 10:36:03 +00:00
Donald J. Brown b8c6812d3a Moving the DWR validator into its own plugin
WW-2589


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@647418 13f79535-47bb-0310-9956-ffa450edef68
2008-04-12 10:33:33 +00:00
Jeromy Evans e027762fdf Moved the search for a TextProvider from the Text tag into a Helper class and changed UIBean and Label to
use the helper instead of an OGNL expression to invoke getText(String)
Additional methods added to TestAction to override its default TextProvider impl

WW-1681, related issues WW-2539, W2511



git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@647366 13f79535-47bb-0310-9956-ffa450edef68
2008-04-12 03:09:28 +00:00
Donald J. Brown 1633765ee1 Moving JUnit and TestNG base classes into their own plugins
WW-2588


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@647062 13f79535-47bb-0310-9956-ffa450edef68
2008-04-11 06:07:13 +00:00
Rainer Hermanns 081c28d1ce WW-2421
updated freemarker dep to 2.3.12

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@645134 13f79535-47bb-0310-9956-ffa450edef68
2008-04-05 16:40:29 +00:00
Rainer Hermanns 5e80208eba WW-2421
o adding default-class-ref to struts-default.xml to make showcase working again

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@643398 13f79535-47bb-0310-9956-ffa450edef68
2008-04-01 13:45:45 +00:00
Rainer Hermanns e1cf8664c5 WW-2565
StreamResult calling wrong method for setContentType in resolveParamsFromStack

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@643360 13f79535-47bb-0310-9956-ffa450edef68
2008-04-01 11:07:24 +00:00
Rainer Hermanns 92db102c07 WW-2465
Dynamic trees in the dojo plugin causes a freemarker error if the child property returns null

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@643359 13f79535-47bb-0310-9956-ffa450edef68
2008-04-01 11:01:22 +00:00
Rainer Hermanns 3475f27cb0 WW-2421
Use XWork 2.1.1 release

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@643358 13f79535-47bb-0310-9956-ffa450edef68
2008-04-01 10:54:28 +00:00
Rainer Hermanns cae6a55f03 Update all S2 Wiki docs and S2/XW JavaDocs to reflect camelCase interceptor and result names.
Issue Number: WW-2491

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@642323 13f79535-47bb-0310-9956-ffa450edef68
2008-03-28 18:07:22 +00:00
Rainer Hermanns b75f525915 WW-2421 Fixing test failure in DateTestTag if calculated year is a leap year
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@642295 13f79535-47bb-0310-9956-ffa450edef68
2008-03-28 17:10:25 +00:00
Brian Pontarelli 5c984bb6d4 Escaped key prior to OGNL evaluation for label. Test is commented out because I couldn't figure out how to get it working.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@635737 13f79535-47bb-0310-9956-ffa450edef68
2008-03-10 22:35:58 +00:00
Brian Pontarelli ec0efd5b40 Moved the dynamic attributes up so that that they are available to type converters in the context
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@634406 13f79535-47bb-0310-9956-ffa450edef68
2008-03-06 20:34:49 +00:00
René Gielen fa5a2ae788 Update for security fix release
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@632865 13f79535-47bb-0310-9956-ffa450edef68
2008-03-02 23:02:40 +00:00
Donald J. Brown ed3d9e2fff Fixing show action NPE
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@632747 13f79535-47bb-0310-9956-ffa450edef68
2008-03-02 12:30:31 +00:00
Nils-Helge Garli 7653396d04 WW-2509 No need for the FilterDispatcher in the sample application, and removed duplicate entry for commons-lang in the pom.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@632737 13f79535-47bb-0310-9956-ffa450edef68
2008-03-02 11:13:15 +00:00
Jeromy Evans 7eb4ee32f3 WW-2256 Update template/xhtml/validation.js to allow client-side validation of an autocompleter (gentle search for TR nodes containing error labels)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@632335 13f79535-47bb-0310-9956-ffa450edef68
2008-02-29 15:00:18 +00:00
Jeromy Evans 69f5373afb WW-2518 Applied Sarat Pediredla's patch so the RestWorkflowInterceptor uses the method names overridden by the configuration
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@631829 13f79535-47bb-0310-9956-ffa450edef68
2008-02-28 03:37:12 +00:00
Jeromy Evans ecbdc6091a WW-2512 DefaultHttpHeaders no longer attempts to generate an ETag if the model/target is null
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@631421 13f79535-47bb-0310-9956-ffa450edef68
2008-02-26 23:03:54 +00:00
Jeromy Evans 7e0a75ebe1 WW-2511 fixed OGNL expression in the I18n component to call TextProvider's getTexts(bundleName) method. Added new unit test for this tag.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@631413 13f79535-47bb-0310-9956-ffa450edef68
2008-02-26 22:50:17 +00:00
Wesley Wannemacher 3acb5e8762 eliminating NPE, from WW-1969
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@631059 13f79535-47bb-0310-9956-ffa450edef68
2008-02-26 01:40:10 +00:00
Musachy Barroso e6e4d9a1d6 WW-2500 JSONValidationInterceptor: IE chokes when evaling JSON string
* Add a comma to separate the fields, only when there are action errors

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@629504 13f79535-47bb-0310-9956-ffa450edef68
2008-02-20 15:26:19 +00:00
Jeromy Evans 641d81f4c5 WW-2428 Reversing patch applied at r628299 for alwaysSelectFullNamespace as it breaks the default use case (no configuration)
(alwaysSelectFullNamespace defaults to true somewhere)


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@629491 13f79535-47bb-0310-9956-ffa450edef68
2008-02-20 15:02:28 +00:00
Jeromy Evans b95f8dfc50 WW-2498 Minor change to avoid NPE when parseContent attribute is missing on dojo tags or in the context. Defaults to false if null.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@629326 13f79535-47bb-0310-9956-ffa450edef68
2008-02-20 02:52:27 +00:00
Jeromy Evans a0c5ea1944 WW-2491 updated javadoc snippet to reference redirectAction instead of redirect-action
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@629322 13f79535-47bb-0310-9956-ffa450edef68
2008-02-20 02:30:03 +00:00
Jeromy Evans 305f56cba8 WW-2491 Update javadoc/snippets (only), replace references to result & interceptor names with camelCase
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@629319 13f79535-47bb-0310-9956-ffa450edef68
2008-02-20 02:17:08 +00:00
Nils-Helge Garli ed0a3981e7 WW-2101 Added back classes with deprecation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@629255 13f79535-47bb-0310-9956-ffa450edef68
2008-02-19 22:36:48 +00:00
Donald J. Brown 69604a1251 Adding test to ensure slashes in names works with root namespace
WW-2461


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@629022 13f79535-47bb-0310-9956-ffa450edef68
2008-02-19 08:35:35 +00:00
Donald J. Brown 6090657251 Backing out the 1.0.3 upgrade until struts-annotations 1.0.3 gets officially released
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@628459 13f79535-47bb-0310-9956-ffa450edef68
2008-02-17 09:11:00 +00:00
Donald J. Brown 85609113a5 Upgrading to Struts Annotations 1.0.3, removing repositories from pom
WW-2421


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@628454 13f79535-47bb-0310-9956-ffa450edef68
2008-02-17 08:45:31 +00:00
Donald J. Brown f52f2221b2 Rolling back upgrade to TestNG 5.7, re-enabling portlet tests
WW-2454 WW-2494


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@628443 13f79535-47bb-0310-9956-ffa450edef68
2008-02-17 08:11:34 +00:00
David Newton 5fb36bc977 Minor JavaDoc cleanup.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@628341 13f79535-47bb-0310-9956-ffa450edef68
2008-02-16 16:09:48 +00:00
Wesley Wannemacher 5853ca6976 fixing OGNL demo, removing page on static methods per WW-2441
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@628329 13f79535-47bb-0310-9956-ffa450edef68
2008-02-16 15:37:22 +00:00
Donald J. Brown 7bf30eacb3 Fix NPE when PARSE_CONTENT parameter not in context
WW-2398


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@628302 13f79535-47bb-0310-9956-ffa450edef68
2008-02-16 14:12:14 +00:00
Donald J. Brown 588dfb56f7 Ensuring parent result annotations don't override children
WW-2443


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@628300 13f79535-47bb-0310-9956-ffa450edef68
2008-02-16 14:07:35 +00:00
Donald J. Brown 9c00c3fcfb Adding support for always select full namespace
WW-2428


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@628299 13f79535-47bb-0310-9956-ffa450edef68
2008-02-16 14:03:26 +00:00
Donald J. Brown 6a564daee7 Commenting out tests for now
WW-2494


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@628298 13f79535-47bb-0310-9956-ffa450edef68
2008-02-16 14:01:29 +00:00
Donald J. Brown e305393082 Trying to exclude servlet 2.4 that sneaks in
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@628290 13f79535-47bb-0310-9956-ffa450edef68
2008-02-16 13:27:05 +00:00
Donald J. Brown c338ede06d Escaping HTML for values
WW-2319


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@628287 13f79535-47bb-0310-9956-ffa450edef68
2008-02-16 13:06:12 +00:00
Donald J. Brown 2ed83ba79c Adding cssErrorClass and cssErrorStyle attributes
WW-771


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@628286 13f79535-47bb-0310-9956-ffa450edef68
2008-02-16 12:55:39 +00:00
Donald J. Brown 5270291101 Added ability to configure strong level 1 cache for Freemarker
WW-2189


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@628283 13f79535-47bb-0310-9956-ffa450edef68
2008-02-16 12:32:12 +00:00
Donald J. Brown bb263e0081 Fixing edit where id wouldn't be set
WW-2186


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@628279 13f79535-47bb-0310-9956-ffa450edef68
2008-02-16 12:27:07 +00:00
Donald J. Brown 5679317c89 Updating struts annotations dep to more recent snapshot
WW-2451


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@628278 13f79535-47bb-0310-9956-ffa450edef68
2008-02-16 12:13:18 +00:00
Donald J. Brown 932c632da2 Fixing uri resolver not being set correctly for xslt result
WW-2334


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@628277 13f79535-47bb-0310-9956-ffa450edef68
2008-02-16 12:08:55 +00:00
Donald J. Brown ce2e9e0fe2 Fixing freemarker tests when path included a space
WW-2452


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@628274 13f79535-47bb-0310-9956-ffa450edef68
2008-02-16 12:01:30 +00:00
Donald J. Brown 9c66f338f8 Upping TestNG dependency to 5.7
WW-2454


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@628272 13f79535-47bb-0310-9956-ffa450edef68
2008-02-16 11:57:35 +00:00
Donald J. Brown 1502327f25 Adding test to ensure custom parameters are handled correctly
WW-2170


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@628270 13f79535-47bb-0310-9956-ffa450edef68
2008-02-16 11:50:48 +00:00
Donald J. Brown b2ad4544f6 Adding support for short circut validations in javascript
WW-2270


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@628262 13f79535-47bb-0310-9956-ffa450edef68
2008-02-16 11:12:16 +00:00
Wesley Wannemacher 71b19cfd56 Using the 'c' builtin in freemarker so that numbers are output in a fashion usable in JavaScript, address WW-2254
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@627922 13f79535-47bb-0310-9956-ffa450edef68
2008-02-15 00:41:16 +00:00
Wesley Wannemacher f43c0d77e0 fixes IllegalStateException when running with Jetty 6.1.6, addresses WW-2350
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@627920 13f79535-47bb-0310-9956-ffa450edef68
2008-02-15 00:31:23 +00:00
René Gielen 7b922cd5d5 WW-2482:
Fix Freemarker exception when model list entry has null value field

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@620841 13f79535-47bb-0310-9956-ffa450edef68
2008-02-12 16:07:46 +00:00
Wesley Wannemacher 37084a92a1 brought autocompleters back to life, per WW-2442
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@620704 13f79535-47bb-0310-9956-ffa450edef68
2008-02-12 05:58:56 +00:00
Wesley Wannemacher 6c08b7f469 fixing typo, WW-2436
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@620359 13f79535-47bb-0310-9956-ffa450edef68
2008-02-11 00:22:55 +00:00
Wesley Wannemacher 701c115497 fix taken from webwork, struts issue WW-2351
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@620329 13f79535-47bb-0310-9956-ffa450edef68
2008-02-10 21:10:25 +00:00
Wesley Wannemacher 4ba2f42d6b aesthetic fix to address WW-2438
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@620320 13f79535-47bb-0310-9956-ffa450edef68
2008-02-10 20:38:29 +00:00
Wesley Wannemacher ee081ef5ed Updated Test that uses getResources() to load the TLD file, fixing WW-2477
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@620297 13f79535-47bb-0310-9956-ffa450edef68
2008-02-10 17:58:16 +00:00
Wesley Wannemacher 9f7e6d59e3 The DynAttribsTest unit test fails in Java 6, so Bamboo is unhappy
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@620206 13f79535-47bb-0310-9956-ffa450edef68
2008-02-09 22:13:49 +00:00
Wesley Wannemacher fb5582ea96 fix and test to address WW-2477
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@620204 13f79535-47bb-0310-9956-ffa450edef68
2008-02-09 21:39:40 +00:00
Brian Pontarelli c897c03810 Fixed bug in extensionless URL handling
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@618772 13f79535-47bb-0310-9956-ffa450edef68
2008-02-05 20:49:54 +00:00
Brian Pontarelli c1bec83192 Added better handling for extensionless URLs that contain dots in directory names
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615679 13f79535-47bb-0310-9956-ffa450edef68
2008-01-27 23:43:31 +00:00
Antonio Petrelli 113cde5b85 WW-2437
Added licenses to the "apps" distribution.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615606 13f79535-47bb-0310-9956-ffa450edef68
2008-01-27 14:11:04 +00:00
Antonio Petrelli 3b3593d81e WW-2437
Added XWork, XStream, XPP3 licenses and notice.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615603 13f79535-47bb-0310-9956-ffa450edef68
2008-01-27 14:06:24 +00:00
Nils-Helge Garli b1546d7382 WW-2240 Temporary workaround for NPE problems when doing info logging. Patch by Benjamin McCann
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615436 13f79535-47bb-0310-9956-ffa450edef68
2008-01-26 08:53:12 +00:00
Antonio Petrelli f5a88391e1 WW-2437
Added Plexus and SiteMesh license and notice.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615331 13f79535-47bb-0310-9956-ffa450edef68
2008-01-25 20:30:09 +00:00
Antonio Petrelli 42c8104e4e WW-2437
Added OGNL license and notice.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615323 13f79535-47bb-0310-9956-ffa450edef68
2008-01-25 20:12:45 +00:00
Antonio Petrelli 89c19b8989 WW-2437
Fixed copyright notice in assembly descriptors.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615299 13f79535-47bb-0310-9956-ffa450edef68
2008-01-25 18:26:44 +00:00
Donald J. Brown df1183e399 Ensuring numbers are formatted in the client-side javascript validation in such a way to not break the code
WW-1937


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615230 13f79535-47bb-0310-9956-ffa450edef68
2008-01-25 14:27:51 +00:00
Donald J. Brown e7bc9d380d Fixing problems with fast byte array output stream with large data
WW-2412


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615216 13f79535-47bb-0310-9956-ffa450edef68
2008-01-25 13:31:16 +00:00
Donald J. Brown 4d2b21c773 Fixed NPE for show config action
WW-2439


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615215 13f79535-47bb-0310-9956-ffa450edef68
2008-01-25 13:18:36 +00:00
Donald J. Brown 5912c8b2a8 Added headers for dojo tags
WW-2440


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615213 13f79535-47bb-0310-9956-ffa450edef68
2008-01-25 13:14:55 +00:00
Donald J. Brown dae026a0f0 Adding a check for double quotes to help prevent XSS attacks
WW-2427


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615212 13f79535-47bb-0310-9956-ffa450edef68
2008-01-25 13:13:23 +00:00
Donald J. Brown 7e169a93e2 Escaping forward slashes in element ids
WW-2303


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615208 13f79535-47bb-0310-9956-ffa450edef68
2008-01-25 12:40:17 +00:00
Donald J. Brown bd0e6e2014 Fixing setters to return void (stupid ognl)
WW-2324


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615204 13f79535-47bb-0310-9956-ffa450edef68
2008-01-25 12:30:27 +00:00
Donald J. Brown 876cf91a30 Adding test to ensure label separator for radio tag works WW-2343
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615201 13f79535-47bb-0310-9956-ffa450edef68
2008-01-25 12:22:22 +00:00
Donald J. Brown 0497356bc2 Moved i18n interceptor before all params interceptors
WW-2287


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615196 13f79535-47bb-0310-9956-ffa450edef68
2008-01-25 12:12:47 +00:00
Donald J. Brown d741210f20 Making retrieval of theme and templateDir more safe
WW-2366


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615195 13f79535-47bb-0310-9956-ffa450edef68
2008-01-25 12:05:37 +00:00
Donald J. Brown 2e3bedad4c Enabled the "disabled" attribute for datetimepicker
WW-2320


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615188 13f79535-47bb-0310-9956-ffa450edef68
2008-01-25 11:45:27 +00:00
Donald J. Brown b43746bde5 Adding support for Iteratable
WW-2397


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615175 13f79535-47bb-0310-9956-ffa450edef68
2008-01-25 11:14:15 +00:00
Donald J. Brown 39a91b294e Ensuring all action name parsing happens in ActionMapper, adding parsing to DWRValidator
WW-2217 WW-2323


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615173 13f79535-47bb-0310-9956-ffa450edef68
2008-01-25 11:02:08 +00:00
James Mitchell bd3f2f59c9 WW-2414 - followup on earlier commit -- recursively replace <<<<<script>>>>> until completely sanitized
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@615103 13f79535-47bb-0310-9956-ffa450edef68
2008-01-25 03:50:48 +00:00
Antonio Petrelli 26122c63e6 WW-2437
I commented by mistake a piece of the assembly pom, fixed.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@614989 13f79535-47bb-0310-9956-ffa450edef68
2008-01-24 20:57:20 +00:00
Antonio Petrelli 73e34893f1 WW-2421
Fixed Subversion properties.


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@614987 13f79535-47bb-0310-9956-ffa450edef68
2008-01-24 20:54:27 +00:00
Antonio Petrelli 420510aae3 WW-2437
Added FreeMarker, JSON-lib and EZMorph notices.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@614986 13f79535-47bb-0310-9956-ffa450edef68
2008-01-24 20:53:03 +00:00
Antonio Petrelli c6004e9c1a WW-2437
Added Classworlds notice.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@614969 13f79535-47bb-0310-9956-ffa450edef68
2008-01-24 20:12:19 +00:00
Ted Nathan Husted 613f786d91 WW-2171 "Label tag does not use key attribute to lookup value in resources when using simple theme" Apply patch provided by Maja S Bratseth.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@614842 13f79535-47bb-0310-9956-ffa450edef68
2008-01-24 11:09:59 +00:00
James Mitchell 09147ffad2 WW-2414 - failsafe sanitization of querystring params
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@614814 13f79535-47bb-0310-9956-ffa450edef68
2008-01-24 07:39:45 +00:00
James Mitchell 28ee8f79d1 WW-2421 - omnibus -- remove straggling character
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@614786 13f79535-47bb-0310-9956-ffa450edef68
2008-01-24 03:38:22 +00:00
James Mitchell 9276b0c654 WW-2421 - omnibus -- documentation fix ... thanks Jeremysvn diff
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@614785 13f79535-47bb-0310-9956-ffa450edef68
2008-01-24 03:36:26 +00:00
Ted Nathan Husted 8d876334c5 WW-2435 "<s:set> tag does not evaluate Body" Apply patch suggested by Lukasz Racon.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@614751 13f79535-47bb-0310-9956-ffa450edef68
2008-01-24 00:29:34 +00:00
Donald J. Brown f86377ce17 Updating junit to 3.8.2
WW-2453


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@614532 13f79535-47bb-0310-9956-ffa450edef68
2008-01-23 13:40:42 +00:00
Donald J. Brown b9ae2c5e6a Removing final to support subclasses returning different freemarker configuration
WW-2257


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@614528 13f79535-47bb-0310-9956-ffa450edef68
2008-01-23 13:12:57 +00:00
Donald J. Brown ec2a7ffdda Changing dependency of struts-annotations to specific snapshot version
WW-2451


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@614525 13f79535-47bb-0310-9956-ffa450edef68
2008-01-23 12:54:37 +00:00
Ted Nathan Husted 7b80259d0f WW-2451 "Updated poms to use struts annotations 1.0.3-SNAPSHOT to fix dependency issue" Apply patch suggested by Al Sutton, but leave issue open pending a 1.0.3 release of Struts-Annotations.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@614488 13f79535-47bb-0310-9956-ffa450edef68
2008-01-23 10:56:48 +00:00
Antonio Petrelli 4e7c6b76c6 WW-2421
Fixed Subversion properties.
Removed "velocity-tools" wrong transitive dependencies.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@614309 13f79535-47bb-0310-9956-ffa450edef68
2008-01-22 20:26:23 +00:00
Antonio Petrelli 764877efeb WW-2437
Fixed the first bunch of license issues.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@614306 13f79535-47bb-0310-9956-ffa450edef68
2008-01-22 20:23:19 +00:00
Nils-Helge Garli 4b8c29dff4 WW-2416 Serialize the request map, but filter out the value stack to reduce the verbosity of the output
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@614140 13f79535-47bb-0310-9956-ffa450edef68
2008-01-22 08:25:58 +00:00
James Mitchell 5129ab3a1d WW-2421 (omnibus)
Remove forgotten file

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@613515 13f79535-47bb-0310-9956-ffa450edef68
2008-01-20 06:49:42 +00:00
James Mitchell 6b882d5bd1 WW-2094 File upload - maximum size valida...
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@613513 13f79535-47bb-0310-9956-ffa450edef68
2008-01-20 06:45:09 +00:00
James Mitchell fcfdcc1e50 WW-2421 - simple typo
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@613497 13f79535-47bb-0310-9956-ffa450edef68
2008-01-20 02:01:58 +00:00
Ted Nathan Husted 32b04db224 WW-2226 "TextProvider.class should not be registered as a Singleton" Apply patch provided by Darren Shepherd.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@612799 13f79535-47bb-0310-9956-ffa450edef68
2008-01-17 11:56:38 +00:00
Ted Nathan Husted 11f257c1d4 WW-2236 doublemultiple doesn't work in doubleselect - Apply change suggested by Annie Wang.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@612695 13f79535-47bb-0310-9956-ffa450edef68
2008-01-17 03:19:54 +00:00
Ted Nathan Husted bfc364fd12 WW-2423, WW-2425, WW-2426 Update Spring, DWR, Freemarker, and SiteMesh dependencies per patch provided by Al Sutton.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@612481 13f79535-47bb-0310-9956-ffa450edef68
2008-01-16 15:24:54 +00:00
Nils-Helge Garli 72fd80afc1 WW-1859 The namespace computation does not seem to have any meaning, so removing it completely.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@612406 13f79535-47bb-0310-9956-ffa450edef68
2008-01-16 10:05:06 +00:00
Ted Nathan Husted 8ec7dd34fe WW-2383 option transfer select .ftl is brittle - Apply patch submitted by Dale Newfield
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@612336 13f79535-47bb-0310-9956-ffa450edef68
2008-01-16 02:31:47 +00:00
Ted Nathan Husted 15a5c95b8b ww-2310 Extra option to make redirectAction supress empty parameters - Apply patch submitted by Dale Newfield
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@612335 13f79535-47bb-0310-9956-ffa450edef68
2008-01-16 02:30:21 +00:00
Ted Nathan Husted 05cca5c546 WW-1741 make ExecuteAndWaitInterceptor token aware - Apply patch provided by Thomas Micheline.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@612104 13f79535-47bb-0310-9956-ffa450edef68
2008-01-15 12:41:14 +00:00
Ted Nathan Husted 1881566ced WW-2286 Apply FIXBUG patches supplied by Giovanni Azua Garcia.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@611999 13f79535-47bb-0310-9956-ffa450edef68
2008-01-15 03:06:41 +00:00
Ted Nathan Husted 62a40584e3 WW-2285 Apply FIXBUG patches supplied by Giovanni Azua Garcia.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@611998 13f79535-47bb-0310-9956-ffa450edef68
2008-01-15 03:05:26 +00:00
Ted Nathan Husted 006f717c95 WW-2094 Reapply patch submitted by Benjamin McCann that was previously applied in r590970 and somehow rolled back by r591003.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@611995 13f79535-47bb-0310-9956-ffa450edef68
2008-01-15 02:23:31 +00:00
Ted Nathan Husted 1aff95d29c WW-2421 Move devMode true setting from web.xml in REST showcase application to the documentation page.
Experience shows that if we set such things in examples, people will monkey them in production applications (and then blame the framework for poor performance). I strongly suggest that we try to make all examples both production-quality and production-ready. 

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@611829 13f79535-47bb-0310-9956-ffa450edef68
2008-01-14 15:23:36 +00:00
Antonio Petrelli bda27dd5e1 WW-2379
Added the XWork retrotranslated artifact to the jdk14 distribution.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@611671 13f79535-47bb-0310-9956-ffa450edef68
2008-01-13 23:06:33 +00:00
Antonio Petrelli 7ab72009be WW-2379
Removed the dependencies from the jdk14 assembly.
Re-added the license of Retrotranslator.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@611289 13f79535-47bb-0310-9956-ffa450edef68
2008-01-11 20:16:43 +00:00
David Newton 5374961f04 Trying to get snippet to show up right; sorry :( Other snippets work right.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@610634 13f79535-47bb-0310-9956-ffa450edef68
2008-01-10 01:33:25 +00:00
David Newton ae3efb07f8 HTML-escaped example snippet tag brackets.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@610622 13f79535-47bb-0310-9956-ffa450edef68
2008-01-10 00:39:57 +00:00
Nils-Helge Garli d90c8b2935 WW-2370 Using the name of the current executing action in the url when no action is specified.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@609901 13f79535-47bb-0310-9956-ffa450edef68
2008-01-08 08:18:23 +00:00
Nils-Helge Garli 9f6cea6d57 WW-2404 Changed the order of the interceptors
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@609581 13f79535-47bb-0310-9956-ffa450edef68
2008-01-07 12:16:39 +00:00
Antonio Petrelli 0406307a55 WW-2380
Added runtime dependency on tiles-jsp in the Tiles 2 plugin.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@605311 13f79535-47bb-0310-9956-ffa450edef68
2007-12-18 19:42:08 +00:00
Donald J. Brown c54b64bf8a Adding the retrotranslated jars into the proper assemblies
WW-2379


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@604847 13f79535-47bb-0310-9956-ffa450edef68
2007-12-17 12:03:58 +00:00
Donald J. Brown affb31ab96 Updating assemblies, adding all plugins to jdk14 zip
WW-2379


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@604801 13f79535-47bb-0310-9956-ffa450edef68
2007-12-17 09:20:25 +00:00
David Newton b6f77d1ef7 Patch for optiontransferselect.ftl null doubleListValue issue from Dale Newfield.
See thread at http://www.nabble.com/-struts--2.0.11--optiontransferselect-limit--tt14344098.html#a14344098.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@604737 13f79535-47bb-0310-9956-ffa450edef68
2007-12-16 23:14:16 +00:00
Donald J. Brown 918a89ce7d Moving api package to sandbox, cleaning up retrotranslator so it can be executed by CI,
removing unnecessary backport directory

WW-1700 WW-2258



git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@604603 13f79535-47bb-0310-9956-ffa450edef68
2007-12-16 10:56:47 +00:00
Donald J. Brown 30ca710ee5 Adding this strange, uncommitted file that is apparently breaking the build
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@604436 13f79535-47bb-0310-9956-ffa450edef68
2007-12-15 14:56:47 +00:00
Donald J. Brown 0289ee27e2 Fixing maven repositories to support opensymphony maven 2 snapshots
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@604427 13f79535-47bb-0310-9956-ffa450edef68
2007-12-15 13:40:21 +00:00
Donald J. Brown 0cdf26238b Adding new validator beans from XW-597
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@604419 13f79535-47bb-0310-9956-ffa450edef68
2007-12-15 12:06:34 +00:00
Donald J. Brown 524b2e714e Adding ignore props for the assembly
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@604378 13f79535-47bb-0310-9956-ffa450edef68
2007-12-15 02:49:59 +00:00
Donald J. Brown ea8c137ce0 Adding svn:ignore values that ignore ide and target directories and files
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@604376 13f79535-47bb-0310-9956-ffa450edef68
2007-12-15 02:47:10 +00:00
David Newton 0481cd8fa8 Very minor JavaDoc spelling.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@603750 13f79535-47bb-0310-9956-ffa450edef68
2007-12-12 21:55:01 +00:00
Donald J. Brown 7cd9c9165a Updating Struts to support the new immutable object scheme and the
new xwork capability to limit methods that are called.  Still more to do
here.

WW-2363 XW-595 XW-594


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@602665 13f79535-47bb-0310-9956-ffa450edef68
2007-12-09 12:11:25 +00:00
Nils-Helge Garli d4be10c786 WW-2347,WW-2348 - Make multipart form fields available in the parameter map.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@601700 13f79535-47bb-0310-9956-ffa450edef68
2007-12-06 11:05:08 +00:00
Nils-Helge Garli 9d4f368ed6 Removed unused local variable
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@601698 13f79535-47bb-0310-9956-ffa450edef68
2007-12-06 10:59:38 +00:00
Ted Nathan Husted 2c68dfc935 Roll back version number on 2.x index page to the current GA release.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@599535 13f79535-47bb-0310-9956-ffa450edef68
2007-11-29 18:25:49 +00:00
Ted Nathan Husted a4ad651054 Change min-height to height per suggestions by Jim Cushing and Frank W. Zammetti.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@598741 13f79535-47bb-0310-9956-ffa450edef68
2007-11-27 19:41:25 +00:00
Nils-Helge Garli 5f8d4cd385 Added some ignores
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@598260 13f79535-47bb-0310-9956-ffa450edef68
2007-11-26 13:08:46 +00:00
Nils-Helge Garli 6121174144 WW-2337 Trying to set a different temp directory for the test.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@598196 13f79535-47bb-0310-9956-ffa450edef68
2007-11-26 10:02:31 +00:00
Antonio Petrelli d37e1dd67e WW-2259
Added configuration to create "backport" and "docs" assemblies.
It must be corrected when the XWork backported artifacts will be available.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@598003 13f79535-47bb-0310-9956-ffa450edef68
2007-11-25 15:31:56 +00:00
Nils-Helge Garli c82338aee0 There seems to be some issues with the infrastructure on the CI server that causes the tests to fail randomly.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@597962 13f79535-47bb-0310-9956-ffa450edef68
2007-11-25 08:34:20 +00:00
Thomas Schneider 6fd129b9ed WW-2328 fix for DefaultActionMapper not parsing out the sessionid
Submitted By: Omkar Patil
Reviewed By: Tom Schneider



git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@597904 13f79535-47bb-0310-9956-ffa450edef68
2007-11-24 19:08:26 +00:00
Nils-Helge Garli 2788ac9ab5 WW-2335 Using the computed value for content length instead of the hardcoded value, as it is done in the other test methods.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@597674 13f79535-47bb-0310-9956-ffa450edef68
2007-11-23 14:41:32 +00:00
Antonio Petrelli 1382694b0e WW-2329
Removed libs from source distribution.
Upgraded to Maven assembly plugin 2.2-beta-1.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@597482 13f79535-47bb-0310-9956-ffa450edef68
2007-11-22 19:37:13 +00:00
David Newton ce9c1849a9 Minor JavaDoc additions.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@595898 13f79535-47bb-0310-9956-ffa450edef68
2007-11-17 02:22:22 +00:00
Donald J. Brown 3e5e82dde6 Setting devmode properly
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@595849 13f79535-47bb-0310-9956-ffa450edef68
2007-11-16 22:30:57 +00:00
David Newton c3a3a80843 JavaDoc spelling and grammar ;)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@595746 13f79535-47bb-0310-9956-ffa450edef68
2007-11-16 17:21:05 +00:00
Nils-Helge Garli ded8c8f491 Enabling the tests, trying a new strategy for locating a free port.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@595584 13f79535-47bb-0310-9956-ffa450edef68
2007-11-16 07:11:07 +00:00
Nils-Helge Garli 3f8c282065 Added the tests again, but excluding them from beeing run with excludes in pom.xml
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@595575 13f79535-47bb-0310-9956-ffa450edef68
2007-11-16 06:43:29 +00:00
Nils-Helge Garli e748db2226 Causing too many problems for Bamboo, so removing for now.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@595571 13f79535-47bb-0310-9956-ffa450edef68
2007-11-16 06:27:43 +00:00
Nils-Helge Garli 427d507d4e remove extra newline
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@595569 13f79535-47bb-0310-9956-ffa450edef68
2007-11-16 06:19:31 +00:00
Nils-Helge Garli 930383d8c4 Bamboo maven build complains about this file beeing missing.... so trying to force a new build.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@595558 13f79535-47bb-0310-9956-ffa450edef68
2007-11-16 05:27:37 +00:00
Nils-Helge Garli fb180126fa Exlude transitive servlet-api dependency from velocity tools.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@595483 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 22:58:55 +00:00
Antonio Petrelli 98e99fb820 WW-2327
Fixed Velocity related Maven references.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@595430 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 20:20:59 +00:00
Antonio Petrelli 84ef73c9a1 WW-2313
Now the assemblies contain plugin and all webapps source code.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@595403 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 19:26:13 +00:00
David Newton 60823c6582 Same Double/Long cast issue as in IteratorGeneratorTag.
Now casting instanceof Double to a Double (not Long).

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@595363 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 17:08:58 +00:00
David Newton 117d0bbb43 Fixed broken typecast (would have cast Double to Long; boom).
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@595360 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 17:04:56 +00:00
David Newton 8676ff40fd https://issues.apache.org/struts/browse/WW-2322 Now putting generated collection into stack context (not pageContext)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@595336 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 15:41:41 +00:00
David Newton 9ab85528a7 I guess the taglib HTML docs are under source control.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@595334 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 15:38:46 +00:00
Donald J. Brown 9b6309df91 Fixing tests WW-2321
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@594777 13f79535-47bb-0310-9956-ffa450edef68
2007-11-14 05:37:41 +00:00
Donald J. Brown 06ad2cb8ff Adding empty dir
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@594770 13f79535-47bb-0310-9956-ffa450edef68
2007-11-14 05:13:01 +00:00
Donald J. Brown 8334897347 Moving rest app over the apps area
WW-2312


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@594767 13f79535-47bb-0310-9956-ffa450edef68
2007-11-14 05:06:19 +00:00
Donald J. Brown e0dfb08c9d Renaming rest plugin dir, adding plugin to build, removing unnecessary files
WW-2321


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@594766 13f79535-47bb-0310-9956-ffa450edef68
2007-11-14 05:02:55 +00:00
Donald J. Brown 6229ad7a47 Moving rest plugin into trunk
WW-2321


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@594765 13f79535-47bb-0310-9956-ffa450edef68
2007-11-14 04:57:40 +00:00
Niall Kegan Pemberton 0f06910a73 Revert logo link from sponsorship page to www.apache.org and add separate sponsorship link
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@594620 13f79535-47bb-0310-9956-ffa450edef68
2007-11-13 19:41:11 +00:00
David Newton e917196458 Spelling error in tag param description.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@594370 13f79535-47bb-0310-9956-ffa450edef68
2007-11-13 00:51:00 +00:00
Ted Nathan Husted c165646443 Include links to ASF Thanks and Sponsorship pages, as directed by the PRC.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@593863 13f79535-47bb-0310-9956-ffa450edef68
2007-11-11 10:28:03 +00:00
Donald J. Brown ab845ac21b Minor formatting cleanups
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@592963 13f79535-47bb-0310-9956-ffa450edef68
2007-11-08 00:02:32 +00:00
Antonio Petrelli 3bf7c239bf WW-2258
Changed classifier to "backport".
Configured the assemblies so they do not include backported packages.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@592882 13f79535-47bb-0310-9956-ffa450edef68
2007-11-07 20:33:26 +00:00
Antonio Petrelli 474467e145 WW-2258
Configured the retrotranslator plugin to work in a new profile, in attached mode.
Removed unnecessary legacy Retrotranslator configuration.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@592853 13f79535-47bb-0310-9956-ffa450edef68
2007-11-07 18:58:12 +00:00
Donald J. Brown 84e2bcde4d Separating out action mapping parameter handling into new interceptor
WW-2203


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@592669 13f79535-47bb-0310-9956-ffa450edef68
2007-11-07 09:34:04 +00:00
Musachy Barroso 8386422ff3 WW-2050 Separate JSONValidationInterceptor from AnnotationValidationInterceptor
* Fix functions to display error when doing client/ajax validation
Patch provided by Lukasz Racon

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@592047 13f79535-47bb-0310-9956-ffa450edef68
2007-11-05 15:28:50 +00:00
Musachy Barroso 7c1d42d580 Fix broken links
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@592019 13f79535-47bb-0310-9956-ffa450edef68
2007-11-05 14:41:30 +00:00
Nils-Helge Garli e738512cfe Changed port
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@591970 13f79535-47bb-0310-9956-ffa450edef68
2007-11-05 12:12:34 +00:00
Nils-Helge Garli 447d59f8bb WW-2296 Added jetty-pluto embedded to the sample application. Also added some new samples and a new integration test.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@591942 13f79535-47bb-0310-9956-ffa450edef68
2007-11-05 10:06:31 +00:00
Nils-Helge Garli be55979596 WW-2295 Exclude servlet-api from beeing included from commons-digester.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@591939 13f79535-47bb-0310-9956-ffa450edef68
2007-11-05 09:57:38 +00:00
Antonio Petrelli a7f74978a4 WW-2147
Now a RAT check is run during the release process.
Fixed files with missing license.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@591790 13f79535-47bb-0310-9956-ffa450edef68
2007-11-04 15:30:32 +00:00
Antonio Petrelli 9053e731bf WW-2074
Now the project information and project reports appear.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@591786 13f79535-47bb-0310-9956-ffa450edef68
2007-11-04 14:16:51 +00:00
Antonio Petrelli 1c7efe4764 WW-2221
Configured the WAR plugin to put the LICENSE.txt and NOTICE.txt files under META-INF.
Removed redundant LICENSE.txt and NOTICE.txt in blank webapp.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@591754 13f79535-47bb-0310-9956-ffa450edef68
2007-11-04 10:44:35 +00:00
Antonio Petrelli 1aa93b6c65 WW-2288
Now the Struts 2 plugin depends on Tiles 2.0.5.
Assembly and Showcase have been changed accordingly.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@591630 13f79535-47bb-0310-9956-ffa450edef68
2007-11-03 15:11:59 +00:00
Donald J. Brown c19679f6e5 Adding support for different redirect result codes
WW-2289


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@591627 13f79535-47bb-0310-9956-ffa450edef68
2007-11-03 14:22:36 +00:00
Thomas Schneider 68b9138b63 WW-1622 - added clear session interceptor to struts-default
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@591553 13f79535-47bb-0310-9956-ffa450edef68
2007-11-03 05:21:19 +00:00
Donald J. Brown c3ce93739b Adding retrieval of result parameters from stack for stream result
WW-1281


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@591531 13f79535-47bb-0310-9956-ffa450edef68
2007-11-03 01:18:14 +00:00
Ted Nathan Husted d643feff6c WW-2282 Apply a number of "FindBugs" performance optimizations submitted by Giovanni Azua Garcia. Most (or all) of these are line for line substitutions.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@591174 13f79535-47bb-0310-9956-ffa450edef68
2007-11-02 00:31:53 +00:00
Musachy Barroso 680fc59903 WW-2275 autocompleter tag doesn't send multibyte characters correctly
thanks to Sakamoto Osamu for the patch

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@591003 13f79535-47bb-0310-9956-ffa450edef68
2007-11-01 13:42:08 +00:00
Ted Nathan Husted dc3e409303 WW-2094 Error DateTimePicker when erase input then click again the calendar - Apply fix submitted by Benjamin McCann for to issue originally reported by Leneveut Michaël.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@590970 13f79535-47bb-0310-9956-ffa450edef68
2007-11-01 11:57:58 +00:00
Antonio Petrelli 8dfaa6dd90 WW-2063
Fixed subversion properties.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@590812 13f79535-47bb-0310-9956-ffa450edef68
2007-10-31 20:32:54 +00:00
Thomas Schneider 69588f6f20 WW-1622 - added interceptor to clear out the http session
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@590536 13f79535-47bb-0310-9956-ffa450edef68
2007-10-31 01:55:32 +00:00
Ted Nathan Husted 8c2dfbd367 WW-1789, WW-2279 Update velocity to 1.5, velocity-tools to 1.3, and Spring to 2.0.7. Apply one-line change to VelocityManager suggested by Rod Vagg.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@590528 13f79535-47bb-0310-9956-ffa450edef68
2007-10-31 01:24:43 +00:00
Thomas Schneider e43579f6f9 WW-2204 Updated jfreechart and jasperreports to use struts-default as the parent package
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@589945 13f79535-47bb-0310-9956-ffa450edef68
2007-10-30 02:41:37 +00:00
David Newton 71b26fdcb0 Closing xsl tag typo.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@589867 13f79535-47bb-0310-9956-ffa450edef68
2007-10-29 21:45:12 +00:00
Ted Nathan Husted 2151d7273c WW-1715 Update POMs and backport for 2.1.1-SNAPSHOT.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@589617 13f79535-47bb-0310-9956-ffa450edef68
2007-10-29 13:12:30 +00:00
1256 changed files with 90185 additions and 84581 deletions
@@ -1,65 +0,0 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2;
/**
* Default action interface. Provided purely for user convenience. Struts does not require actions to implement any
* interfaces. Actions need only implement a public, no argument method which returns {@code String}. If a user does
* not specify a method name, Struts defaults to {@code execute()}.
*
* <p>For example:
*
* <pre>
* static import ResultNames.*;
*
* public class MyAction <b>implements Action</b> {
*
* public String execute() {
* return SUCCESS;
* }
* }
* </pre>
*
* <p>is equivalent to:
*
* <pre>
* static import ResultNames.*;
*
* public class MyAction {
*
* public String execute() {
* return SUCCESS;
* }
* }
* </pre>
*
* @author crazybob@google.com (Bob Lee)
*/
public interface Action {
/**
* Executes this action.
*
* @return result name which matches a result name from the action mapping in the configuration file. See {@link
* ResultNames} for common suggestions.
*/
String execute();
}
@@ -1,61 +0,0 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2;
/**
* Implemented by actions which may need to record errors or messages.
*
* <pre>
* static import ResultNames.*;
*
* public class SetName implements MessageAware {
*
* Messages messages;
* String name;
*
* public String execute() {
* return SUCCESS;
* }
*
* public void setName(String name) {
* if ("".equals(name))
* messages.forField("name").addError("name.required");
*
* this.name = name;
* }
*
* public void setMessages(Messages messages) {
* this.messages = messages;
* }
* }
* </pre>
*
* @author crazybob@google.com (Bob Lee)
*/
public interface MessageAware {
/**
* Sets messages.
*
* @param messages messages
*/
void setMessages(Messages messages);
}
@@ -1,216 +0,0 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2;
import java.util.List;
import java.util.Set;
import java.util.Map;
/**
* Collection of messages. Supports nesting messages by field name.
*
* <p>Uses keys when adding instead of actual messages to decouple code from messages.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface Messages {
// TODO: Use Object[] for args instead of String[].
/**
* Message severity.
*/
public enum Severity {
/**
* Informational messages.
*/
INFO,
/**
* Warning messages.
*/
WARN,
/**
* Error messages.
*/
ERROR,
}
/**
* Gets nested messages for the given field.
*
* <p>Supports dot notation to represent nesting. For example:
*
* <pre>
* messages.forField("foo").forField("bar") == messages.forField("foo.bar")
* </pre>
*
* @param fieldName name of the field
* @return nested {@code Messages} for given field name
*/
Messages forField(String fieldName);
/**
* Gets map of field name to messages for that field.
*
* @return map of field name to {@code Messages}
*/
Map<String, Messages> forFields();
/**
* Adds informational message.
*
* @param key message key
* @see Severity.INFO
*/
void addInformation(String key);
/**
* Adds informational message.
*
* @param key message key
* @param arguments message arguments
* @see Severity.INFO
*/
void addInformation(String key, String... arguments);
/**
* Adds warning message.
*
* @param key message key
* @see Severity.WARN
*/
void addWarning(String key);
/**
* Adds warning message.
*
* @param key message key
* @param arguments message arguments
* @see Severity.WARN
*/
void addWarning(String key, String... arguments);
/**
* Adds error message.
*
* @param key message key
* @see Severity.ERROR
*/
void addError(String key);
/**
* Adds error message.
*
* @param key message key
* @param arguments message arguments
* @see Severity.ERROR
*/
void addError(String key, String... arguments);
/**
* Adds message.
*
* @param severity message severity
* @param key message key
*/
void add(Severity severity, String key);
/**
* Adds request-scoped message.
*
* @param severity message severity
* @param key message key
* @param arguments message arguments
*/
void add(Severity severity, String key, String... arguments);
/**
* Gets set of severities for which this {@code Messages} instance has messages. Not recursive.
*
* @return unmodifiable set of {@link Severity} sorted from least to most severe
*/
Set<Severity> getSeverities();
/**
* Gets message strings for the given severity. Not recursive.
*
* @param severity message severity
* @return unmodifiable list of messages
*/
List<String> forSeverity(Severity severity);
/**
* Gets error message strings for this {@code Messages} instance. Not recursive.
*
* @return unmodifiable list of messages
*/
List<String> getErrors();
/**
* Gets error message strings for this {@code Messages} instance. Not recursive.
*
* @return unmodifiable list of messages
*/
List<String> getWarnings();
/**
* Gets informational message strings for this {@code Messages} instance. Not recursive.
*
* @return unmodifiable list of messages
*/
List<String> getInformation();
/**
* Returns true if this or a nested {@code Messages} instance has error messages.
*
* @see Severity.ERROR
*/
boolean hasErrors();
/**
* Returns true if this or a nested {@code Messages} instance has warning messages.
*
* @see Severity.WARN
*/
boolean hasWarnings();
/**
* Returns true if this or a nested {@code Messages} instance has informational messages.
*
* @see Severity.INFO
*/
boolean hasInformation();
/**
* Returns true if this and all nested {@code Messages} instances have no messages.
*/
boolean isEmpty();
/**
* Returns true if this and all nested {@code Messages} instances have no messages for the given severity.
*
* @param severity message severity
*/
boolean isEmpty(Severity severity);
}
@@ -1,79 +0,0 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.spi;
import java.lang.reflect.Method;
/**
* Context of an action execution.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface ActionContext {
/**
* Gets action instance.
*/
Object getAction();
/**
* Gets action method.
*/
Method getMethod();
/**
* Gets action name.
*/
String getActionName();
/**
* Gets the path for the action's namespace.
*/
String getNamespacePath();
/**
* Gets the {@link Result} instance for the action.
*
* @return {@link Result} instance or {@code null} if we don't have a result yet.
*/
Result getResult();
/**
* Adds a result interceptor for the action. Enables executing code before and after a result, executing an
* alternate result, etc.
*/
void addResultInterceptor(Result interceptor);
/**
* Gets context of action which chained to us.
*
* @return context of previous action or {@code null} if this is the first action in the chain
*/
ActionContext getPrevious();
/**
* Gets context of action which this action chained to.
*
* @return context of next action or {@code null} if we haven't chained to another action yet or this is the last
* action in the chain.
*/
ActionContext getNext();
}
@@ -1,121 +0,0 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.spi;
import org.apache.struts2.Messages;
import javax.servlet.ServletContext;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Locale;
import java.util.Map;
/**
* Request context. A single request may span multiple actions with action chaining.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface RequestContext {
/**
* Gets context of the currently executing action.
*
* @return current action context
*/
ActionContext getActionContext();
/**
* Convenience method.&nbsp;Equivalent to {@code getActionContext().getAction()}.
*
* @return currently executing action
*/
Object getAction();
/**
* Gets map of request parameters.
*/
Map<String, String[]> getParameterMap();
/**
* Gets map of request attributes.
*/
Map<String, Object> getAttributeMap();
/**
* Gets map of session attributes.
*/
Map<String, Object> getSessionMap();
/**
* Gets map of application (servlet context) attributes.
*/
Map<String, Object> getApplicationMap();
/**
* Finds cookies with the given name,
*/
List<Cookie> findCookiesForName(String name);
/**
* Gets locale.
*/
Locale getLocale();
/**
* Sets locale. Stores the locale in the session for future requests.
*/
void setLocale(Locale locale);
/**
* Gets messages.
*/
Messages getMessages();
/**
* Gets the servlet request.
*/
HttpServletRequest getServletRequest();
/**
* Gets the servlet response.
*/
HttpServletResponse getServletResponse();
/**
* Gets the servlet context.
*/
ServletContext getServletContext();
/**
* Gets the value stack.
*/
ValueStack getValueStack();
/**
* Invokes the next interceptor or the action method if no more interceptors remain.
*
* @return result name
* @throws IllegalStateException if already invoked or called from the action
*/
String proceed() throws Exception;
}
@@ -1,39 +0,0 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.spi;
import org.apache.struts2.spi.RequestContext;
/**
* Implemented by actions that need access to the current {@link org.apache.struts2.spi.RequestContext}. Use
* judiciously.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface RequestContextAware {
/**
* Sets {@link org.apache.struts2.spi.RequestContext}.
*
* @param requestContext
*/
void setRequestContext(RequestContext requestContext);
}
@@ -1,38 +0,0 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.spi;
import org.apache.struts2.spi.RequestContext;
/**
* The result of an action request. Struts creates a new {@code Result} instance for each request.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface Result {
/**
* Executes result.
*
* @param requestContext
*/
void execute(RequestContext requestContext) throws Exception;
}
@@ -1,113 +0,0 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.spi;
/**
* A central fixture of the Struts framework, the {@code ValueStack} is a stack which contains the actions
* which have executed in addition to other objects. Users can get and set values on the stack using expressions. The
* {@code ValueStack} will search down the stack starting with the most recent objects until it finds an object to
* which the expression can apply.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface ValueStack extends Iterable<Object> {
/**
* Gets the top, most recent object from the stack without changing the stack.
*
* @return the top object
*/
Object peek();
/**
* Removes the top, most recent object from the stack.
*
* @return the top object
*/
Object pop();
/**
* Pushes an object onto the stack.
*
* @param o
*/
void push(Object o);
/**
* Creates a shallow copy of this stack.
*
* @return a new stack which contains the same objects as this one
*/
ValueStack clone();
/**
* Queries the stack. Starts with the top, most recent object. If the expression can apply to the object, this
* method returns the result of evaluating the expression. If the expression does not apply, this method moves
* down the stack to the next object and repeats. Returns {@code null} if the expression doesn't apply to any
* objects.
*
* @param expression
* @return the evaluation of the expression against the first applicable object in the stack
*/
Object get(String expression);
/**
* Queries the stack and converts the result to the specified type. Starts with the top, most recent object. If
* the expression can apply to the object, this method returns the result of evaluating the expression converted
* to the specified type. If the expression does not apply, this method moves down the stack to the next object
* and repeats. Returns {@code null} if the expression doesn't apply to any objects.
*
* @param expression
* @param asType the type to convert the result to
* @return the evaluation of the expression against the first applicable object in the stack converted to the
* specified type
*/
<T> T get(String expression, Class<T> asType);
/**
* Queries the stack and converts the result to a {@code String}. Starts with the top, most recent object. If the
* expression can apply to the object, this method returns the result of evaluating the expression converted to a
* {@code String}. If the expression does not apply, this method moves down the stack to the next object and
* repeats. Returns {@code null} if the expression doesn't apply to any objects.
*
* @param expression
* @return the evaluation of the expression against the first applicable object in the stack converted to a {@code
* String}
*/
String getString(String expression);
/**
* Sets a value on an object from the stack. This method starts at the top, most recent object. If the expression
* applies to that object, this methods sets the given value on that object using the expression and converting
* the type as necessary. If the expression does not apply, this method moves to the next object and repeats.
*
* @param expression
* @param value
*/
void set(String expression, Object value);
/**
* Returns the number of object on the stack.
*
* @return size of stack
*/
int size();
}
-174
View File
@@ -1,174 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
-174
View File
@@ -1,174 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
-6
View File
@@ -1,6 +0,0 @@
Apache Struts
Copyright 2006 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/
+9 -9
View File
@@ -1,10 +1,10 @@
README.txt - blank
This is an "empty" application that you can deploy as the basis of your own
application.
For more on getting started with Struts, see
* http://cwiki.apache.org/WW/home.html
README.txt - blank
This is an "empty" application that you can deploy as the basis of your own
application.
For more on getting started with Struts, see
* http://cwiki.apache.org/WW/home.html
----------------------------------------------------------------------------
+8 -11
View File
@@ -21,13 +21,12 @@
* 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">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.1.0</version>
<version>2.1.2</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-blank</artifactId>
@@ -35,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_2/apps/blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_2/apps/blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_2/apps/blank</url>
</scm>
<dependencies>
@@ -55,14 +54,12 @@
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>2.0.1</version>
<groupId>${pom.groupId}</groupId>
<artifactId>struts2-junit-plugin</artifactId>
<version>${pom.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
@@ -1,3 +0,0 @@
@echo off
set CLASSPATH=..\..\..\lib\xwork-2.0-beta-1.jar
javac *.java -d ..\..\..\classes
+25 -25
View File
@@ -1,25 +1,25 @@
<?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="example" namespace="/example" extends="struts-default">
<action name="HelloWorld" class="example.HelloWorld">
<result>/example/HelloWorld.jsp</result>
</action>
<action name="Login_*" method="{1}" class="example.Login">
<result name="input">/example/Login.jsp</result>
<result type="redirectAction">Menu</result>
</action>
<action name="*" class="example.ExampleSupport">
<result>/example/{1}.jsp</result>
</action>
<!-- Add actions here -->
</package>
</struts>
<?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="example" namespace="/example" extends="struts-default">
<action name="HelloWorld" class="example.HelloWorld">
<result>/example/HelloWorld.jsp</result>
</action>
<action name="Login_*" method="{1}" class="example.Login">
<result name="input">/example/Login.jsp</result>
<result type="redirectAction">Menu</result>
</action>
<action name="*" class="example.ExampleSupport">
<result>/example/{1}.jsp</result>
</action>
<!-- Add actions here -->
</package>
</struts>
@@ -1,16 +1,16 @@
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="username">
<field-validator type="requiredstring">
<message key="requiredstring"/>
</field-validator>
</field>
<field name="password">
<field-validator type="requiredstring">
<message key="requiredstring"/>
</field-validator>
</field>
</validators>
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="username">
<field-validator type="requiredstring">
<message key="requiredstring"/>
</field-validator>
</field>
<field name="password">
<field-validator type="requiredstring">
<message key="requiredstring"/>
</field-validator>
</field>
</validators>
+17 -17
View File
@@ -1,18 +1,18 @@
README.txt - mailreader
The MailReader demonstrates a localized application with a master/child
CRUD workflow.
This rendition also demonstrates using wildcards to "normalize" an
application.
See the Sandbox for other MailReader examples using other architectures.
* http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2/apps/
For more about the MailReader applicaton genneraly, visit Struts University.
* http://www.StrutsUniversity.org/
README.txt - mailreader
The MailReader demonstrates a localized application with a master/child
CRUD workflow.
This rendition also demonstrates using wildcards to "normalize" an
application.
See the Sandbox for other MailReader examples using other architectures.
* http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2/apps/
For more about the MailReader applicaton genneraly, visit Struts University.
* http://www.StrutsUniversity.org/
----------------------------------------------------------------------------
+5 -6
View File
@@ -21,13 +21,12 @@
* 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">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.1.0</version>
<version>2.1.2</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-mailreader</artifactId>
@@ -35,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_2/apps/mailreader</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_2/apps/mailreader</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_2/apps/mailreader</url>
</scm>
<dependencies>
@@ -1,47 +1,47 @@
<?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="mailreader-default" namespace="/" extends="struts-default">
<interceptors>
<interceptor name="authentication"
class="mailreader2.AuthenticationInterceptor"/>
<interceptor-stack name="user" >
<interceptor-ref name="authentication" />
<interceptor-ref name="defaultStack"/>
</interceptor-stack>
<interceptor-stack name="user-submit" >
<interceptor-ref name="tokenSession" />
<interceptor-ref name="user"/>
</interceptor-stack>
<interceptor-stack name="guest" >
<interceptor-ref name="defaultStack"/>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="user"/>
<global-results>
<result name="error">/pages/Error.jsp</result>
<result name="invalid.token">/pages/Error.jsp</result>
<result name="login" type="redirectAction">Login_input</result>
</global-results>
<global-exception-mappings>
<exception-mapping
result="error"
exception="java.lang.Throwable"/>
</global-exception-mappings>
</package>
</struts>
<?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="mailreader-default" namespace="/" extends="struts-default">
<interceptors>
<interceptor name="authentication"
class="mailreader2.AuthenticationInterceptor"/>
<interceptor-stack name="user" >
<interceptor-ref name="authentication" />
<interceptor-ref name="defaultStack"/>
</interceptor-stack>
<interceptor-stack name="user-submit" >
<interceptor-ref name="tokenSession" />
<interceptor-ref name="user"/>
</interceptor-stack>
<interceptor-stack name="guest" >
<interceptor-ref name="defaultStack"/>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="user"/>
<global-results>
<result name="error">/pages/Error.jsp</result>
<result name="invalid.token">/pages/Error.jsp</result>
<result name="login" type="redirectAction">Login_input</result>
</global-results>
<global-exception-mappings>
<exception-mapping
result="error"
exception="java.lang.Throwable"/>
</global-exception-mappings>
</package>
</struts>
@@ -1,63 +1,63 @@
<?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="mailreader-support" namespace="/" extends="mailreader-default">
<action name="Tour">
<result>/tour.html</result>
<interceptor-ref name="guest"/>
</action>
<action name="Welcome" class="mailreader2.Welcome">
<result>/Welcome.jsp</result>
<interceptor-ref name="guest"/>
</action>
<action name="Logout" class="mailreader2.Logout">
<result type="redirectAction">Welcome</result>
</action>
<action name="Login_*" method="{1}" class="mailreader2.Login">
<result name="input">/Login.jsp</result>
<result name="cancel" type="redirectAction">Welcome</result>
<result type="redirectAction">MainMenu</result>
<result name="expired" type="chain">ChangePassword</result>
<exception-mapping
exception="org.apache.struts.apps.mailreader.dao.ExpiredPasswordException"
result="expired"/>
<interceptor-ref name="guest"/>
</action>
<action name="Registration_*" method="{1}" class="mailreader2.Registration">
<result name="input">/Registration.jsp</result>
<result type="redirectAction">MainMenu</result>
<interceptor-ref name="guest"/>
</action>
</package>
<package name="subscription" namespace="/" extends="mailreader-support">
<global-results>
<result name="input">/Subscription.jsp</result>
<result type="redirectAction">Registration_input</result>
</global-results>
<action name="Subscription_save" method="save" class="mailreader2.Subscription">
<interceptor-ref name="user-submit" />
</action>
<action name="Subscription_*" method="{1}" class="mailreader2.Subscription" />
</package>
<package name="wildcard" namespace="/" extends="mailreader-support">
<action name="*" class="mailreader2.MailreaderSupport">
<result>/{1}.jsp</result>
</action>
</package>
</struts>
<?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="mailreader-support" namespace="/" extends="mailreader-default">
<action name="Tour">
<result>/tour.html</result>
<interceptor-ref name="guest"/>
</action>
<action name="Welcome" class="mailreader2.Welcome">
<result>/Welcome.jsp</result>
<interceptor-ref name="guest"/>
</action>
<action name="Logout" class="mailreader2.Logout">
<result type="redirectAction">Welcome</result>
</action>
<action name="Login_*" method="{1}" class="mailreader2.Login">
<result name="input">/Login.jsp</result>
<result name="cancel" type="redirectAction">Welcome</result>
<result type="redirectAction">MainMenu</result>
<result name="expired" type="chain">ChangePassword</result>
<exception-mapping
exception="org.apache.struts.apps.mailreader.dao.ExpiredPasswordException"
result="expired"/>
<interceptor-ref name="guest"/>
</action>
<action name="Registration_*" method="{1}" class="mailreader2.Registration">
<result name="input">/Registration.jsp</result>
<result type="redirectAction">MainMenu</result>
<interceptor-ref name="guest"/>
</action>
</package>
<package name="subscription" namespace="/" extends="mailreader-support">
<global-results>
<result name="input">/Subscription.jsp</result>
<result type="redirectAction">Registration_input</result>
</global-results>
<action name="Subscription_save" method="save" class="mailreader2.Subscription">
<interceptor-ref name="user-submit" />
</action>
<action name="Subscription_*" method="{1}" class="mailreader2.Subscription" />
</package>
<package name="wildcard" namespace="/" extends="mailreader-support">
<action name="*" class="mailreader2.MailreaderSupport">
<result>/{1}.jsp</result>
</action>
</package>
</struts>
@@ -1,14 +1,14 @@
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="username">
<field-validator type="requiredstring">
<message key="error.username.required"/>
</field-validator>
</field>
<field name="password">
<field-validator type="requiredstring">
<message key="error.password.required"/>
</field-validator>
</field>
</validators>
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="username">
<field-validator type="requiredstring">
<message key="error.username.required"/>
</field-validator>
</field>
<field name="password">
<field-validator type="requiredstring">
<message key="error.password.required"/>
</field-validator>
</field>
</validators>
@@ -1,32 +1,32 @@
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="username">
<field-validator type="requiredstring">
<message key="error.username.required"/>
</field-validator>
</field>
<field name="user.fullName">
<field-validator type="requiredstring">
<message key="error.fullName.required"/>
</field-validator>
</field>
<field name="user.fromAddress">
<field-validator type="requiredstring">
<message key="error.fromAddress.required"/>
</field-validator>
<field-validator type="email">
<message key="errors.email"/>
</field-validator>
</field>
<field name="user.replyToAddress">
<field-validator type="email">
<message key="errors.email"/>
</field-validator>
</field>
</validators>
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="username">
<field-validator type="requiredstring">
<message key="error.username.required"/>
</field-validator>
</field>
<field name="user.fullName">
<field-validator type="requiredstring">
<message key="error.fullName.required"/>
</field-validator>
</field>
<field name="user.fromAddress">
<field-validator type="requiredstring">
<message key="error.fromAddress.required"/>
</field-validator>
<field-validator type="email">
<message key="errors.email"/>
</field-validator>
</field>
<field name="user.replyToAddress">
<field-validator type="email">
<message key="errors.email"/>
</field-validator>
</field>
</validators>
@@ -1,23 +1,23 @@
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="subscription.username">
<field-validator type="requiredstring">
<message key="error.username.required"/>
</field-validator>
</field>
<field name="subscription.password">
<field-validator type="requiredstring">
<message key="error.password.required"/>
</field-validator>
</field>
<field name="subscription.type">
<field-validator type="requiredstring">
<message key="error.type.invalid"/>
</field-validator>
</field>
</validators>
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="subscription.username">
<field-validator type="requiredstring">
<message key="error.username.required"/>
</field-validator>
</field>
<field name="subscription.password">
<field-validator type="requiredstring">
<message key="error.password.required"/>
</field-validator>
</field>
<field name="subscription.type">
<field-validator type="requiredstring">
<message key="error.type.invalid"/>
</field-validator>
</field>
</validators>
@@ -1,11 +1,11 @@
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="host">
<field-validator type="requiredstring">
<message key="error.host.required"/>
</field-validator>
</field>
</validators>
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="host">
<field-validator type="requiredstring">
<message key="error.host.required"/>
</field-validator>
</field>
</validators>
+15 -15
View File
@@ -1,16 +1,16 @@
<?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>
<constant name="struts.action.extension" value="do" />
<constant name="struts.devMode" value="false" />
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<include file="mailreader-default.xml"/>
<include file="mailreader-support.xml"/>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.action.extension" value="do" />
<constant name="struts.devMode" value="false" />
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<include file="mailreader-default.xml"/>
<include file="mailreader-support.xml"/>
</struts>
@@ -1,13 +1,13 @@
<?xml version='1.0'?>
<database>
<user username="user" fromAddress="John.User@somewhere.com"
fullName="John Q. User" password="pass">
<subscription host="mail.hotmail.com" autoConnect="false"
password="bar" type="pop3" username="user1234">
</subscription>
<subscription host="mail.yahoo.com" autoConnect="false" password="foo"
type="imap" username="jquser">
</subscription>
</user>
</database>
<?xml version='1.0'?>
<database>
<user username="user" fromAddress="John.User@somewhere.com"
fullName="John Q. User" password="pass">
<subscription host="mail.hotmail.com" autoConnect="false"
password="bar" type="pop3" username="user1234">
</subscription>
<subscription host="mail.yahoo.com" autoConnect="false" password="foo"
type="imap" username="jquser">
</subscription>
</user>
</database>
+1 -1
View File
@@ -1462,7 +1462,7 @@ public class <strong>AuthenticationInterceptor</strong> implements Interceptor {
&lt;interceptor-ref name="defaultStack"/>
&lt;/interceptor-stack>
&lt;interceptor-stack name="<strong>user-submit</strong>" >
&lt;interceptor-ref name="token-session" />
&lt;interceptor-ref name="tokenSession" />
&lt;interceptor-ref name="user"/>
&lt;/interceptor-stack>
&lt;interceptor-stack name="<strong>guest</strong>" >
+72 -22
View File
@@ -21,14 +21,12 @@
* 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">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.1.0</version>
<version>2.1.2</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
@@ -39,12 +37,13 @@
<module>mailreader</module>
<module>portlet</module>
<module>showcase</module>
<module>rest-showcase</module>
</modules>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/apps/</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/apps/</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_2/apps</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_2/apps</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_2/apps</url>
</scm>
<distributionManagement>
@@ -108,14 +107,10 @@
</goals>
<configuration>
<tasks>
<taskdef resource="hostedqatasks" classpathref="maven.plugin.classpath"/>
<upload file="${project.build.directory}/${project.build.finalName}.war"
account="struts" email="${email}"
password="${password}" resourceId="${resourceId}"/>
<taskdef resource="hostedqatasks" classpathref="maven.plugin.classpath" />
<upload file="${project.build.directory}/${project.build.finalName}.war" account="struts" email="${email}" password="${password}" resourceId="${resourceId}" />
<playsuite suiteId="${suiteId}" clientConfigs="${clientConfigs}" appConfigs="${appConfigs}" account="struts"
email="${email}"
password="${password}"/>
<playsuite suiteId="${suiteId}" clientConfigs="${clientConfigs}" appConfigs="${appConfigs}" account="struts" email="${email}" password="${password}" />
</tasks>
</configuration>
</execution>
@@ -131,6 +126,45 @@
</plugins>
</build>
</profile>
<profile>
<id>release</id>
<activation>
<property>
<name>release</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<inherited>true</inherited>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rat-maven-plugin</artifactId>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<addDefaultLicenseMatchers>false</addDefaultLicenseMatchers>
<licenseMatchers>
<classNames>
<className>rat.analysis.license.ApacheSoftwareLicense20</className>
</classNames>
</licenseMatchers>
<includes>
<include>pom.xml</include>
</includes>
<excludes>
<exclude>src/**</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
@@ -138,6 +172,7 @@
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>0.3.1</version>
<configuration>
<container>
<containerId>tomcat5x</containerId>
@@ -159,13 +194,11 @@
<phase>process-sources</phase>
<configuration>
<tasks>
<copy todir="${project.build.directory}/${pom.artifactId}/WEB-INF/src/java"
failonerror="false">
<fileset dir="${basedir}/src/main/java"/>
<copy todir="${project.build.directory}/${pom.artifactId}/WEB-INF/src/java" failonerror="false">
<fileset dir="${basedir}/src/main/java" />
</copy>
<copy todir="${project.build.directory}/${pom.artifactId}/WEB-INF/src/java"
failonerror="false">
<fileset dir="${basedir}/src/main/resources"/>
<copy todir="${project.build.directory}/${pom.artifactId}/WEB-INF/src/java" failonerror="false">
<fileset dir="${basedir}/src/main/resources" />
</copy>
</tasks>
</configuration>
@@ -175,6 +208,23 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<targetPath>META-INF</targetPath>
<includes>
<include>LICENSE.txt</include>
<include>NOTICE.txt</include>
</includes>
</resource>
</webResources>
<warSourceExcludes>WEB-INF/classes/LICENSE.txt,WEB-INF/classes/NOTICE.txt</warSourceExcludes>
</configuration>
</plugin>
</plugins>
<finalName>${pom.artifactId}</finalName>
@@ -192,9 +242,9 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-mock</artifactId>
<version>2.0.1</version>
<version>2.0.7</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
</project>
+16 -16
View File
@@ -1,17 +1,17 @@
README.txt - portlet
This is a simple example of using the portlet API with Struts applications.
For more on getting started with Struts, see
* http://cwiki.apache.org/WW/home.html
WARNING - Additional configuration required for deployment
Due to difference in portlet container implementations, the portlet
WAR is not ready-to-run. Extract the portlet WAR, and then copy the
contents of apps/portlet/src/main/etc/<your_portal_server>/ into the
WAR's WEB-INF directory.
README.txt - portlet
This is a simple example of using the portlet API with Struts applications.
For more on getting started with Struts, see
* http://cwiki.apache.org/WW/home.html
WARNING - Additional configuration required for deployment
Due to difference in portlet container implementations, the portlet
WAR is not ready-to-run. Extract the portlet WAR, and then copy the
contents of apps/portlet/src/main/etc/<your_portal_server>/ into the
WAR's WEB-INF directory.
----------------------------------------------------------------------------
+124 -49
View File
@@ -21,13 +21,12 @@
* 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">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.1.0</version>
<version>2.1.2</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-portlet</artifactId>
@@ -35,42 +34,63 @@
<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_2/apps/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_2/apps/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_2/apps/portlet</url>
</scm>
<profiles>
<profile>
<id>pluto</id>
<build>
<plugins>
<!-- configure maven-war-plugin to use updated web.xml -->
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
</configuration>
</plugin>
<!-- bind 'pluto:assemble' goal to 'process-resources' lifecycle -->
<plugin>
<groupId>org.apache.pluto</groupId>
<artifactId>maven-pluto-plugin</artifactId>
<version>1.1.3</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<profiles>
<profile>
<id>pluto</id>
<build>
<plugins>
<!-- configure maven-war-plugin to use updated web.xml -->
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
</configuration>
</plugin>
<!-- bind 'pluto:assemble' goal to 'process-resources' lifecycle -->
<plugin>
<groupId>org.apache.pluto</groupId>
<artifactId>maven-pluto-plugin</artifactId>
<version>1.1.3</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<configuration>
<webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
<webDefaultXml>src/main/webapp/WEB-INF/jetty-pluto-web-default.xml</webDefaultXml>
<systemProperties>
<systemProperty>
<name>org.apache.pluto.embedded.portletId</name>
<value>StrutsPortlet</value>
</systemProperty>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.bekk.boss</groupId>
<artifactId>maven-jetty-pluto-embedded</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>portlet-api</groupId>
@@ -93,21 +113,43 @@
<artifactId>struts2-portlet-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
<dependency>
<groupId>velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.4</version>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-dwr-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
<dependency>
<groupId>velocity-tools</groupId>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
<version>1.1</version>
<version>1.3</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>struts</groupId>
<artifactId>struts</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
<version>1.8</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
@@ -124,13 +166,46 @@
<artifactId>log4j</artifactId>
<version>1.2.9</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.0</version>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>6.1.4rc0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.jwebunit</groupId>
<artifactId>jwebunit-htmlunit-plugin</artifactId>
<version>1.4.1</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.bekk.boss</groupId>
<artifactId>maven-jetty-pluto-embedded</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jsp-2.1</artifactId>
<version>6.1.4rc0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.1</version>
</dependency>
</dependencies>
@@ -1,20 +1,20 @@
<page>
<defaults
skin="orange"
layout-decorator="tigris"
portlet-decorator="tigris"
/>
<title>Struts Portlet Example Application</title>
<metadata name="title" xml:lang="en">Struts Portlet Example Application</metadata>
<fragment id="simplest" type="layout" name="jetspeed-layouts::VelocityTwoColumns">
<fragment id="struts-portlet-1" type="portlet" name="struts-portlet::StrutsPortlet">
<property layout="TwoColumns" name="row" value="0" />
<property layout="TwoColumns" name="column" value="0" />
</fragment>
</fragment>
<security-constraints>
<security-constraints-ref>public-view</security-constraints-ref>
</security-constraints>
<page>
<defaults
skin="orange"
layout-decorator="tigris"
portlet-decorator="tigris"
/>
<title>Struts Portlet Example Application</title>
<metadata name="title" xml:lang="en">Struts Portlet Example Application</metadata>
<fragment id="simplest" type="layout" name="jetspeed-layouts::VelocityTwoColumns">
<fragment id="struts-portlet-1" type="portlet" name="struts-portlet::StrutsPortlet">
<property layout="TwoColumns" name="row" value="0" />
<property layout="TwoColumns" name="column" value="0" />
</fragment>
</fragment>
<security-constraints>
<security-constraints-ref>public-view</security-constraints-ref>
</security-constraints>
</page>
@@ -20,18 +20,17 @@
*/
package org.apache.struts2.portlet.example;
import org.apache.struts2.dispatcher.DefaultActionSupport;
import com.opensymphony.xwork2.ActionSupport;
/**
*/
public class FormExample extends ActionSupport {
public class FormExample extends DefaultActionSupport {
String firstName = null;
String lastName = null;
public String execute() throws Exception {
// TODO Auto-generated method stub
return super.execute();
}
public String getFirstName() {
return firstName;
}
@@ -44,4 +43,8 @@ public class FormExample extends ActionSupport {
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String displayResult() {
return "displayResult";
}
}
@@ -1,37 +1,37 @@
/*
* $Id: FormExample.java 471756 2006-11-06 15:01:43Z husted $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.portlet.example;
import org.apache.struts2.portlet.example.model.Name;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
/**
*/
public class FormExampleModelDriven extends ActionSupport implements ModelDriven<Name> {
private Name name = new Name();
public Name getModel() {
return name;
}
}
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.portlet.example;
import org.apache.struts2.portlet.example.model.Name;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
/**
*/
public class FormExampleModelDriven extends ActionSupport implements ModelDriven<Name> {
private Name name = new Name();
public Name getModel() {
return name;
}
}
@@ -1,81 +1,81 @@
/*
* $Id: $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.portlet.example.fileupload;
import java.io.File;
import org.apache.struts2.dispatcher.DefaultActionSupport;
/**
* File Upload example's action. <code>FileUploadAction</code>
*
*/
public class FileUploadAction extends DefaultActionSupport {
private static final long serialVersionUID = 5156288255337069381L;
private String contentType;
private File upload;
private String fileName;
private String caption;
// since we are using <s:file name="upload" .../> the file name will be
// obtained through getter/setter of <file-tag-name>FileName
public String getUploadFileName() {
return fileName;
}
public void setUploadFileName(String fileName) {
this.fileName = fileName;
}
// since we are using <s:file name="upload" ... /> the content type will be
// obtained through getter/setter of <file-tag-name>ContentType
public String getUploadContentType() {
return contentType;
}
public void setUploadContentType(String contentType) {
this.contentType = contentType;
}
// since we are using <s:file name="upload" ... /> the File itself will be
// obtained through getter/setter of <file-tag-name>
public File getUpload() {
return upload;
}
public void setUpload(File upload) {
this.upload = upload;
}
public String getCaption() {
return caption;
}
public void setCaption(String caption) {
this.caption = caption;
}
public String upload() throws Exception {
return SUCCESS;
}
}
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.portlet.example.fileupload;
import java.io.File;
import org.apache.struts2.dispatcher.DefaultActionSupport;
/**
* File Upload example's action. <code>FileUploadAction</code>
*
*/
public class FileUploadAction extends DefaultActionSupport {
private static final long serialVersionUID = 5156288255337069381L;
private String contentType;
private File upload;
private String fileName;
private String caption;
// since we are using <s:file name="upload" .../> the file name will be
// obtained through getter/setter of <file-tag-name>FileName
public String getUploadFileName() {
return fileName;
}
public void setUploadFileName(String fileName) {
this.fileName = fileName;
}
// since we are using <s:file name="upload" ... /> the content type will be
// obtained through getter/setter of <file-tag-name>ContentType
public String getUploadContentType() {
return contentType;
}
public void setUploadContentType(String contentType) {
this.contentType = contentType;
}
// since we are using <s:file name="upload" ... /> the File itself will be
// obtained through getter/setter of <file-tag-name>
public File getUpload() {
return upload;
}
public void setUpload(File upload) {
this.upload = upload;
}
public String getCaption() {
return caption;
}
public void setCaption(String caption) {
this.caption = caption;
}
public String upload() throws Exception {
return SUCCESS;
}
}
@@ -1,18 +1,18 @@
package org.apache.struts2.portlet.example.model;
public class Name {
private String firstName;
private String lastName;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
package org.apache.struts2.portlet.example.model;
public class Name {
private String firstName;
private String lastName;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
@@ -0,0 +1,13 @@
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="firstName">
<field-validator type="requiredstring">
<message>You must enter a first name</message>
</field-validator>
</field>
<field name="lastName">
<field-validator type="requiredstring">
<message>You must enter a last name</message>
</field-validator>
</field>
</validators>
+47 -47
View File
@@ -1,48 +1,48 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="edit" extends="struts-portlet-default"
namespace="/edit">
<action name="index"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">/WEB-INF/edit/index.jsp</result>
</action>
<action name="test"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">/WEB-INF/edit/test.jsp</result>
</action>
<action name="formExampleEdit"
class="org.apache.struts2.portlet.example.FormExample" method="input">
<result name="input">
/WEB-INF/edit/formExampleInput.jsp
</result>
</action>
<action name="processFormExampleEdit"
class="org.apache.struts2.portlet.example.FormExample">
<result name="input">
/WEB-INF/edit/formExampleInput.jsp
</result>
<result name="success">
/edit/processFormExampleForward.action?firstName=${firstName}&amp;lastName=${lastName}
</result>
</action>
<action name="processFormExampleForward"
class="org.apache.struts2.portlet.example.FormExample">
<result name="success">
/WEB-INF/edit/formExample.jsp
</result>
</action>
</package>
<package name="editTest" extends="edit" namespace="/edit/dummy/test">
<action name="testAction"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">/WEB-INF/edit/namespaceTest.jsp</result>
</action>
</package>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="edit" extends="struts-portlet-default"
namespace="/edit">
<action name="index"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">/WEB-INF/edit/index.jsp</result>
</action>
<action name="test"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">/WEB-INF/edit/test.jsp</result>
</action>
<action name="formExampleEdit"
class="org.apache.struts2.portlet.example.FormExample" method="input">
<result name="input">
/WEB-INF/edit/formExampleInput.jsp
</result>
</action>
<action name="processFormExampleEdit"
class="org.apache.struts2.portlet.example.FormExample">
<result name="input">
/WEB-INF/edit/formExampleInput.jsp
</result>
<result name="success">
/edit/processFormExampleForward.action?firstName=${firstName}&amp;lastName=${lastName}
</result>
</action>
<action name="processFormExampleForward"
class="org.apache.struts2.portlet.example.FormExample">
<result name="success">
/WEB-INF/edit/formExample.jsp
</result>
</action>
</package>
<package name="editTest" extends="edit" namespace="/edit/dummy/test">
<action name="testAction"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">/WEB-INF/edit/namespaceTest.jsp</result>
</action>
</package>
</struts>
+13 -13
View File
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="help" extends="struts-portlet-default"
namespace="/help">
<action name="index"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">/WEB-INF/help/index.jsp</result>
</action>
</package>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="help" extends="struts-portlet-default"
namespace="/help">
<action name="index"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">/WEB-INF/help/index.jsp</result>
</action>
</package>
</struts>
+130 -115
View File
@@ -1,115 +1,130 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="view" extends="struts-portlet-default"
namespace="/view">
<action name="index"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">/WEB-INF/view/index.jsp</result>
</action>
<action name="formExample"
class="org.apache.struts2.portlet.example.FormExample" method="input">
<result name="input">
/WEB-INF/view/formExampleInput.jsp
</result>
</action>
<action name="processFormExample"
class="org.apache.struts2.portlet.example.FormExample">
<result name="input">
/WEB-INF/view/formExampleInput.jsp
</result>
<result name="success">
/WEB-INF/view/formExample.jsp
</result>
</action>
<action name="formExampleModelDriven"
class="org.apache.struts2.portlet.example.FormExampleModelDriven">
<result name="input">
/WEB-INF/view/formExampleInputModelDriven.jsp
</result>
<result name="success">
/WEB-INF/view/formExample.jsp
</result>
</action>
<action name="validationExample"
class="org.apache.struts2.portlet.example.FormExample" method="input">
<result name="input">
/WEB-INF/view/formExampleInputValidation.jsp
</result>
</action>
<action name="processValidationExample"
class="org.apache.struts2.portlet.example.FormExample">
<result name="success">
/WEB-INF/view/formExample.jsp
</result>
<result name="input">
/WEB-INF/view/formExampleInputValidation.jsp
</result>
</action>
<action name="fileUpload" class="org.apache.struts2.portlet.example.fileupload.FileUploadAction">
<result name="input">
/WEB-INF/view/fileUpload.jsp
</result>
<result name="success">
/WEB-INF/view/fileUploadSuccess.jsp
</result>
</action>
<action name="tokenExample"
class="com.opensymphony.xwork2.ActionSupport" method="input">
<result name="input">
/WEB-INF/view/tokenExampleInput.jsp
</result>
</action>
<action name="processTokenExample"
class="com.opensymphony.xwork2.ActionSupport">
<result name="input">
/WEB-INF/view/tokenExampleInput.jsp
</result>
<result name="invalid.token">
/WEB-INF/view/tokenExampleInput.jsp
</result>
<result name="success">
/WEB-INF/view/tokenExample.jsp
</result>
<interceptor-ref name="portletDefaultStackWithToken" />
</action>
<action name="springExample" class="springAction">
<result name="success">
/WEB-INF/view/springExample.jsp
</result>
</action>
<action name="freeMarkerExample"
class="com.opensymphony.xwork2.ActionSupport" method="input">
<result type="freemarker" name="input">
/WEB-INF/view/freeMarkerExampleInput.ftl
</result>
</action>
<action name="processFreeMarkerExample"
class="org.apache.struts2.portlet.example.FormExample">
<result name="success">/view/processFreeMarkerView.action?firstName=${firstName}&amp;lastName=${lastName}</result>
</action>
<action name="processFreeMarkerView" class="org.apache.struts2.portlet.example.FormExample">
<result type="freemarker" name="success">/WEB-INF/view/freeMarkerExample.ftl</result>
</action>
<action name="velocityHelloWorld" class="com.opensymphony.xwork2.ActionSupport">
<result type="velocity" name="success">/WEB-INF/view/helloWorld.vm</result>
</action>
</package>
</struts>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="view" extends="struts-portlet-default"
namespace="/view">
<action name="index"
class="com.opensymphony.xwork2.ActionSupport">
<result name="success">/WEB-INF/view/index.jsp</result>
</action>
<action name="formExample"
class="org.apache.struts2.portlet.example.FormExample" method="input">
<result name="input">
/WEB-INF/view/formExampleInput.jsp
</result>
</action>
<action name="processFormExample"
class="org.apache.struts2.portlet.example.FormExample">
<result name="input">
/WEB-INF/view/formExampleInput.jsp
</result>
<result name="success">
/WEB-INF/view/formExample.jsp
</result>
</action>
<action name="formExamplePrg" class="org.apache.struts2.portlet.example.FormExample">
<result name="input">
/WEB-INF/view/formExampleInputPrg.jsp
</result>
<result name="success" type="redirectAction">
<param name="actionName">formExamplePrg</param>
<param name="method">displayResult</param>
<param name="firstName">${firstName}</param>
<param name="lastName">${lastName}</param>
</result>
<result name="displayResult">
/WEB-INF/view/formExample.jsp
</result>
</action>
<action name="formExampleModelDriven"
class="org.apache.struts2.portlet.example.FormExampleModelDriven">
<result name="input">
/WEB-INF/view/formExampleInputModelDriven.jsp
</result>
<result name="success">
/WEB-INF/view/formExample.jsp
</result>
</action>
<action name="validationExample"
class="org.apache.struts2.portlet.example.FormExample" method="input">
<result name="input">
/WEB-INF/view/formExampleInputValidation.jsp
</result>
</action>
<action name="processValidationExample"
class="org.apache.struts2.portlet.example.FormExample">
<result name="success">
/WEB-INF/view/formExample.jsp
</result>
<result name="input">
/WEB-INF/view/formExampleInputValidation.jsp
</result>
</action>
<action name="fileUpload" class="org.apache.struts2.portlet.example.fileupload.FileUploadAction">
<result name="input">
/WEB-INF/view/fileUpload.jsp
</result>
<result name="success">
/WEB-INF/view/fileUploadSuccess.jsp
</result>
</action>
<action name="tokenExample"
class="com.opensymphony.xwork2.ActionSupport" method="input">
<result name="input">
/WEB-INF/view/tokenExampleInput.jsp
</result>
</action>
<action name="processTokenExample"
class="com.opensymphony.xwork2.ActionSupport">
<result name="input">
/WEB-INF/view/tokenExampleInput.jsp
</result>
<result name="invalid.token">
/WEB-INF/view/tokenExampleInput.jsp
</result>
<result name="success">
/WEB-INF/view/tokenExample.jsp
</result>
<interceptor-ref name="portletDefaultStackWithToken" />
</action>
<action name="springExample" class="springAction">
<result name="success">
/WEB-INF/view/springExample.jsp
</result>
</action>
<action name="freeMarkerExample"
class="com.opensymphony.xwork2.ActionSupport" method="input">
<result type="freemarker" name="input">
/WEB-INF/view/freeMarkerExampleInput.ftl
</result>
</action>
<action name="processFreeMarkerExample"
class="org.apache.struts2.portlet.example.FormExample">
<result name="success">/view/processFreeMarkerView.action?firstName=${firstName}&amp;lastName=${lastName}</result>
</action>
<action name="processFreeMarkerView" class="org.apache.struts2.portlet.example.FormExample">
<result type="freemarker" name="success">/WEB-INF/view/freeMarkerExample.ftl</result>
</action>
<action name="velocityHelloWorld" class="com.opensymphony.xwork2.ActionSupport">
<result type="velocity" name="success">/WEB-INF/view/helloWorld.vm</result>
</action>
</package>
</struts>
@@ -0,0 +1,384 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- ===================================================================== -->
<!-- This file contains the default descriptor for web applications. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- The intent of this descriptor is to include jetty specific or common -->
<!-- configuration for all webapps. If a context has a webdefault.xml -->
<!-- descriptor, it is applied before the contexts own web.xml file -->
<!-- -->
<!-- A context may be assigned a default descriptor by: -->
<!-- + Calling WebApplicationContext.setDefaultsDescriptor -->
<!-- + Passed an arg to addWebApplications -->
<!-- -->
<!-- This file is used both as the resource within the jetty.jar (which is -->
<!-- used as the default if no explicit defaults descriptor is set) and it -->
<!-- is copied to the etc directory of the Jetty distro and explicitly -->
<!-- by the jetty.xml file. -->
<!-- -->
<!-- ===================================================================== -->
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
metadata-complete="true"
version="2.5">
<description>
Default web.xml file.
This file is applied to a Web application before it's own WEB_INF/web.xml file
</description>
<!-- ==================================================================== -->
<!-- Context params to control Session Cookies -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- UNCOMMENT TO ACTIVATE
<context-param>
<param-name>org.mortbay.jetty.servlet.SessionDomain</param-name>
<param-value>127.0.0.1</param-value>
</context-param>
<context-param>
<param-name>org.mortbay.jetty.servlet.SessionPath</param-name>
<param-value>/</param-value>
</context-param>
<context-param>
<param-name>org.mortbay.jetty.servlet.MaxAge</param-name>
<param-value>-1</param-value>
</context-param>
-->
<context-param>
<param-name>org.mortbay.jetty.webapp.NoTLDJarPattern</param-name>
<param-value>start.jar|ant-.*\.jar|dojo-.*\.jar|jetty-.*\.jar|jsp-api-.*\.jar|junit-.*\.jar|servlet-api-.*\.jar|dnsns\.jar|rt\.jar|jsse\.jar|tools\.jar|sunpkcs11\.jar|sunjce_provider\.jar|xerces.*\.jar</param-value>
</context-param>
<listener>
<listener-class>
com.bekk.boss.pluto.embedded.jetty.util.OverrideContextLoaderListener
</listener-class>
</listener>
<listener>
<listener-class>
com.bekk.boss.pluto.embedded.util.PortalStartupListener
</listener-class>
</listener>
<filter>
<filter-name>plutoResourceFilter</filter-name>
<filter-class>com.bekk.boss.pluto.embedded.util.PlutResourcesFilter</filter-class>
</filter>
<filter>
<filter-name>plutoPortalDriver</filter-name>
<filter-class>com.bekk.boss.pluto.embedded.util.PlutoPortalDriverFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>plutoResourceFilter</filter-name>
<url-pattern>*.css</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>plutoResourceFilter</filter-name>
<url-pattern>*.gif</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>plutoResourceFilter</filter-name>
<url-pattern>*.png</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>plutoResourceFilter</filter-name>
<url-pattern>*.js</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>plutoPortalDriver</filter-name>
<url-pattern>/pluto/index.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>plutoPortalDriver</filter-name>
<url-pattern>/pluto/index.jsp/*</url-pattern>
</filter-mapping>
<!-- ==================================================================== -->
<!-- The default servlet. -->
<!-- This servlet, normally mapped to /, provides the handling for static -->
<!-- content, OPTIONS and TRACE methods for the context. -->
<!-- The following initParameters are supported: -->
<!-- -->
<!-- acceptRanges If true, range requests and responses are -->
<!-- supported -->
<!-- -->
<!-- dirAllowed If true, directory listings are returned if no -->
<!-- welcome file is found. Else 403 Forbidden. -->
<!-- -->
<!-- redirectWelcome If true, redirect welcome file requests -->
<!-- else use request dispatcher forwards -->
<!-- -->
<!-- gzip If set to true, then static content will be served-->
<!-- as gzip content encoded if a matching resource is -->
<!-- found ending with ".gz" -->
<!-- -->
<!-- resoureBase Can be set to replace the context resource base -->
<!-- -->
<!-- relativeResourceBase -->
<!-- Set with a pathname relative to the base of the -->
<!-- servlet context root. Useful for only serving -->
<!-- static content from only specific subdirectories. -->
<!-- -->
<!-- useFileMappedBuffer -->
<!-- If set to true (the default), a memory mapped -->
<!-- file buffer will be used to serve static content -->
<!-- when using an NIO connector. Setting this value -->
<!-- to false means that a direct buffer will be used -->
<!-- instead. If you are having trouble with Windows -->
<!-- file locking, set this to false. -->
<!-- -->
<!-- cacheControl If set, all static content will have this value -->
<!-- set as the cache-control header. -->
<!-- -->
<!-- maxCacheSize Maximum size of the static resource cache -->
<!-- -->
<!-- maxCachedFileSize Maximum size of any single file in the cache -->
<!-- -->
<!-- maxCachedFiles Maximum number of files in the cache -->
<!-- -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.mortbay.jetty.servlet.DefaultServlet</servlet-class>
<init-param>
<param-name>acceptRanges</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>dirAllowed</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>redirectWelcome</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>maxCacheSize</param-name>
<param-value>4000000</param-value>
</init-param>
<init-param>
<param-name>maxCachedFileSize</param-name>
<param-value>254000</param-value>
</init-param>
<init-param>
<param-name>maxCachedFiles</param-name>
<param-value>1000</param-value>
</init-param>
<init-param>
<param-name>gzip</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>useFileMappedBuffer</param-name>
<param-value>true</param-value>
</init-param>
<!--
<init-param>
<param-name>cacheControl</param-name>
<param-value>max-age=3600,public</param-value>
</init-param>
-->
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping> <servlet-name>default</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping>
<!-- ==================================================================== -->
<!-- JSP Servlet -->
<!-- This is the jasper JSP servlet from the jakarta project -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- The JSP page compiler and execution servlet, which is the mechanism -->
<!-- used by Glassfish to support JSP pages. Traditionally, this servlet -->
<!-- is mapped to URL patterh "*.jsp". This servlet supports the -->
<!-- following initialization parameters (default values are in square -->
<!-- brackets): -->
<!-- -->
<!-- checkInterval If development is false and reloading is true, -->
<!-- background compiles are enabled. checkInterval -->
<!-- is the time in seconds between checks to see -->
<!-- if a JSP page needs to be recompiled. [300] -->
<!-- -->
<!-- compiler Which compiler Ant should use to compile JSP -->
<!-- pages. See the Ant documenation for more -->
<!-- information. [javac] -->
<!-- -->
<!-- classdebuginfo Should the class file be compiled with -->
<!-- debugging information? [true] -->
<!-- -->
<!-- classpath What class path should I use while compiling -->
<!-- generated servlets? [Created dynamically -->
<!-- based on the current web application] -->
<!-- Set to ? to make the container explicitly set -->
<!-- this parameter. -->
<!-- -->
<!-- development Is Jasper used in development mode (will check -->
<!-- for JSP modification on every access)? [true] -->
<!-- -->
<!-- enablePooling Determines whether tag handler pooling is -->
<!-- enabled [true] -->
<!-- -->
<!-- fork Tell Ant to fork compiles of JSP pages so that -->
<!-- a separate JVM is used for JSP page compiles -->
<!-- from the one Tomcat is running in. [true] -->
<!-- -->
<!-- ieClassId The class-id value to be sent to Internet -->
<!-- Explorer when using <jsp:plugin> tags. -->
<!-- [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93] -->
<!-- -->
<!-- javaEncoding Java file encoding to use for generating java -->
<!-- source files. [UTF-8] -->
<!-- -->
<!-- keepgenerated Should we keep the generated Java source code -->
<!-- for each page instead of deleting it? [true] -->
<!-- -->
<!-- logVerbosityLevel The level of detailed messages to be produced -->
<!-- by this servlet. Increasing levels cause the -->
<!-- generation of more messages. Valid values are -->
<!-- FATAL, ERROR, WARNING, INFORMATION, and DEBUG. -->
<!-- [WARNING] -->
<!-- -->
<!-- mappedfile Should we generate static content with one -->
<!-- print statement per input line, to ease -->
<!-- debugging? [false] -->
<!-- -->
<!-- -->
<!-- reloading Should Jasper check for modified JSPs? [true] -->
<!-- -->
<!-- suppressSmap Should the generation of SMAP info for JSR45 -->
<!-- debugging be suppressed? [false] -->
<!-- -->
<!-- dumpSmap Should the SMAP info for JSR45 debugging be -->
<!-- dumped to a file? [false] -->
<!-- False if suppressSmap is true -->
<!-- -->
<!-- scratchdir What scratch directory should we use when -->
<!-- compiling JSP pages? [default work directory -->
<!-- for the current web application] -->
<!-- -->
<!-- tagpoolMaxSize The maximum tag handler pool size [5] -->
<!-- -->
<!-- xpoweredBy Determines whether X-Powered-By response -->
<!-- header is added by generated servlet [false] -->
<!-- -->
<!-- If you wish to use Jikes to compile JSP pages: -->
<!-- Set the init parameter "compiler" to "jikes". Define -->
<!-- the property "-Dbuild.compiler.emacs=true" when starting Jetty -->
<!-- to cause Jikes to emit error messages in a format compatible with -->
<!-- Jasper. -->
<!-- If you get an error reporting that jikes can't use UTF-8 encoding, -->
<!-- try setting the init parameter "javaEncoding" to "ISO-8859-1". -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<servlet id="jsp">
<servlet-name>jsp</servlet-name>
<servlet-class>com.bekk.boss.pluto.embedded.util.PortletJspServlet</servlet-class>
<init-param>
<param-name>logVerbosityLevel</param-name>
<param-value>DEBUG</param-value>
</init-param>
<init-param>
<param-name>fork</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>xpoweredBy</param-name>
<param-value>false</param-value>
</init-param>
<!--
<init-param>
<param-name>classpath</param-name>
<param-value>?</param-value>
</init-param>
-->
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
<url-pattern>*.jspf</url-pattern>
<url-pattern>*.jspx</url-pattern>
<url-pattern>*.xsp</url-pattern>
<url-pattern>*.JSP</url-pattern>
<url-pattern>*.JSPF</url-pattern>
<url-pattern>*.JSPX</url-pattern>
<url-pattern>*.XSP</url-pattern>
</servlet-mapping>
<!-- ==================================================================== -->
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<!-- ==================================================================== -->
<!-- Default MIME mappings -->
<!-- The default MIME mappings are provided by the mime.properties -->
<!-- resource in the org.mortbay.jetty.jar file. Additional or modified -->
<!-- mappings may be specified here -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- UNCOMMENT TO ACTIVATE
<mime-mapping>
<extension>mysuffix</extension>
<mime-type>mymime/type</mime-type>
</mime-mapping>
-->
<!-- ==================================================================== -->
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- ==================================================================== -->
<locale-encoding-mapping-list>
<locale-encoding-mapping><locale>ar</locale><encoding>ISO-8859-6</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>be</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>bg</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>ca</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>cs</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>da</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>de</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>el</locale><encoding>ISO-8859-7</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>en</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>es</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>et</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>fi</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>fr</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>hr</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>hu</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>is</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>it</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>iw</locale><encoding>ISO-8859-8</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>ja</locale><encoding>Shift_JIS</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>ko</locale><encoding>EUC-KR</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>lt</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>lv</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>mk</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>nl</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>no</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>pl</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>pt</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>ro</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>ru</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>sh</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>sk</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>sl</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>sq</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>sr</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>sv</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>tr</locale><encoding>ISO-8859-9</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>uk</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>zh</locale><encoding>GB2312</encoding></locale-encoding-mapping>
<locale-encoding-mapping><locale>zh_TW</locale><encoding>Big5</encoding></locale-encoding-mapping>
</locale-encoding-mapping-list>
</web-app>
@@ -1,13 +1,13 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<h1>Fileupload sample</h1>
<s:actionerror />
<s:fielderror />
<s:form action="fileUpload" method="POST" enctype="multipart/form-data">
<s:file name="upload" label="File"/>
<s:textfield name="caption" label="Caption"/>
<s:submit />
</s:form>
<%@ taglib prefix="s" uri="/struts-tags" %>
<h1>Fileupload sample</h1>
<s:actionerror />
<s:fielderror />
<s:form action="fileUpload" method="POST" enctype="multipart/form-data">
<s:file name="upload" label="File"/>
<s:textfield name="caption" label="Caption"/>
<s:submit />
</s:form>
@@ -1,14 +1,14 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<h1>Fileupload sample</h1>
<p>
<ul>
<li>ContentType: <s:property value="uploadContentType" /></li>
<li>FileName: <s:property value="uploadFileName" /></li>
<li>File: <s:property value="upload" /></li>
<li>Caption:<s:property value="caption" /></li>
</ul>
</p>
<%@ taglib prefix="s" uri="/struts-tags" %>
<h1>Fileupload sample</h1>
<p>
<ul>
<li>ContentType: <s:property value="uploadContentType" /></li>
<li>FileName: <s:property value="uploadFileName" /></li>
<li>File: <s:property value="upload" /></li>
<li>Caption:<s:property value="caption" /></li>
</ul>
</p>
@@ -1,8 +1,8 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<H2>Input your name</H2>
<s:form action="formExampleModelDriven" method="POST">
<s:textfield label="First name" name="firstName" value="%{firstName}"/>
<s:textfield label="Last name" name="lastName" value="%{lastName}"/>
<s:submit value="Submit the form"/>
</s:form>
<%@ taglib prefix="s" uri="/struts-tags" %>
<H2>Input your name</H2>
<s:form action="formExampleModelDriven" method="POST">
<s:textfield label="First name" name="firstName" value="%{firstName}"/>
<s:textfield label="Last name" name="lastName" value="%{lastName}"/>
<s:submit value="Submit the form"/>
</s:form>
@@ -0,0 +1,8 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<H2>Input your name</H2>
<s:form action="formExamplePrg" method="POST">
<s:textfield label="First name" name="firstName" value="%{firstName}"/>
<s:textfield label="Last name" name="lastName" value="%{lastName}"/>
<s:submit value="Submit the form"/>
</s:form>
@@ -0,0 +1,6 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<H2>Hello <s:property value="firstName"/> <s:property value="lastName"/></H2>
<p/>
<a href="<s:url action="index"/>">Back to front page</a>
@@ -4,6 +4,7 @@
Here you'll find examples of what is possible with the Struts Portlet integration framework.
<ul>
<li><a href="<s:url action="formExample"/>">A simple form</a></li>
<li><a href="<s:url action="formExamplePrg" method="input"/>">Form example with proper PRG</a></li>
<li><a href="<s:url action="formExampleModelDriven" method="input"/>">Model driven example</li>
<li><a href="<s:url action="validationExample"/>">Validation</a></li>
<li><a href="<s:url action="tokenExample"/>">Token</a></li>
@@ -9,21 +9,6 @@
</param-value>
</context-param>
<filter id="filterdispatcher">
<filter-name>Struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>Struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class> org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<!-- Uncomment to use the dispatcher servlet -->
<!--<servlet id="Struts2PortletDispatcherServlet">
<servlet-name>Struts2PortletDispatcherServlet</servlet-name>
@@ -0,0 +1,19 @@
import org.apache.pluto.core.PortletServlet;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.servlet.ServletHolder;
import org.mortbay.jetty.webapp.WebAppContext;
public class JettyPlutoLauncher {
public static void main(String[] args) throws Exception {
System.setProperty("org.apache.pluto.embedded.portletId", "StrutsPortlet");
Server server = new Server(8080);
WebAppContext webapp = new WebAppContext("src/main/webapp", "/test");
webapp.setDefaultsDescriptor("/WEB-INF/jetty-pluto-web-default.xml");
ServletHolder portletServlet = new ServletHolder(new PortletServlet());
portletServlet.setInitParameter("portlet-name", "StrutsPortlet");
portletServlet.setInitOrder(1);
webapp.addServlet(portletServlet, "/PlutoInvoker/StrutsPortlet");
server.addHandler(webapp);
server.start();
}
}
@@ -0,0 +1,81 @@
package org.apache.struts2.portlet.test;
import java.io.File;
import net.sourceforge.jwebunit.junit.WebTestCase;
import org.apache.pluto.core.PortletServlet;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.servlet.ServletHolder;
import org.mortbay.jetty.webapp.WebAppContext;
public abstract class BasePortletTest extends WebTestCase {
protected Server server;
private String contextPath = "/test";
private int port;
public void setUp() throws Exception {
System.setProperty("org.apache.pluto.embedded.portletId", getPortletName());
server = new Server(port);
WebAppContext webapp = new WebAppContext("src/main/webapp", contextPath);
webapp.setTempDirectory(new File("target/work"));
webapp.setDefaultsDescriptor("/WEB-INF/jetty-pluto-web-default.xml");
ServletHolder portletServlet = new ServletHolder(new PortletServlet());
portletServlet.setInitParameter("portlet-name", getPortletName());
portletServlet.setInitOrder(1);
webapp.addServlet(portletServlet, "/PlutoInvoker/" + getPortletName());
server.addHandler(webapp);
server.start();
// Retrieve the actual port that is used, in case a random, free port is
// picked
int port = server.getConnectors()[0].getLocalPort();
getTestContext().setBaseUrl("http://localhost:" + port + contextPath);
}
public void tearDown() throws Exception {
server.stop();
}
public void minimizeWindow() {
clickElementByXPath("//span[@class='minimized']/..");
}
public void maximizeWindow() {
clickElementByXPath("//span[@class='minimized']/..");
}
public void restoreWindow() {
clickElementByXPath("//span[@class='normal']/..");
}
public void switchEdit() {
clickElementByXPath("//span[@class='edit']/..");
}
public void switchView() {
clickElementByXPath("//span[@class='view']/..");
}
public void switchHelp() {
clickElementByXPath("//span[@class='help']/..");
}
public void setContextPath(String contextPath) {
if(!contextPath.startsWith("/")) {
this.contextPath = "/" + contextPath;
}
else {
this.contextPath = contextPath;
}
}
public void setPort(int port) {
this.port = port;
}
public abstract String getPortletName();
}
@@ -0,0 +1,85 @@
package org.apache.struts2.portlet.test;
public class Struts2PortletTest extends BasePortletTest {
private final static String PORTLET_NAME = "StrutsPortlet";
public void testNone() {}
public void testIndexPage() throws Exception {
beginAt("pluto/index.jsp");
assertTextPresent("Welcome to the Struts example portlet");
assertLinkPresentWithExactText("A simple form");
assertLinkPresentWithExactText("Validation");
}
public void testFormExample() throws Exception {
beginAt("pluto/index.jsp");
clickLinkWithExactText("A simple form");
assertFormPresent("processFormExample");
assertTextPresent("Input your name");
setWorkingForm("processFormExample");
setTextField("firstName", "Nils-Helge");
setTextField("lastName", "Garli");
submit();
assertTextPresent("Hello Nils-Helge Garli");
}
public void testValidationExample() throws Exception {
beginAt("pluto/index.jsp");
clickLinkWithExactText("Validation");
assertFormPresent("processValidationExample");
assertTextPresent("Input your name");
setWorkingForm("processValidationExample");
setTextField("firstName", "Nils-Helge");
submit();
assertTextFieldEquals("firstName", "Nils-Helge");
assertTextPresent("You must enter a last name");
setTextField("lastName", "Garli");
submit();
assertTextPresent("Hello Nils-Helge Garli");
}
public void testValidationErrorMessagesStickBetweenWindowStateChanges() throws Exception {
beginAt("pluto/index.jsp");
clickLinkWithExactText("Validation");
assertFormPresent("processValidationExample");
assertTextPresent("Input your name");
setWorkingForm("processValidationExample");
setTextField("firstName", "Nils-Helge");
submit();
assertTextFieldEquals("firstName", "Nils-Helge");
assertTextPresent("You must enter a last name");
minimizeWindow();
assertTextNotPresent("Input your name");
restoreWindow();
assertTextPresent("Input your name");
assertTextPresent("You must enter a last name");
}
public void testTokenExample() throws Exception {
beginAt("pluto/index.jsp");
clickLinkWithText("Token");
setWorkingForm(0);
setTextField("theValue", "something");
submit();
assertTextPresent("ERROR");
setWorkingForm(1);
setTextField("theValue", "somethingElse");
submit();
assertTextPresent("The form was successfully submitted with a valid token");
}
public void testSwitchFromViewToEditShouldGoToDefaultEditPage() throws Exception {
beginAt("pluto/index.jsp");
assertTextPresent("Welcome to the Struts example portlet");
switchEdit();
assertTextPresent("Back to view mode");
}
@Override
public String getPortletName() {
return PORTLET_NAME;
}
}
+75
View File
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.1.2</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-rest-showcase</artifactId>
<packaging>war</packaging>
<version>2.1.2</version>
<name>Struts 2 Rest Showcase Example</name>
<description>Struts 2 Rest Showcase Example</description>
<dependencies>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-rest-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>struts2-rest-showcase</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.0.1</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,73 @@
package org.apache.struts2.rest.example;
public class Order {
String id;
String clientName;
int amount;
public Order() {}
public Order(String id, String clientName, int amount) {
super();
this.id = id;
this.clientName = clientName;
this.amount = amount;
}
public int getAmount() {
return amount;
}
public void setAmount(int amount) {
this.amount = amount;
}
public String getClientName() {
return clientName;
}
public void setClientName(String clientName) {
this.clientName = clientName;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + amount;
result = prime * result
+ ((clientName == null) ? 0 : clientName.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final Order other = (Order) obj;
if (amount != other.amount)
return false;
if (clientName == null) {
if (other.clientName != null)
return false;
} else if (!clientName.equals(other.clientName))
return false;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
}
@@ -0,0 +1,92 @@
package org.apache.struts2.rest.example;
import java.util.Collection;
import org.apache.struts2.config.Result;
import org.apache.struts2.config.Results;
import org.apache.struts2.dispatcher.ServletActionRedirectResult;
import org.apache.struts2.rest.DefaultHttpHeaders;
import org.apache.struts2.rest.HttpHeaders;
import com.opensymphony.xwork2.ModelDriven;
import com.opensymphony.xwork2.Validateable;
import com.opensymphony.xwork2.ValidationAwareSupport;
@Results({
@Result(name="success", type=ServletActionRedirectResult.class, value="orders")
})
public class OrdersController extends ValidationAwareSupport implements ModelDriven<Object>, Validateable{
private Order model = new Order();
private String id;
private Collection<Order> list;
private OrdersService ordersService = new OrdersService();
// GET /orders/1
public HttpHeaders show() {
return new DefaultHttpHeaders("show");
}
// GET /orders
public HttpHeaders index() {
list = ordersService.getAll();
return new DefaultHttpHeaders("index")
.disableCaching();
}
// GET /orders/1/edit
public String edit() {
return "edit";
}
// GET /orders/new
public String editNew() {
model = new Order();
return "editNew";
}
// GET /orders/1/deleteConfirm
public String deleteConfirm() {
return "deleteConfirm";
}
// DELETE /orders/1
public String destroy() {
ordersService.remove(id);
addActionMessage("Order removed successfully");
return "success";
}
// POST /orders
public HttpHeaders create() {
ordersService.save(model);
addActionMessage("New order created successfully");
return new DefaultHttpHeaders("success")
.setLocationId(model.getId());
}
// PUT /orders/1
public String update() {
ordersService.save(model);
addActionMessage("Order updated successfully");
return "success";
}
public void validate() {
if (model.getClientName() == null || model.getClientName().length() ==0) {
addFieldError("clientName", "The client name is empty");
}
}
public void setId(String id) {
if (id != null) {
this.model = ordersService.get(id);
}
this.id = id;
}
public Object getModel() {
return (list != null ? list : model);
}
}
@@ -0,0 +1,35 @@
package org.apache.struts2.rest.example;
import java.util.*;
public class OrdersService {
private static Map<String,Order> orders = new HashMap<String,Order>();
private static int nextId = 6;
static {
orders.put("3", new Order("3", "Bob", 33));
orders.put("4", new Order("4", "Sarah", 44));
orders.put("5", new Order("5", "Jim", 66));
}
public Order get(String id) {
return orders.get(id);
}
public List<Order> getAll() {
return new ArrayList<Order>(orders.values());
}
public void save(Order order) {
if (order.getId() == null) {
order.setId(String.valueOf(nextId++));
}
orders.put(order.getId(), order);
}
public void remove(String id) {
orders.remove(id);
}
}
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="starter" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Struts 2 Rest Example</display-name>
<!-- Filters -->
<!-- START SNIPPET: filter -->
<filter>
<filter-name>action2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
<init-param>
<param-name>actionPackages</param-name>
<param-value>org.apache.struts2.rest.example</param-value>
</init-param>
</filter>
<!-- END SNIPPET: filter -->
<filter-mapping>
<filter-name>action2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Welcome file lists -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
@@ -0,0 +1,2 @@
<% response.sendRedirect("orders"); %>
@@ -0,0 +1,23 @@
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Order ${id}</title>
</head>
<body>
<form action="../${id}?_method=DELETE" method="post">
<p>
Are you sure you want to delete order ${id}?
</p>
<div>
<input type="submit" value="Delete" />
<input type="button" value="Cancel" onclick="window.location.href = '../../orders'" />
</div>
</form>
<br />
<a href="../../orders">Back to Orders</a>
</body>
</html>
@@ -0,0 +1,27 @@
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@taglib prefix="s" uri="/struts-tags" %>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Order <s:property value="id" /></title>
</head>
<body>
<s:form method="post" action="%{#request.contextPath}/orders/%{id}">
<s:hidden name="_method" value="put" />
<table>
<s:textfield name="id" label="ID" disabled="true"/>
<s:textfield name="clientName" label="Client"/>
<s:textfield name="amount" label="Amount" />
<tr>
<td colspan="2">
<s:submit />
</td>
</table>
</s:form>
<a href="<%=request.getContextPath() %>/orders">Back to Orders</a>
</body>
</html>
@@ -0,0 +1,25 @@
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@taglib prefix="s" uri="/struts-tags" %>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>New Order</title>
</head>
<body>
<s:form method="post" action="%{#request.contextPath}/orders">
<table>
<s:textfield name="clientName" label="Client"/>
<s:textfield name="amount" label="Amount" />
<tr>
<td colspan="2">
<s:submit />
</td>
</table>
</s:form>
<a href="<%=request.getContextPath() %>/orders">Back to Orders</a>
</body>
</html>
@@ -0,0 +1,34 @@
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@taglib prefix="s" uri="/struts-tags" %>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Orders</title>
</head>
<body>
<s:actionmessage />
<table>
<tr>
<th>ID</th>
<th>Client</th>
<th>Amount</th>
<th>Actions</th>
</tr>
<s:iterator value="model">
<tr>
<td>${id}</td>
<td>${clientName}</td>
<td>${amount}</td>
<td><a href="orders/${id}">View</a> |
<a href="orders/${id}/edit">Edit</a> |
<a href="orders/${id}/deleteConfirm">Delete</a></td>
</tr>
</s:iterator>
</table>
<a href="orders/new">Create a new order</a>
</body>
</html>
@@ -0,0 +1,27 @@
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Order ${id}</title>
</head>
<body>
<table>
<tr>
<th>ID</th>
<td>${id}</td>
</tr>
<tr>
<th>Client</th>
<td>${clientName}</td>
</tr>
<tr>
<th>Amount</th>
<td>${amount}</td>
</tr>
</table>
<a href="../orders">Back to Orders</a>
</body>
</html>
+9 -9
View File
@@ -1,10 +1,10 @@
README.txt - showcase
Showcase is a collection of examples with code that you might be adopt and
adapt in your own applications.
For more on getting started with Struts, see
* http://cwiki.apache.org/WW/home.html
README.txt - showcase
Showcase is a collection of examples with code that you might be adopt and
adapt in your own applications.
For more on getting started with Struts, see
* http://cwiki.apache.org/WW/home.html
----------------------------------------------------------------------------
+28 -13
View File
@@ -21,13 +21,12 @@
* 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">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.1.0</version>
<version>2.1.2</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-showcase</artifactId>
@@ -35,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_2/apps/showcase</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_2/apps/showcase</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_2/apps/showcase</url>
</scm>
@@ -90,10 +89,16 @@
<version>${pom.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-dwr-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
<scope>runtime</scope>
</dependency>
@@ -118,27 +123,37 @@
<!-- Velocity -->
<dependency>
<groupId>velocity</groupId>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.4</version>
<version>1.5</version>
</dependency>
<dependency>
<groupId>velocity-tools</groupId>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
<version>1.1</version>
<version>1.3</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>struts</groupId>
<artifactId>struts</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>opensymphony</groupId>
<artifactId>sitemesh</artifactId>
<version>2.2.1</version>
<version>2.3</version>
</dependency>
<dependency>
<groupId>uk.ltd.getahead</groupId>
<artifactId>dwr</artifactId>
<version>1.1-beta-3</version>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
@@ -1,5 +1,5 @@
/*
* $Id: pom.xml 559206 2007-07-24 21:01:18Z apetrelli $
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -1,88 +1,88 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.showcase.action;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.opensymphony.xwork2.ActionSupport;
public class ExampleAction extends ActionSupport {
public static final String CONSTANT = "Struts Rocks!";
public static Date getCurrentDate() {
return new Date();
}
public String getName() {
return "John Galt";
}
public String[] getBands() {
return new String[] { "Pink Floyd", "Metallica", "Guns & Roses" };
}
public List<String> getMovies() {
return Arrays.asList("Lord of the Rings", "Matrix");
}
public Book getBook() {
return new Book("Iliad", "Homer");
}
public Map<String, Book> getBooks() {
Map<String, Book> books = new HashMap<String, Book>();
books.put("Iliad", new Book("Iliad", "Homer"));
books.put("The Republic", new Book("The Replublic", "Plato"));
books.put("Thus Spake Zarathustra", new Book("Thus Spake Zarathustra",
"Friedrich Nietzsche"));
return books;
}
}
class Book {
private String title;
private String author;
public Book(String title, String author) {
this.title = title;
this.author = author;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.showcase.action;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.opensymphony.xwork2.ActionSupport;
public class ExampleAction extends ActionSupport {
public static final String CONSTANT = "Struts Rocks!";
public static Date getCurrentDate() {
return new Date();
}
public String getName() {
return "John Galt";
}
public String[] getBands() {
return new String[] { "Pink Floyd", "Metallica", "Guns & Roses" };
}
public List<String> getMovies() {
return Arrays.asList("Lord of the Rings", "Matrix");
}
public Book getBook() {
return new Book("Iliad", "Homer");
}
public Map<String, Book> getBooks() {
Map<String, Book> books = new HashMap<String, Book>();
books.put("Iliad", new Book("Iliad", "Homer"));
books.put("The Republic", new Book("The Replublic", "Plato"));
books.put("Thus Spake Zarathustra", new Book("Thus Spake Zarathustra",
"Friedrich Nietzsche"));
return books;
}
}
class Book {
private String title;
private String author;
public Book(String title, String author) {
this.title = title;
this.author = author;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
}
@@ -1,77 +1,77 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.showcase.action;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.net.URL;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.interceptor.annotations.After;
/**
* Will only work on containers that unzip war files
*
*/
public class JSPEvalAction extends ExampleAction {
private String jsp;
private final static String FILE = "/interactive/demo.jsp";
public String execute() throws IOException {
if (jsp != null) {
//write it to file
URL url = ServletActionContext.getServletContext().getResource(FILE);
BufferedWriter writer = new BufferedWriter(new FileWriter(new File(url
.getFile())));
try {
//directive
writer.write("<%@ taglib prefix=\"s\" uri=\"/struts-tags\" %>");
writer.write(jsp);
} finally {
if (writer != null)
writer.close();
}
}
return Action.SUCCESS;
}
@After
public void cleanUp() throws IOException {
URL url = ServletActionContext.getServletContext().getResource(FILE);
FileOutputStream out = new FileOutputStream(new File(url.getFile()));
try {
out.getChannel().truncate(0);
} finally {
if (out != null)
out.close();
}
}
public void setJsp(String jsp) {
this.jsp = jsp;
}
}
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.showcase.action;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.net.URL;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.interceptor.annotations.After;
/**
* Will only work on containers that unzip war files
*
*/
public class JSPEvalAction extends ExampleAction {
private String jsp;
private final static String FILE = "/interactive/demo.jsp";
public String execute() throws IOException {
if (jsp != null) {
//write it to file
URL url = ServletActionContext.getServletContext().getResource(FILE);
BufferedWriter writer = new BufferedWriter(new FileWriter(new File(url
.getFile())));
try {
//directive
writer.write("<%@ taglib prefix=\"s\" uri=\"/struts-tags\" %>");
writer.write(jsp);
} finally {
if (writer != null)
writer.close();
}
}
return Action.SUCCESS;
}
@After
public void cleanUp() throws IOException {
URL url = ServletActionContext.getServletContext().getResource(FILE);
FileOutputStream out = new FileOutputStream(new File(url.getFile()));
try {
out.getChannel().truncate(0);
} finally {
if (out != null)
out.close();
}
}
public void setJsp(String jsp) {
this.jsp = jsp;
}
}
@@ -1,5 +1,5 @@
/*
* $Id: pom.xml 559206 2007-07-24 21:01:18Z apetrelli $
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -26,7 +26,7 @@ import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
/**
* Example to illustrate the <code>token</code> and <code>token-session</code> interceptor.
* Example to illustrate the <code>token</code> and <code>tokenSession</code> interceptor.
*
*/
public class TokenAction extends ActionSupport {
@@ -1,15 +1,15 @@
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="ognl" namespace="/nodecorate" extends="struts-default">
<action name="jspEval" class="org.apache.struts2.showcase.action.JSPEvalAction">
<interceptor-ref name="params"/>
<interceptor-ref name="debugging"/>
<interceptor-ref name="annotationWorkflow" />
<result>/interactive/demo.jsp</result>
</action>
<action name="example" class="org.apache.struts2.showcase.action.ExampleAction" />
</package>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="ognl" namespace="/nodecorate" extends="struts-default">
<action name="jspEval" class="org.apache.struts2.showcase.action.JSPEvalAction">
<interceptor-ref name="params"/>
<interceptor-ref name="debugging"/>
<interceptor-ref name="annotationWorkflow" />
<result>/interactive/demo.jsp</result>
</action>
<action name="example" class="org.apache.struts2.showcase.action.ExampleAction" />
</package>
</struts>
+63 -63
View File
@@ -1,63 +1,63 @@
[
["Alabama","AL"],
["Alaska","AK"],
["American Samoa","AS"],
["Arizona","AZ"],
["Arkansas","AR"],
["Armed Forces Europe","AE"],
["Armed Forces Pacific","AP"],
["Armed Forces the Americas","AA"],
["California","CA"],
["Colorado","CO"],
["Connecticut","CT"],
["Delaware","DE"],
["District of Columbia","DC"],
["Federated States of Micronesia","FM"],
["Florida","FL"],
["Georgia","GA"],
["Guam","GU"],
["Hawaii","HI"],
["Idaho","ID"],
["Illinois","IL"],
["Indiana","IN"],
["Iowa","IA"],
["Kansas","KS"],
["Kentucky","KY"],
["Louisiana","LA"],
["Maine","ME"],
["Marshall Islands","MH"],
["Maryland","MD"],
["Massachusetts","MA"],
["Michigan","MI"],
["Minnesota","MN"],
["Mississippi","MS"],
["Missouri","MO"],
["Montana","MT"],
["Nebraska","NE"],
["Nevada","NV"],
["New Hampshire","NH"],
["New Jersey","NJ"],
["New Mexico","NM"],
["New York","NY"],
["North Carolina","NC"],
["North Dakota","ND"],
["Northern Mariana Islands","MP"],
["Ohio","OH"],
["Oklahoma","OK"],
["Oregon","OR"],
["Pennsylvania","PA"],
["Puerto Rico","PR"],
["Rhode Island","RI"],
["South Carolina","SC"],
["South Dakota","SD"],
["Tennessee","TN"],
["Texas","TX"],
["Utah","UT"],
["Vermont","VT"],
["Virgin Islands, U.S.","VI"],
["Virginia","VA"],
["Washington","WA"],
["West Virginia","WV"],
["Wisconsin","WI"],
["Wyoming","WY"]
]
[
["Alabama","AL"],
["Alaska","AK"],
["American Samoa","AS"],
["Arizona","AZ"],
["Arkansas","AR"],
["Armed Forces Europe","AE"],
["Armed Forces Pacific","AP"],
["Armed Forces the Americas","AA"],
["California","CA"],
["Colorado","CO"],
["Connecticut","CT"],
["Delaware","DE"],
["District of Columbia","DC"],
["Federated States of Micronesia","FM"],
["Florida","FL"],
["Georgia","GA"],
["Guam","GU"],
["Hawaii","HI"],
["Idaho","ID"],
["Illinois","IL"],
["Indiana","IN"],
["Iowa","IA"],
["Kansas","KS"],
["Kentucky","KY"],
["Louisiana","LA"],
["Maine","ME"],
["Marshall Islands","MH"],
["Maryland","MD"],
["Massachusetts","MA"],
["Michigan","MI"],
["Minnesota","MN"],
["Mississippi","MS"],
["Missouri","MO"],
["Montana","MT"],
["Nebraska","NE"],
["Nevada","NV"],
["New Hampshire","NH"],
["New Jersey","NJ"],
["New Mexico","NM"],
["New York","NY"],
["North Carolina","NC"],
["North Dakota","ND"],
["Northern Mariana Islands","MP"],
["Ohio","OH"],
["Oklahoma","OK"],
["Oregon","OR"],
["Pennsylvania","PA"],
["Puerto Rico","PR"],
["Rhode Island","RI"],
["South Carolina","SC"],
["South Dakota","SD"],
["Tennessee","TN"],
["Texas","TX"],
["Utah","UT"],
["Vermont","VT"],
["Virgin Islands, U.S.","VI"],
["Virginia","VA"],
["Washington","WA"],
["West Virginia","WV"],
["Wisconsin","WI"],
["Wyoming","WY"]
]
@@ -62,7 +62,7 @@ Using a JSON list returned from an action (href="/JSONList.action"), without aut
Reload on type (loadOnTextChange="true"), after 3 characters (loadMinimumCount="3", it is "3" by default), without the down arrow button (showDownArrow="false")
<br/>
<sx:autocompleter
<sx:autocompleter
id="auto2"
indicator="indicator"
href="%{jsonList}"
@@ -78,6 +78,7 @@ Reload on type (loadOnTextChange="true"), after 3 characters (loadMinimumCount="
Using a JSON list returned from an action (href="/JSONList.action"), with autoComplete (autoComplete="true")
<br/>
<sx:autocompleter
name="auto3"
href="%{#jsonList}"
cssStyle="width: 200px;"
autoComplete="true" />
@@ -92,21 +93,33 @@ Using a local list (list="%{'apple','banana','grape','pear'}")
Force valid options (forceValidOption="true")
<br/>
<sx:autocompleter href="%{#jsonList}" cssStyle="width: 200px;" forceValidOption="true"/>
<sx:autocompleter
name="auto4"
href="%{#jsonList}"
cssStyle="width: 200px;"
forceValidOption="true"/>
<br/>
<br/>
Make dropdown's height to 180px (dropdownHeight="180")
<br/>
<sx:autocompleter href="%{#jsonList}" cssStyle="width: 200px;" dropdownHeight="180"/>
<sx:autocompleter
name="auto5"
href="%{#jsonList}"
cssStyle="width: 200px;"
dropdownHeight="180"/>
<br/>
<br/>
Disabled combobox (disabled="true")
<br/>
<sx:autocompleter href="%{#jsonList}" cssStyle="width: 200px;" disabled="true"/>
<sx:autocompleter
name="auto6"
href="%{#jsonList}"
cssStyle="width: 200px;"
disabled="true"/>
<br/>
<br/>
@@ -129,6 +142,7 @@ Link two autocompleter elements. When the selected value in 'Autocompleter 1' ch
</form>
Autocompleter 2
<sx:autocompleter
name="auto8"
href="%{#autoex}"
autoComplete="false"
formId="selectForm"
@@ -140,6 +154,7 @@ Autocompleter 2
Publish before/after/value notify topics
<br/>
<sx:autocompleter
name="auto9"
href="%{#jsonList}"
listenTopics="/reload"
beforeNotifyTopics="/before"
@@ -9,17 +9,17 @@
</head>
<script type="text/javascript">
dojo.event.topic.subscribe("/before", function(event, widget){
alert('inside a topic event. before request');
//event: set event.cancel = true, to cancel request
//widget: widget that published the topic
});
dojo.event.topic.subscribe("/after", function(data, request, widget){
alert('inside a topic event. after request');
//data : text returned from request
//request: XMLHttpRequest object
//widget: widget that published the topic
dojo.event.topic.subscribe("/before", function(event, widget){
alert('inside a topic event. before request');
//event: set event.cancel = true, to cancel request
//widget: widget that published the topic
});
dojo.event.topic.subscribe("/after", function(data, request, widget){
alert('inside a topic event. after request');
//data : text returned from request
//request: XMLHttpRequest object
//widget: widget that published the topic
});
</script>
@@ -30,7 +30,7 @@
<sx:div id="tab2" label="test2" disabled="true" >
Diabled Tab
</sx:div >
<sx:div id="tab3" label="test2" >
<sx:div id="tab3" label="test3" >
Some other Tab
</sx:div >
</sx:tabbedpanel>
@@ -1,5 +1,5 @@
/*
* $Id: Person.java 440597 2006-09-06 03:34:39Z tmjee $
* $Id$
*
* Copyright 2006 The Apache Software Foundation.
*
@@ -1,5 +1,5 @@
/*
* $Id: Person.java 440597 2006-09-06 03:34:39Z tmjee $
* $Id$
*
* Copyright 2006 The Apache Software Foundation.
*
@@ -1,5 +1,5 @@
/*
* $Id: Person.java 440597 2006-09-06 03:34:39Z tmjee $
* $Id$
*
* Copyright 2006 The Apache Software Foundation.
*
@@ -1,5 +1,5 @@
/*
* $Id: Person.java 440597 2006-09-06 03:34:39Z tmjee $
* $Id$
*
* Copyright 2006 The Apache Software Foundation.
*
@@ -1,5 +1,5 @@
/*
* $Id: Person.java 440597 2006-09-06 03:34:39Z tmjee $
* $Id$
*
* Copyright 2006 The Apache Software Foundation.
*
@@ -1,5 +1,5 @@
/*
* $Id: AbstractDao.java 394498 2006-04-16 15:28:06Z tmjee $
* $Id$
*
* Copyright 2006 The Apache Software Foundation.
*
@@ -1,5 +1,5 @@
/*
* $Id: AbstractDao.java 394498 2006-04-16 15:28:06Z tmjee $
* $Id$
*
* Copyright 2006 The Apache Software Foundation.
*
@@ -13,6 +13,7 @@
<head>
<title><s:property value="#title"/></title>
<s:head/>
<sx:head/>
</head>
<body>
@@ -1,25 +1,25 @@
<%@taglib prefix="s" uri="/struts-tags" %>
<%@taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Showcase - Fileupload</title>
</head>
<body>
<ul>
<li>
<s:url var="url" action="upload" namespace="/fileupload" />
<s:a href="%{#url}">Single File Upload</s:a>
</li>
<li>
<s:url var="url" action="multipleUploadUsingList" namespace="/fileupload" />
<s:a href="%{#url}">Multiple File Upload (List)</s:a>
</li>
<li>
<s:url var="url" action="multipleUploadUsingArray" namespace="/fileupload" />
<s:a href="%{#url}">Multiple File Upload (Array)</s:a>
</li>
</ul>
<ul>
<li>
<s:url var="url" action="upload" namespace="/fileupload" />
<s:a href="%{#url}">Single File Upload</s:a>
</li>
<li>
<s:url var="url" action="multipleUploadUsingList" namespace="/fileupload" />
<s:a href="%{#url}">Multiple File Upload (List)</s:a>
</li>
<li>
<s:url var="url" action="multipleUploadUsingArray" namespace="/fileupload" />
<s:a href="%{#url}">Multiple File Upload (Array)</s:a>
</li>
</ul>
</body>
</html>
@@ -1,37 +1,37 @@
<%@taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Insert title here</title>
</head>
<body>
<table border="1">
<s:iterator value="upload" status="stat">
<tr>
<td>File <s:property value="%{#stat.index}" /></td>
<td><s:property value="%{upload[#stat.index]}" /></td>
</tr>
</s:iterator>
</table>
<table border="1">
<s:iterator value="uploadFileName" status="stat">
<tr>
<td>File Name <s:property value="%{#stat.index}" /></td>
<td><s:property value="%{uploadFileName[#stat.index]}" /></td>
</tr>
</s:iterator>
</table>
<table border="1">
<s:iterator value="uploadContentType" status="stat">
<tr>
<td>Content Type <s:property value="%{#stat.index}" /></td>
<td><s:property value="%{uploadContentType[#stat.index]}" /></td>
</tr>
</s:iterator>
</table>
</body>
<%@taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Insert title here</title>
</head>
<body>
<table border="1">
<s:iterator value="upload" status="stat">
<tr>
<td>File <s:property value="%{#stat.index}" /></td>
<td><s:property value="%{upload[#stat.index]}" /></td>
</tr>
</s:iterator>
</table>
<table border="1">
<s:iterator value="uploadFileName" status="stat">
<tr>
<td>File Name <s:property value="%{#stat.index}" /></td>
<td><s:property value="%{uploadFileName[#stat.index]}" /></td>
</tr>
</s:iterator>
</table>
<table border="1">
<s:iterator value="uploadContentType" status="stat">
<tr>
<td>Content Type <s:property value="%{#stat.index}" /></td>
<td><s:property value="%{uploadContentType[#stat.index]}" /></td>
</tr>
</s:iterator>
</table>
</body>
</html>
@@ -1,20 +1,20 @@
<%@ page
language="java"
contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Showcase - fileupload - multiple fileupload using List</title>
</head>
<body>
<s:form action="doMultipleUploadUsingArray" method="POST" enctype="multipart/form-data">
<s:file label="File (1)" name="upload" />
<s:file label="File (2)" name="upload" />
<s:file label="FIle (3)" name="upload" />
<s:submit />
</s:form>
</body>
<%@ page
language="java"
contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Showcase - fileupload - multiple fileupload using List</title>
</head>
<body>
<s:form action="doMultipleUploadUsingArray" method="POST" enctype="multipart/form-data">
<s:file label="File (1)" name="upload" />
<s:file label="File (2)" name="upload" />
<s:file label="FIle (3)" name="upload" />
<s:submit />
</s:form>
</body>
</html>
@@ -1,37 +1,37 @@
<%@taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Insert title here</title>
</head>
<body>
<table border="1">
<s:iterator value="upload" status="stat">
<tr>
<td>File <s:property value="%{#stat.index}" /></td>
<td><s:property value="%{upload[#stat.index]}" /></td>
</tr>
</s:iterator>
</table>
<table border="1">
<s:iterator value="uploadFileName" status="stat">
<tr>
<td>File Name <s:property value="%{#stat.index}" /></td>
<td><s:property value="%{uploadFileName[#stat.index]}" /></td>
</tr>
</s:iterator>
</table>
<table border="1">
<s:iterator value="uploadContentType" status="stat">
<tr>
<td>Content Type <s:property value="%{#stat.index}" /></td>
<td><s:property value="%{uploadContentType[#stat.index]}" /></td>
</tr>
</s:iterator>
</table>
</body>
<%@taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Insert title here</title>
</head>
<body>
<table border="1">
<s:iterator value="upload" status="stat">
<tr>
<td>File <s:property value="%{#stat.index}" /></td>
<td><s:property value="%{upload[#stat.index]}" /></td>
</tr>
</s:iterator>
</table>
<table border="1">
<s:iterator value="uploadFileName" status="stat">
<tr>
<td>File Name <s:property value="%{#stat.index}" /></td>
<td><s:property value="%{uploadFileName[#stat.index]}" /></td>
</tr>
</s:iterator>
</table>
<table border="1">
<s:iterator value="uploadContentType" status="stat">
<tr>
<td>Content Type <s:property value="%{#stat.index}" /></td>
<td><s:property value="%{uploadContentType[#stat.index]}" /></td>
</tr>
</s:iterator>
</table>
</body>
</html>
@@ -1,20 +1,20 @@
<%@ page
language="java"
contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page
language="java"
contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Showcase - fileupload - multiple fileupload using List</title>
</head>
<body>
<s:form action="doMultipleUploadUsingList" method="POST" enctype="multipart/form-data">
<s:file label="File (1)" name="upload" />
<s:file label="File (2)" name="upload" />
<s:file label="FIle (3)" name="upload" />
<s:submit />
</s:form>
<s:form action="doMultipleUploadUsingList" method="POST" enctype="multipart/form-data">
<s:file label="File (1)" name="upload" />
<s:file label="File (2)" name="upload" />
<s:file label="FIle (3)" name="upload" />
<s:submit />
</s:form>
</body>
</html>
@@ -1,76 +1,76 @@
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<pre style="font-style: normal;">
<span class="kw">package</span> org.apache.struts2.showcase.action;
<span class="kw">import</span> java.util.Arrays;
<span class="kw">import</span> java.util.Date;
<span class="kw">import</span> java.util.HashMap;
<span class="kw">import</span> java.util.List;
<span class="kw">import</span> java.util.Map;
<span class="kw">import</span> com.opensymphony.xwork2.ActionSupport;
<span class="kw">public class</span> ExampleAction <span class="kw">extends</span> ActionSupport {
<span class="kw">public static final</span> String CONSTANT = "Struts Rocks!";
<span class="kw">public static</span> Date getCurrentDate() {
return new Date();
}
<span class="kw">public</span> String getName() {
return "John Galt";
}
<span class="kw">public</span> String[] getBands() {
return new String[] { "Pink Floyd", "Metallica", "Guns & Roses" };
}
<span class="kw">public</span> List&lt;String&gt; getMovies() {
return Arrays.asList("Lord of the Rings", "Matrix");
}
<span class="kw">public</span> Book getBook() {
<span class="kw">return</span> new Book("Iliad", "Homer");
}
<span class="kw">public</span> Map&lt;String, Book&gt; getBooks() {
Map&lt;String, Book&gt; books = new HashMap&lt;String, Book&gt;();
books.put("Iliad", new Book("Iliad", "Homer"));
books.put("The Republic", new Book("The Replublic", "Plato"));
books.put("Thus Spake Zarathustra", new Book("Thus Spake Zarathustra",
"Friedrich Nietzsche"));
return books;
}
}
<span class="kw">class</span> Book {
<span class="kw">private</span> String title;
<span class="kw">private</span> String author;
<span class="kw">public</span> Book(String title, String author) {
this.title = title;
this.author = author;
}
<span class="kw">public</span> String getTitle() {
<span class="kw">return</span> title;
}
<span class="kw">public void</span> setTitle(String title) {
this.title = title;
}
<span class="kw">public</span> String getAuthor() {
return author;
}
<span class="kw">public void</span> setAuthor(String author) {
this.author = author;
}
}
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<pre style="font-style: normal;">
<span class="kw">package</span> org.apache.struts2.showcase.action;
<span class="kw">import</span> java.util.Arrays;
<span class="kw">import</span> java.util.Date;
<span class="kw">import</span> java.util.HashMap;
<span class="kw">import</span> java.util.List;
<span class="kw">import</span> java.util.Map;
<span class="kw">import</span> com.opensymphony.xwork2.ActionSupport;
<span class="kw">public class</span> ExampleAction <span class="kw">extends</span> ActionSupport {
<span class="kw">public static final</span> String CONSTANT = "Struts Rocks!";
<span class="kw">public static</span> Date getCurrentDate() {
return new Date();
}
<span class="kw">public</span> String getName() {
return "John Galt";
}
<span class="kw">public</span> String[] getBands() {
return new String[] { "Pink Floyd", "Metallica", "Guns & Roses" };
}
<span class="kw">public</span> List&lt;String&gt; getMovies() {
return Arrays.asList("Lord of the Rings", "Matrix");
}
<span class="kw">public</span> Book getBook() {
<span class="kw">return</span> new Book("Iliad", "Homer");
}
<span class="kw">public</span> Map&lt;String, Book&gt; getBooks() {
Map&lt;String, Book&gt; books = new HashMap&lt;String, Book&gt;();
books.put("Iliad", new Book("Iliad", "Homer"));
books.put("The Republic", new Book("The Replublic", "Plato"));
books.put("Thus Spake Zarathustra", new Book("Thus Spake Zarathustra",
"Friedrich Nietzsche"));
return books;
}
}
<span class="kw">class</span> Book {
<span class="kw">private</span> String title;
<span class="kw">private</span> String author;
<span class="kw">public</span> Book(String title, String author) {
this.title = title;
this.author = author;
}
<span class="kw">public</span> String getTitle() {
<span class="kw">return</span> title;
}
<span class="kw">public void</span> setTitle(String title) {
this.title = title;
}
<span class="kw">public</span> String getAuthor() {
return author;
}
<span class="kw">public void</span> setAuthor(String author) {
this.author = author;
}
}
</pre>
@@ -1,247 +1,247 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<html>
<head>
<title>OGNL and tags demo</title>
<s:url var="struts" value="/struts" includeParams="none"/>
<s:url var="jspEval" action="jspEval" namespace="/nodecorate" includeParams="none"/>
<s:url var="viewClass" value="/interactive/example-action.jsp" includeParams="none"/>
<s:url var="ognlBase" value="/interactive/ognl_" includeParams="none"/>
<s:url var="jspBase" value="/interactive/jsp_" includeParams="none"/>
<script src="${struts}/webconsole.js"></script>
<sx:head/>
<script>
var index = -1;
var runningOgnl = true;
var ognlBase = "${ognlBase}";
var jspBase = "${jspBase}";
var ognlCount = 10;
var jspCount = 5;
dojo.addOnLoad(function() {
var classSrc = dojo.byId("classSrc");
dojo.io.updateNode(classSrc, "${viewClass}");
dojo.html.hide("previous");
dojo.html.hide("next");
});
dojo.event.topic.subscribe("/reloadGuide", function() {
next();
});
function startOgnl() {
selectOGNLTab();
index = -1;
runningOgnl = true;
change(1);
updateNavigation();
}
function startJSP() {
selectJSPTab();
index = -1;
runningOgnl = false;
change(1);
updateNavigation();
}
function execOgnl(id) {
var exp = dojo.string.trim(dojo.byId(id ? id : "example").innerHTML);
dojo.byId("wc-command").value = exp;
keyEvent({keyCode : 13}, '${jspEval}');
}
function execJSP(id) {
var exp = dojo.string.trim(dojo.byId(id ? id : "example").innerHTML);
dojo.byId("jsp").value = unscape(exp);
dojo.event.topic.publish("/evalJSP")
}
function unscape(str) {
return str.replace(/&amp;/gm, "&").replace(/&lt;/gm, "<").replace(/&gt;/gm, ">").replace(/&quot;/gm, '"');
}
function selectClassSrcTab() {
dojo.widget.byId("mainTabContainer").selectTab("classTab");
}
function selectJSPTab() {
dojo.widget.byId("mainTabContainer").selectTab("jspTab");
}
function selectOGNLTab() {
dojo.widget.byId("mainTabContainer").selectTab("ognlTab");
}
function change(delta) {
index+=delta;
var url = (runningOgnl ? ognlBase : jspBase) + index + ".jsp";
var bind = dojo.widget.byId("guideBind");
bind.href = url;
dojo.event.topic.publish("/loadContent");
updateNavigation();
}
function updateNavigation() {
if(index <= 0) {
dojo.html.hide("previous");
} else {
dojo.html.show("previous");
}
var top = runningOgnl ? ognlCount : jspCount;
if(index == top - 1) {
dojo.html.hide("next");
} else {
dojo.html.show("next");
}
}
</script>
<style type="">
.wc-results {
overflow: auto;
margin: 0px;
padding: 5px;
font-family: courier;
color: white;
background-color: black;
height: 200px;
}
.wc-results pre {
display: inline;
}
.wc-command {
margin: 1px 0 0 0;
border-style: none;
font-family: courier;
color: white;
background-color: black;
width: 100%;
padding: 0px;
}
.shell {
width: 100%;
}
.jsp {
border-style: solid;
width: 100%;
height: 200px;
}
.jspResult {
border-style: none;
width: 100%;
height: 200px;
padding: 5px;
}
.jspResultHeader {
background-color: #818EBD;
color: white;
width: 100%;
height: 15px;
}
.jspResultHeader span {
padding: 5px;
}
.classSrc {
font-family:Courier;
font-size:11px;
line-height:13px;
overflow: auto;
height: 400px;
width: 100%;
}
.tabContainer {
width: 1000px;
margin: 0 auto;
}
.guideContainer {
width: 600px;
border-width: 1px;
border-style: solid;
margin: 0 auto;
}
.guide {
padding: 5px;
}
pre {
font-family:Verdana,Geneva,Arial,Helvetica,sans-serif;
font-style: italic;
}
span.kw {
color: rgb(127, 0, 85);
font-weight: bold;;
}
</style>
</head>
<sx:bind id="guideBind" targets="guide" listenTopics="/loadContent"/>
<body>
<sx:tabbedpanel id="mainTabContainer" cssClass="tabContainer">
<sx:div label="OGNL Console" id="ognlTab">
<div id="shell" class="shell">
<form onsubmit="return false" id="wc-form">
<div class="wc-results" id="wc-result">
Welcome to the OGNL console!
<br />
:-&gt;
</div>
<input type="hidden" name="debug" value="command" />
OGNL Expression <input name="expression" onkeyup="keyEvent(event, '${jspEval}')" class="wc-command" id="wc-command" type="text" />
</form>
</div>
</sx:div>
<sx:div label="JSP Console" id="jspTab">
<table style="width: 100%" cellpadding="1">
<tr valign="top">
<td width="50%">
<form theme="simple" namespace="/nodecorate" action="jspEval" method="post">
<s:textarea cssClass="jsp" theme="simple" name="jsp" />
<sx:submit
value="Eval JSP Fragment"
href="%{#jspEval}"
targets="jspResult"
listenTopics="/evalJSP"/>
</form>
</td>
<td width="50%">
<div class="jspResultHeader">
<span>JSP Eval Result</span>
</div>
<div id="jspResult" class="jspResult">
</div>
</td>
</tr>
</table>
</sx:div>
<sx:div label="Class on top of the Value Stack" id="classTab">
<div id="classSrc" class="classSrc">
</div>
</sx:div>
</sx:tabbedpanel>
<br/><br/>
<div class="guideContainer">
<div class="jspResultHeader">
<span>Interactive Guide</span>
</div>
<sx:div id="guide" listenTopics="/reloadGuide" cssClass="guide">
<p><a href="#" onclick="startOgnl()">Start OGNL Interactive Demo</a></p>
<p><a href="#" onclick="startJSP()">Start JSP Interactive Demo</a></p>
</sx:div>
<div>
<a href="#" id="previous" onclick="change(-1)" style="float: left"><< Previous</a>
<a href="#" id="next" onclick="change(1)" style="float: right">Next >></a>
</div>
</div>
</body>
</html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<html>
<head>
<title>OGNL and tags demo</title>
<s:url var="struts" value="/struts" includeParams="none"/>
<s:url var="jspEval" action="jspEval" namespace="/nodecorate" includeParams="none"/>
<s:url var="viewClass" value="/interactive/example-action.jsp" includeParams="none"/>
<s:url var="ognlBase" value="/interactive/ognl_" includeParams="none"/>
<s:url var="jspBase" value="/interactive/jsp_" includeParams="none"/>
<script src="${struts}/webconsole.js"></script>
<sx:head/>
<script>
var index = -1;
var runningOgnl = true;
var ognlBase = "${ognlBase}";
var jspBase = "${jspBase}";
var ognlCount = 9;
var jspCount = 5;
dojo.addOnLoad(function() {
var classSrc = dojo.byId("classSrc");
dojo.io.updateNode(classSrc, "${viewClass}");
dojo.html.hide("previous");
dojo.html.hide("next");
});
dojo.event.topic.subscribe("/reloadGuide", function() {
next();
});
function startOgnl() {
selectOGNLTab();
index = -1;
runningOgnl = true;
change(1);
updateNavigation();
}
function startJSP() {
selectJSPTab();
index = -1;
runningOgnl = false;
change(1);
updateNavigation();
}
function execOgnl(id) {
var exp = dojo.string.trim(dojo.byId(id ? id : "example").innerHTML);
dojo.byId("wc-command").value = exp;
keyEvent({keyCode : 13}, '${jspEval}');
}
function execJSP(id) {
var exp = dojo.string.trim(dojo.byId(id ? id : "example").innerHTML);
dojo.byId("jsp").value = unscape(exp);
dojo.event.topic.publish("/evalJSP")
}
function unscape(str) {
return str.replace(/&amp;/gm, "&").replace(/&lt;/gm, "<").replace(/&gt;/gm, ">").replace(/&quot;/gm, '"');
}
function selectClassSrcTab() {
dojo.widget.byId("mainTabContainer").selectTab("classTab");
}
function selectJSPTab() {
dojo.widget.byId("mainTabContainer").selectTab("jspTab");
}
function selectOGNLTab() {
dojo.widget.byId("mainTabContainer").selectTab("ognlTab");
}
function change(delta) {
index+=delta;
var url = (runningOgnl ? ognlBase : jspBase) + index + ".jsp";
var bind = dojo.widget.byId("guideBind");
bind.href = url;
dojo.event.topic.publish("/loadContent");
updateNavigation();
}
function updateNavigation() {
if(index <= 0) {
dojo.html.hide("previous");
} else {
dojo.html.show("previous");
}
var top = runningOgnl ? ognlCount : jspCount;
if(index == top - 1) {
dojo.html.hide("next");
} else {
dojo.html.show("next");
}
}
</script>
<style type="">
.wc-results {
overflow: auto;
margin: 0px;
padding: 5px;
font-family: courier;
color: white;
background-color: black;
height: 200px;
}
.wc-results pre {
display: inline;
}
.wc-command {
margin: 1px 0 0 0;
border-style: none;
font-family: courier;
color: white;
background-color: black;
width: 100%;
padding: 0px;
}
.shell {
width: 100%;
}
.jsp {
border-style: solid;
width: 100%;
height: 200px;
}
.jspResult {
border-style: none;
width: 100%;
height: 200px;
padding: 5px;
}
.jspResultHeader {
background-color: #818EBD;
color: white;
width: 100%;
height: 15px;
}
.jspResultHeader span {
padding: 5px;
}
.classSrc {
font-family:Courier;
font-size:11px;
line-height:13px;
overflow: auto;
height: 400px;
width: 100%;
}
.tabContainer {
width: 1000px;
margin: 0 auto;
}
.guideContainer {
width: 600px;
border-width: 1px;
border-style: solid;
margin: 0 auto;
}
.guide {
padding: 5px;
}
pre {
font-family:Verdana,Geneva,Arial,Helvetica,sans-serif;
font-style: italic;
}
span.kw {
color: rgb(127, 0, 85);
font-weight: bold;;
}
</style>
</head>
<sx:bind id="guideBind" targets="guide" listenTopics="/loadContent"/>
<body>
<sx:tabbedpanel id="mainTabContainer" cssClass="tabContainer">
<sx:div label="OGNL Console" id="ognlTab">
<div id="shell" class="shell">
<form onsubmit="return false" id="wc-form">
<div class="wc-results" id="wc-result">
Welcome to the OGNL console!
<br />
:-&gt;
</div>
<input type="hidden" name="debug" value="command" />
OGNL Expression <input name="expression" onkeyup="keyEvent(event, '${jspEval}')" class="wc-command" id="wc-command" type="text" />
</form>
</div>
</sx:div>
<sx:div label="JSP Console" id="jspTab">
<table style="width: 100%" cellpadding="1">
<tr valign="top">
<td width="50%">
<form theme="simple" namespace="/nodecorate" action="jspEval" method="post">
<s:textarea cssClass="jsp" theme="simple" name="jsp" />
<sx:submit
value="Eval JSP Fragment"
href="%{#jspEval}"
targets="jspResult"
listenTopics="/evalJSP"/>
</form>
</td>
<td width="50%">
<div class="jspResultHeader">
<span>JSP Eval Result</span>
</div>
<div id="jspResult" class="jspResult">
</div>
</td>
</tr>
</table>
</sx:div>
<sx:div label="Class on top of the Value Stack" id="classTab">
<div id="classSrc" class="classSrc">
</div>
</sx:div>
</sx:tabbedpanel>
<br/><br/>
<div class="guideContainer">
<div class="jspResultHeader">
<span>Interactive Guide</span>
</div>
<sx:div id="guide" listenTopics="/reloadGuide" cssClass="guide">
<p><a href="#" onclick="startOgnl()">Start OGNL Interactive Demo</a></p>
<p><a href="#" onclick="startJSP()">Start JSP Interactive Demo</a></p>
</sx:div>
<div>
<a href="#" id="previous" onclick="change(-1)" style="float: left"><< Previous</a>
<a href="#" id="next" onclick="change(1)" style="float: right">Next >></a>
</div>
</div>
</body>
</html>
@@ -1,62 +1,62 @@
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b>String Attributes</b>
</p>
<p>
Some tag attributes are expected to be Strings in which case String literals
can be passed as the value, like the <i>href</i> attribute in the <i>a</i> tag.
</p>
<p>
<i>
&lt;s:a href=&quot;http://struts.apache.org/&quot; /&gt;
</i>
</p>
<p>
If the value that you want to use in one of these string literal attributes is stored on the Value Stack,
then the <i>%{#name}</i> syntax (alternative syntax) needs to be used. Assuming there is a value
with the name "url" stored on the stack:
</p>
<p>
<i>
&lt;s:a href=&quot;%{#url}&quot; /&gt;
</i>
</p>
<p>
will create an anchor and use the value of "url" for the <i>href</i> attribute.
</p>
<p>
<b>Value Attributes</b>
</p>
<p>
Other attributes expect an object as their value(not an string literal). In these attributes you can specify
the name of a variable stored on the Value Stack, and the tag will look it up and use it. Like the
<i>value</i> attribute in the <i>property</i> tag. Assuming there is an object stored on the Value Stack with
the name "movie", then:
</p>
<p>
<i>
&lt;s:property value=&quot;movie&quot; /&gt;
</i>
</p>
<p>
will print the value to the page. To pass an String literal to an attribute that expects a value use the <i>%{'string'}</i>
notation.
</p>
<p>
If you don't remember if an attribute expects an string literal or a value, you can always use the <i>%{value}</i> notation:
</p>
<p>
<i>
&lt;s:a href=&quot;%{'http://struts.apache.org/'}&quot; /&gt;
<br />
&lt;s:property value=&quot;%{#movie}&quot; /&gt;
</i>
</p>
<p>
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/tag-syntax.html')">[More details]</a>
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b>String Attributes</b>
</p>
<p>
Some tag attributes are expected to be Strings in which case String literals
can be passed as the value, like the <i>href</i> attribute in the <i>a</i> tag.
</p>
<p>
<i>
&lt;s:a href=&quot;http://struts.apache.org/&quot; /&gt;
</i>
</p>
<p>
If the value that you want to use in one of these string literal attributes is stored on the Value Stack,
then the <i>%{#name}</i> syntax (alternative syntax) needs to be used. Assuming there is a value
with the name "url" stored on the stack:
</p>
<p>
<i>
&lt;s:a href=&quot;%{#url}&quot; /&gt;
</i>
</p>
<p>
will create an anchor and use the value of "url" for the <i>href</i> attribute.
</p>
<p>
<b>Value Attributes</b>
</p>
<p>
Other attributes expect an object as their value(not an string literal). In these attributes you can specify
the name of a variable stored on the Value Stack, and the tag will look it up and use it. Like the
<i>value</i> attribute in the <i>property</i> tag. Assuming there is an object stored on the Value Stack with
the name "movie", then:
</p>
<p>
<i>
&lt;s:property value=&quot;movie&quot; /&gt;
</i>
</p>
<p>
will print the value to the page. To pass an String literal to an attribute that expects a value use the <i>%{'string'}</i>
notation.
</p>
<p>
If you don't remember if an attribute expects an string literal or a value, you can always use the <i>%{value}</i> notation:
</p>
<p>
<i>
&lt;s:a href=&quot;%{'http://struts.apache.org/'}&quot; /&gt;
<br />
&lt;s:property value=&quot;%{#movie}&quot; /&gt;
</i>
</p>
<p>
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/tag-syntax.html')">[More details]</a>
</p>
@@ -1,52 +1,52 @@
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b>Print property value, using the <i>property tag</i></b>
</p>
<p>
On the OGNL demo you learned how to access values from the Value Stack using OGNL expressions.
The <i>property</i> tag is used to print to the page the result of an OGNL expression. The expression
is specified in the <i>value</i> attribute.
</p>
<p>To print the value of the expression <i>name</i> to the page type:
<p>
<i id="example0">
&lt;s:property value=&quot;name&quot; /&gt;
</i>
</p>
<p>
on the JSP console and hit enter. <a href="#" onclick="execJSP('example0')">Do it for me</a>
</p>
<p>
As you saw in the OGNL demo, to print a property of an object that is not on top of the stack,
use the <i>#object.property</i> notation.
</p>
<p>To print the value for the key "struts.view_uri" in <i>request</i> to the page type:
<p>
<i id="example1">
&lt;s:property value=&quot;#request['struts.view_uri']&quot; /&gt;
</i>
</p>
<p>
on the JSP console and hit enter. <a href="#" onclick="execJSP('example1')">Do it for me</a>
</p>
<p>
<b>Print property value, using the <i>$</i> operator</b>
</p>
<p>Use the <i>${name}</i> notation to print values from the Value Stack to the page.
<p>To print the value of the expression <i>name</i> to the page type:
<p>
<i id="example2">
&#36;{name}
</i>
</p>
<p>
on the JSP console and hit enter. <a href="#" onclick="execJSP('example2')">Do it for me</a>
</p>
<p>
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/property.html')">[More details]</a>
</p>
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b>Print property value, using the <i>property tag</i></b>
</p>
<p>
On the OGNL demo you learned how to access values from the Value Stack using OGNL expressions.
The <i>property</i> tag is used to print to the page the result of an OGNL expression. The expression
is specified in the <i>value</i> attribute.
</p>
<p>To print the value of the expression <i>name</i> to the page type:
<p>
<i id="example0">
&lt;s:property value=&quot;name&quot; /&gt;
</i>
</p>
<p>
on the JSP console and hit enter. <a href="#" onclick="execJSP('example0')">Do it for me</a>
</p>
<p>
As you saw in the OGNL demo, to print a property of an object that is not on top of the stack,
use the <i>#object.property</i> notation.
</p>
<p>To print the value for the key "struts.view_uri" in <i>request</i> to the page type:
<p>
<i id="example1">
&lt;s:property value=&quot;#request['struts.view_uri']&quot; /&gt;
</i>
</p>
<p>
on the JSP console and hit enter. <a href="#" onclick="execJSP('example1')">Do it for me</a>
</p>
<p>
<b>Print property value, using the <i>$</i> operator</b>
</p>
<p>Use the <i>${name}</i> notation to print values from the Value Stack to the page.
<p>To print the value of the expression <i>name</i> to the page type:
<p>
<i id="example2">
&#36;{name}
</i>
</p>
<p>
on the JSP console and hit enter. <a href="#" onclick="execJSP('example2')">Do it for me</a>
</p>
<p>
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/property.html')">[More details]</a>
</p>
@@ -1,54 +1,54 @@
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b><i>if</i> tag</b>
</p>
<p>
The <i>if</i> tag allows you to optionally execute a JSP section. Multiple <i>elseif</i> tags
and one <i>else</i> tag can be associated to an <i>if tag</i>.
</p>
<p>
To say hello to John Galt type:
</p>
<p>
<pre id="example0">
&lt;s:if test="name == 'John Galt'"&gt;
Hi John
&lt;/s:if&gt;
&lt;s:else&gt;
I don't know you!
&lt;/s:else&gt;
</pre>
</p>
<p>
on the JSP console and hit enter. <a href="#" onclick="execJSP('example0')">Do it for me</a>
</p>
<p>
<b><i>iterator</i> tag</b>
</p>
<p>
The <i>iterator</i> tag loops over an <i>Iterable</i> object one object at a time into
the Value Stack (the value will be on top of the stack).
</p>
<p>
To print the all the elements in the "bands" property type:
</p>
<p>
<pre id="example1">
&lt;s:iterator value="bands"&gt;
&lt;s:property /&gt;
&lt;br /&gt;
&lt;/s:iterator&gt;
</pre>
</p>
<p>
on the JSP console and hit enter. <a href="#" onclick="execJSP('example1')">Do it for me</a>
</p>
<p>
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/property.html')">[More on the <i>if</i> tag]</a>
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/iterator.html')">[More on the <i>iterator</i> tag]</a>
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b><i>if</i> tag</b>
</p>
<p>
The <i>if</i> tag allows you to optionally execute a JSP section. Multiple <i>elseif</i> tags
and one <i>else</i> tag can be associated to an <i>if tag</i>.
</p>
<p>
To say hello to John Galt type:
</p>
<p>
<pre id="example0">
&lt;s:if test="name == 'John Galt'"&gt;
Hi John
&lt;/s:if&gt;
&lt;s:else&gt;
I don't know you!
&lt;/s:else&gt;
</pre>
</p>
<p>
on the JSP console and hit enter. <a href="#" onclick="execJSP('example0')">Do it for me</a>
</p>
<p>
<b><i>iterator</i> tag</b>
</p>
<p>
The <i>iterator</i> tag loops over an <i>Iterable</i> object one object at a time into
the Value Stack (the value will be on top of the stack).
</p>
<p>
To print the all the elements in the "bands" property type:
</p>
<p>
<pre id="example1">
&lt;s:iterator value="bands"&gt;
&lt;s:property /&gt;
&lt;br /&gt;
&lt;/s:iterator&gt;
</pre>
</p>
<p>
on the JSP console and hit enter. <a href="#" onclick="execJSP('example1')">Do it for me</a>
</p>
<p>
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/property.html')">[More on the <i>if</i> tag]</a>
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/iterator.html')">[More on the <i>iterator</i> tag]</a>
</p>
@@ -1,65 +1,65 @@
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b><i>set</i> tag</b>
</p>
<p>
The <i>set</i> tag sets the variable with the name specified in the <i>name</i> attribute to
the value specified in the <i>value</i> attribute in the scope
entered in the <i>scope</i> attribute. The available scopes are:
<ul>
<li>application - application scope according to servlet spec</li>
<li>session - session scope according to servlet spec</li>
<li>request - request scope according to servlet spec</li>
<li>page - page scope according to servlet sepc</li>
<li>action - the value will be set in the request scope and Struts' action context</li>
</ul>
</p>
<p>
This example sets <i>favouriteBand</i> in the request scope to the first element of the <i>bands</i> property:
</p>
<p>
<pre id="example0">
&lt;s:set name="favouriteBand" value="bands[0]" /&gt;
&lt;s:property value="#favouriteBand" /&gt;
</pre>
</p>
<p>
<a href="#" onclick="execJSP('example0')">Do it for me</a>
</p>
<p>
<b><i>url</i> tag</b>
</p>
<p>
The <i>url</i> tag is used to build urls (who would have guessed!). To build an url mapping to
an action, set the <i>namespace</i> and <i>action</i> attributes. The url will be stored under
the name specified in the <i>id</i> attribute. <b>url tag uses the <i>id</i> attribute while
the <i>set</i> tag uses name</b>. To specify a value (no action lookup), just use the <i>value</i>
attribute. <i>param</i> tags can be nested inside the <i>url</i> tag to add parameters to the url.
</p>
<p>
First link creates a url that maps to an action, second one creates a url to google, passing one parameter:
</p>
<p>
<pre id="example1">
&lt;s:url id="evalAction" namespace="/nodecorate" action="jspEval" /&gt;
&lt;s:a href="%{#evalAction}" &gt;Eval&lt;/s:a&gt;
&lt;s:url id="google" value="http://www.google.com" &gt;
&lt;s:param name="q" value="%{'Struts 2'}" /&gt;
&lt;/s:url&gt;
&lt;s:a href="%{#google}" &gt;Eval&lt;/s:a&gt;
</pre>
</p>
<p>
<a href="#" onclick="execJSP('example1')">Do it for me</a>
</p>
<p>
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/set.html')">[More on the <i>set</i> tag]</a>
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/url.html')">[More on the <i>url</i> tag]</a>
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b><i>set</i> tag</b>
</p>
<p>
The <i>set</i> tag sets the variable with the name specified in the <i>name</i> attribute to
the value specified in the <i>value</i> attribute in the scope
entered in the <i>scope</i> attribute. The available scopes are:
<ul>
<li>application - application scope according to servlet spec</li>
<li>session - session scope according to servlet spec</li>
<li>request - request scope according to servlet spec</li>
<li>page - page scope according to servlet sepc</li>
<li>action - the value will be set in the request scope and Struts' action context</li>
</ul>
</p>
<p>
This example sets <i>favouriteBand</i> in the request scope to the first element of the <i>bands</i> property:
</p>
<p>
<pre id="example0">
&lt;s:set name="favouriteBand" value="bands[0]" /&gt;
&lt;s:property value="#favouriteBand" /&gt;
</pre>
</p>
<p>
<a href="#" onclick="execJSP('example0')">Do it for me</a>
</p>
<p>
<b><i>url</i> tag</b>
</p>
<p>
The <i>url</i> tag is used to build urls (who would have guessed!). To build an url mapping to
an action, set the <i>namespace</i> and <i>action</i> attributes. The url will be stored under
the name specified in the <i>id</i> attribute. <b>url tag uses the <i>id</i> attribute while
the <i>set</i> tag uses name</b>. To specify a value (no action lookup), just use the <i>value</i>
attribute. <i>param</i> tags can be nested inside the <i>url</i> tag to add parameters to the url.
</p>
<p>
First link creates a url that maps to an action, second one creates a url to google, passing one parameter:
</p>
<p>
<pre id="example1">
&lt;s:url id="evalAction" namespace="/nodecorate" action="jspEval" /&gt;
&lt;s:a href="%{#evalAction}" &gt;Eval&lt;/s:a&gt;
&lt;s:url id="google" value="http://www.google.com" &gt;
&lt;s:param name="q" value="%{'Struts 2'}" /&gt;
&lt;/s:url&gt;
&lt;s:a href="%{#google}" &gt;Eval&lt;/s:a&gt;
</pre>
</p>
<p>
<a href="#" onclick="execJSP('example1')">Do it for me</a>
</p>
<p>
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/set.html')">[More on the <i>set</i> tag]</a>
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/url.html')">[More on the <i>url</i> tag]</a>
</p>
@@ -1,16 +1,16 @@
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b>More on JSP tags</b>
</p>
<p>
Struts 2 provides many more tags which you can learn about
<a href="#" onclick="window.open('http://cwiki.apache.org/confluence/display/WW/Tag+Reference')">here</a>
</p>
<br/>
You can keep playing with the JSP console or
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b>More on JSP tags</b>
</p>
<p>
Struts 2 provides many more tags which you can learn about
<a href="#" onclick="window.open('http://cwiki.apache.org/confluence/display/WW/Tag+Reference')">here</a>
</p>
<br/>
You can keep playing with the JSP console or
<a href="#" onclick="startOgnl()">Start OGNL Interactive Demo</a>
@@ -1,30 +1,30 @@
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b>Accessing properties</b>
</p>
<p>
The framework uses a standard naming context to evaluate OGNL expressions.
The top level object dealing with OGNL is a Map (usually referred as a context map or context).
OGNL has a notion of there being a root (or default) object within the context.
In OGNL expressions, the properties of the root object can be referenced without any special "marker" notion.
References to other objects are marked with a pound sign (#).
In this example (and in your JSP pages) the last action executed will be on the top of the stack.
</p>
<p>
<a href="#" onclick="selectClassSrcTab()">This action</a> is available on the third tab above.
To access the <i>name</i> field type:
</p>
<p>
<i id="example">
name
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl()">Do it for me</a>
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b>Accessing properties</b>
</p>
<p>
The framework uses a standard naming context to evaluate OGNL expressions.
The top level object dealing with OGNL is a Map (usually referred as a context map or context).
OGNL has a notion of there being a root (or default) object within the context.
In OGNL expressions, the properties of the root object can be referenced without any special "marker" notion.
References to other objects are marked with a pound sign (#).
In this example (and in your JSP pages) the last action executed will be on the top of the stack.
</p>
<p>
<a href="#" onclick="selectClassSrcTab()">This action</a> is available on the third tab above.
To access the <i>name</i> field type:
</p>
<p>
<i id="example">
name
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl()">Do it for me</a>
</p>
@@ -1,28 +1,28 @@
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b>Accessing nested properties</b>
</p>
<p>
To access nested properties, use the dot "." operator to concatenate the property names. The action
class has a <i>book</i> field, with <i>title</i> and <i>author</i> fields.
</p>
<p>
To access the name of the book type:
</p>
<p>
<i id="example">
book.title
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl()">Do it for me</a>
</p>
<br/>
<p>
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/properties.html')">[More details]</a>
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b>Accessing nested properties</b>
</p>
<p>
To access nested properties, use the dot "." operator to concatenate the property names. The action
class has a <i>book</i> field, with <i>title</i> and <i>author</i> fields.
</p>
<p>
To access the name of the book type:
</p>
<p>
<i id="example">
book.title
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl()">Do it for me</a>
</p>
<br/>
<p>
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/properties.html')">[More details]</a>
</p>
@@ -1,43 +1,43 @@
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b>Accessing properties inside Arrays</b>
</p>
<p>
To access properties inside arrays, use the brackets "[]" operators with the desired index(starting from 0). The action
class has an array of String in the field <i>bands</i>.
</p>
<p>
To access the second element in the <i>bands</i> array type:
</p>
<p>
<i id="example0">
bands[1]
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example0')">Do it for me</a>
</p>
<p>
<b>Accessing properties inside Lists</b>
</p>
<p>Lists can be accessed on the same way. The action class has a List of String on the field <i>movies</i>.</p>
<p>
To access the first element in the <i>movies</i> list type:
</p>
<p>
<i id="example1">
movies[0]
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example1')">Do it for me</a>
</p>
<br/>
<p>
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/indexing.html#N10184')">[More details]</a>
</p>
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b>Accessing properties inside Arrays</b>
</p>
<p>
To access properties inside arrays, use the brackets "[]" operators with the desired index(starting from 0). The action
class has an array of String in the field <i>bands</i>.
</p>
<p>
To access the second element in the <i>bands</i> array type:
</p>
<p>
<i id="example0">
bands[1]
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example0')">Do it for me</a>
</p>
<p>
<b>Accessing properties inside Lists</b>
</p>
<p>Lists can be accessed on the same way. The action class has a List of String on the field <i>movies</i>.</p>
<p>
To access the first element in the <i>movies</i> list type:
</p>
<p>
<i id="example1">
movies[0]
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example1')">Do it for me</a>
</p>
<br/>
<p>
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/indexing.html#N10184')">[More details]</a>
</p>
@@ -1,54 +1,54 @@
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b>Accessing properties inside Maps</b>
</p>
<p>
To access properties inside maps, use the brackets "[]" operators with the desired key. The action
class has a map of Book objects in the field <i>books</i>.
</p>
<p>
To access the book with key "Iliad" in the <i>books</i> map type:
</p>
<p>
<i id="example0">
books['Iliad']
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example0')">Do it for me</a>
</p>
<p>If the key does not have spaces in it, you can access an element in the map, using the dot "." operator.</p>
<p>
To access the book with key "Iliad" in the <i>books</i> map type:
</p>
<p>
<i id="example1">
books.Iliad
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example1')">Do it for me</a>
</p>
<p>
Note that the object returned is of type Book. If you want to access one of its properties, you can do so using the dot
"." operator as you did before.</p>
<p>
To access the <i>author</i> property of the book with key "Iliad" in the <i>books</i> map type:
</p>
<p>
<i id="example2">
books['Iliad'].author
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example2')">Do it for me</a>
</p>
<br/>
<p>
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/indexing.html#N10184')">[More details]</a>
</p>
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b>Accessing properties inside Maps</b>
</p>
<p>
To access properties inside maps, use the brackets "[]" operators with the desired key. The action
class has a map of Book objects in the field <i>books</i>.
</p>
<p>
To access the book with key "Iliad" in the <i>books</i> map type:
</p>
<p>
<i id="example0">
books['Iliad']
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example0')">Do it for me</a>
</p>
<p>If the key does not have spaces in it, you can access an element in the map, using the dot "." operator.</p>
<p>
To access the book with key "Iliad" in the <i>books</i> map type:
</p>
<p>
<i id="example1">
books.Iliad
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example1')">Do it for me</a>
</p>
<p>
Note that the object returned is of type Book. If you want to access one of its properties, you can do so using the dot
"." operator as you did before.</p>
<p>
To access the <i>author</i> property of the book with key "Iliad" in the <i>books</i> map type:
</p>
<p>
<i id="example2">
books['Iliad'].author
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example2')">Do it for me</a>
</p>
<br/>
<p>
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/indexing.html#N10184')">[More details]</a>
</p>
@@ -1,32 +1,32 @@
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b>Accessing properties on the stack</b>
</p>
<p>
Object that are not on the top of the Value Stack are accessed using the "#name" notation.
Some objects are always pushed into the stack by Struts, like:
</p>
<ul>
<li>#application</li>
<li>#session</li>
<li>#request</li>
<li>#parameters</li>
</ul>
<p>To see the value of the first parameter type:</p>
<p>
<i id="example">
#parameters['debug'][0]
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl()">Do it for me</a>
</p>
<br/>
<p>
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/ognl.html')">[More details]</a>
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b>Accessing properties on the stack</b>
</p>
<p>
Object that are not on the top of the Value Stack are accessed using the "#name" notation.
Some objects are always pushed into the stack by Struts, like:
</p>
<ul>
<li>#application</li>
<li>#session</li>
<li>#request</li>
<li>#parameters</li>
</ul>
<p>To see the value of the first parameter type:</p>
<p>
<i id="example">
#parameters['debug'][0]
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl()">Do it for me</a>
</p>
<br/>
<p>
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/ognl.html')">[More details]</a>
</p>
@@ -1,37 +1,25 @@
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b>Static fields</b>
</p>
<p>
Static fields can easily be accessed in OGNL expressions using the notation
<i>@some.package.ClassName@PROPERTY_NAME</i> for properties, and <i>@some.package.ClassName@METHOD_NAME()</i>
for methods.
</p>
<p>To access the value of the <i>CONSTANT</i> field in the ExampleAction type:</p>
<p>
<i id="example0">
@org.apache.struts2.showcase.action.ExampleAction@CONSTANT
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example0')">Do it for me</a>
</p>
<p>To execute the static method <i>getCurrentDate</i> in the ExampleAction type:</p>
<p>
<i id="example1">
@org.apache.struts2.showcase.action.ExampleAction@getCurrentDate()
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example1')">Do it for me</a>
</p>
<br/>
<p>
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/staticFields.html')">[More details on static fields]</a>
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/staticMethods.html')">[More details on static methods]</a>
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b>Calling methods</b>
</p>
<p>
OGNL follows Java's syntax to execute a method.
</p>
<p>To execute the <i>getTitle()</i> method on the <i>book</i> object type:</p>
<p>
<i id="example">
book.getTitle()
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl()">Do it for me</a>
</p>
<br/>
<p>
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/methods.html')">[More details]</a>
</p>
@@ -1,25 +1,43 @@
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b>Calling methods</b>
</p>
<p>
OGNL follows Java's syntax to execute a method.
</p>
<p>To execute the <i>getTitle()</i> method on the <i>book</i> object type:</p>
<p>
<i id="example">
book.getTitle()
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl()">Do it for me</a>
</p>
<br/>
<p>
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/methods.html')">[More details]</a>
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<p>
<b>Expressions</b>
</p>
<p>
OGNL supports expressions using primitive values.
</p>
<p>Arithmetic:</p>
<p>
<i id="example0">
(6 - 2)/2
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example0')">Do it for me</a>
</p>
<p>Logical:</p>
<p>
<i id="example1">
(true || false) and true
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example1')">Do it for me</a>
</p>
<p>Equality:</p>
<p>
<i id="example2">
'a' == 'a'
</i>
</p>
<p>
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example2')">Do it for me</a>
</p>
<p>
OGNL supports many more operators and expressions, see <a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/apa.html#operators')">[Operators Reference]</a>
for more details.
</p>

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