Compare commits

..

206 Commits

Author SHA1 Message Date
Yasser Zamani 60a1a2642a [maven-release-plugin] prepare release STRUTS_2_3_37 2018-12-30 14:50:11 +03:30
Yasser Zamani d25a342bd2 Merge pull request #305 from lukaszlenart/WW-4975-struts23x
[WW-4975] Upgrades commons-fileupload to version 1.4 - Struts 2.3.x
2018-12-30 10:15:48 +03:30
Lukasz Lenart 6870fb7f79 WW-4975 Upgrades commons-fileupload to version 1.4 2018-12-29 17:23:44 +01:00
Lukasz Lenart e62ae2ee7a Upgrades commons-fileupload to version 1.3.3 2018-11-06 10:56:41 +01:00
Yasser Zamani 83dc967eac [maven-release-plugin] prepare for next development iteration 2018-09-18 12:25:22 +04:30
Yasser Zamani dd1588d3eb [maven-release-plugin] prepare release STRUTS_2_3_36 2018-09-18 12:14:32 +04:30
Yasser Zamani 6194d3fc88 change http to https in doc urls 2018-09-18 11:41:22 +04:30
Yasser Zamani bd0d514de9 add checksum-maven-plugin
http://www.apache.org/dev/release-distribution#sigs-and-sums
> New policy :
>
>   -- SHOULD supply a SHA-256 and/or SHA-512 checksum file
>   -- SHOULD NOT supply MD5 or SHA-1 checksum files

See also: WW-4951
2018-09-17 17:32:32 +04:30
Lukasz Lenart cde8a288f9 Merge pull request #248 from aleksandr-m/feature/2_3_security_logs
Improve log messages in SecurityMemberAccess
2018-09-04 06:47:17 +02:00
Aleksandr Mashchenko ac868ae3ab Improve log messages in SecurityMemberAccess 2018-09-03 22:07:17 +03:00
Yasser Zamani feb5ab1333 Merge pull request #245 from apache/WW-4954-struts-2-3
WW-4954 Moves XWorkList out of the util package
2018-08-31 16:19:42 +04:30
Lukasz Lenart 458acb89e5 WW-4954 Moves XWorkList out of the util package 2018-08-30 08:52:33 +02:00
Lukasz Lenart 88c2d216e3 Merge pull request #243 from benelog/fix-log-2-3-x
Fix logging messages (for 2.3.x)
2018-08-27 16:10:10 +02:00
Sanghyuk Jung 61735542c2 Fix logging messages 2018-08-27 21:02:41 +09:00
Lukasz Lenart 0b41b68da4 [maven-release-plugin] prepare for next development iteration 2018-07-12 09:51:27 +02:00
Lukasz Lenart dbcca3512e [maven-release-plugin] prepare release STRUTS_2_3_35 2018-07-12 09:51:04 +02:00
Lukasz Lenart 6ec2bdc197 Uses proper path to Gitbox 2018-07-12 09:40:21 +02:00
Lukasz Lenart 9b9aa10059 [maven-release-plugin] rollback the release of STRUTS_2_3_35 2018-07-12 09:37:38 +02:00
Lukasz Lenart 6c216de38e [maven-release-plugin] prepare release STRUTS_2_3_35 2018-07-12 09:37:10 +02:00
Lukasz Lenart a89b7c11af Uses the new docs site to build assembly 2018-07-12 09:29:25 +02:00
Yasser Zamani 918182344c fix some sonar issue 2018-06-29 23:25:59 +04:30
Yasser Zamani 52e8d46364 revert a delete mistake from previous commit 2018-06-21 14:11:20 +04:30
Yasser Zamani c59f294fb9 delete redundant code for performance 2018-06-21 13:20:48 +04:30
Lukasz Lenart 86e5bd7f52 Upgrades freemarker 2018-06-21 08:19:44 +02:00
Lukasz Lenart bea6fb599d Ports changes to properly support primitives 2018-06-21 08:19:33 +02:00
Lukasz Lenart 4a3917176d Avoids parsing namespace when using existing namespace 2018-05-08 07:58:34 +02:00
Yasser Zamani a746fc872a revert 4db5cdc 2018-04-26 22:36:30 +04:30
Yasser Zamani 949e069f53 make maven's surefire show stacktrace in console 2018-04-26 21:22:33 +04:30
Yasser Zamani 4db5cdc473 not fail if OS or JDK doesn't support jpeg 2018-04-26 20:44:50 +04:30
Yasser Zamani afc8f20440 fork apt to avoid duplicate same class loading which fails JDK6 2018-04-24 18:27:01 +04:30
Lukasz Lenart 75d7bf481c Uses Java 6 in the pom 2017-11-29 11:22:48 +01:00
Lukasz Lenart d86539ed07 [maven-release-plugin] prepare for next development iteration 2017-09-05 20:37:36 +02:00
Lukasz Lenart f0b3a1d213 [maven-release-plugin] prepare release STRUTS_2_3_34 2017-09-05 20:37:14 +02:00
Lukasz Lenart 2306f5f7fa Uses better class resolver logic 2017-08-26 14:26:20 +02:00
Lukasz Lenart ed7f9dd4cb Drops unused annotation in this Java version 2017-08-24 12:07:33 +02:00
Lukasz Lenart cf53b59647 Fixes post cherry-pick 2017-08-24 11:09:29 +02:00
Lukasz Lenart 6dd6e5cfb7 Allows define allowed classes per action 2017-08-24 09:10:28 +02:00
Lukasz Lenart b9a0c497d3 Fixes post cherry-pick 2017-08-24 09:10:12 +02:00
Lukasz Lenart 2f95b9a130 Updates tests 2017-08-24 08:56:07 +02:00
Lukasz Lenart 103e3b174e Updates flow to handle new API 2017-08-24 08:55:50 +02:00
Lukasz Lenart 2776b34b44 Adds an abstract layer to allow easily handle API change 2017-08-24 08:53:57 +02:00
Lukasz Lenart 287e3bc8cb Adds new methods and marks current as deprecated 2017-08-24 08:49:21 +02:00
Lukasz Lenart 677ccebe83 WW-4836 Upgrades xstream lib to the latest version 2017-08-24 08:46:34 +02:00
Lukasz Lenart f11ac901d3 WW-4844 Upgrades to struts-master 11 2017-08-23 07:22:23 +02:00
Stefaan Dutry 3fddfb6eb5 WW-4834 Improve RegEx used to validate URLs 2017-08-04 13:58:31 +02:00
Lukasz Lenart 744c1f409d Uses better RegEx to improve performance 2017-08-01 12:01:43 +02:00
Lukasz Lenart 54a4dce7bf WW-4832 Upgrades to OGNL 3.0.21 2017-08-01 11:50:33 +02:00
Lukasz Lenart 16eb7fa768 [maven-release-plugin] prepare for next development iteration 2017-07-07 14:47:26 +02:00
Lukasz Lenart 631ce98d17 [maven-release-plugin] prepare release STRUTS_2_3_33 2017-07-07 14:47:12 +02:00
Yasser Zamani 086b637355 Adds constant to control proxy member access 2017-07-07 13:35:10 +04:30
Lukasz Lenart ae56301979 WW-4805 Ports proxy detection to 2.3 2017-06-29 09:41:53 +02:00
Lukasz Lenart 73da12e723 Uses resource message key instead of passing message directly 2017-06-23 09:22:43 +02:00
Yasser Zamani 583da3d5df WW-4805 Blocks ognl access to class members of Spring proxy 2017-06-21 16:40:29 +04:30
Stefaan Dutry 9e8627ca66 WW-4770 Fixes problem with dojo.version 2017-03-24 21:34:31 +01:00
Lukasz Lenart c349dfa5ab WW-4735 Ports more relax domain suffix validation 2017-03-24 11:45:51 +01:00
Lukasz Lenart 4d888a5ab6 [maven-release-plugin] prepare for next development iteration 2017-03-06 12:03:18 +01:00
Lukasz Lenart 1ed29d508f [maven-release-plugin] prepare release STRUTS_2_3_32 2017-03-06 12:03:06 +01:00
Lukasz Lenart 3523064939 Uses default error key if specified key doesn't exist 2017-03-06 11:56:39 +01:00
Lukasz Lenart 54dff362f5 Adds additional example URLs to check if validation works properly 2016-11-25 19:35:15 +01:00
Lukasz Lenart b12864dd38 [maven-release-plugin] prepare for next development iteration 2016-10-05 08:53:34 +02:00
Lukasz Lenart de90290354 [maven-release-plugin] prepare release STRUTS_2_3_31 2016-10-05 08:53:19 +02:00
Lukasz Lenart ba0563183b Fixes issues in config-browse plugin 2016-09-28 11:42:24 +02:00
Lukasz Lenart b348fc552c WW-4674 Uses the same logic as in Dispatcher to control handling exception 2016-09-16 16:37:29 +02:00
Lukasz Lenart 81371e09c5 WW-4685 Adjusts cherry pick to 2.3.x 2016-09-16 16:07:59 +02:00
Lukasz Lenart 431e50e922 WW-4685 Uses dedicated prefixes to access I18N and Struts internals 2016-09-16 16:00:45 +02:00
Lukasz Lenart 156db8e5df WW-4685 Supports evaluating expressions from tiles definitions as a Struts values 2016-09-16 16:00:27 +02:00
Lukasz Lenart 6f5ddca471 WW-4667 Applies params to all instances of interceptor defined in stack 2016-09-06 09:07:02 +02:00
Lukasz Lenart cc0d52f216 WW-4663 Checks if expression is null to avoid NPE 2016-09-02 13:57:15 +02:00
Lukasz Lenart 23e0181328 WW-4669 Returns default action/method instead of throwing exception 2016-08-30 09:20:41 +02:00
Lukasz Lenart 030ffa3354 Disables params evaluation when creating results by convention 2016-08-17 15:36:20 +02:00
Lukasz Lenart 8e67b9144a Adds double check if resource exists 2016-08-17 15:36:20 +02:00
Lukasz Lenart 77017cd677 Allows modify params on coping 2016-08-17 15:36:20 +02:00
cnenning 7d8c3598ef merged fix for WW-4628 (proper url decoding of query-string) 2016-08-03 13:28:00 +02:00
cnenning 83bb64f4c2 WW-4628: new issues were introduced by last change, restoring old behavior and ignoring new tests 2016-08-01 15:42:36 +02:00
cnenning ae2840f183 merged fix for WW-4628 (avoid double encoding of url parameters) 2016-08-01 13:50:23 +02:00
Lukasz Lenart e8b48f8bb4 WW-4601 Hides webconsole when not in devMode 2016-07-08 06:44:12 +02:00
Lukasz Lenart 3243448084 [maven-release-plugin] prepare for next development iteration 2016-07-07 08:32:14 +02:00
Lukasz Lenart 5c61c9a575 [maven-release-plugin] prepare release STRUTS_2_3_30 2016-07-07 08:31:52 +02:00
Lukasz Lenart e40dcaa3f4 Uses the latest OGNL version 2016-06-29 20:24:57 +02:00
Lukasz Lenart ab6acd2382 Cleans up test 2016-06-26 22:04:23 +02:00
Lukasz Lenart bf0a01d390 Upgrades OGNL to latest version 2016-06-26 22:02:32 +02:00
Lukasz Lenart 00c47b7ce6 WW-4648 Upgrades commons-fileupload to the latest version 2016-06-22 10:56:31 +02:00
Lukasz Lenart c84810ff82 Adds test to guard pre-evaulation of name attribute 2016-06-22 10:46:09 +02:00
Lukasz Lenart 2ea59b31b4 Drops commented out test 2016-06-22 10:38:39 +02:00
Lukasz Lenart fae1e0e799 Uses LocaleProvider and default TextProvider instead of evaluating expression 2016-06-22 10:38:12 +02:00
Lukasz Lenart e4ce3ce839 Reverts dropping name pre-evaluation 2016-06-22 08:55:42 +02:00
Lukasz Lenart 730441b7a7 [maven-release-plugin] prepare for next development iteration 2016-06-14 07:11:10 +02:00
Lukasz Lenart bb22c585b5 [maven-release-plugin] prepare release STRUTS_2_3_29 2016-06-14 07:10:57 +02:00
Lukasz Lenart eccc31ebce Improves validation RegEx 2016-06-14 06:53:36 +02:00
Lukasz Lenart 1c92a8b2c9 Reverts previous RegEx 2016-06-03 13:12:02 +02:00
Lukasz Lenart b28b78c062 Introduces new callMethod() function to be used to execute actions 2016-06-03 13:10:58 +02:00
Lukasz Lenart 8d172b8e9b Upgrades to latest OGNL version 2016-06-03 13:08:51 +02:00
Lukasz Lenart 88b885339a Drops pre-evaluation of name 2016-06-02 16:57:44 +02:00
Lukasz Lenart 3f526d630a Drops unneeded method 2016-06-02 16:46:40 +02:00
Lukasz Lenart 34025eafec Allows empty string as a action name 2016-05-23 17:04:38 +02:00
Lukasz Lenart 54e8bf1f75 Disallows dot in action name 2016-05-23 16:02:25 +02:00
Lukasz Lenart 9f2cae2f1e WW-4627 Adds unit test to confirm the issue 2016-05-13 08:00:04 +02:00
Lukasz Lenart 9bcd1bc9f6 WW-4626 Adds support for .cat domain 2016-05-13 07:40:25 +02:00
Lukasz Lenart f052398cd2 WW-4618 Supports custom redirect types which base on ServletRedirectResult 2016-05-13 07:04:50 +02:00
Lukasz Lenart 237432512d Throws away methods that doesn't match pattern 2016-05-12 15:40:04 +02:00
Lukasz Lenart ca25476120 Upgrades commons-collections 2016-05-05 10:46:56 +02:00
Aleksandr Mashchenko 731fde544c WW-4630 - <s:submit> generates a value attribute for type=image which violates W3C (cherry picked from commit c4d2b687be8bdb454a11c5376bb475a8fa7f9c67​) 2016-05-04 23:00:33 +03:00
Lukasz Lenart 76eb8f38a3 Cleans up method name 2016-04-29 08:40:03 +02:00
Lukasz Lenart deefeffd11 Cleans up method name 2016-04-20 08:01:29 +02:00
Lukasz Lenart 98d2692e43 Drops defining location via request 2016-04-20 08:01:22 +02:00
Lukasz Lenart 46517afb14 Adds additional blocked classes 2016-04-20 08:01:12 +02:00
Lukasz Lenart 5190b53673 Uses isSequence flag to block chained expressions 2016-04-20 08:01:02 +02:00
Lukasz Lenart d36f31b3e1 Upgrades OGNL 2016-04-20 08:00:53 +02:00
Lukasz Lenart cbae13a6a8 Reverts 098ee502b4 2016-04-11 16:30:38 +02:00
Lukasz Lenart 865f1f2784 Adds support for deprecated param name 2016-04-08 10:26:21 +02:00
Aleksandr Mashchenko 5ce807aaea WW-4622 - Adds fallback to static config definitions to allow work in restricted envs (cherry picked from 6770b35), getRealPath NPE check; WW-4623, WW-4624 - Adds support for multiple tiles defintions (cherry picked from c12cd61) 2016-04-06 19:36:13 +03:00
Lukasz Lenart 17dab897d9 Uses proper doctype version 2016-04-04 11:21:54 +02:00
Lukasz Lenart 45fa8d0320 Adds missing closing tags 2016-04-04 11:21:37 +02:00
Lukasz Lenart 6fee2eb1a4 [maven-release-plugin] prepare for next development iteration 2016-03-18 20:50:53 +01:00
Lukasz Lenart 0ac8932aa3 [maven-release-plugin] prepare release STRUTS_2_3_28 2016-03-18 20:50:41 +01:00
Lukasz Lenart 6b497ef8f7 WW-4605 Reverts to previous flow when result is created just before executing it 2016-03-18 20:41:06 +01:00
Lukasz Lenart 519c767114 [maven-release-plugin] prepare for next development iteration 2016-03-18 08:54:43 +01:00
Lukasz Lenart 8a59ed02c9 [maven-release-plugin] prepare release STRUTS_2_3_27 2016-03-18 08:54:31 +01:00
Lukasz Lenart f48c30eaa7 Adds proper logic to exclude MemberAccess 2016-03-18 08:45:13 +01:00
Lukasz Lenart 94c4462658 [maven-release-plugin] prepare for next development iteration 2016-03-14 11:39:11 +01:00
Lukasz Lenart 013077abcb [maven-release-plugin] prepare release STRUTS_2_3_26 2016-03-14 11:38:57 +01:00
Lukasz Lenart fbb91d1bb9 Reverts excluded classes 2016-03-14 11:25:00 +01:00
Lukasz Lenart a67ac45258 [maven-release-plugin] prepare for next development iteration 2016-03-11 16:02:55 +01:00
Lukasz Lenart 8ca0f2fc46 [maven-release-plugin] prepare release STRUTS_2_3_25 2016-03-11 16:02:17 +01:00
Lukasz Lenart 37842193ab Narrows possible locale to those from available locales 2016-03-11 11:03:36 +01:00
Lukasz Lenart 609cb0bb97 WW-4533 Reverts the old behaviour of how empty action should be handled 2016-03-10 08:45:12 +01:00
Lukasz Lenart b155532314 Reduces expression evaluation if there is no expression 2016-03-06 10:07:06 +01:00
Aleksandr Mashchenko 9de0cf4c8b radio checked fix vol.2
(cherry picked from commit f7364a50dc)
2016-03-04 20:52:53 +02:00
Aleksandr Mashchenko 5cf4aacd50 radio checked fix
(cherry picked from commit 866b8902cd)
2016-03-04 20:47:00 +02:00
Aleksandr Mashchenko d82289a1be formatting
(cherry picked from commit 820c52dd26)
2016-03-04 20:46:47 +02:00
Aleksandr Mashchenko 6ac2a58da7 WW-4586 Custom StrutsTypeConverter's convertToString not called in radio and checkboxlist tags
(cherry picked from commit 7a0ae0ebae)
2016-03-04 20:46:23 +02:00
Lukasz Lenart c714d2674a Upgrades lib to latest version 2016-03-04 18:38:25 +01:00
Lukasz Lenart ffa6d5cb5b WW-4610 Ports fix from master branch 2016-03-03 18:02:38 +01:00
Lukasz Lenart 9860ef829a WW-4410 Adds dedicated interface to allow inject ServletContext 2016-02-25 21:29:25 +01:00
Lukasz Lenart d028886cd1 Drops wrong arg passed to logger 2016-02-25 20:29:38 +01:00
Lukasz Lenart 1b4868df3e WW-4595 Resolves regression issue but keeping support for custom text provider 2016-02-25 20:12:23 +01:00
Lukasz Lenart 5cfe05075b WW-4563 Reverts checking if value is excluded and uses Internal Security Mechanism 2016-02-25 18:30:26 +01:00
Lukasz Lenart 5efc595011 WW-4560 Reverts checking if value is excluded and uses Internal Security Mechanism 2016-02-25 18:16:32 +01:00
Lukasz Lenart 9c7b833668 WW-4600 Ports solution with PreResultListener from WW-4605 2016-02-11 08:21:59 +01:00
cnenning 87979d2821 WW-4606 made @TilesDefinition work with tiles 2 2016-02-03 14:18:54 +01:00
cnenning 8a9e01727c removed outcommented line 2016-02-03 13:34:47 +01:00
cnenning 5b2b244a66 added missing license header 2016-02-03 13:34:32 +01:00
cnenning 473403ca17 formatted annotations more nicely 2016-02-03 13:34:09 +01:00
cnenning 1bbcd4bf70 renamed test class to stick to naming convention 2016-02-03 13:33:48 +01:00
cnenning 469b25f8e1 WW-4606 fixed javadoc 2016-02-03 13:33:22 +01:00
cnenning 27260685e1 updated javadoc 2016-02-03 13:23:01 +01:00
cnenning bd5e64e598 added tests for StrutsTilesAnnotationProcessor 2016-02-03 13:22:35 +01:00
cnenning 9a8f36dee2 WW-4606 added @TilesDefinition sample to showcase app 2016-02-03 13:21:59 +01:00
cnenning a6345e79c9 WW-4606 cherry-picked @TilesDefinition and related classes 2016-02-03 13:15:44 +01:00
Lukasz Lenart 85373951b7 WW-4600 Adds additional check if session was invalidated 2016-02-03 09:33:50 +01:00
cnenning c44566bd24 fixed jenkins by resolving compiler error in test class (did not appear locally) and adjusting asserts to older version of spring mock objects 2016-01-29 15:12:17 +01:00
cnenning 2a6acabe5d updated comments 2016-01-29 13:54:31 +01:00
cnenning 377c6cdda0 increased visibilty of methods and constants for better extensibility 2016-01-29 13:54:08 +01:00
cnenning 6438396ef8 made methods non static and private, javadoc updates 2016-01-29 13:53:48 +01:00
cnenning 69bc2947c1 WW-4599: backport JSONActionRedirectResult to struts 2.3 2016-01-29 13:53:31 +01:00
Lukasz Lenart 15c79e1398 WW-4587 Adds logic to cache missing bundles 2016-01-26 10:59:47 +01:00
Lukasz Lenart dd36946573 WW-4575 Adds missing constants translation 2016-01-26 10:00:21 +01:00
Lukasz Lenart 18bdc141ea WW-4575 Uses startWith instead of pattern matching to improve overall performance 2016-01-26 09:33:48 +01:00
petersr 2ec3890dc7 WW-4588: Improve the Struts2 Rest plugin to honor Accept header
Conflicts:
	plugins/rest/src/main/java/org/apache/struts2/rest/DefaultContentTypeHandlerManager.java
2016-01-20 16:12:55 +01:00
Lukasz Lenart 10a612c9da Merge branch 'support-2-3' of https://git-wip-us.apache.org/repos/asf/struts into support-2-3
Conflicts:
	plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java
2016-01-20 10:13:03 +01:00
petersr 1d160f4d5f WW-4589 do not overwrite explicit method name
Conflicts:
	plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java
2016-01-20 10:06:46 +01:00
donghui a398793177 make test passed for people not using GMT.
(cherry picked from commit 32ec7a669c)
2016-01-14 20:11:54 +02:00
Aleksandr Mashchenko ff4cdd9670 WW-4585 Struts2 Rest plugin doesn't handle JSESSIONID with DMI 2016-01-14 20:08:21 +02:00
Rene Gielen 7c4bb7e7bd WW-4403 - add JDK 8 profile, disabling JavaDoc lint checker when building with JDK8 2016-01-14 17:43:20 +01:00
Rene Gielen 5421930b49 WW-4507 - clone Tomcat UDecoder and use it for in query string handling 2016-01-14 14:52:03 +01:00
Lukasz Lenart c6750c110c Solves issue with warning abut Custom EL 2016-01-10 16:05:20 +01:00
Lukasz Lenart 997966829a WW-4568 Upgrades the Tiles plugin to Tiles 2 2016-01-10 12:21:23 +01:00
Lukasz Lenart bd1a121b82 Ports blocking eval expressions from commit 61a7ee2961 2016-01-10 12:17:34 +01:00
Lukasz Lenart 6177cf3387 Ports exclude access Class from commit 74e26830d2 2016-01-10 12:17:34 +01:00
Aleksandr Mashchenko b448d79959 Add import for UUID 2016-01-06 19:30:12 +02:00
Aleksandr Mashchenko 9a0a0a16e9 WW-4583 JakartaStreamMultiPartRequest fails on short file name and on empty file input
(cherry picked from commit a4f8d49214)
2016-01-06 19:26:18 +02:00
Victor Sosa bf46145baf A proper way to close the db connection
Conflicts:
	plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/JasperReportsResult.java
2016-01-04 20:21:15 +01:00
Victor Sosa 1158b0adda fix for WW-4573
NPE/ concurrent modification exception

using a CopyOnWriteArrayList. This is to keep Memory consistency on the
ValueStack.
2016-01-04 20:07:04 +01:00
Lukasz Lenart 5ed7b36567 Adds fetching resources from classpath 2015-12-27 15:17:28 +01:00
Lukasz Lenart 2d70ea2f7d Adds missing header with license 2015-12-19 10:23:39 +01:00
Lukasz Lenart 9136521d27 Cleans up and fixes issue based on feedback 2015-12-19 10:15:02 +01:00
Lukasz Lenart 5be1590a60 Uses the new context implementation 2015-12-19 10:14:40 +01:00
Lukasz Lenart f721d5490c Implements ApplicationContext which supports wildcards 2015-12-19 10:13:57 +01:00
Lukasz Lenart db318c2116 Drops duplicated and unused dependencies 2015-12-19 10:13:10 +01:00
Johannes Geppert f295852482 WW-4545 - Setting status code in HttpHeaders will be ignored
(cherry picked from commit 4cd9a74cb8)
2015-12-17 19:45:59 +02:00
Lukasz Lenart 8bbfb461c4 WW-4365 Fixes issue with evaluating doubleHeaderValue and doubleHeaderKey 2015-11-30 08:12:44 +01:00
Lukasz Lenart 38e8f86a75 WW-4569 Adds support for .tech
(cherry picked from commit 7f10be5c37)
2015-11-28 16:38:57 +01:00
Lukasz Lenart 696e566279 Reverts back to XWork logging layer 2015-11-28 15:57:52 +01:00
Lukasz Lenart 27aa7e1e27 Fixes dependency clash
(cherry picked from commit 6622fab25b)

Conflicts:
	apps/showcase/pom.xml
	plugins/bean-validation/pom.xml
2015-11-28 15:39:47 +01:00
Lukasz Lenart f19e4be947 Registers Tiles model
(cherry picked from commit 388861f)
2015-11-28 15:36:28 +01:00
Lukasz Lenart 913944b8ee Adds missing header with license
(cherry picked from commit 27ad6cb)
2015-11-28 15:36:22 +01:00
Lukasz Lenart ddeb7f0f7c Updates Portal Tiles integration
(cherry picked from commit 6edc0ff)
2015-11-28 15:36:16 +01:00
Lukasz Lenart 5d30eb1ad2 Replaces call to deprecated api
(cherry picked from commit 26f153d)
2015-11-28 15:36:11 +01:00
Lukasz Lenart efcea81b67 Drops unused classes
(cherry picked from commit 24a5bce)
2015-11-28 15:36:04 +01:00
Lukasz Lenart 9862580bbe Re-implements tiles integration based on new API
(cherry picked from commit 70716e9)
2015-11-28 15:35:48 +01:00
Lukasz Lenart 1dc545e34c Adds required dependencies
(cherry picked from commit 85b2198)
2015-11-28 15:34:55 +01:00
Lukasz Lenart 90dbf54bf4 WW-4570 Drops ASM from minimal set of Jars 2015-11-22 13:52:19 +01:00
Lukasz Lenart b4a18d07e4 WW-4570 Uses proper schema for assembly descriptor 2015-11-20 13:29:49 +01:00
Lukasz Lenart 5d26c6c1e5 WW-4570 Defines a minimal jar set to be used by users 2015-11-20 13:16:26 +01:00
Lukasz Lenart 22cb8c7e7d WW-4562 Upgrades OGNL to latest 3.0.13 version 2015-11-04 18:09:55 +01:00
Lukasz Lenart 0958077762 WW-4134 Checks if Response wasn't committed to allow store messages 2015-10-27 09:01:09 +01:00
Lukasz Lenart 7848534e2f WW-4554 Drops duplicated calls to initialize BeanPostProcessors
It's already done by Spring
2015-10-27 08:27:25 +01:00
Lukasz Lenart c708876339 WW-4556 Extracts tooltips into dedicated template file 2015-10-27 08:25:36 +01:00
Lukasz Lenart f65e38bb81 WW-3161 Sets proper ActionContext to allow I18N to work 2015-10-20 08:40:25 +02:00
Lukasz Lenart 412684bd22 Drops unused code 2015-10-20 08:39:39 +02:00
Lukasz Lenart 3e2d5da12c WW-4526 Checks if passed in scheme param is valid 2015-10-20 08:16:41 +02:00
Christoph Nenning d15424ee5f added changes from PRs #54 and #55 which have been merged to master (also see WW-4552 and WW-4553) 2015-10-12 13:27:22 +02:00
Lukasz Lenart 30d30e07de WW-4536 Checks for patterns in action names to build the same key for actions with patterns 2015-10-11 18:54:15 +02:00
Lukasz Lenart 755ad3fadb WW-4536 Drops static to allow redefine the key 2015-10-10 10:10:21 +02:00
Lukasz Lenart f5d455da12 WW-4551 Adds support for conversion of RFC3339 dates with date part only 2015-10-10 10:01:33 +02:00
Lukasz Lenart 4f817dc7a9 Prepares for 2.3.x development cycle 2015-10-09 19:02:09 +02:00
3600 changed files with 211069 additions and 72529 deletions
+6 -3
View File
@@ -8,8 +8,6 @@
.classpath
.project
.settings/
.metadata/
Servers/
# OSX
.DS_Store
@@ -33,8 +31,10 @@ archetypes/struts2-archetype-starter/target
archetypes/target
plugins/convention/target
plugins/embeddedjsp/target
plugins/dojo/target
plugins/osgi/target
plugins/cdi/target
plugins/codebehind/target
plugins/spring/target
plugins/jfreechart/target
apps/rest-showcase/target
@@ -49,11 +49,14 @@ apps/target
bundles/admin/target
plugins/config-browser/target
plugins/jasperreports/target
plugins/jsf/target
plugins/json/target
plugins/portlet-tiles/target
plugins/portlet/target
plugins/sitegraph/target
plugins/sitemesh/target
plugins/struts1/target
plugins/tiles3/target
plugins/javatemplates/target
bundles/demo/target
plugins/rest/target
@@ -67,4 +70,4 @@ plugins/tiles/target
bundles/target
plugins/target
target
plugins/testng/test-output
plugins/testng/test-output
-9
View File
@@ -1,9 +0,0 @@
language: java
sudo: false
jdk:
- openjdk7
- oraclejdk8
install: true
script: mvn test -DskipAssembly
-40
View File
@@ -1,40 +0,0 @@
The Apache Struts web framework
-------------------------------
[![Build Status](https://travis-ci.org/apache/struts.svg?branch=master)](https://travis-ci.org/apache/struts)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.struts/struts2-core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.apache.struts/struts2-core/)
[![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
The Apache Struts web framework is a free open-source solution for creating Java web applications.
Web applications differ from conventional websites in that web applications can create a dynamic response. Many websites deliver only static pages. A web application can interact with databases and business logic engines to customize a response.
Web applications based on JavaServer Pages sometimes commingle database code, page design code, and control flow code. In practice, we find that unless these concerns are separated, larger applications become difficult to maintain.
One way to separate concerns in a software application is to use a Model-View-Controller (MVC) architecture. The Model represents the business or database code, the View represents the page design code, and the Controller represents the navigational code. The Struts framework is designed to help developers create web applications that utilize a MVC architecture.
The framework provides three key components:
A “request” handler provided by the application developer that is mapped to a standard URI. A “response” handler that transfers control to another resource which completes the response. A tag library that helps developers create interactive form-based applications with server pages. The frameworks architecture and tags are buzzword compliant. Struts works well with conventional REST applications and with technologies like SOAP and AJAX.
The Apache Struts Project
-------------------------
The Apache Struts Project is the open source community that creates and maintains the Apache Struts framework. The project consists of a diverse group of volunteers who share common values regarding collaborative, community-based open source development. The Apache Struts Project is proud to share these values with our parent organization: The Apache Software Foundation.
The project is called “Struts” because the framework is meant to furnish the “invisible underpinnings” that support professional application development. Struts provides the glue that joins the various elements of the standard Java platform into a coherent whole. Our goal is to leverage existing standards by producing the missing pieces we need to create enterprise-grade applications that are easy to maintain over time.
The Apache Struts Project offered two major versions of the Struts framework. Currently we are only maintaining the Struts 2 version. It is recommended to upgrade all Struts 1.x application to Struts 2. Please do not start new application development using Struts 1.x, as we are no longer issuing security patches.
Struts 2 was originally known as WebWork 2. After working independently for several years, the WebWork and Struts communities joined forces to create Struts 2. The 2.x framework is the best choice for teams who value elegant solutions to difficult problems.
Why should you use Apache Struts?
---------------------------------
Apache Struts is a modern, maintained and full-featured web framework. It has been there for years and give the huge user base it is unlikely it will go away anytime soon in the future. Not only that we have dedicated users and developers on the project. Apache Struts is licensed to the Apache License 2.0 and this will not change. We maintain a clean IP and you are “safe” to use the project. Sometimes you are not “safe” to use a project when a company controls the SCM. Access to Source Code doesnt mean it is free. With Apache Struts, you are not only free to “do what you want with it”, you can even contribute (which is not always the case). And best of it: you can become a part of the core team too.
It is usually very easy to integrate other technologies with Apache Struts. If you are using an ORM like Apache Cayenne, Hibernate or JDBC you will not have any restrictions. Apache Struts is not even tied too much to a frontend technology. In old days it was JSP, then came Velocity and Freemarker. Nowadays you might build your web application with just static HTML and AngularJS. Or you want to use Sitemesh or Tiles. This all is no problem due to Struts elegant and easy to use extension mechanisms.
Unlike other, component oriented frameworks, we do not aim to hide the stateless nature of the web. We think it is perfectly acceptable to build upon a Request/Response cycle. We also think the MVC pattern is not so bad, just because it is old. In fact, we believe the Apache Struts architecture is clean and easy to understand.
Of course, if you wish to build components on the server side which render on the front end side, you are most likely wrong with Struts. This is a different approach which promises to reduce the amount of HTML/JavaScript knowledge needed and to create reusable components for the view layer. Projects like Wicket and Tapestry serve this purpose very well. As with every framework you need to decide if it makes sense for you to build components or if you are better with the Struts-approach.
+16
View File
@@ -0,0 +1,16 @@
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
I18N:
=====
Please note that this project was created with the assumption that it will be run
in an environment where the default locale is set to English. This means that
the default messages defined in package.properties are in English. If the default
locale for your server is different, then rename package.properties to package_en.properties
and create a new package.properties with proper values for your default locale.
+95
View File
@@ -0,0 +1,95 @@
<?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.3.37</version>
</parent>
<artifactId>struts2-blank</artifactId>
<packaging>war</packaging>
<name>Struts 2 Blank Webapp</name>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>struts2-junit-plugin</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.16.v20140903</version>
<configuration>
<stopKey>CTRL+C</stopKey>
<stopPort>8999</stopPort>
<scanIntervalSeconds>10</scanIntervalSeconds>
<scanTargets>
<scanTarget>src/main/webapp/WEB-INF/web.xml</scanTarget>
</scanTargets>
<systemProperties>
<systemProperty>
<name>xwork.loggerFactory</name>
<value>com.opensymphony.xwork2.util.logging.log4j2.Log4j2LoggerFactory</value>
</systemProperty>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
@@ -0,0 +1,30 @@
/*
* $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 example;
import com.opensymphony.xwork2.ActionSupport;
/**
* Base Action class for the Tutorial package.
*/
public class ExampleSupport extends ActionSupport {
}
@@ -0,0 +1,68 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package example;
import java.util.Arrays;
import java.util.List;
/**
* <code>Set welcome message.</code>
*/
public class HelloWorld extends ExampleSupport {
public String execute() throws Exception {
setMessage(getText(MESSAGE));
return SUCCESS;
}
/**
* Provide default valuie for Message property.
*/
public static final String MESSAGE = "HelloWorld.message";
/**
* Field for Message property.
*/
private String message;
/**
* Return Message property.
*
* @return Message property
*/
public String getMessage() {
return message;
}
/**
* Set Message property.
*
* @param message Text to display on HelloWorld page.
*/
public void setMessage(String message) {
this.message = message;
}
public List<YesNo> getValues() {
return Arrays.asList(YesNo.values());
}
}
@@ -0,0 +1,57 @@
/*
* $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 example;
import org.apache.struts2.interceptor.validation.SkipValidation;
public class Login extends ExampleSupport {
public String execute() throws Exception {
return SUCCESS;
}
@SkipValidation
public String form() throws Exception {
return INPUT;
}
private String username;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
private String password;
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
@@ -0,0 +1,5 @@
package example;
public enum YesNo {
YES, NO
}
+5
View File
@@ -0,0 +1,5 @@
Apache Struts
Copyright 2000-2011 The Apache Software Foundation
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
+25
View File
@@ -0,0 +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="default">
<action name="HelloWorld" class="example.HelloWorld">
<result>/WEB-INF/jsp/example/HelloWorld.jsp</result>
</action>
<action name="Login_*" method="{1}" class="example.Login">
<result name="input">/WEB-INF/jsp/example/Login.jsp</result>
<result type="redirectAction">Menu</result>
</action>
<action name="*" class="example.ExampleSupport">
<result>/WEB-INF/jsp/example/{1}.jsp</result>
</action>
<!-- Add actions here -->
</package>
</struts>
@@ -0,0 +1,16 @@
<!DOCTYPE validators PUBLIC
"-//Apache Struts//XWork Validator 1.0.2//EN"
"http://struts.apache.org/dtds/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>
@@ -0,0 +1,7 @@
HelloWorld.message= Struts is up and running ...
requiredstring = ${getText(fieldName)} is required.
password = Password
username = User Name
Missing.message = This feature is under construction. Please try again in the next interation.
test-yes=Yo
test-no=Nein
@@ -0,0 +1,5 @@
HelloWorld.message= ¡Struts está bien! ...
requiredstring = ${getText(fieldName)} se requiere.
password = Contraseña
username = Nombre de Usuario
Missing.message = ¡en obras! ¡seguir intentando!
@@ -6,8 +6,8 @@
</Console>
</Appenders>
<Loggers>
<Logger name="com.opensymphony.xwork2" level="info"/>
<Logger name="org.apache.struts2" level="info"/>
<Logger name="com.opensymphony.xwork2" level="debug"/>
<Logger name="org.apache.struts2" level="debug"/>
<Root level="warn">
<AppenderRef ref="STDOUT"/>
</Root>
+35
View File
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="true" />
<package name="default" namespace="/" extends="struts-default">
<default-action-ref name="index" />
<global-results>
<result name="error">/WEB-INF/jsp/error.jsp</result>
</global-results>
<global-exception-mappings>
<exception-mapping exception="java.lang.Exception" result="error"/>
</global-exception-mappings>
<action name="index">
<result type="redirectAction">
<param name="actionName">HelloWorld</param>
<param name="namespace">/example</param>
</result>
</action>
</package>
<include file="example.xml"/>
<!-- Add packages here -->
</struts>
@@ -0,0 +1 @@
runtime.log.logsystem.class=org.apache.velocity.runtime.log.NullLogChute
@@ -0,0 +1,15 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head><title>Simple jsp page</title></head>
<body>
<h3>Exception:</h3>
<s:property value="exception"/>
<h3>Stack trace:</h3>
<pre>
<s:property value="exceptionStack"/>
</pre>
</body>
</html>
@@ -0,0 +1,30 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title><s:text name="HelloWorld.message"/></title>
</head>
<body>
<h2><s:property value="message"/></h2>
<h3>Languages</h3>
<ul>
<li>
<s:url id="url" action="HelloWorld">
<s:param name="request_locale">en</s:param>
</s:url>
<s:a class="test" href="%{url}">English</s:a>
</li>
<li>
<s:url id="url" action="HelloWorld">
<s:param name="request_locale">es</s:param>
</s:url>
<s:a href="%{url}">Espanol</s:a>
</li>
</ul>
<s:checkboxlist name="test" list="values" listLabelKey="'test-' + name().toLowerCase()" />
</body>
</html>
@@ -0,0 +1,15 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Sign On</title>
</head>
<body>
<s:form action="Login">
<s:textfield key="username"/>
<s:password key="password" />
<s:submit/>
</s:form>
</body>
</html>
@@ -0,0 +1,3 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<s:include value="Missing.jsp"/>
@@ -0,0 +1,11 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head><title>Missing Feature</title></head>
<body>
<p>
<s:text name="Missing.message"/>
</p>
</body>
</html>
@@ -0,0 +1,3 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<s:include value="Missing.jsp"/>
@@ -0,0 +1,18 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Welcome</title>
<link href="<s:url value="/css/examplecss"/>" rel="stylesheet"
type="text/css"/>
</head>
<body>
<h3>Commands</h3>
<ul>
<li><a href="<s:url action="Login_input"/>">Sign On</a></li>
<li><a href="<s:url action="Register"/>">Register</a></li>
</ul>
</body>
</html>
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Struts Blank</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<!-- Restricts access to pure JSP files - access available only via Struts action -->
<security-constraint>
<display-name>No direct JSP access</display-name>
<web-resource-collection>
<web-resource-name>No-JSP</web-resource-name>
<url-pattern>*.jsp</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>no-users</role-name>
</auth-constraint>
</security-constraint>
<security-role>
<description>Don't assign users to this role</description>
<role-name>no-users</role-name>
</security-role>
</web-app>
+10
View File
@@ -0,0 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=example/HelloWorld.action">
</head>
<body>
<p>Loading ...</p>
</body>
</html>
@@ -0,0 +1,96 @@
/*
* $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 example;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.config.RuntimeConfiguration;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.config.entities.ResultConfig;
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
import org.apache.struts2.StrutsTestCase;
import java.util.List;
import java.util.Map;
public class ConfigTest extends StrutsTestCase {
protected void assertSuccess(String result) throws Exception {
assertTrue("Expected a success result!",
ActionSupport.SUCCESS.equals(result));
}
protected void assertInput(String result) throws Exception {
assertTrue("Expected an input result!",
ActionSupport.INPUT.equals(result));
}
protected Map<String, List<String>> assertFieldErrors(ActionSupport action) throws Exception {
assertTrue(action.hasFieldErrors());
return action.getFieldErrors();
}
protected void assertFieldError(Map field_errors, String field_name, String error_message) {
List errors = (List) field_errors.get(field_name);
assertNotNull("Expected errors for " + field_name, errors);
assertTrue("Expected errors for " + field_name, errors.size()>0);
// TODO: Should be a loop
assertEquals(error_message,errors.get(0));
}
protected void setUp() throws Exception {
super.setUp();
XmlConfigurationProvider c = new XmlConfigurationProvider("struts.xml");
configurationManager.addContainerProvider(c);
configurationManager.reload();
}
protected ActionConfig assertClass(String namespace, String action_name, String class_name) {
RuntimeConfiguration configuration = configurationManager.getConfiguration().getRuntimeConfiguration();
ActionConfig config = configuration.getActionConfig(namespace, action_name);
assertNotNull("Mssing action", config);
assertTrue("Wrong class name: [" + config.getClassName() + "]",
class_name.equals(config.getClassName()));
return config;
}
protected ActionConfig assertClass(String action_name, String class_name) {
return assertClass("", action_name, class_name);
}
protected void assertResult(ActionConfig config, String result_name, String result_value) {
Map results = config.getResults();
ResultConfig result = (ResultConfig) results.get(result_name);
Map params = result.getParams();
String value = (String) params.get("actionName");
if (value == null)
value = (String) params.get("location");
assertTrue("Wrong result value: [" + value + "]",
result_value.equals(value));
}
public void testConfig() throws Exception {
assertNotNull(configurationManager);
}
}
@@ -0,0 +1,37 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package example;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.StrutsTestCase;
public class HelloWorldTest extends StrutsTestCase {
public void testHelloWorld() throws Exception {
HelloWorld hello_world = new HelloWorld();
String result = hello_world.execute();
assertTrue("Expected a success result!",
ActionSupport.SUCCESS.equals(result));
assertTrue("Expected the default message!",
hello_world.getText(HelloWorld.MESSAGE).equals(hello_world.getMessage()));
}
}
@@ -0,0 +1,55 @@
/*
* $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 example;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import java.util.Map;
public class LoginTest extends ConfigTest {
public void FIXME_testLoginConfig() throws Exception {
ActionConfig config = assertClass("example", "Login_input", "example.Login");
assertResult(config, ActionSupport.SUCCESS, "Menu");
assertResult(config, ActionSupport.INPUT, "/example/Login.jsp");
}
public void testLoginSubmit() throws Exception {
Login login = new Login();
login.setUsername("username");
login.setPassword("password");
String result = login.execute();
assertSuccess(result);
}
// Needs access to an envinronment that includes validators
public void FIXME_testLoginSubmitInput() throws Exception {
Login login = new Login();
String result = login.execute();
assertInput(result);
Map errors = assertFieldErrors(login);
assertFieldError(errors,"username","Username is required.");
assertFieldError(errors,"password","Password is required.");
}
}
+16
View File
@@ -0,0 +1,16 @@
README.txt - JBoss Blank
This is an "empty" application that you can deploy as the basis of your own
application. This specially dedicated to JBoss server as it includes the Javassist library.
For more on getting started with Struts, see
* http://cwiki.apache.org/WW/home.html
I18N:
=====
Please note that this project was created with the assumption that it will be run
in an environment where the default locale is set to English. This means that
the default messages defined in package.properties are in English. If the default
locale for your server is different, then rename package.properties to package_en.properties
and create a new package.properties with proper values for your default locale.
+61
View File
@@ -0,0 +1,61 @@
<?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.3.37</version>
</parent>
<artifactId>struts2-jboss-blank</artifactId>
<packaging>war</packaging>
<name>Struts 2 JBoss Blank Webapp</name>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>struts2-junit-plugin</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
@@ -1,29 +1,30 @@
/*
* $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.struts.beanvalidation;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.Result;
public class VoidResult implements Result {
public void execute(ActionInvocation invocation) throws Exception {
}
}
/*
* $Id: ExampleSupport.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 example;
import com.opensymphony.xwork2.ActionSupport;
/**
* Base Action class for the Tutorial package.
*/
public class ExampleSupport extends ActionSupport {
}
@@ -0,0 +1,61 @@
/*
* $Id: HelloWorld.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 example;
/**
* <code>Set welcome message.</code>
*/
public class HelloWorld extends ExampleSupport {
public String execute() throws Exception {
setMessage(getText(MESSAGE));
return SUCCESS;
}
/**
* Provide default valuie for Message property.
*/
public static final String MESSAGE = "HelloWorld.message";
/**
* Field for Message property.
*/
private String message;
/**
* Return Message property.
*
* @return Message property
*/
public String getMessage() {
return message;
}
/**
* Set Message property.
*
* @param message Text to display on HelloWorld page.
*/
public void setMessage(String message) {
this.message = message;
}
}
@@ -0,0 +1,59 @@
/*
* $Id: Login.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 example;
public class Login extends ExampleSupport {
public String execute() throws Exception {
if (isInvalid(getUsername())) return INPUT;
if (isInvalid(getPassword())) return INPUT;
return SUCCESS;
}
private boolean isInvalid(String value) {
return (value == null || value.length() == 0);
}
private String username;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
private String password;
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
@@ -0,0 +1,174 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
@@ -0,0 +1,5 @@
Apache Struts
Copyright 2000-2011 The Apache Software Foundation
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
@@ -0,0 +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>/WEB-INF/jsp/example/HelloWorld.jsp</result>
</action>
<action name="Login_*" method="{1}" class="example.Login">
<result name="input">/WEB-INF/jsp/example/Login.jsp</result>
<result type="redirectAction">Menu</result>
</action>
<action name="*" class="example.ExampleSupport">
<result>/WEB-INF/jsp/example/{1}.jsp</result>
</action>
<!-- Add actions here -->
</package>
</struts>
@@ -0,0 +1,16 @@
<!DOCTYPE validators PUBLIC
"-//Apache Struts//XWork Validator 1.0.2//EN"
"http://struts.apache.org/dtds/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>
@@ -0,0 +1,5 @@
HelloWorld.message= Struts is up and running ...
requiredstring = ${getText(fieldName)} is required.
password = Password
username = User Name
Missing.message = This feature is under construction. Please try again in the next interation.
@@ -0,0 +1,5 @@
HelloWorld.message= ¡Struts está bien! ...
requiredstring = ${getText(fieldName)} se requiere.
password = Contraseña
username = Nombre de Usuario
Missing.message = ¡en obras! ¡seguir intentando!
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="false" />
<include file="example.xml"/>
<package name="default" namespace="/" extends="struts-default">
<default-action-ref name="index" />
<action name="index">
<result type="redirectAction">
<param name="actionName">HelloWorld</param>
<param name="namespace">/example</param>
</result>
</action>
</package>
<!-- Add packages here -->
</struts>
@@ -0,0 +1 @@
runtime.log.logsystem.class=org.apache.velocity.runtime.log.NullLogChute
@@ -0,0 +1,28 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title><s:text name="HelloWorld.message"/></title>
</head>
<body>
<h2><s:property value="message"/></h2>
<h3>Languages</h3>
<ul>
<li>
<s:url id="url" action="HelloWorld">
<s:param name="request_locale">en</s:param>
</s:url>
<s:a href="%{url}">English</s:a>
</li>
<li>
<s:url id="url" action="HelloWorld">
<s:param name="request_locale">es</s:param>
</s:url>
<s:a href="%{url}">Espanol</s:a>
</li>
</ul>
</body>
</html>
@@ -0,0 +1,15 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Sign On</title>
</head>
<body>
<s:form action="Login">
<s:textfield key="username"/>
<s:password key="password" />
<s:submit/>
</s:form>
</body>
</html>
@@ -0,0 +1,3 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<s:include value="Missing.jsp"/>
@@ -0,0 +1,11 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head><title>Missing Feature</title></head>
<body>
<p>
<s:text name="Missing.message"/>
</p>
</body>
</html>
@@ -0,0 +1,3 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<s:include value="Missing.jsp"/>
@@ -0,0 +1,18 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Welcome</title>
<link href="<s:url value="/css/examplecss"/>" rel="stylesheet"
type="text/css"/>
</head>
<body>
<h3>Commands</h3>
<ul>
<li><a href="<s:url action="Login_input"/>">Sign On</a></li>
<li><a href="<s:url action="Register"/>">Register</a></li>
</ul>
</body>
</html>
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Struts Blank</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<!-- Restricts access to pure JSP files - access available only via Struts action -->
<security-constraint>
<display-name>No direct JSP access</display-name>
<web-resource-collection>
<web-resource-name>No-JSP</web-resource-name>
<url-pattern>*.jsp</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>no-users</role-name>
</auth-constraint>
</security-constraint>
<security-role>
<description>Don't assign users to this role</description>
<role-name>no-users</role-name>
</security-role>
</web-app>
@@ -0,0 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=example/HelloWorld.action">
</head>
<body>
<p>Loading ...</p>
</body>
</html>
@@ -0,0 +1,96 @@
/*
* $Id: ConfigTest.java 670170 2008-06-21 09:40:34Z hermanns $
*
* 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 example;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.config.RuntimeConfiguration;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.config.entities.ResultConfig;
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
import org.apache.struts2.StrutsTestCase;
import java.util.List;
import java.util.Map;
public class ConfigTest extends StrutsTestCase {
protected void assertSuccess(String result) throws Exception {
assertTrue("Expected a success result!",
ActionSupport.SUCCESS.equals(result));
}
protected void assertInput(String result) throws Exception {
assertTrue("Expected an input result!",
ActionSupport.INPUT.equals(result));
}
protected Map<String, List<String>> assertFieldErrors(ActionSupport action) throws Exception {
assertTrue(action.hasFieldErrors());
return action.getFieldErrors();
}
protected void assertFieldError(Map field_errors, String field_name, String error_message) {
List errors = (List) field_errors.get(field_name);
assertNotNull("Expected errors for " + field_name, errors);
assertTrue("Expected errors for " + field_name, errors.size()>0);
// TODO: Should be a loop
assertEquals(error_message,errors.get(0));
}
protected void setUp() throws Exception {
super.setUp();
XmlConfigurationProvider c = new XmlConfigurationProvider("struts.xml");
configurationManager.addContainerProvider(c);
configurationManager.reload();
}
protected ActionConfig assertClass(String namespace, String action_name, String class_name) {
RuntimeConfiguration configuration = configurationManager.getConfiguration().getRuntimeConfiguration();
ActionConfig config = configuration.getActionConfig(namespace, action_name);
assertNotNull("Mssing action", config);
assertTrue("Wrong class name: [" + config.getClassName() + "]",
class_name.equals(config.getClassName()));
return config;
}
protected ActionConfig assertClass(String action_name, String class_name) {
return assertClass("", action_name, class_name);
}
protected void assertResult(ActionConfig config, String result_name, String result_value) {
Map results = config.getResults();
ResultConfig result = (ResultConfig) results.get(result_name);
Map params = result.getParams();
String value = (String) params.get("actionName");
if (value == null)
value = (String) params.get("location");
assertTrue("Wrong result value: [" + value + "]",
result_value.equals(value));
}
public void testConfig() throws Exception {
assertNotNull(configurationManager);
}
}
@@ -0,0 +1,38 @@
/*
* $Id: HelloWorldTest.java 577750 2007-09-20 13:54:31Z mrdon $
*
* 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 example;
import org.apache.struts2.StrutsTestCase;
import com.opensymphony.xwork2.ActionSupport;
public class HelloWorldTest extends StrutsTestCase {
public void testHelloWorld() throws Exception {
HelloWorld hello_world = new HelloWorld();
String result = hello_world.execute();
assertTrue("Expected a success result!",
ActionSupport.SUCCESS.equals(result));
assertTrue("Expected the default message!",
hello_world.getText(HelloWorld.MESSAGE).equals(hello_world.getMessage()));
}
}
@@ -0,0 +1,55 @@
/*
* $Id: LoginTest.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 example;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import java.util.Map;
public class LoginTest extends ConfigTest {
public void FIXME_testLoginConfig() throws Exception {
ActionConfig config = assertClass("example", "Login_input", "example.Login");
assertResult(config, ActionSupport.SUCCESS, "Menu");
assertResult(config, ActionSupport.INPUT, "/example/Login.jsp");
}
public void testLoginSubmit() throws Exception {
Login login = new Login();
login.setUsername("username");
login.setPassword("password");
String result = login.execute();
assertSuccess(result);
}
// Needs access to an envinronment that includes validators
public void FIXME_testLoginSubmitInput() throws Exception {
Login login = new Login();
String result = login.execute();
assertInput(result);
Map errors = assertFieldErrors(login);
assertFieldError(errors,"username","Username is required.");
assertFieldError(errors,"password","Password is required.");
}
}
+23
View File
@@ -0,0 +1,23 @@
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/
I18N:
=====
Please note that this project was created with the assumption that it will be run
in an environment where the default locale is set to English. This means that
the default messages defined in package.properties are in English. If the default
locale for your server is different, then rename package.properties to package_en.properties
and create a new package.properties with proper values for your default locale.
+100
View File
@@ -0,0 +1,100 @@
<?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.3.37</version>
</parent>
<artifactId>struts2-mailreader</artifactId>
<packaging>war</packaging>
<name>Struts 2 Mail Reader Webapp</name>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>struts-mailreader-dao</artifactId>
<version>1.3.5</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.16.v20140903</version>
<configuration>
<stopKey>CTRL+C</stopKey>
<stopPort>8999</stopPort>
<systemProperties>
<systemProperty>
<name>log4j.configuration</name>
<value>file:${basedir}/src/main/resources/log4j.properties</value>
</systemProperty>
<systemProperty>
<name>slf4j</name>
<value>false</value>
</systemProperty>
</systemProperties>
<scanIntervalSeconds>10</scanIntervalSeconds>
<webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
<webAppConfig>
<contextPath>/struts2-mailreader</contextPath>
<descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
</webAppConfig>
</configuration>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
@@ -0,0 +1,3 @@
password=Enter your Password here ==>
struts.logo.path=struts-power.gif
struts.logo.alt=Powered by Struts
@@ -0,0 +1 @@
.password=\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b==>
@@ -0,0 +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>
@@ -0,0 +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>/WEB-INF/jsp/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">/WEB-INF/jsp/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">/WEB-INF/jsp/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">/WEB-INF/jsp/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>/WEB-INF/jsp/{1}.jsp</result>
</action>
</package>
</struts>
@@ -0,0 +1,240 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package mailreader2;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import org.apache.struts.apps.mailreader.dao.impl.memory.MemoryUserDatabase;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* <p><code>ServletContextListener</code> that initializes and finalizes the
* persistent storage of User and Subscription information for the Struts
* Demonstration Application, using an in-memory database backed by an XML
* file.</p>
* <p/>
* <p><strong>IMPLEMENTATION WARNING</strong> - If this web application is run
* from a WAR file, or in another environment where reading and writing of the
* web application resource is impossible, the initial contents will be copied
* to a file in the web application temporary directory provided by the
* container. This is for demonstration purposes only - you should
* <strong>NOT</strong> assume that files written here will survive a restart
* of your servlet container.</p>
* <p/>
* <p>This class was borrowed from the Shale Mailreader. Changes were:</p>
* <p/>
* <ul>
* <p/>
* <li>Path to database.xml (under classes here). </li>
* <p/>
* <li>Class to store protocol list (an array here). </li>
* <p/>
* </ul>
* <p>
* DEVELOPMENT NOTE - Another approach would be to instantiate the database via Spring.
* </p>
*/
public final class ApplicationListener implements ServletContextListener {
// ------------------------------------------------------ Manifest Constants
/**
* <p>Appication scope attribute key under which the in-memory version of
* our database is stored.</p>
*/
public static final String DATABASE_KEY = "database";
/**
* <p>Application scope attribute key under which the valid selection
* items for the protocol property is stored.</p>
*/
public static final String PROTOCOLS_KEY = "protocols";
// ------------------------------------------------------ Instance Variables
/**
* <p>The <code>ServletContext</code> for this web application.</p>
*/
private ServletContext context = null;
/**
* The {@link MemoryUserDatabase} object we construct and make available.
*/
private MemoryUserDatabase database = null;
/**
* <p>Logging output for this plug in instance.</p>
*/
private Logger log = LoggerFactory.getLogger(this.getClass());
// ------------------------------------------------------------- Properties
/**
* <p>The web application resource path of our persistent database storage
* file.</p>
*/
private String pathname = "/WEB-INF/database.xml";
/**
* <p>Return the application resource path to the database.</p>
*
* @return application resource path path to the database
*/
public String getPathname() {
return (this.pathname);
}
/**
* <p>Set the application resource path to the database.</p>
*
* @param pathname to the database
*/
public void setPathname(String pathname) {
this.pathname = pathname;
}
// ------------------------------------------ ServletContextListener Methods
/**
* <p>Gracefully shut down this database, releasing any resources that
* were allocated at initialization.</p>
*
* @param event ServletContextEvent to process
*/
public void contextDestroyed(ServletContextEvent event) {
log.info("Finalizing memory database plug in");
if (database != null) {
try {
database.close();
} catch (Exception e) {
log.error("Closing memory database", e);
}
}
context.removeAttribute(DATABASE_KEY);
context.removeAttribute(PROTOCOLS_KEY);
database = null;
context = null;
}
/**
* <p>Initialize and load our initial database from persistent
* storage.</p>
*
* @param event The context initialization event
*/
public void contextInitialized(ServletContextEvent event) {
log.info("Initializing memory database plug in from '" +
pathname + "'");
// Remember our associated ServletContext
this.context = event.getServletContext();
// Construct a new database and make it available
database = new MemoryUserDatabase();
try {
String path = calculatePath();
if (log.isDebugEnabled()) {
log.debug(" Loading database from '" + path + "'");
}
database.setPathname(path);
database.open();
} catch (Exception e) {
log.error("Opening memory database", e);
throw new IllegalStateException("Cannot load database from '" +
pathname + "': " + e);
}
context.setAttribute(DATABASE_KEY, database);
}
// -------------------------------------------------------- Private Methods
/**
* <p>Calculate and return an absolute pathname to the XML file to contain
* our persistent storage information.</p>
*
* @throws Exception if an input/output error occurs
*/
private String calculatePath() throws Exception {
// Can we access the database via file I/O?
String path = context.getRealPath(pathname);
if (path != null) {
return (path);
}
// Does a copy of this file already exist in our temporary directory
File dir = (File)
context.getAttribute("javax.servlet.context.tempdir");
File file = new File(dir, "struts-example-database.xml");
if (file.exists()) {
return (file.getAbsolutePath());
}
// Copy the static resource to a temporary file and return its path
InputStream is =
context.getResourceAsStream(pathname);
BufferedInputStream bis = new BufferedInputStream(is, 1024);
FileOutputStream os =
new FileOutputStream(file);
BufferedOutputStream bos = new BufferedOutputStream(os, 1024);
byte buffer[] = new byte[1024];
while (true) {
int n = bis.read(buffer);
if (n <= 0) {
break;
}
bos.write(buffer, 0, n);
}
bos.close();
bis.close();
return (file.getAbsolutePath());
}
}
@@ -0,0 +1,51 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package mailreader2;
import com.opensymphony.xwork2.interceptor.Interceptor;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.Action;
import java.util.Map;
import org.apache.struts.apps.mailreader.dao.User;
public class AuthenticationInterceptor implements Interceptor {
public void destroy () {}
public void init() {}
public String intercept(ActionInvocation actionInvocation) throws Exception {
Map session = actionInvocation.getInvocationContext().getSession();
User user = (User) session.get(Constants.USER_KEY);
boolean isAuthenticated = (null!=user) && (null!=user.getDatabase());
if (!isAuthenticated) {
return Action.LOGIN;
}
else {
return actionInvocation.invoke();
}
}
}
@@ -0,0 +1,128 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package mailreader2;
/**
* <p> Manifest constants for the MailReader application. </p>
*/
public final class Constants {
// --- Tokens ----
/**
* <p> The token representing a "cancel" request. </p>
*/
public static final String CANCEL = "cancel";
/**
* <p> The token representing a "create" task. </p>
*/
public static final String CREATE = "Create";
/**
* <p> The application scope attribute under which our user database is
* stored. </p>
*/
public static final String DATABASE_KEY = "database";
/**
* <p> The token representing a "edit" task. </p>
*/
public static final String DELETE = "Delete";
/**
* <p> The token representing a "edit" task. </p>
*/
public static final String EDIT = "Edit";
/**
* <p> The package name for this application. </p>
*/
public static final String PACKAGE = "org.apache.struts.apps.mailreader";
/**
* <p> The session scope attribute under which the Subscription object
* currently selected by our logged-in User is stored. </p>
*/
public static final String SUBSCRIPTION_KEY = "subscription";
/**
* <p> The session scope attribute under which the User object for the
* currently logged in user is stored. </p>
*/
public static final String USER_KEY = "user";
/**
* <p>The token representing the "Host" property.
*/
public static final String HOST = "host";
// ---- Error Messages ----
/**
* <p>
* A static message in case message resource is not loaded.
* </p>
*/
public static final String ERROR_MESSAGES_NOT_LOADED =
"ERROR: Message resources not loaded -- check servlet container logs for error messages.";
/**
* <p>
* A static message in case database resource is not loaded.
* <p>
*/
public static final String ERROR_DATABASE_NOT_LOADED =
"ERROR: User database not loaded -- check servlet container logs for error messages.";
/**
* <p>
* A standard key from the message resources file, to test if it is available.
* <p>
*/
public static final String ERROR_DATABASE_MISSING = "error.database.missing";
/**
* <P>
* A "magic" username to trigger an ExpiredPasswordException for testing.
*</p>
*/
public static final String EXPIRED_PASSWORD_EXCEPTION = "ExpiredPasswordException";
/**
* <p>
* Name of field to associate with authentification errors.
* <p>
*/
public static final String PASSWORD_MISMATCH_FIELD = "password";
// ---- Log Messages ----
/**
* <p> Message to log if saving a user fails. </p>
*/
public static final String LOG_DATABASE_SAVE_ERROR =
" Unexpected error when saving User: ";
}
@@ -0,0 +1,14 @@
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/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>
@@ -18,23 +18,31 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts.beanvalidation.models;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
package mailreader2;
public class Address {
import org.apache.struts.apps.mailreader.dao.User;
import org.apache.struts.apps.mailreader.dao.ExpiredPasswordException;
@NotNull(message = "streetNotNull")
@Size(min = 3, max = 64, message = "streetSize")
private String street;
/**
* <p> Validate a user login. </p>
*/
public final class Login extends MailreaderSupport {
public void setStreet(String street) {
this.street = street;
}
public String execute() throws ExpiredPasswordException {
User user = findUser(getUsername(), getPassword());
if (user != null) {
setUser(user);
}
if (hasErrors()) {
return INPUT;
}
return SUCCESS;
public String getStreet() {
return street;
}
}
@@ -0,0 +1,35 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package mailreader2;
/**
* <p> Log user out of the current session. </p>
*/
public class Logout extends MailreaderSupport {
public String execute() {
setUser(null);
return SUCCESS;
}
}
@@ -0,0 +1,584 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package mailreader2;
import java.util.Map;
import org.apache.struts.apps.mailreader.dao.ExpiredPasswordException;
import org.apache.struts.apps.mailreader.dao.Subscription;
import org.apache.struts.apps.mailreader.dao.User;
import org.apache.struts.apps.mailreader.dao.UserDatabase;
import org.apache.struts.apps.mailreader.dao.impl.memory.MemorySubscription;
import org.apache.struts.apps.mailreader.dao.impl.memory.MemoryUser;
import org.apache.struts2.interceptor.ApplicationAware;
import org.apache.struts2.interceptor.SessionAware;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* <p> Base Action for MailreaderSupport application. </p>
* <p/>
* <p> Note that this class does NOT implement model driven because of the way
* the pre-existing model is designed. The MailReader DAO includes immutable
* fields that can only be set on construction, and some objects do not have a
* default construction. One approach would be to mirror all the DAO
* properties on the Actions. As an alternative, this implementations uses the
* DAO properties where possible, and uses local Action properties only as
* needed. To create new objects, a blank temporary object is constructed, and
* the page uses a mix of local Action properties and DAO properties. When the
* new object is to be saved, the local Action properties are used to create
* the object using the DAO factory methods, the input values are copied from
* the temporary object, and the new object is saved. It's kludge, but it
* avoids creating unnecessary local properties. Pick your poison.</p>
*/
public class MailreaderSupport extends ActionSupport
implements SessionAware, ApplicationAware {
/**
* Return CANCEL so apropriate result can be selected.
* @return "cancel" so apropriate result can be selected.
*/
public String cancel() {
return Constants.CANCEL;
}
/**
* Convenience method to copy User properties.
**/
protected void copyUser(User source, User target) {
if ((source==null) || (target==null)) return;
target.setFromAddress(source.getFromAddress());
target.setFullName(source.getFullName());
target.setPassword(source.getPassword());
target.setReplyToAddress(source.getReplyToAddress());
}
/**
* Convenience method to copy Subscription properties.
**/
protected void copySubscription(Subscription source, Subscription target) {
if ((source==null) || (target==null)) return;
target.setAutoConnect(source.getAutoConnect());
target.setPassword(source.getPassword());
target.setType(source.getType());
target.setUsername(source.getUsername());
}
// ---- ApplicationAware ----
/**
* <p>Field to store application context or its proxy.</p>
* <p/>
* <p>The application context lasts for the life of the application. A
* reference to the database is stored in the application context at
* startup.</p>
*/
private Map application;
/**
* <p>Store a new application context.</p>
*
* @param value A Map representing application state
*/
public void setApplication(Map value) {
application = value;
}
/**
* <p>Provide application context.</p>
*/
public Map getApplication() {
return application;
}
// ---- SessionAware ----
/**
* <p>Field to store session context, or its proxy.</p>
*/
private Map session;
/**
* <p>Store a new session context.</p>
*
* @param value A Map representing session state
*/
public void setSession(Map value) {
session = value;
}
/**
* <p>Provide session context.</p>
*
* @return session context
*/
public Map getSession() {
return session;
}
// ---- Task property (utilized by UI) ----
/**
* <p>Field to store workflow task.</p>
* <p/>
* <p>The Task is used to track the state of the CRUD workflows. It can be
* set to Constant.CREATE, Constant.EDIT, or Constant.DELETE as
* needed.</p>
*/
private String task = null;
/**
* <p>Provide worklow task.</p>
*
* @return Returns the task.
*/
public String getTask() {
return task;
}
/**
* <p>Store new workflow task.</p>
*
* @param value The task to set.
*/
public void setTask(String value) {
task = value;
}
// ---- Token property (utilized by UI) ----
/**
* <p>Field to store double-submit guard.</p>
*/
private String token = null;
/**
* <p>Provide Token.</p>
*
* @return Returns the token.
*/
public String getToken() {
return token;
}
/**
* <p>Store new Token.</p>
*
* @param value The token to set.
*/
public void setToken(String value) {
token = value;
}
// ---- Host property ----
/**
* <p>Field to store Subscription host.</p>
* <p/>
* <p> The host is an immutable property of the Subscrtion DAP object, so
* we need to store it locally until we are ready to create the
* Subscription. </p>
*/
private String host;
/**
* <p>Provide tSubscription host.</p>
*
* @return host property
*/
public String getHost() {
return host;
}
/**
* <p>Store new Subscription host.</p>
*
* @param value
*/
public void setHost(String value) {
host = value;
}
// ---- Password property ----
/**
* <p>Field to store User password property.</p>
* <p/>
* <p>The User DAO object password proerty is immutable, so we store it
* locally until we are ready to create the object.</p>
*/
private String password = null;
/**
* <p>Provide User password</p>
*
* @return Returns the password.
*/
public String getPassword() {
return password;
}
/**
* <p>Store new User Password</p>
*
* @param value The password to set.
*/
public void setPassword(String value) {
password = value;
}
// ---- Password2 property (confirmation) ----
/**
* <p>Field to store the User password confirmation.</p>
* <p/>
* <p>When a User object is created, we ask the client to enter the
* password twice, to help ensure the password is being typed
* correctly.</p>
*/
private String password2 = null;
/**
* <p>Provide the User password confirmation.</p>
*
* @return Returns the confirmationpassword.
*/
public String getPassword2() {
return password2;
}
/**
* <p>Store a new User password confirmation.</p>
*
* @param value The confirmation password to set.
*/
public void setPassword2(String value) {
password2 = value;
}
// ---- Username property ----
/**
* <p>Field to store User username.</p>
* <p/>
* <p>The User DAO object password proerty is immutable, so we store it
* locally until we are ready to create the object.</p>
*/
private String username = null;
/**
* <p>Provide User username.</p>
*
* @return Returns the User username.
*/
public String getUsername() {
return username;
}
/**
* <p>Store new User username</p>
*
* @param value The username to set.
*/
public void setUsername(String value) {
username = value;
}
// ---- Database property ----
/**
* <p>Provide reference to UserDatabase, or null if the database is not
* available. </p>
*
* @return a reference to the UserDatabase or null if the database is not
* available
*/
public UserDatabase getDatabase() {
Object db = getApplication().get(Constants.DATABASE_KEY);
if (db == null) {
this.addActionError(getText("error.database.missing"));
}
return (UserDatabase) db;
}
/**
* <p>Store a new reference to UserDatabase</p>
*
* @param database
*/
public void setDatabase(UserDatabase database) {
getApplication().put(Constants.DATABASE_KEY, database);
}
// ---- User property ----
/**
* <p>Provide reference to User object for authenticated user.</p>
*
* @return User object for authenticated user.
*/
public User getUser() {
return (User) getSession().get(Constants.USER_KEY);
}
/**
* <p>Store new reference to User Object.</p>
*
* @param user User object for authenticated user
*/
public void setUser(User user) {
getSession().put(Constants.USER_KEY, user);
}
/**
* <p>Obtain User object from database, or return null if the credentials
* are not found or invalid.</p>
*
* @param username User username
* @param password User password
* @return User object or null if not found
* @throws ExpiredPasswordException
*/
public User findUser(String username, String password)
throws ExpiredPasswordException {
// FIXME: Stupid testing hack to compensate for inadequate DAO layer
if (Constants.EXPIRED_PASSWORD_EXCEPTION.equals(username)) {
throw new ExpiredPasswordException(Constants.EXPIRED_PASSWORD_EXCEPTION);
}
User user = getDatabase().findUser(username);
if ((user != null) && !user.getPassword().equals(password)) {
user = null;
}
if (user == null) {
this.addFieldError(Constants.PASSWORD_MISMATCH_FIELD,
getText("error.password.mismatch"));
}
return user;
}
/**
* <p><code>Log</code> instance for this application. </p>
*/
protected Logger log = LoggerFactory.getLogger(Constants.PACKAGE);
/**
* <p> Persist the User object, including subscriptions, to the database.
* </p>
*
* @throws java.lang.Exception on database error
*/
public void saveUser() throws Exception {
try {
getDatabase().save();
} catch (Exception e) {
String message = Constants.LOG_DATABASE_SAVE_ERROR + getUser()
.getUsername();
log.error(message, e);
throw new Exception(message, e);
}
}
public void createInputUser() {
User user = new MemoryUser(null, null);
setUser(user);
}
/**
* <p> Verify input for creating a new user, create the user, and process
* the login. </p>
*
* @return A new User and empty Errors if create succeeds, or null and
* Errors if create fails
*/
public User createUser(String username, String password) {
UserDatabase database = getDatabase();
User user;
try {
user = database.findUser(username);
}
catch (ExpiredPasswordException e) {
user = getUser(); // Just so that it is not null
}
if (user != null) {
this.addFieldError("username", "error.username.unique");
return null;
}
return database.createUser(username);
}
// Since user.username is immutable, we have to use some local properties
/**
* <p>Use the current User object to create a new User object, and make
* the new User object the authenticated user.</p>
* <p/>
* <p>The "current" User object is usually a temporary object being used
* to capture input.</p>
*
* @param _username User username
* @param _password User password
*/
public void copyUser(String _username, String _password) {
User input = getUser();
input.setPassword(_password);
User user = createUser(_username, _password);
if (null != user) {
copyUser(input,user);
setUser(user);
}
}
// ---- Subscription property ----
/**
* <p>Obtain the cached Subscription object, if any. </p>
*
* @return Cached Subscription object or null
*/
public Subscription getSubscription() {
return (Subscription) getSession().get(Constants.SUBSCRIPTION_KEY);
}
/**
* <p>Store new User Subscription.</p>
*
* @param subscription
*/
public void setSubscription(Subscription subscription) {
getSession().put(Constants.SUBSCRIPTION_KEY, subscription);
}
/**
* <p> Obtain User Subscription object for the given host, or return null
* if not found. </p>
*
* <p>It would be possible for this code to throw a NullPointerException,
* but the ExceptionHandler in the xwork.xml will catch that for us.</p>
*
* @return The matching Subscription or null
*/
public Subscription findSubscription(String host) {
Subscription subscription;
subscription = getUser().findSubscription(host);
return subscription;
}
/**
* <p>Obtain uSER Subscription for the local Host property.</p>
* <p/>
* <p>Usually, the host property will be set from the client request,
* because it was embedded in a link to the Subcription action.
*
* @return Subscription or null if not found
*/
public Subscription findSubscription() {
return findSubscription(getHost());
}
/**
* <p>Provide a "temporary" User Subscription object that can be used to
* capture input values.</p>
*/
public void createInputSubscription() {
Subscription sub = new MemorySubscription(getUser(), null);
setSubscription(sub);
setHost(sub.getHost());
}
/**
* <p>Provide new User Subscription object for the given host, or null if
* the host is not unique.</p>
*
* @param host
* @return New User Subscription object or null
*/
public Subscription createSubscription(String host) {
Subscription sub;
sub = findSubscription(host);
if (null != sub) {
// FIXME - localization - "error.host.unique")
addFieldError(Constants.HOST,"That hostname is already defined");
return null;
}
return getUser().createSubscription(host);
}
/**
* <p>Create a new Subscription from the current Subscription object,
* making the new Subscription the current Subscription. </p>
* <p/>
* <p>Usually, the "current" Subscription is a temporary object being used
* to capture input values.</p>
*
* @param host
*/
public void copySubscription(String host) {
Subscription input = getSubscription();
Subscription sub = createSubscription(host);
if (null != sub) {
copySubscription(input, sub);
setSubscription(sub);
setHost(sub.getHost());
}
}
/**
* <p>Delete the current Subscription object from the database.</p>
*/
public void removeSubscription() {
getUser().removeSubscription(getSubscription());
getSession().remove(Constants.SUBSCRIPTION_KEY);
}
/**
* <p>Provide MailServer Host for current User Subscription.</p>
*
* @return MailServer Host for current User Subscription
*/
public String getSubscriptionHost() {
Subscription sub = getSubscription();
if (null == sub) {
return null;
}
return sub.getHost();
}
}
@@ -0,0 +1,97 @@
button.cancel=Cancel
button.confirm=Confirm
button.doSubmit=DO_SUBMIT
button.doReset=DO_RESULT
button.doCancel=org.apache.struts.taglib.html.CANCEL
button.reset=Reset
button.save=Save
button.logon=Log on
change.message=Your password has expired. Please ask the system administrator to change it.
change.try=Try Again
change.title=Password Has Expired
database.load=Cannot load database from {0}
error.database.missing=User database is missing, cannot validate login credentials
error.fromAddress.format=Invalid format for From Address
error.fromAddress.required=From Address is required
error.fullName.required=Full Name is required
error.host.required=Mail Server is required
error.noSubscription=No Subscription bean in user session
error.password.expired=Your password has expired for username {0}
error.password.required=Password is required
error.password2.required=Confirmation password is required
error.password.match=Password and confirmation password must match
error.password.mismatch=Invalid username and/or password, please try again
error.replyToAddress.format=Invalid format for Reply To Address
struts.messages.invalid.token=Cannot submit this form out of order
error.type.invalid=Server Type must be 'imap' or 'pop3'
error.type.required=Server Type is required
error.username.required=Username is required
error.username.unique=That username is already in use - please select another
errors.footer=</ul><hr>
errors.header=<h3><font color="red">Validation Error</font></h3><p>You must correct the following error(s) before proceeding:</p><ul>
errors.prefix=<li>
errors.suffix=</li>
errors.ioException=I/O exception rendering error messages: {0}
expired.password=User Password has expired for {0}
heading.autoConnect=Auto
heading.subscriptions=Current Subscriptions
heading.host=Host Name
heading.user=User Name
heading.type=Server Type
heading.action=Action
index.heading=MailReader Demonstration Application Options
index.login=Log on to the MailReader Demonstration Application
index.registration=Register with the MailReader Demonstration Application
index.title=MailReader Demonstration Application
index.tour=A Walking Tour of the MailReader Demonstration Application
linkSubscription.io=I/O Error: {0}
linkSubscription.noSubscription=No subscription under attribute {0}
linkUser.io=I/O Error: {0}
linkUser.noUser=No user under attribute {0}
login.title=MailReader Demonstration Application - Login
mainMenu.heading=Main Menu Options for
mainMenu.logout=Log off MailReader Demonstration Application
mainMenu.registration=Edit your user registration profile
mainMenu.title=MailReader Demonstration Application - Main Menu
option.imap=IMAP Protocol
option.pop3=POP3 Protocol
# prompt.
host=Mail Server
password=Password
password2=(Repeat) Password
username=Username
registration.addSubscription=Add
registration.deleteSubscription=Delete
registration.editSubscription=Edit
registration.title.create=Register for the MailReader Demonstration Application
registration.title.edit=Edit Registration for the MailReader Demonstration Application
subscription.autoConnect=Auto Connect
subscription.password=Mail Password
subscription.type=Server Type
subscription.username=Mail Username
subscription.title.create=Create New Mail Subscription
subscription.title.delete=Delete Existing Mail Subscription
subscription.title.edit=Edit Existing Mail Subscription
user.fromAddress=From Address
user.fullName=Full Name
user.replyToAddress=Reply To Address
# Standard error messages for validator framework checks
errors.required=${getText(fieldName)} is required.
errors.minlength=${getText(fieldName)} cannot be less than {1} characters.
errors.maxlength=${getText(fieldName)} cannot be greater than {1} characters.
errors.invalid=${getText(fieldName)} is invalid.
errors.byte=${getText(fieldName)} must be an byte.
errors.short=${getText(fieldName)} must be an short.
errors.integer=${getText(fieldName)} must be an integer.
errors.long=${getText(fieldName)} must be an long.
errors.float=${getText(fieldName)} must be an float.
errors.double=${getText(fieldName)} must be an double.
errors.date=${getText(fieldName)} is not a date.
errors.range=${getText(fieldName)} is not in the range ${minLength} through ${maxLength}.
errors.creditcard=${getText(fieldName)} is not a valid credit card number.
errors.email=${getText(fieldName)} is an invalid e-mail address.
errors.literal=${getText(fieldName)}
@@ -0,0 +1,89 @@
button.cancel=\u30ad\u30e3\u30f3\u30bb\u30eb
button.confirm=\u78ba\u8a8d
button.reset=\u30ea\u30bb\u30c3\u30c8
button.save=\u4fdd\u5b58
change.message=\u30D1\u30B9\u30EF\u30FC\u30C9\u306E\u6709\u52B9\u671F\u9650\u304C\u904E\u304E\u307E\u3057\u305F\u3002\u30B7\u30B9\u30C6\u30E0\u7BA1\u7406\u8005\u306B\u304A\u554F\u3044\u5408\u308F\u305B\u4E0B\u3055\u3044
change.try=\u518D\u8A66\u884C
change.title=\u30d1\u30b9\u30ef\u30fc\u30c9\u671f\u9650\u5207\u308c
database.load= {0} \u304B\u3089\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093
error.database.missing=\u30E6\u30FC\u30B6\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\u30ED\u30B0\u30AA\u30F3\u306E\u8A8D\u8A3C\u304C\u51FA\u6765\u307E\u305B\u3093
error.fromAddress.format=From\u30A2\u30C9\u30EC\u30B9\u306E\u66F8\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093
error.fromAddress.required=From\u30A2\u30C9\u30EC\u30B9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044
error.fullName.required=\u30D5\u30EB\u30CD\u30FC\u30E0\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044
error.host.required=\u30E1\u30FC\u30EB\u30B5\u30FC\u30D0\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044
error.noSubscription=Subscription bean \u304c\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u4e2d\u306b\u3042\u308a\u307e\u305b\u3093
error.password.expired=\u30E6\u30FC\u30B6 {0} \u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u306E\u6709\u52B9\u671F\u9650\u304C\u904E\u304E\u307E\u3057\u305F
error.password.required=\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u5FC5\u8981\u3067\u3059
error.password2.required=\u30D1\u30B9\u30EF\u30FC\u30C9(\u78BA\u8A8D\u7528)\u304C\u5FC5\u8981\u3067\u3059
error.password.match=\u30D1\u30B9\u30EF\u30FC\u30C9\u3068\u78BA\u8A8D\u7528\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u4E00\u81F4\u3057\u3066\u3044\u307E\u305B\u3093
error.password.mismatch=\u30E6\u30FC\u30B6\u540D\u307E\u305F\u306F\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u4E0D\u6B63\u3067\u3059\u3002\u518D\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044
error.replyToAddress.format=\u8FD4\u4FE1\u30A2\u30C9\u30EC\u30B9\u306E\u66F8\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093
struts.messages.invalid.token=\u3053\u306E\u30D5\u30A9\u30FC\u30E0\u306E\u5185\u5BB9\u304C\u6B63\u3057\u304F\u306A\u3044\u305F\u3081\u9001\u4FE1\u3059\u308B\u3053\u3068\u304C\u51FA\u6765\u307E\u305B\u3093
error.type.invalid=\u30B5\u30FC\u30D0\u30BF\u30A4\u30D7\u306F 'imap' \u304B 'pop3'\u306E\u3069\u3061\u3089\u304B\u3067\u306A\u3051\u308C\u3070\u306A\u308A\u307E\u305B\u3093
error.type.required=\u30B5\u30FC\u30D0\u30BF\u30A4\u30D7\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044
error.username.required=\u30E6\u30FC\u30B6\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044
error.username.unique=\u305D\u306E\u30E6\u30FC\u30B6\u540D\u306F\u65E2\u306B\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059\u3002 \u5225\u306E\u30E6\u30FC\u30B6\u540D\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044
errors.footer=</ul><hr>
errors.header=<h3><font color="red">\u5165\u529b\u30c1\u30a7\u30c3\u30af\u30a8\u30e9\u30fc</font></h3><p>\u4ee5\u4e0b\u306e\u30a8\u30e9\u30fc\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044:</p><ul>
errors.prefix=<li>
errors.suffix=</li>
errors.ioException=I/O\u4f8b\u5916\u304c\u767a\u751f\u3057\u307e\u3057\u305f: {0}
expired.password=\u30E6\u30FC\u30B6 {0} \u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u306E\u6709\u52B9\u671F\u9650\u304C\u904E\u304E\u307E\u3057\u305F
heading.autoConnect=\u81ea\u52d5\u63a5\u7d9a
heading.subscriptions=\u73fe\u5728\u306e\u8cfc\u8aad\u60c5\u5831
heading.host=\u30db\u30b9\u30c8\u540d
heading.user=\u30e6\u30fc\u30b6\u540d
heading.type=\u30b5\u30fc\u30d0\u30bf\u30a4\u30d7
heading.action=\u64cd\u4f5c
index.heading=MailReader\u30c7\u30e2\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3 \u30aa\u30d7\u30b7\u30e7\u30f3
index.login=MailReader\u30c7\u30e2\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3 - \u30ed\u30b0\u30aa\u30f3
index.registration=MailReader\u30c7\u30e2\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3 - \u30e6\u30fc\u30b6\u767b\u9332
index.title=MailReader\u30c7\u30e2\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3(Struts 1.1-dev)
index.tour=\u30b5\u30f3\u30d7\u30eb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u6563\u7b56\u3059\u308b
linkSubscription.io=I/O\u30a8\u30e9\u30fc: {0}
linkSubscription.noSubscription=\u5c5e\u6027 {0} \u306b\u8cfc\u8aad\u60c5\u5831\u304c\u5b58\u5728\u3057\u307e\u305b\u3093
linkUser.io=I/O\u30a8\u30e9\u30fc: {0}
linkUser.noUser=\u5c5e\u6027 {0} \u306b\u30e6\u30fc\u30b6\u60c5\u5831\u304c\u5b58\u5728\u3057\u307e\u305b\u3093
login.title=MailReader\u30c7\u30e2\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3 - \u30ed\u30b0\u30aa\u30f3
mainMenu.heading=\u30e1\u30a4\u30f3\u30e1\u30cb\u30e5\u30fc
mainMenu.logout=MailReader \u30c7\u30e2\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30ed\u30b0\u30aa\u30d5
mainMenu.registration=\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u306e\u7de8\u96c6
mainMenu.title=MailReader\u30c7\u30e2\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3 - \u30e1\u30a4\u30f3\u30e1\u30cb\u30e5\u30fc
option.imap=IMAP \u30d7\u30ed\u30c8\u30b3\u30eb
option.pop3=POP3 \u30d7\u30ed\u30c8\u30b3\u30eb
# prompt.
autoConnect=\u81ea\u52d5\u63a5\u7d9a
fromAddress=From\u30a2\u30c9\u30ec\u30b9
fullName=\u30d5\u30eb\u30cd\u30fc\u30e0
mailHostname=\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0
mailPassword=\u30e1\u30fc\u30eb\u30d1\u30b9\u30ef\u30fc\u30c9
mailServerType=\u30b5\u30fc\u30d0\u30bf\u30a4\u30d7
mailUsername=\u30e1\u30fc\u30eb\u30e6\u30fc\u30b6\u540d
.password=\u30d1\u30b9\u30ef\u30fc\u30c9
password2=\u30d1\u30b9\u30ef\u30fc\u30c9(\u78ba\u8a8d\u7528)
replyToAddress=\u8fd4\u4fe1\u30a2\u30c9\u30ec\u30b9
username=\u30e6\u30fc\u30b6\u540d
registration.addSubscription=\u65b0\u898f\u4f5c\u6210
registration.deleteSubscription=\u524a\u9664
registration.editSubscription=\u7de8\u96c6
registration.title.create=MailReader\u30c7\u30e2\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3 - \u30e6\u30fc\u30b6\u767b\u9332
registration.title.edit=MailReader\u30c7\u30e2\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3 - \u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u7de8\u96c6
subscription.title.create=\u30e1\u30fc\u30eb\u8cfc\u8aad\u60c5\u5831\u306e\u65b0\u898f\u4f5c\u6210
subscription.title.delete=\u30e1\u30fc\u30eb\u8cfc\u8aad\u60c5\u5831\u306e\u524a\u9664
subscription.title.edit=\u30e1\u30fc\u30eb\u8cfc\u8aad\u60c5\u5831\u306e\u7de8\u96c6
# Standard error messages for validator framework checks
errors.required=${getText(fieldName)} \u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002
errors.minlength=${getText(fieldName)} \u306f {1} \u6587\u5b57\u4ee5\u4e0a\u3067\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002
errors.maxlength=${getText(fieldName)} \u306f {2} \u6587\u5b57\u4ee5\u4e0b\u3067\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002
errors.invalid=${getText(fieldName)} \u306f\u6b63\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002
errors.byte=${getText(fieldName)} \u306fbyte\u578b\u3067\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002
errors.short=${getText(fieldName)} \u306fshort\u578b\u3067\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002
errors.integer=${getText(fieldName)} \u306finteger\u578b\u3067\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002
errors.long=${getText(fieldName)} \u306flong\u578b\u3067\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002
errors.float=${getText(fieldName)} \u306ffloat\u578b\u3067\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002
errors.double=${getText(fieldName)} \u306fdouble\u578b\u3067\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002
errors.date=${getText(fieldName)} \u306f\u65e5\u4ed8\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002
errors.range=${getText(fieldName)} \u306f {1} \u304b\u3089 {2} \u306e\u9593\u3067\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002
errors.creditcard=${getText(fieldName)} \u306f\u6b63\u3057\u3044\u30af\u30ec\u30b8\u30c3\u30c8\u30ab\u30fc\u30c9\u756a\u53f7\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002
errors.email=${getText(fieldName)} \u306f\u6b63\u3057\u3044\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002
@@ -0,0 +1,89 @@
button.cancel=\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c
button.confirm=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c
button.reset=\u0421\u0431\u0440\u043e\u0441\u0438\u0442\u044c
button.save=\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c
change.message=Your password has expired. Please ask the system administrator to change it.
change.try=Try Again
change.title=Password Has Expired
database.load=\u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430 \u0438\u0437 {0}
error.database.missing=\u041d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f - \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e.
error.fromAddress.format=\u0412 \u043f\u043e\u043b\u0435 '\u0410\u0434\u0440\u0435\u0441 \u041e\u0442:' \u0443\u043a\u0430\u0437\u0430\u043d \u0430\u0434\u0440\u0435\u0441 \u0432 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435.
error.fromAddress.required=\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u0432 \u043f\u043e\u043b\u0435 '\u0410\u0434\u0440\u0435\u0441 \u041e\u0442:'.
error.fullName.required=\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0435 \u0438\u043c\u044f.
error.host.required=\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440.
error.noSubscription=\u041f\u043e\u0434\u043f\u0438\u0441\u043a\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u0432 \u0441\u0435\u0441\u0441\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f
error.password.expired=Your password has expired for username {0}
error.password.required=\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c.
error.password2.required=\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u043e\u043b\u044f.
error.password.match=\u041f\u0430\u0440\u043e\u043b\u044c \u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u043e\u043b\u044f \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442.
error.password.mismatch=\u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u0438\u043c\u044f \u0438/\u0438\u043b\u0438 \u043f\u0430\u0440\u043e\u043b\u044c - \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0441\u043d\u043e\u0432\u0430.
error.replyToAddress.format=\u0412 \u043f\u043e\u043b\u0435 '\u0410\u0434\u0440\u0435\u0441 \u041e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430:' \u0443\u043a\u0430\u0437\u0430\u043d \u0430\u0434\u0440\u0435\u0441 \u0432 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435.
struts.messages.invalid.token=\u042d\u0442\u0430 \u0444\u043e\u0440\u043c\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 - \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u0437\u0430\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445.
error.type.invalid=\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0438\u043f\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u043b\u0438\u0448\u044c 'imap' \u0438\u043b\u0438 'pop3'
error.type.required=\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0438\u043f \u0441\u0435\u0440\u0432\u0435\u0440\u0430
error.username.required=\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f
error.username.unique=\u0423\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f - \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0434\u0440\u0443\u0433\u043e\u0435 \u0438\u043c\u044f.
errors.footer=</ul><hr>
errors.header=<h3><font color="red">\u041e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0438 \u0437\u0430\u043d\u0435\u0441\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445</font></h3><p>\u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u043d\u0438\u0436\u0435 \u043e\u0448\u0438\u0431\u043a\u0438:</p><ul>
errors.prefix=<li>
errors.suffix=</li>
errors.ioException=\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u0432\u043e\u0434\u0430/\u0432\u044b\u0432\u043e\u0434\u0430 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445: {0}
expired.password=User Password has expired for {0}
heading.autoConnect=\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438
heading.subscriptions=\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438
heading.host=\u0421\u0435\u0440\u0432\u0435\u0440
heading.user=\u0418\u043c\u044f
heading.type=\u0422\u0438\u043f \u0441\u0435\u0440\u0432\u0435\u0440\u0430
heading.action=\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435
index.heading=\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 '\u0427\u0442\u0435\u043d\u0438\u0435 \u043f\u043e\u0447\u0442\u044b'
index.login=\u0412\u043e\u0439\u0442\u0438 \u043a\u0430\u043a \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c
index.registration=\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f
index.title=\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 '\u0427\u0442\u0435\u043d\u0438\u0435 \u043f\u043e\u0447\u0442\u044b' (Struts 1.1-dev)
index.tour=\u041e\u0431\u0437\u043e\u0440 \u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f '\u0427\u0442\u0435\u043d\u0438\u0435 \u043f\u043e\u0447\u0442\u044b'
linkSubscription.io=\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u0432\u043e\u0434\u0430/\u0432\u044b\u0432\u043e\u0434\u0430 (\u0434\u043b\u044f \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438): {0}
linkSubscription.noSubscription=\u0410\u0442\u0440\u0438\u0431\u0443\u0442 {0} \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0435 \u0438\u043b\u0438 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.
linkUser.io=\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u0432\u043e\u0434\u0430/\u0432\u044b\u0432\u043e\u0434\u0430 (\u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f): {0}
linkUser.noUser=\u0410\u0442\u0440\u0438\u0431\u0443\u0442 {0} \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435 \u0438\u043b\u0438 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.
login.title=\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0427\u0442\u0435\u043d\u0438\u0435 \u043f\u043e\u0447\u0442\u044b - \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0438\u043c\u0435\u043d\u0438 \u0438 \u043f\u0430\u0440\u043e\u043b\u044f.
mainMenu.heading=\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u044e \u0434\u043b\u044f
mainMenu.logout=\u0412\u044b\u0439\u0442\u0438
mainMenu.registration=\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438
mainMenu.title=\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 '\u0427\u0442\u0435\u043d\u0438\u0435 \u043f\u043e\u0447\u0442\u044b' - \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043c\u0435\u043d\u044e
option.imap=\u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b IMAP
option.pop3=\u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b POP3
# prompt.
autoConnect=\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435:
fromAddress=\u0410\u0434\u0440\u0435\u0441 \u041e\u0442:
fullName=\u041f\u043e\u043b\u043d\u043e\u0435 \u0438\u043c\u044f:
mailHostname=\u041f\u043e\u0447\u0442\u043e\u0432\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440:
mailPassword=\u041f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f \u043f\u043e\u0447\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430:
mailServerType=\u0422\u0438\u043f \u0441\u0435\u0440\u0432\u0435\u0440\u0430:
mailUsername=\u0418\u043c\u044f \u0434\u043b\u044f \u043f\u043e\u0447\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430:
password=\u041f\u0430\u0440\u043e\u043b\u044c:
password2=(\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435) \u041f\u0430\u0440\u043e\u043b\u044c:
replyToAddress=\u0410\u0434\u0440\u0435\u0441 \u041e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430:
username=\u0418\u043c\u044f:
registration.addSubscription=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c
registration.deleteSubscription=\u0423\u0434\u0430\u043b\u0438\u0442\u044c
registration.editSubscription=\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c
registration.title.create=\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f
registration.title.edit=\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0441\u0432\u043e\u0435\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438
subscription.title.create=\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0443
subscription.title.delete=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0443
subscription.title.edit=\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0443
# Standard error messages for validator framework checks
errors.required=${getText(fieldName)} is required.
errors.minlength=${getText(fieldName)} cannot be less than {1} characters.
errors.maxlength=${getText(fieldName)} cannot be greater than {2} characters.
errors.invalid=${getText(fieldName)} is invalid.
errors.byte=${getText(fieldName)} must be an byte.
errors.short=${getText(fieldName)} must be an short.
errors.integer=${getText(fieldName)} must be an integer.
errors.long=${getText(fieldName)} must be an long.
errors.float=${getText(fieldName)} must be an float.
errors.double=${getText(fieldName)} must be an double.
errors.date=${getText(fieldName)} is not a date.
errors.range=${getText(fieldName)} is not in the range {1} through {2}.
errors.creditcard=${getText(fieldName)} is not a valid credit card number.
errors.email=${getText(fieldName)} is an invalid e-mail address.
@@ -0,0 +1,28 @@
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
<field name="password">
<field-validator type="requiredstring">
<message key="error.password.required"/>
</field-validator>
<field-validator type="stringlength">
<param name="trim">true</param>
<param name="minLength">4</param>
<param name="maxLength">10</param>
<message key="errors.range"/>
</field-validator>
</field>
<field name="password2">
<field-validator type="requiredstring">
<message key="error.password2.required"/>
</field-validator>
</field>
<validator type="expression">
<param name="expression">password eq password2</param>
<message key="error.password.match"/>
</validator>
</validators>
@@ -0,0 +1,32 @@
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/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>
@@ -0,0 +1,122 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package mailreader2;
import org.apache.struts.apps.mailreader.dao.User;
/**
* <p>Insert or update a User object to the persistent store. </p>
*/
public class Registration extends MailreaderSupport {
/**
* <p>Double check that there is not a valid User login. </p>
*
* @return True if there is not a valid User login
*/
private boolean isCreating() {
User user = getUser();
return (null == user) || (null == user.getDatabase());
}
/**
* <p> Retrieve User object to edit or null if User does not exist. </p>
*
* @return The "Success" result for this mapping
* @throws Exception on any error
*/
public String input() throws Exception {
if (isCreating()) {
createInputUser();
setTask(Constants.CREATE);
} else {
setTask(Constants.EDIT);
setUsername(getUser().getUsername());
setPassword(getUser().getPassword());
setPassword2(getUser().getPassword());
}
return INPUT;
}
/**
* <p>Insert or update a Registration.</p>
*
* @return The "outcome" result code
* @throws Exception on any error
*/
public String save() throws Exception {
return execute();
}
/**
* <p> Insert or update a User object to the persistent store. </p>
* <p/>
* <p> If a User is not logged in, then a new User is created and
* automatically logged in. Otherwise, the existing User is updated. </p>
*
* @return The "outcome" result code
* @throws Exception on any error
*/
public String execute()
throws Exception {
boolean creating = Constants.CREATE.equals(getTask());
creating = creating && isCreating(); // trust but verify
if (creating) {
User user = findUser(getUsername(), getPassword());
boolean haveUser = (user != null);
if (haveUser) {
addActionError(getText("error.username.unique"));
return INPUT;
}
copyUser(getUsername(), getPassword());
} else {
// FIXME: Any way to call the RegisrationSave validators from here?
String newPassword = getPassword();
if (newPassword != null) {
String confirmPassword = getPassword2();
boolean matches = ((null != confirmPassword)
&& (confirmPassword.equals(newPassword)));
if (matches) {
getUser().setPassword(newPassword);
} else {
addActionError(getText("error.password.match"));
return INPUT;
}
}
}
saveUser();
return SUCCESS;
}
}
@@ -0,0 +1,23 @@
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/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>
@@ -0,0 +1,11 @@
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
<validators>
<field name="host">
<field-validator type="requiredstring">
<message key="error.host.required"/>
</field-validator>
</field>
</validators>
@@ -0,0 +1,145 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package mailreader2;
import com.opensymphony.xwork2.Preparable;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* <p> Provide an Edit method for retrieving an existing subscription, and a
* Save method for updating or inserting a subscription. </p>
*/
public class Subscription extends MailreaderSupport
implements Preparable {
/**
* <p>Field to store list of MailServer types</p>
*/
private Map types = null;
/**
* <p>Provide the list of MailServer types.</p>
*
* @return List of MailServer types
*/
public Map getTypes() {
return types;
}
/**
* <p>Setup the MailerServer types and set the local Host property from
* the User Subscription (if any). </p>
*/
public void prepare() {
Map m = new LinkedHashMap();
m.put("imap", "IMAP Protocol");
m.put("pop3", "POP3 Protocol");
types = m;
setHost(getSubscriptionHost());
}
/**
* <p>Setup a temporary User Subscription object to capture input
* values.</p>
*
* @return INPUT
*/
public String input() {
createInputSubscription();
setTask(Constants.CREATE);
return INPUT;
}
/**
* <p>Load User Subscription for the local Host property.</p>
* <p/>
* <p>Usually, the Host is being set from the request by a link to an Edit
* or Delete task.</p>
*
* @return INPUT or Error, if Subscription is not found
*/
public String find() {
org.apache.struts.apps.mailreader.dao.Subscription
sub = findSubscription();
if (sub == null) {
return ERROR;
}
setSubscription(sub);
return INPUT;
}
/**
* <p>Prepare to present a confirmation page before removing
* Subscription.</p>
*
* @return INPUT or Error, if Subscription is not found
*/
public String delete() {
setTask(Constants.DELETE);
return find();
}
/**
* <p>Prepare to edit User Subscription.</p>
*
* @return INPUT or Error, if Subscription is not found
*/
public String edit() {
setTask(Constants.EDIT);
return find();
}
/**
* <p> Examine the Task property and DELETE, CREATE, or save the User
* Subscription, as appropriate. </p>
*
* @return SUCCESS
* @throws Exception on a database error
*/
public String save() throws Exception {
if (Constants.DELETE.equals(getTask())) {
removeSubscription();
}
if (Constants.CREATE.equals(getTask())) {
copySubscription(getHost());
}
if (hasErrors()) return INPUT;
saveUser();
return SUCCESS;
}
}
@@ -0,0 +1,49 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package mailreader2;
/**
* Verify that essential resources are available.
*/
public class Welcome extends MailreaderSupport {
public String execute() {
// Confirm message resources loaded
String message = getText(Constants.ERROR_DATABASE_MISSING);
if (Constants.ERROR_DATABASE_MISSING.equals(message)) {
addActionError(Constants.ERROR_MESSAGES_NOT_LOADED);
}
// Confirm database loaded
if (null==getDatabase()) {
addActionError(Constants.ERROR_DATABASE_NOT_LOADED);
}
if (hasErrors()) {
return ERROR;
}
else {
return SUCCESS;
}
}
}
+16
View File
@@ -0,0 +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"/>
</struts>
@@ -0,0 +1,174 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
@@ -0,0 +1,5 @@
Apache Struts
Copyright 2000-2011 The Apache Software Foundation
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
@@ -0,0 +1,36 @@
#
# Log4J Settings for log4j 1.2.x (via jakarta-commons-logging)
#
# The five logging levels used by Log are (in order):
#
# 1. DEBUG (the least serious)
# 2. INFO
# 3. WARN
# 4. ERROR
# 5. FATAL (the most serious)
# Set root logger level to WARN and append to stdout
log4j.rootLogger=INFO, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%d %5p (%c:%L) - %m%n
# Print only messages of level ERROR or above in the package noModule.
log4j.logger.noModule=FATAL
# OpenSymphony Stuff
log4j.logger.freemarker=INFO
log4j.logger.com.opensymphony=INFO
log4j.logger.com.opensymphony.xwork2.ognl=ERROR
log4j.logger.org.apache.struts2=WARN
log4j.logger.org.apache.struts2.components=WARN
log4j.logger.org.apache.struts2.dispatcher=WARN
log4j.logger.org.apache.struts2.convention=INFO
# Spring Stuff
log4j.logger.org.springframework=WARN
@@ -0,0 +1 @@
runtime.log.logsystem.class=org.apache.velocity.runtime.log.NullLogChute
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/">
</Context>
@@ -0,0 +1,9 @@
<?xml version='1.0'?>
<database>
<user username="user" fromAddress="John.User@somewhere.com" fullName="John Q. User" password="pass">
<subscription host="mail.yahoo.com" autoConnect="false" password="foo" type="imap" username="jquser">
</subscription>
<subscription host="mail.hotmail.com" autoConnect="false" password="bar" type="pop3" username="user1234">
</subscription>
</user>
</database>
@@ -0,0 +1,25 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 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><s:text name="change.title"/></title>
<link href="<s:url value="/css/mailreader.css"/>" rel="stylesheet"
type="text/css"/>
</head>
<body>
<p>
<s:text name="change.message"/>
</p>
<p>
<a href="<s:url action="Login_input"/>">
<s:text name="change.try"/>
</a>
</p>
</body>
</html>
@@ -0,0 +1,40 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 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>Unexpected Error</title>
</head>
<body>
<h2>An unexpected error has occured</h2>
<p>
Please report this error to your system administrator
or appropriate technical support personnel.
Thank you for your cooperation.
</p>
<hr/>
<h3>Error Message</h3>
<s:actionerror />
<p>
<s:property value="%{exception.message}"/>
</p>
<hr/>
<h3>Technical Details</h3>
<p>
<s:property value="%{exceptionStack}"/>
</p>
<jsp:include page="Footer.jsp"/>
</body>
</html>
@@ -0,0 +1,6 @@
<%@ taglib uri="/struts-tags" prefix="s" %>
<hr/>
<p>
<a href="<s:url action="Welcome" includeParams="none"/>"><s:text name="index.title"/></a>
</p>
@@ -0,0 +1,30 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 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><s:text name="login.title"/></title>
<link href="<s:url value="/css/mailreader.css"/>" rel="stylesheet"
type="text/css"/>
</head>
<body onLoad="self.focus();document.Login.username.focus()">
<s:actionerror />
<s:form action="Login" validate="true">
<s:textfield key="username" />
<s:password key="password" showPassword="true"/>
<s:submit key="button.logon"/>
<s:reset key="button.reset"/>
<s:submit action="Login_cancel" key="button.cancel"
onclick="form.onsubmit=null"/>
</s:form>
<jsp:include page="Footer.jsp"/>
</body>
</html>
@@ -0,0 +1,25 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 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><s:text name="mainMenu.title"/></title>
<link href="<s:url value="/css/mailreader.css"/>" rel="stylesheet"
type="text/css"/>
</head>
<body>
<h3><s:text name="mainMenu.heading"/> <s:property
value="user.fullName"/></h3>
<ul>
<li><a href="<s:url action="Registration_input" />">
<s:text name="mainMenu.registration"/>
</a>
</li>
<li><a href="<s:url action="Logout"/>">
<s:text name="mainMenu.logout"/>
</a>
</ul>
</body>
</html>
@@ -0,0 +1,115 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 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>
<s:if test="task=='Create'">
<title><s:text name="registration.title.create"/></title>
</s:if>
<s:if test="task=='Edit'">
<title><s:text name="registration.title.edit"/></title>
</s:if>
<link href="<s:url value="/css/mailreader.css"/>" rel="stylesheet"
type="text/css"/>
</head>
<body onLoad="self.focus();document.Registration_save_username.focus()">
<s:actionerror/>
<s:form action="Registration_save" validate="false">
<s:token />
<s:hidden name="task"/>
<s:if test="task == 'Create'">
<s:textfield key="username"/>
</s:if>
<s:else>
<s:label key="username"/>
<s:hidden name="username"/>
</s:else>
<s:password key="password" showPassword="true"/>
<s:password key="password2"/>
<s:textfield key="user.fullName"/>
<s:textfield key="user.fromAddress"/>
<s:textfield key="user.replyToAddress"/>
<s:if test="task == 'Create'">
<s:submit key="button.save" action="Registration_save"/>
<s:reset key="button.reset"/>
<s:submit action="Welcome" key="button.cancel"
onclick="form.onsubmit=null"/>
</s:if>
<s:else>
<s:submit key="button.save" action="Registration"/>
<s:reset key="button.reset"/>
<s:submit action="MainMenu" key="button.cancel"
onclick="form.onsubmit=null"/>
</s:else>
</s:form>
<s:if test="task == 'Edit'">
<div align="center">
<h3><s:text name="heading.subscriptions"/></h3>
</div>
<table border="1" width="100%">
<tr>
<th align="center" width="30%">
<s:text name="heading.host"/>
</th>
<th align="center" width="25%">
<s:text name="heading.user"/>
</th>
<th align="center" width="10%">
<s:text name="heading.type"/>
</th>
<th align="center" width="10%">
<s:text name="heading.autoConnect"/>
</th>
<th align="center" width="15%">
<s:text name="heading.action"/>
</th>
</tr>
<s:iterator value="user.subscriptions">
<tr>
<td align="left">
<s:property value="host"/>
</td>
<td align="left">
<s:property value="username"/>
</td>
<td align="center">
<s:property value="type"/>
</td>
<td align="center">
<s:property value="autoConnect"/>
</td>
<td align="center">
<a href="<s:url action="Subscription_delete"><s:param name="host" value="host"/></s:url>">
<s:text name="registration.deleteSubscription"/>
</a>
&nbsp;
<a href="<s:url action="Subscription_edit"><s:param name="host" value="host"/></s:url>">
<s:text name="registration.editSubscription"/>
</a>
</td>
</tr>
</s:iterator>
</table>
<a href="<s:url action="Subscription_input"/>"><s:text
name="registration.addSubscription"/></a>
</s:if>
<jsp:include page="Footer.jsp"/>
</body>
</html>
@@ -0,0 +1,60 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 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>
<s:if test="task=='Create'">
<title><s:text name="subscription.title.create"/></title>
</s:if>
<s:if test="task=='Edit'">
<title><s:text name="subscription.title.edit"/></title>
</s:if>
<s:if test="task=='Delete'">
<title><s:text name="subscription.title.delete"/></title>
</s:if>
<link href="<s:url value="/css/mailreader.css" includeParams="none"/>" rel="stylesheet"
type="text/css"/>
</head>
<body onLoad="self.focus();document.Subscription.username.focus()">
<s:actionerror/>
<s:form action="Subscription_save" validate="true">
<s:token />
<s:hidden name="task"/>
<s:label key="username" name="user.username"/>
<s:if test="task == 'Create'">
<s:textfield key="host"/>
</s:if>
<s:else>
<s:label key="host"/>
<s:hidden name="host"/>
</s:else>
<s:if test="task == 'Delete'">
<s:label key="subscription.username"/>
<s:label key="subscription.password"/>
<s:label key="subscription.type"/>
<s:label key="subscription.autoConnect"/>
<s:submit key="button.confirm"/>
</s:if>
<s:else>
<s:textfield key="subscription.username"/>
<s:textfield key="subscription.password"/>
<s:select key="subscription.type" list="types"/>
<s:checkbox key="subscription.autoConnect"/>
<s:submit key="button.save"/>
<s:reset key="button.reset"/>
</s:else>
<s:submit action="Registration_input"
key="button.cancel"
onclick="form.onsubmit=null"/>
</s:form>
<jsp:include page="Footer.jsp"/>
</body>
</html>
@@ -0,0 +1,55 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title><s:text name="index.title"/></title>
<link href="<s:url value="/css/mailreader.css"/>" rel="stylesheet"
type="text/css"/>
</head>
<body>
<h3><s:text name="index.heading"/></h3>
<ul>
<li><a href="<s:url action="Registration_input"/>"><s:text
name="index.registration"/></a></li>
<li><a href="<s:url action="Login_input"/>"><s:text
name="index.login"/></a></li>
</ul>
<h3>Language Options</h3>
<ul>
<li>
<s:url id="en" action="Welcome">
<s:param name="request_locale">en</s:param>
</s:url>
<s:a href="%{en}">English</s:a>
</li>
<li>
<s:url id="ja" action="Welcome">
<s:param name="request_locale">ja</s:param>
</s:url>
<s:a href="%{ja}">Japanese</s:a>
</li>
<li>
<s:url id="ru" action="Welcome">
<s:param name="request_locale">ru</s:param>
</s:url>
<s:a href="%{ru}">Russian</s:a>
</li>
</ul>
<hr/>
<p><s:i18n name="alternate"><a href="http://struts.apache.org/">
<img src="<s:text name="struts.logo.path"/>"
alt="<s:text name="struts.logo.alt"/>" border="0px"/>
</a>
</s:i18n></p>
</body>
</html>
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Struts 2 Mailreader</display-name>
<filter>
<filter-name>Struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>Struts2</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<!-- Application Listener for Mailreader database -->
<listener>
<listener-class>
mailreader2.ApplicationListener
</listener-class>
</listener>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<!-- Restricts access to pure JSP files - access available only via Struts action -->
<security-constraint>
<display-name>No direct JSP access</display-name>
<web-resource-collection>
<web-resource-name>No-JSP</web-resource-name>
<url-pattern>*.jsp</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>no-users</role-name>
</auth-constraint>
</security-constraint>
<security-role>
<description>Don't assign users to this role</description>
<role-name>no-users</role-name>
</security-role>
</web-app>
@@ -0,0 +1,46 @@
/**
* Mailreader stylesheet
*/
body {
background-color: #FFFFFF;
color: #000000;
link: 000066;
visited: #660066;
active: #33CCCC;
}
A:hover {
color: #FF0000;
}
h1 {
font-family: Arial, Helvetica, sans-serif;
}
h2 {
font-family: Arial, Helvetica, sans-serif;
}
h3 {
font-family: Arial, Helvetica, sans-serif;
}
h4 {
font-family: Arial, Helvetica, sans-serif;
}
h5 {
font-family: Arial, Helvetica, sans-serif;
}
h6 {
font-family: Arial, Helvetica, sans-serif;
}
font.hint {
font-style: italic;
font-size: 80%;
font-family: Arial, Helvetica, sans-serif;
text-align: left;
}
@@ -0,0 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=Welcome.do">
</head>
<body>
<p>Loading ...</p>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

File diff suppressed because it is too large Load Diff
+4 -1
View File
@@ -26,12 +26,15 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.5</version>
<version>2.3.37</version>
</parent>
<artifactId>struts2-apps</artifactId>
<packaging>pom</packaging>
<name>Struts 2 Webapps</name>
<modules>
<module>blank</module>
<module>jboss-blank</module>
<module>mailreader</module>
<module>portlet</module>
<module>showcase</module>
<module>rest-showcase</module>
+9 -13
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.5</version>
<version>2.3.37</version>
</parent>
<artifactId>struts2-portlet</artifactId>
@@ -49,7 +49,7 @@
<plugin>
<groupId>org.apache.pluto</groupId>
<artifactId>maven-pluto-plugin</artifactId>
<version>1.1.7</version>
<version>1.1.3</version>
<executions>
<execution>
<phase>generate-resources</phase>
@@ -68,7 +68,7 @@
<webDefaultXml>src/main/webapp/WEB-INF/jetty-pluto-web-default.xml</webDefaultXml>
<systemProperties>
<systemProperty>
<name>org.apache.pluto.embedded.portletIds</name>
<name>org.apache.pluto.embedded.portletId</name>
<value>StrutsPortlet</value>
</systemProperty>
</systemProperties>
@@ -133,17 +133,13 @@
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j2.version}</version>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j2.version}</version>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
<dependency>
@@ -155,7 +151,7 @@
<dependency>
<groupId>net.sourceforge.jwebunit</groupId>
<artifactId>jwebunit-htmlunit-plugin</artifactId>
<version>3.3</version>
<version>1.4.1</version>
<scope>test</scope>
<exclusions>
<exclusion>
@@ -168,7 +164,7 @@
<dependency>
<groupId>com.bekk.boss</groupId>
<artifactId>maven-jetty-pluto-embedded</artifactId>
<version>1.0.1</version>
<version>1.0</version>
<scope>test</scope>
</dependency>
+1 -1
View File
@@ -10,7 +10,7 @@
<filter>
<filter-name>action2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>

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