Compare commits

...

63 Commits

Author SHA1 Message Date
Lukasz Lenart 17e14ef42b [maven-release-plugin] prepare release STRUTS_2_5_2 2016-07-07 10:48:45 +02:00
Lukasz Lenart d75a890482 WW-4655 Cleans up code and uses more user friendly logic to process parameters 2016-07-03 10:55:14 +02:00
Lukasz Lenart d06689120d Uses the latest OGNL version 2016-06-29 20:41:57 +02:00
Lukasz Lenart fb92c67d13 Cleans up test 2016-06-29 20:34:03 +02:00
victorsosa 6e07a63797 WW-4650 Json deserialization does not work in 2.5.1
logic need to be changed as accept can be a list; the check need to be
done in the list itself.

Accept:application/json, text/plain, */*
2016-06-24 09:06:52 -04:00
victorsosa b462286589 Merge branch 'apache-master' 2016-06-24 08:26:27 -04:00
victorsosa 4f07433626 Merge branch 'master' of https://github.com/apache/struts into apache-master 2016-06-24 08:25:42 -04:00
Lukasz Lenart cd13846e19 Fixes test and conflicts 2016-06-22 11:10:26 +02:00
Lukasz Lenart f096dd611e Adds test to guard pre-evaulation of name attribute 2016-06-22 11:10:04 +02:00
Lukasz Lenart cfcefcf589 Drops commented out test 2016-06-22 11:04:07 +02:00
Lukasz Lenart 8dfe178585 Uses LocaleProvider and default TextProvider instead of evaluating expression 2016-06-22 11:03:41 +02:00
Lukasz Lenart d5e0fe9207 WW-4648 Upgrades commons-fileupload to the latest version 2016-06-22 10:57:14 +02:00
Lukasz Lenart a2de255697 [maven-release-plugin] prepare for next development iteration 2016-06-14 08:07:45 +02:00
Lukasz Lenart e8aa825f21 [maven-release-plugin] prepare release STRUTS_2_5_1 2016-06-14 08:07:24 +02:00
Lukasz Lenart a0fdca138f Improves validation RegEx 2016-06-14 07:02:09 +02:00
Lukasz Lenart 7621c2bc92 WW-4643 Makes set unmodifiable 2016-06-12 19:40:27 +02:00
Lukasz Lenart b866e0e880 WW-4643 Fixes SMI when used with Action-less resutls 2016-06-12 19:38:31 +02:00
Lukasz Lenart 08360cb916 WW-4634 Fixes centre alignment in Velocity tags 2016-06-12 15:48:35 +02:00
Lukasz Lenart 1afb48aa76 WW-4640 Adds more informative message when method is not allowed 2016-06-12 15:41:28 +02:00
Lukasz Lenart ca256a74e9 Inlines constants and drops class 2016-06-12 15:22:45 +02:00
Lukasz Lenart e60119436a WW-4632 Uses proper DTD version 2016-06-12 13:10:49 +02:00
Lukasz Lenart 7da4ef3902 Introduces new callMethod() function to be used to execute actions
(cherry picked from commit b28b78c062)
2016-06-12 13:03:39 +02:00
Lukasz Lenart ce294b48df Drops unneeded method
(cherry picked from commit 3f526d630a)
2016-06-12 13:02:03 +02:00
Lukasz Lenart 04e5e9dde8 Upgrades OGNL to the latest version 2016-06-12 12:54:15 +02:00
Aleksandr Mashchenko e28e5f03a6 Fixes WW-4529 and few other typos 2016-06-11 21:17:01 +03:00
Aleksandr Mashchenko 39cc611d72 WW-4644 - Drops xwork-core from bom 2016-06-11 20:30:05 +03:00
jumiller dd3b80f2be add GlobalAllowedMethods getter to PackageConfig and modified getActionConfig method in ConventionUnknownHandler to reference it 2016-06-10 07:59:27 -06:00
jumiller 0d92fd0ee5 add allowed methods to ActionBuilder 2016-06-09 15:39:23 -06:00
victor sosa 7985fd191a Merge pull request #17 from apache/master
update pull
2016-05-26 19:23:37 -04:00
victorsosa e0b13a5b0b fix test cases 2016-05-25 10:38:37 -04:00
victorsosa 8fea9566a9 fix test cases 2016-05-25 10:36:53 -04:00
victorsosa 2cd28b160e fix test 2016-05-25 09:47:28 -04:00
victorsosa 30b74a3f01 Merge branch 'WW-4634' of github.com:victorsosa/struts into WW-4634 2016-05-25 09:23:39 -04:00
victorsosa dce6d3e110 test fix 2016-05-25 09:23:13 -04:00
victor sosa c70f2409f2 Update styles.css 2016-05-25 08:29:20 -04:00
victorsosa 175d0d42db Add a class .tdInput for future and use align attribute with
class="align-${parameters.align?html}"
2016-05-25 07:52:23 -04:00
Lukasz Lenart 095960b569 Allows empty string as a action name 2016-05-23 17:05:53 +02:00
Lukasz Lenart 9b34a28190 Disallows dot in action name 2016-05-23 16:03:09 +02:00
Lukasz Lenart 880c1d54a4 WW-4558 contentType override ignored for JSONInterceptor 2016-05-22 08:30:27 +02:00
victorsosa 9e11b2c2b1 WW-4634 2016-05-17 09:17:35 -04:00
victorsosa d06c71d68e WW-4634 2016-05-17 09:03:27 -04:00
victorsosa ffdacf1b60 WW-4634 2016-05-17 09:00:33 -04:00
victorsosa f9e4a5e676 Merge branch 'master' of github.com:victorsosa/struts 2016-05-17 08:50:50 -04:00
victor sosa b4facc8e06 Merge pull request #15 from apache/master
update pull
2016-05-17 08:39:51 -04:00
victorsosa 6b360108e5 WW-4634 2016-05-17 08:37:13 -04:00
Lukasz Lenart 104bd92b88 WW-4627 Adds unit test to confirm the issue 2016-05-13 08:07:59 +02:00
Lukasz Lenart a44c7bc13d WW-4626 Adds support for .cat domain 2016-05-13 07:43:02 +02:00
Lukasz Lenart dbf744f54b WW-4618 Supports custom redirect types which base on ServletRedirectResult 2016-05-13 07:05:27 +02:00
Lukasz Lenart 27ca165ddb Throws away methods that doesn't match pattern 2016-05-12 15:36:12 +02:00
victorsosa d16aa65098 remove old second contentType parameter 2016-05-06 18:04:04 -04:00
Lukasz Lenart 8b688cc38d Fixes label positioning 2016-05-06 13:04:30 +02:00
Lukasz Lenart 3a78fd1a11 [maven-release-plugin] prepare for next development iteration 2016-05-05 15:21:50 +02:00
victor sosa ca74ac36fc Merge pull request #14 from apache/master
update pull
2016-05-04 10:47:57 -04:00
victor sosa 47cf4ff84b Merge pull request #13 from apache/master
update pull
2016-04-20 14:58:32 -04:00
victor sosa 379b75292e Merge pull request #11 from apache/master
update pull
2016-03-27 14:43:40 -04:00
victor sosa 6bb1ec67ad Merge pull request #10 from apache/master
pull update
2016-03-04 18:07:16 -04:00
victor sosa a5d7163939 Merge pull request #9 from victorsosa/easymock_update
Easymock update
2016-03-03 14:41:11 -04:00
victor sosa da8b13a87e Merge pull request #8 from apache/master
update pull
2016-03-03 14:16:11 -04:00
victorsosa 8b8135af79 Merge branch 'ww-4558' of github.com:victorsosa/struts into ww-4558
# Conflicts:
#	plugins/json/src/main/java/org/apache/struts2/json/JSONInterceptor.java
2016-02-15 10:37:26 -04:00
victorsosa 2fada1ec05 Merge branch 'ww-4558' of github.com:victorsosa/struts into ww-4558
# Conflicts:
#	plugins/json/src/main/java/org/apache/struts2/json/JSONInterceptor.java
2016-02-15 10:35:29 -04:00
victorsosa bab451c6d8 Merge branch 'ww-4558' of github.com:victorsosa/struts into ww-4558
# Conflicts:
#	plugins/json/src/main/java/org/apache/struts2/json/JSONInterceptor.java
2016-02-15 10:34:15 -04:00
victorsosa 0d49050381 fix patch WW-4558
contentType override ignored for JSONInterceptor

use of accept parameter st by the interceptor params


Signed-off-by: victorsosa <victor.sosa@peopleware.do>
2016-02-15 10:31:36 -04:00
victorsosa fab687a07e fix patch WW-4558
contentType override ignored for JSONInterceptor

From now on:

The "accept" request header parameter must be "application/json" or
"application/json-rpc"

Also the default encoding is "UTF-8"
2016-02-15 08:28:01 -04:00
234 changed files with 751 additions and 561 deletions
+3
View File
@@ -11,6 +11,9 @@
.metadata/
Servers/
#VSCode
.vscode
# OSX
.DS_Store
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.5</version>
<version>2.5.2</version>
</parent>
<artifactId>struts2-apps</artifactId>
<packaging>pom</packaging>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.5</version>
<version>2.5.2</version>
</parent>
<artifactId>struts2-portlet</artifactId>
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<package name="edit" extends="struts-portlet-default"
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<package name="eventing" extends="struts-portlet-default" namespace="/eventing">
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<package name="help" extends="struts-portlet-default"
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<package name="tiles" extends="struts-portlet-tiles-default" namespace="/tiles">
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<package name="view" extends="struts-portlet-default"
+2 -2
View File
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<include file="struts-view.xml"/>
+2 -2
View File
@@ -26,12 +26,12 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.5</version>
<version>2.5.2</version>
</parent>
<artifactId>struts2-rest-showcase</artifactId>
<packaging>war</packaging>
<version>2.5</version>
<version>2.5.2</version>
<name>Struts 2 Rest Showcase Webapp</name>
<description>Struts 2 Rest Showcase Example</description>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.5</version>
<version>2.5.2</version>
</parent>
<artifactId>struts2-showcase</artifactId>
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<package name="actionchaining" extends="struts-default" namespace="/actionchaining">
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<package name="conversion" namespace="/conversion" extends="struts-default">
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<package name="filedownload" extends="struts-default" namespace="/filedownload">
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<package name="fileupload" extends="struts-default" namespace="/fileupload">
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<package name="freemarker" namespace="/freemarker" extends="struts-default">
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<package name="hangman" extends="struts-default" namespace="/hangman">
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<package name="interactive" namespace="/interactive" extends="struts-default">
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<package name="modelDriven" extends="struts-default" namespace="/modelDriven">
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<!-- START SNIPPET: xworkSample -->
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<package name="ui-tags" extends="struts-default" namespace="/tags/ui">
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<include file="struts-tags-ui.xml"/>
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<package name="tiles" extends="tiles-default" namespace="/tiles">
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<package name="token" extends="struts-default" namespace="/token">
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<package name="wait" extends="struts-default" namespace="/wait">
@@ -1,8 +1,8 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<package name="xslt" extends="struts-default" namespace="/xslt">
+2 -2
View File
@@ -1,8 +1,8 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<!-- START SNIPPET: xworkSample -->
<struts>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.5</version>
<version>2.5.2</version>
</parent>
<artifactId>struts2-archetypes</artifactId>
@@ -2,7 +2,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.5</version>
<version>2.5.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false"/>
+1 -1
View File
@@ -3,7 +3,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.5</version>
<version>2.5.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<!--
- This file is included by the struts.xml file as an example
- of how to break up the configuration file into multiple files.
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false"/>
<constant name="struts.devMode" value="true"/>
@@ -2,7 +2,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.5</version>
<version>2.5.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false"/>
@@ -2,7 +2,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.5</version>
<version>2.5.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<constant name="struts.convention.default.parent.package" value="struts-portlet-default" />
+1 -1
View File
@@ -2,7 +2,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.5</version>
<version>2.5.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
+1 -1
View File
@@ -2,7 +2,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.5</version>
<version>2.5.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<package name="default" extends="struts-portlet-default" namespace="/view">
+1 -1
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.5</version>
<version>2.5.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -1,7 +1,7 @@
<?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">
"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
+1 -1
View File
@@ -3,7 +3,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.5</version>
<version>2.5.2</version>
</parent>
<artifactId>struts2-assembly</artifactId>
+3 -8
View File
@@ -10,7 +10,7 @@
</parent>
<artifactId>struts2-bom</artifactId>
<version>2.5</version>
<version>2.5.2</version>
<packaging>pom</packaging>
<name>Struts 2 Bill of Materials</name>
@@ -25,7 +25,7 @@
</licenses>
<properties>
<struts-version.version>2.5</struts-version.version>
<struts-version.version>2.5.2</struts-version.version>
</properties>
<build>
@@ -43,11 +43,6 @@
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.struts.xwork</groupId>
<artifactId>xwork-core</artifactId>
<version>${struts-version.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
@@ -177,6 +172,6 @@
</dependencyManagement>
<scm>
<tag>STRUTS_2_5</tag>
<tag>STRUTS_2_5_2</tag>
</scm>
</project>
+1 -1
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
<version>2.5</version>
<version>2.5.2</version>
</parent>
<artifactId>struts2-osgi-admin-bundle</artifactId>
+1 -1
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
<version>2.5</version>
<version>2.5.2</version>
</parent>
<artifactId>struts2-osgi-demo-bundle</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.5</version>
<version>2.5.2</version>
</parent>
<artifactId>struts2-osgi-bundles</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.5</version>
<version>2.5.2</version>
</parent>
<artifactId>struts2-core</artifactId>
<packaging>jar</packaging>
@@ -156,10 +156,6 @@ public class ActionSupport implements Action, Validateable, ValidationAware, Tex
return INPUT;
}
public String doDefault() throws Exception {
return SUCCESS;
}
/**
* A default implementation that does nothing an returns "success".
*
@@ -419,7 +419,7 @@ public class DefaultActionInvocation implements ActionInvocation {
Object methodResult;
try {
methodResult = ognlUtil.getValue(methodName + "()", getStack().getContext(), action);
methodResult = ognlUtil.callMethod(methodName + "()", getStack().getContext(), action);
} catch (MethodFailedException e) {
// if reason is missing method, try checking UnknownHandlers
if (e.getReason() instanceof NoSuchMethodException) {
@@ -197,22 +197,30 @@ public class DefaultActionProxy implements ActionProxy, Serializable {
if (config.isAllowedMethod(method)) {
invocation.init(this);
} else {
throw new ConfigurationException("This method: " + method + " for action " + actionName + " is not allowed!");
throw new ConfigurationException(prepareNotAllowedErrorMessage());
}
} finally {
UtilTimerStack.pop(profileKey);
}
}
protected String prepareNotAllowedErrorMessage() {
return LocalizedTextUtil.findDefaultText(
"struts.exception.method-not-allowed",
Locale.getDefault(),
new String[]{method, actionName}
);
}
protected String getErrorMessage() {
if ((namespace != null) && (namespace.trim().length() > 0)) {
return LocalizedTextUtil.findDefaultText(
XWorkMessages.MISSING_PACKAGE_ACTION_EXCEPTION,
"xwork.exception.missing-package-action",
Locale.getDefault(),
new String[]{namespace, actionName});
} else {
return LocalizedTextUtil.findDefaultText(
XWorkMessages.MISSING_ACTION_EXCEPTION,
"xwork.exception.missing-action",
Locale.getDefault(),
new String[]{actionName});
}
@@ -1,31 +0,0 @@
/*
* Copyright 2002-2006,2009 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.opensymphony.xwork2;
/**
* Contains constants for some default XWork messages.
*
* @author Jason Carreira
*/
public interface XWorkMessages {
public static final String ACTION_EXECUTION_ERROR = "xwork.error.action.execution";
public static final String MISSING_ACTION_EXCEPTION = "xwork.exception.missing-action";
public static final String MISSING_PACKAGE_ACTION_EXCEPTION = "xwork.exception.missing-package-action";
public static final String DEFAULT_INVALID_FIELDVALUE = "xwork.default.invalid.fieldvalue";
}
@@ -346,6 +346,13 @@ public class PackageConfig extends Located implements Comparable, Serializable,
return globalExceptionMappingConfigs;
}
/**
* gets the GlobalAllowedMethods local to this package
*
* @return a Set of method names allowed to be executed if strict method invocation is enabled
*/
public Set<String> getGlobalAllowedMethods() { return Collections.unmodifiableSet(globalAllowedMethods); }
public boolean isStrictMethodInvocation() {
return strictMethodInvocation;
}
@@ -194,7 +194,7 @@ public class XWorkConverter extends DefaultTypeConverter {
}
public static String getConversionErrorMessage(String propertyName, ValueStack stack) {
String defaultMessage = LocalizedTextUtil.findDefaultText(XWorkMessages.DEFAULT_INVALID_FIELDVALUE,
String defaultMessage = LocalizedTextUtil.findDefaultText("xwork.default.invalid.fieldvalue",
ActionContext.getContext().getLocale(),
new Object[]{
propertyName
@@ -205,7 +205,7 @@ public class StaticParametersInterceptor extends AbstractInterceptor {
/**
* Adds the parameters into context's ParameterMap.
* As default, static parameters will not overwrite existing paramaters from other sources.
* As default, static parameters will not overwrite existing parameters from other sources.
* If you want the static parameters as successor over already existing parameters, set overwrite to <tt>true</tt>.
*
* @param ac The action context
@@ -289,6 +289,9 @@ public class OgnlUtil {
if (isEvalExpression(tree, context)) {
throw new OgnlException("Eval expression/chained expressions cannot be used as parameter name");
}
if (isArithmeticExpression(tree, context)) {
throw new OgnlException("Arithmetic expressions cannot be used as parameter name");
}
Ognl.setValue(tree, context, root, value);
return null;
}
@@ -308,6 +311,32 @@ public class OgnlUtil {
return false;
}
private boolean isArithmeticExpression(Object tree, Map<String, Object> context) throws OgnlException {
if (tree instanceof SimpleNode) {
SimpleNode node = (SimpleNode) tree;
OgnlContext ognlContext = null;
if (context!=null && context instanceof OgnlContext) {
ognlContext = (OgnlContext) context;
}
return node.isOperation(ognlContext);
}
return false;
}
private boolean isSimpleMethod(Object tree, Map<String, Object> context) throws OgnlException {
if (tree instanceof SimpleNode) {
SimpleNode node = (SimpleNode) tree;
OgnlContext ognlContext = null;
if (context!=null && context instanceof OgnlContext) {
ognlContext = (OgnlContext) context;
}
return node.isSimpleMethod(ognlContext) && !node.isChain(ognlContext);
}
return false;
}
public Object getValue(final String name, final Map<String, Object> context, final Object root) throws OgnlException {
return compileAndExecute(name, context, new OgnlTask<Object>() {
public Object execute(Object tree) throws OgnlException {
@@ -316,6 +345,14 @@ public class OgnlUtil {
});
}
public Object callMethod(final String name, final Map<String, Object> context, final Object root) throws OgnlException {
return compileAndExecuteMethod(name, context, new OgnlTask<Object>() {
public Object execute(Object tree) throws OgnlException {
return Ognl.getValue(tree, context, root);
}
});
}
public Object getValue(final String name, final Map<String, Object> context, final Object root, final Class resultType) throws OgnlException {
return compileAndExecute(name, context, new OgnlTask<Object>() {
public Object execute(Object tree) throws OgnlException {
@@ -350,6 +387,27 @@ public class OgnlUtil {
return exec;
}
private <T> Object compileAndExecuteMethod(String expression, Map<String, Object> context, OgnlTask<T> task) throws OgnlException {
Object tree;
if (enableExpressionCache) {
tree = expressions.get(expression);
if (tree == null) {
tree = Ognl.parseExpression(expression);
checkSimpleMethod(tree, context);
}
} else {
tree = Ognl.parseExpression(expression);
checkSimpleMethod(tree, context);
}
final T exec = task.execute(tree);
// if cache is enabled and it's a valid expression, puts it in
if(enableExpressionCache) {
expressions.putIfAbsent(expression, tree);
}
return exec;
}
public Object compile(String expression, Map<String, Object> context) throws OgnlException {
return compileAndExecute(expression,context,new OgnlTask<Object>() {
public Object execute(Object tree) throws OgnlException {
@@ -364,6 +422,12 @@ public class OgnlUtil {
}
}
private void checkSimpleMethod(Object tree, Map<String, Object> context) throws OgnlException {
if (!isSimpleMethod(tree, context)) {
throw new OgnlException("It isn't a simple method which can be called!");
}
}
/**
* Copies the properties in the object "from" and sets them in the object "to"
* using specified type converter, or {@link com.opensymphony.xwork2.conversion.impl.XWorkConverter} if none
@@ -184,7 +184,7 @@ public class DelegatingValidatorContext implements ValidatorContext {
}
public static TextProvider makeTextProvider(Object object, LocaleProvider localeProvider) {
// the object argument passed through here will most probably be an ActionSupport decendant which does
// the object argument passed through here will most probably be an ActionSupport descendant which does
// implements TextProvider.
if (object != null && object instanceof DelegatingValidatorContext) {
return ((DelegatingValidatorContext) object).getTextProvider();
@@ -23,7 +23,7 @@ package com.opensymphony.xwork2.validator.validators;
* The regular expression used to validate that the string is an email address is:
*
* <pre>
* \\b^['_a-z0-9-\\+]+(\\.['_a-z0-9-\\+]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\\.([a-z]{2}|aero|arpa|asia|biz|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|nato|net|org|pro|tech|tel|travel|xxx)$\\b
* \\b^['_a-z0-9-\\+]+(\\.['_a-z0-9-\\+]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\\.([a-z]{2}|aero|arpa|asia|biz|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|nato|net|org|pro|tel|travel|xxx|tech|cat)$\\b
* </pre>
*
* You can also specify expression, caseSensitive and trim params as a OGNL expression, see the example below.
@@ -80,7 +80,7 @@ public class EmailValidator extends RegexFieldValidator {
// see XW-371
public static final String EMAIL_ADDRESS_PATTERN =
"\\b^['_a-z0-9-\\+]+(\\.['_a-z0-9-\\+]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\\.([a-z]{2}|aero|arpa|asia|biz|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|nato|net|org|pro|tech|tel|travel|xxx)$\\b";
"\\b^['_a-z0-9-\\+]+(\\.['_a-z0-9-\\+]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\\.([a-z]{2}|aero|arpa|asia|biz|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|nato|net|org|pro|tel|travel|xxx|tech|cat)$\\b";
public EmailValidator() {
setRegex(EMAIL_ADDRESS_PATTERN);
@@ -81,7 +81,7 @@ public class URLValidator extends FieldValidatorSupport {
"|((\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\.){3}" +
"(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])" +
")(:\\d+)?" +
")(((\\/+([a-z0-9$_\\.\\+!\\*\\'\\(\\),;:@&=-]|%[0-9a-f]{2})*)*" +
")(((\\/{0,1}([a-z0-9$_\\.\\+!\\*\\'\\(\\),;:@&=-]|%[0-9a-f]{2})*)*" +
"(\\?([a-z0-9$_\\.\\+!\\*\\'\\(\\),;:@&=-]|%[0-9a-f]{2})*)" +
"?)?)?" +
"(#([a-z0-9$_\\.\\+!\\*\\'\\(\\),;:@&=-]|%[0-9a-f]{2})*)?" +
@@ -36,7 +36,7 @@ import java.util.Map;
* <!-- START SNIPPET: javadoc -->
* <p>
* Note that the doublelistkey and doublelistvalue attribute will default to "key" and "value"
* respectively only when the doublelist attribute is evaluated to a Map or its decendant.
* respectively only when the doublelist attribute is evaluated to a Map or its descendant.
* Other thing else, will result in doublelistkey and doublelistvalue to be null and not used.
* </p>
*
@@ -21,7 +21,13 @@
package org.apache.struts2.components;
import com.opensymphony.xwork2.ActionContext;
import java.io.Writer;
import java.util.ResourceBundle;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.StrutsException;
import com.opensymphony.xwork2.LocaleProvider;
import com.opensymphony.xwork2.TextProvider;
import com.opensymphony.xwork2.TextProviderFactory;
@@ -31,13 +37,6 @@ import com.opensymphony.xwork2.util.LocalizedTextUtil;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.StrutsException;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import java.io.Writer;
import java.util.Locale;
import java.util.ResourceBundle;
/**
* <!-- START SNIPPET: javadoc -->
@@ -92,6 +91,8 @@ public class I18n extends Component {
protected String name;
protected Container container;
private TextProvider textProvider;
private TextProvider defaultTextProvider;
private LocaleProvider localeProvider;
public I18n(ValueStack stack) {
super(stack);
@@ -102,26 +103,31 @@ public class I18n extends Component {
this.container = container;
}
@Inject
public void setTextProvider(TextProvider textProvider) {
this.defaultTextProvider = textProvider;
}
@Inject
public void setLocaleProvider(LocaleProvider localeProvider) {
this.localeProvider = localeProvider;
}
public boolean start(Writer writer) {
boolean result = super.start(writer);
try {
String name = this.findString(this.name, "name", "Resource bundle name is required. Example: foo or foo_en");
ResourceBundle bundle = (ResourceBundle) findValue("getTexts('" + name + "')");
ResourceBundle bundle = defaultTextProvider.getTexts(name);
if (bundle == null) {
bundle = LocalizedTextUtil.findResourceBundle(name, (Locale) getStack().getContext().get(ActionContext.LOCALE));
bundle = LocalizedTextUtil.findResourceBundle(name, localeProvider.getLocale());
}
if (bundle != null) {
final Locale locale = (Locale) getStack().getContext().get(ActionContext.LOCALE);
TextProviderFactory tpf = new TextProviderFactory();
container.inject(tpf);
textProvider = tpf.createInstance(bundle, new LocaleProvider() {
public Locale getLocale() {
return locale;
}
});
textProvider = tpf.createInstance(bundle, localeProvider);
getStack().push(textProvider);
pushed = true;
}
@@ -42,7 +42,7 @@ import java.util.Map;
* <!-- START SNIPPET: javadoc -->
* <p>
* Note that the listkey and listvalue attribute will default to "key" and "value"
* respectively only when the list attribute is evaluated to a Map or its decendant.
* respectively only when the list attribute is evaluated to a Map or its descendant.
* Everything else will result in listkey and listvalue to be null and not used.
* </p>
* <!-- END SNIPPET: javadoc -->
@@ -42,7 +42,7 @@ import com.opensymphony.xwork2.util.ValueStack;
* <li>application - the value will be set in application scope according to servlet spec. using the name as its key</li>
* <li>session - the value will be set in session scope according to servlet spec. using the name as key </li>
* <li>request - the value will be set in request scope according to servlet spec. using the name as key </li>
* <li>page - the value will be set in page scope according to servlet sepc. using the name as key</li>
* <li>page - the value will be set in page scope according to servlet spec. using the name as key</li>
* <li>action - the value will be set in the request scope and Struts' action context using the name as key</li>
* </ul>
*
@@ -34,6 +34,7 @@ import org.apache.logging.log4j.Logger;
import org.apache.struts2.RequestUtils;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.StrutsException;
import org.apache.struts2.util.PrefixTrie;
import javax.servlet.http.HttpServletRequest;
@@ -119,7 +120,7 @@ public class DefaultActionMapper implements ActionMapper {
protected boolean allowSlashesInActionNames = false;
protected boolean alwaysSelectFullNamespace = false;
protected PrefixTrie prefixTrie = null;
protected Pattern allowedActionNames = Pattern.compile("[a-zA-Z0-9._!/\\-]*");
protected Pattern allowedActionNames = Pattern.compile("^[a-zA-Z0-9_!/\\-]*((.htm[l]?)|(.action))?$");
private boolean allowActionPrefix = false;
private boolean allowActionCrossNamespaceAccess = false;
@@ -385,14 +386,7 @@ public class DefaultActionMapper implements ActionMapper {
if (allowedActionNames.matcher(rawActionName).matches()) {
return rawActionName;
} else {
LOG.warn("Action [{}] does not match allowed action names pattern [{}], cleaning it up!",
rawActionName, allowedActionNames);
String cleanActionName = rawActionName;
for (String chunk : allowedActionNames.split(rawActionName)) {
cleanActionName = cleanActionName.replace(chunk, "");
}
LOG.debug("Cleaned action name [{}]", cleanActionName);
return cleanActionName;
throw new StrutsException("Action [" + rawActionName + "] does not match allowed action names pattern [" + allowedActionNames + "]!");
}
}
@@ -13,7 +13,7 @@ import com.opensymphony.xwork2.result.ParamNameAwareResult;
import java.util.Map;
/**
* Default implementation which uses {@link com.opensymphony.xwork2.result.ParamNameAwareResult} to accept or throwaway parameters
* Default implementation which uses {@link com.opensymphony.xwork2.result.ParamNameAwareResult} to accept or throw away parameters
*/
public class StrutsResultFactory implements ResultFactory {
@@ -73,8 +73,7 @@ class MessageStorePreResultListener implements PreResultListener {
try {
ResultConfig resultConfig = invocation.getProxy().getConfig().getResults().get(resultCode);
if (resultConfig != null) {
isRedirect = ServletRedirectResult.class.getName().equals(resultConfig.getClassName())
|| ServletActionRedirectResult.class.getName().equals(resultConfig.getClassName());
isRedirect = ServletRedirectResult.class.isAssignableFrom(Class.forName(resultConfig.getClassName()));
}
} catch (Exception e) {
LOG.warn("Cannot read result!", e);
@@ -22,7 +22,6 @@
package org.apache.struts2.result;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -218,15 +217,12 @@ public class StreamResult extends StrutsResultSupport {
* @see StrutsResultSupport#doExecute(java.lang.String, com.opensymphony.xwork2.ActionInvocation)
*/
protected void doExecute(String finalLocation, ActionInvocation invocation) throws Exception {
LOG.debug("Find the Response in context");
// Override any parameters using values on the stack
resolveParamsFromStack(invocation.getStack(), invocation);
// Find the Response in context
HttpServletResponse oResponse = (HttpServletResponse) invocation.getInvocationContext().get(HTTP_RESPONSE);
try (OutputStream oOutput = oResponse.getOutputStream()) {
if (inputStream == null) {
// Find the inputstream from the invocation variable stack
LOG.debug("Find the inputstream from the invocation variable stack");
inputStream = (InputStream) invocation.getStack().findValue(conditionalParse(inputName, invocation));
}
@@ -237,18 +233,17 @@ public class StreamResult extends StrutsResultSupport {
throw new IllegalArgumentException(msg);
}
// Set the content type
LOG.debug("Set the content type: {};charset{}", contentType, contentCharSet);
if (contentCharSet != null && ! contentCharSet.equals("")) {
oResponse.setContentType(conditionalParse(contentType, invocation)+";charset="+contentCharSet);
}
else {
oResponse.setContentType(conditionalParse(contentType, invocation)+";charset="+conditionalParse(contentCharSet, invocation));
} else {
oResponse.setContentType(conditionalParse(contentType, invocation));
}
// Set the content length
LOG.debug("Set the content length: {}", contentLength);
if (contentLength != null) {
String _contentLength = conditionalParse(contentLength, invocation);
int _contentLengthAsInt = -1;
int _contentLengthAsInt;
try {
_contentLengthAsInt = Integer.parseInt(_contentLength);
if (_contentLengthAsInt >= 0) {
@@ -260,12 +255,12 @@ public class StreamResult extends StrutsResultSupport {
}
}
// Set the content-disposition
LOG.debug("Set the content-disposition: {}", contentDisposition);
if (contentDisposition != null) {
oResponse.addHeader("Content-Disposition", conditionalParse(contentDisposition, invocation));
}
// Set the cache control headers if neccessary
LOG.debug("Set the cache control headers if necessary: {}", allowCaching);
if (!allowCaching) {
oResponse.addHeader("Pragma", "no-cache");
oResponse.addHeader("Cache-Control", "no-cache");
@@ -274,7 +269,6 @@ public class StreamResult extends StrutsResultSupport {
LOG.debug("Streaming result [{}] type=[{}] length=[{}] content-disposition=[{}] charset=[{}]",
inputName, contentType, contentLength, contentDisposition, contentCharSet);
// Copy input to output
LOG.debug("Streaming to output buffer +++ START +++");
byte[] oBuff = new byte[bufferSize];
int iSize;
@@ -289,44 +283,4 @@ public class StreamResult extends StrutsResultSupport {
}
}
/**
* Tries to lookup the parameters on the stack. Will override any existing parameters
*
* @param stack The current value stack
* @param invocation the action invocation
*/
protected void resolveParamsFromStack(ValueStack stack, ActionInvocation invocation) {
String disposition = stack.findString("contentDisposition");
if (disposition != null) {
setContentDisposition(disposition);
}
String contentType = stack.findString("contentType");
if (contentType != null) {
setContentType(contentType);
}
String inputName = stack.findString("inputName");
if (inputName != null) {
setInputName(inputName);
}
String contentLength = stack.findString("contentLength");
if (contentLength != null) {
setContentLength(contentLength);
}
Integer bufferSize = (Integer) stack.findValue("bufferSize", Integer.class);
if (bufferSize != null) {
setBufferSize(bufferSize);
}
if (contentCharSet != null ) {
contentCharSet = conditionalParse(contentCharSet, invocation);
}
else {
contentCharSet = stack.findString("contentCharSet");
}
}
}
@@ -78,7 +78,7 @@ public abstract class TagModel implements TemplateTransformModel {
Object value = entry.getValue();
if (value != null) {
// the value should ALWAYS be a decendant of TemplateModel
// the value should ALWAYS be a descendant of TemplateModel
if (value instanceof TemplateModel) {
try {
map.put(entry.getKey(), objectWrapper.unwrap((TemplateModel) value));
@@ -7,4 +7,4 @@ xwork.error.action.execution=Error during Action invocation
xwork.exception.missing-action=There is no Action mapped for action name {0}.
xwork.exception.missing-package-action=There is no Action mapped for namespace {0} and action name {1}.
xwork.default.invalid.fieldvalue=Invalid field value for field "{0}".
struts.exception.method-not-allowed=Method {0} for action {1} is not allowed!
@@ -62,11 +62,11 @@
class="label"<#t/>
</#if>
><#t/>
<#if parameters.required!false && parameters.requiredPosition!"right" != 'right'>
<#if (parameters.required!false) && ((parameters.requiredPosition!"right") != 'right')>
<span class="required">*</span><#t/>
</#if>
${parameters.label?html}<#t/>
<#if parameters.required!false && parameters.requiredPosition!"right" == 'right'>
<#if (parameters.required!false) && ((parameters.requiredPosition!"right") == 'right')>
<span class="required">*</span><#t/>
</#if>
${parameters.labelseparator!":"?html}<#t/>
@@ -21,5 +21,10 @@
*/
-->
<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader-core.ftl" />
<td
<td
<#if parameters.align?? >
class="align-${parameters.align?html}"
<#else >
class="tdInput"
</#if>
><#t/>
@@ -35,3 +35,10 @@
.tdCheckboxErrorMessage {text-align:left; vertical-align:top;}
.tdErrorMessage {text-align:center; vertical-align:top;}
.formButton {text-align:right;}
.tdInput {text-align:left;}
.align-center{text-align:center;}
.align-right{text-align:right;}
.align-left{text-align:left;}
.align-justify{text-align:justify;}
@@ -64,7 +64,6 @@ public class ActionSupportTest extends XWorkTestCase {
}
assertEquals(Action.INPUT, as.input());
assertEquals(Action.SUCCESS, as.doDefault());
assertEquals(Action.SUCCESS, as.execute());
try {
as.clone();
@@ -157,7 +156,7 @@ public class ActionSupportTest extends XWorkTestCase {
ActionContext.getContext().setLocale(new Locale("da"));
MyActionSupport mas = new MyActionSupport();
assertEquals("santa", mas.doDefault());
assertEquals("santa", mas.execute());
assertNotNull(mas.getTexts());
assertEquals(false, mas.hasActionMessages());
@@ -331,7 +330,7 @@ public class ActionSupportTest extends XWorkTestCase {
private Double val;
@Override
public String doDefault() throws Exception {
public String execute() throws Exception {
return "santa";
}
@@ -0,0 +1,24 @@
package com.opensymphony.xwork2;
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
import com.opensymphony.xwork2.mock.MockActionInvocation;
import org.apache.struts2.StrutsInternalTestCase;
import org.junit.Test;
public class DefaultActionProxyTest extends StrutsInternalTestCase {
@Test
public void testThorwExceptionOnNotAllowedMethod() throws Exception {
final String filename = "com/opensymphony/xwork2/config/providers/xwork-test-allowed-methods.xml";
loadConfigurationProviders(new XmlConfigurationProvider(filename));
DefaultActionProxy dap = new DefaultActionProxy(new MockActionInvocation(), "strict", "Default", "notAllowed", true, true);
container.inject(dap);
try {
dap.prepare();
fail("Must throw exception!");
} catch (Exception e) {
assertEquals(e.getMessage(), "Method notAllowed for action Default is not allowed!");
}
}
}
@@ -759,6 +759,21 @@ public class OgnlUtilTest extends XWorkTestCase {
assertEquals(expected.getMessage(), "Eval expressions/chained expressions have been disabled!");
}
public void testCallMethod() throws Exception {
Foo foo = new Foo();
Exception expected = null;
try {
ognlUtil.callMethod("#booScope=@myclass@DEFAULT_SCOPE,#bootScope.init()", ognlUtil.createDefaultContext(foo), foo);
fail();
} catch (OgnlException e) {
expected = e;
}
assertNotNull(expected);
assertSame(OgnlException.class, expected.getClass());
assertEquals(expected.getMessage(), "It isn't a simple method which can be called!");
}
public static class Email {
String address;
@@ -119,24 +119,6 @@ public class SecurityMemberAccessTest extends TestCase {
assertTrue("fooLogic() from FooInterface isn't accessible!!!", accessible);
}
public void testMiddleOfInheritanceExclusion2() throws Exception {
// given
SecurityMemberAccess sma = new SecurityMemberAccess(false);
String propertyName = "barLogic";
Member member = BarInterface.class.getMethod(propertyName);
Set<Class<?>> excluded = new HashSet<Class<?>>();
excluded.add(BarInterface.class);
sma.setExcludedClasses(excluded);
// when
boolean accessible = sma.isAccessible(context, target, member, propertyName);
// then
assertFalse("barLogic() from BarInterface is accessible!!!", accessible);
}
public void testMiddleOfInheritanceExclusion3() throws Exception {
// given
SecurityMemberAccess sma = new SecurityMemberAccess(false);
@@ -144,12 +126,6 @@ public class SecurityMemberAccessTest extends TestCase {
String propertyName = "barLogic";
Member member = BarInterface.class.getMethod(propertyName);
/*
Set<Class<?>> excluded = new HashSet<Class<?>>();
excluded.add(BarInterface.class);
sma.setExcludedClasses(excluded);
*/
// when
boolean accessible = sma.isAccessible(context, target, member, propertyName);
@@ -256,7 +232,7 @@ public class SecurityMemberAccessTest extends TestCase {
public void testAccessStatic() throws Exception {
// given
SecurityMemberAccess sma = new SecurityMemberAccess(true);
sma.setExcludedClasses(new HashSet<Class<?>>(Arrays.<Class<?>>asList(Class.class)));
sma.setExcludedClasses(new HashSet<Class<?>>(Collections.singletonList(Class.class)));
// when
Member method = StaticTester.class.getMethod("sayHello");
@@ -269,7 +245,7 @@ public class SecurityMemberAccessTest extends TestCase {
public void testBlockStaticAccess() throws Exception {
// given
SecurityMemberAccess sma = new SecurityMemberAccess(false);
sma.setExcludedClasses(new HashSet<Class<?>>(Arrays.<Class<?>>asList(Class.class)));
sma.setExcludedClasses(new HashSet<Class<?>>(Collections.singletonList(Class.class)));
// when
Member method = StaticTester.class.getMethod("sayHello");
@@ -282,7 +258,7 @@ public class SecurityMemberAccessTest extends TestCase {
public void testBlockStaticAccessIfClassIsExcluded() throws Exception {
// given
SecurityMemberAccess sma = new SecurityMemberAccess(false);
sma.setExcludedClasses(new HashSet<Class<?>>(Arrays.<Class<?>>asList(Class.class)));
sma.setExcludedClasses(new HashSet<Class<?>>(Collections.singletonList(Class.class)));
// when
Member method = Class.class.getMethod("getClassLoader");
@@ -295,7 +271,7 @@ public class SecurityMemberAccessTest extends TestCase {
public void testAllowStaticAccessIfClassIsNotExcluded() throws Exception {
// given
SecurityMemberAccess sma = new SecurityMemberAccess(true);
sma.setExcludedClasses(new HashSet<Class<?>>(Arrays.<Class<?>>asList(ClassLoader.class)));
sma.setExcludedClasses(new HashSet<Class<?>>(Collections.singletonList(ClassLoader.class)));
// when
Member method = Class.class.getMethod("getClassLoader");
@@ -20,10 +20,7 @@ import com.opensymphony.xwork2.*;
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
import com.opensymphony.xwork2.test.ModelDrivenAction2;
import com.opensymphony.xwork2.test.TestBean2;
import org.apache.struts2.util.DateFormatter;
import org.springframework.format.annotation.DateTimeFormat;
import javax.swing.text.Style;
import java.text.DateFormat;
import java.text.ParseException;
import java.util.Date;
@@ -134,17 +131,17 @@ public class LocalizedTextUtilTest extends XWorkTestCase {
}
public void testDefaultMessage() throws Exception {
String message = LocalizedTextUtil.findDefaultText(XWorkMessages.ACTION_EXECUTION_ERROR, Locale.getDefault());
String message = LocalizedTextUtil.findDefaultText("xwork.error.action.execution", Locale.getDefault());
assertEquals("Error during Action invocation", message);
}
public void testDefaultMessageOverride() throws Exception {
String message = LocalizedTextUtil.findDefaultText(XWorkMessages.ACTION_EXECUTION_ERROR, Locale.getDefault());
String message = LocalizedTextUtil.findDefaultText("xwork.error.action.execution", Locale.getDefault());
assertEquals("Error during Action invocation", message);
LocalizedTextUtil.addDefaultResourceBundle("com/opensymphony/xwork2/test");
message = LocalizedTextUtil.findDefaultText(XWorkMessages.ACTION_EXECUTION_ERROR, Locale.getDefault());
message = LocalizedTextUtil.findDefaultText("xwork.error.action.execution", Locale.getDefault());
assertEquals("Testing resource bundle override", message);
}
@@ -187,12 +184,12 @@ public class LocalizedTextUtilTest extends XWorkTestCase {
}
public void testParameterizedDefaultMessage() throws Exception {
String message = LocalizedTextUtil.findDefaultText(XWorkMessages.MISSING_ACTION_EXCEPTION, Locale.getDefault(), new String[]{"AddUser"});
String message = LocalizedTextUtil.findDefaultText("xwork.exception.missing-action", Locale.getDefault(), new String[]{"AddUser"});
assertEquals("There is no Action mapped for action name AddUser.", message);
}
public void testParameterizedDefaultMessageWithPackage() throws Exception {
String message = LocalizedTextUtil.findDefaultText(XWorkMessages.MISSING_PACKAGE_ACTION_EXCEPTION, Locale.getDefault(), new String[]{"blah", "AddUser"});
String message = LocalizedTextUtil.findDefaultText("xwork.exception.missing-package-action", Locale.getDefault(), new String[]{"blah", "AddUser"});
assertEquals("There is no Action mapped for namespace blah and action name AddUser.", message);
}
@@ -46,6 +46,7 @@ public class EmailValidatorTest extends XWorkTestCase {
assertTrue(verifyEmailValidity("ferda+mravenec@yahoo.com"));
assertTrue(verifyEmailValidity("Ferda+Mravenec@yaHoo.CoM"));
assertTrue(verifyEmailValidity("user@domainname.tech"));
assertTrue(verifyEmailValidity("Ferda+Mravenec@yaHoo.cat"));
assertFalse(verifyEmailValidity("tm_jee#marry@yahoo.co.uk"));
assertFalse(verifyEmailValidity("tm_jee@ yahoo.co.uk"));
@@ -138,6 +138,7 @@ public class URLValidatorTest extends XWorkTestCase {
assertFalse(pattern.matcher("").matches());
assertFalse(pattern.matcher(" ").matches());
assertFalse(pattern.matcher("no url").matches());
assertFalse(pattern.matcher("http://example.com////////////////////////////////////////////////////////////////////////////////////??").matches());
assertTrue(pattern.matcher("http://www.opensymphony.com").matches());
assertTrue(pattern.matcher("https://www.opensymphony.com").matches());
@@ -164,21 +164,4 @@ public class UIBeanTest extends StrutsInternalTestCase {
assertEquals("12", txtFld.getTheme());
}
// I couldn't figure out how to make this test work. Bailing for now.
// public void testEscapeLabel() throws Exception {
// ValueStack stack = ActionContext.getContext().getValueStack();
// MockHttpServletRequest req = new MockHttpServletRequest();
// MockHttpServletResponse res = new MockHttpServletResponse();
// stack.push(this);
//
// TextField txtFld = new TextField(stack, req, res);
// txtFld.setKey("test['foo']");
// txtFld.evaluateParams();
// assertEquals("test_label", txtFld.getParameters().get("label"));
// }
//
// public String getText(String key) {
// assertEquals("test[\\'foo\\']", key);
// return "test_label";
// }
}
@@ -30,6 +30,7 @@ import com.opensymphony.xwork2.config.ConfigurationManager;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.config.impl.DefaultConfiguration;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.StrutsException;
import org.apache.struts2.StrutsInternalTestCase;
import org.apache.struts2.result.StrutsResultSupport;
import org.apache.struts2.views.jsp.StrutsMockHttpServletRequest;
@@ -162,8 +163,8 @@ public class DefaultActionMapperTest extends StrutsInternalTestCase {
public void testGetMappingWithNamespaceSlash() throws Exception {
req.setupGetRequestURI("/my.hh/abc.action");
req.setupGetServletPath("/my.hh/abc.action");
req.setupGetRequestURI("/my-hh/abc.action");
req.setupGetServletPath("/my-hh/abc.action");
req.setupGetAttribute(null);
req.addExpectedGetAttributeName("javax.servlet.include.servlet_path");
@@ -180,7 +181,7 @@ public class DefaultActionMapperTest extends StrutsInternalTestCase {
mapping = mapper.getMapping(req, configManager);
assertEquals("", mapping.getNamespace());
assertEquals("my.hh/abc", mapping.getName());
assertEquals("my-hh/abc", mapping.getName());
}
public void testGetMappingWithUnknownNamespace() throws Exception {
@@ -844,14 +845,37 @@ public class DefaultActionMapperTest extends StrutsInternalTestCase {
String actionName = "action";
assertEquals(actionName, mapper.cleanupActionName(actionName));
Throwable expected = null;
actionName = "${action}";
assertEquals("action", mapper.cleanupActionName(actionName));
try {
mapper.cleanupActionName(actionName);
fail();
} catch (Throwable t) {
expected = t;
}
assertTrue(expected instanceof StrutsException);
assertEquals("Action [${action}] does not match allowed action names pattern [" + mapper.allowedActionNames.pattern() + "]!", expected.getMessage());
actionName = "${${%{action}}}";
assertEquals("action", mapper.cleanupActionName(actionName));
try {
mapper.cleanupActionName(actionName);
fail();
} catch (Throwable t) {
expected = t;
}
assertTrue(expected instanceof StrutsException);
assertEquals("Action [${${%{action}}}] does not match allowed action names pattern [" + mapper.allowedActionNames.pattern() + "]!", expected.getMessage());
actionName = "${#foo='action',#foo}";
assertEquals("fooactionfoo", mapper.cleanupActionName(actionName));
try {
mapper.cleanupActionName(actionName);
fail();
} catch (Throwable t) {
expected = t;
}
assertTrue(expected instanceof StrutsException);
assertEquals("Action [${#foo='action',#foo}] does not match allowed action names pattern [" + mapper.allowedActionNames.pattern() + "]!", expected.getMessage());
actionName = "test-action";
assertEquals("test-action", mapper.cleanupActionName(actionName));
@@ -78,8 +78,8 @@ public class StreamResultTest extends StrutsInternalTestCase {
result.doExecute("helloworld", mai);
assertEquals(String.valueOf(contentLength), result.getContentLength());
assertEquals("text/plain", result.getContentType());
assertEquals(contentLength, response.getContentLength());
assertEquals("text/plain", response.getContentType());
assertEquals("streamForImage", result.getInputName());
assertEquals(1024, result.getBufferSize()); // 1024 is default
assertEquals("inline", result.getContentDisposition());
@@ -94,7 +94,7 @@ public class StreamResultTest extends StrutsInternalTestCase {
result.setContentCharSet("ISO-8859-1");
result.doExecute("helloworld", mai);
assertEquals(String.valueOf(contentLength), result.getContentLength());
assertEquals(contentLength, response.getContentLength());
assertEquals("text/plain", result.getContentType());
assertEquals("streamForImage", result.getInputName());
assertEquals(1024, result.getBufferSize()); // 1024 is default
@@ -111,8 +111,9 @@ public class StreamResultTest extends StrutsInternalTestCase {
result.doExecute("helloworld", mai);
assertEquals(String.valueOf(contentLength), result.getContentLength());
assertEquals(contentLength, response.getContentLength());
assertEquals("text/plain", result.getContentType());
assertEquals("text/plain;charset=UTF-8", response.getContentType());
assertEquals("streamForImage", result.getInputName());
assertEquals(1024, result.getBufferSize()); // 1024 is default
assertEquals("inline", result.getContentDisposition());
@@ -220,6 +221,7 @@ public class StreamResultTest extends StrutsInternalTestCase {
response = new MockHttpServletResponse();
result = new StreamResult();
result.setContentLength("${contentLength}");
stack = ActionContext.getContext().getValueStack();
MyImageAction action = new MyImageAction();
@@ -239,6 +239,62 @@ public class TextfieldTest extends AbstractUITagTest {
verify(TextFieldTag.class.getResource("Textfield-9.txt"));
}
public void testRequiredLabelPositionDefault() throws Exception {
TestAction testAction = (TestAction) action;
testAction.setFoo("bar");
TextFieldTag tag = new TextFieldTag();
tag.setPageContext(pageContext);
tag.setId("myId");
tag.setLabel("mylabel");
tag.setName("foo");
tag.setValue("bar");
tag.setRequiredLabel("true");
tag.doStartTag();
tag.doEndTag();
verify(TextFieldTag.class.getResource("Textfield-12.txt"));
}
public void testRequiredLabelPositionRight() throws Exception {
TestAction testAction = (TestAction) action;
testAction.setFoo("bar");
TextFieldTag tag = new TextFieldTag();
tag.setPageContext(pageContext);
tag.setId("myId");
tag.setLabel("mylabel");
tag.setName("foo");
tag.setValue("bar");
tag.setRequiredLabel("true");
tag.setRequiredPosition("right");
tag.doStartTag();
tag.doEndTag();
verify(TextFieldTag.class.getResource("Textfield-12.txt"));
}
public void testRequiredLabelPositionLeft() throws Exception {
TestAction testAction = (TestAction) action;
testAction.setFoo("bar");
TextFieldTag tag = new TextFieldTag();
tag.setPageContext(pageContext);
tag.setId("myId");
tag.setLabel("mylabel");
tag.setName("foo");
tag.setValue("bar");
tag.setRequiredLabel("true");
tag.setRequiredPosition("left");
tag.doStartTag();
tag.doEndTag();
verify(TextFieldTag.class.getResource("Textfield-13.txt"));
}
public void testErrorPositionBottomCssXhtmlTheme() throws Exception {
TestAction testAction = (TestAction) action;
testAction.setFoo("bar");
@@ -281,4 +337,20 @@ public class TextfieldTest extends AbstractUITagTest {
verify(TextFieldTag.class.getResource("Textfield-11.txt"));
}
public void testNameEvaluation() throws Exception {
TestAction testAction = (TestAction) action;
testAction.setArray(new String[]{"test", "bar"});
testAction.setFooInt(1);
TextFieldTag tag = new TextFieldTag();
tag.setPageContext(pageContext);
tag.setName("array[%{fooInt}]");
tag.doStartTag();
tag.doEndTag();
verify(TextFieldTag.class.getResource("Textfield-14.txt"));
}
}
@@ -1,6 +1,6 @@
<tr>
<td class="tdLabel"><label for="foo" class="label">mylabel:</label></td>
<td>
<td class="tdInput">
<input type="checkbox" name="foo" value="hello" id="foo-1" checked="checked" title="mytitle" onchange="alert('foo');"/>
<label for="foo-1" class="checkboxLabel">world</label>
<input type="checkbox" name="foo" value="foo" id="foo-2" title="mytitle" onchange="alert('foo');"/>
@@ -1,6 +1,6 @@
<tr>
<td class="tdLabel"><label for="collection" class="label">mylabel:</label></td>
<td>
<td class="tdInput">
<input type="checkbox" name="collection" value="hello" id="collection-1" checked="checked"/>
<label for="collection-1" class="checkboxLabel">world</label>
<input type="checkbox" name="collection" value="foo" id="collection-2" checked="checked"/>
@@ -1,6 +1,6 @@
<tr>
<td class="tdLabel"><label for="collection" class="label">mylabel:</label></td>
<td>
<td class="tdInput">
<input type="checkbox" name="collection" value="hello" id="collection-1" checked="checked" disabled="disabled"/>
<label for="collection-1" class="checkboxLabel">world</label>
<input type="checkbox" name="collection" value="foo" id="collection-2" checked="checked" disabled="disabled"/>
@@ -1,6 +1,6 @@
<tr>
<td class="tdLabel"><label for="foo" class="label">mylabel:</label></td>
<td>
<td class="tdInput">
<input type="checkbox" name="foo" value="hello" id="foo-1" checked="checked" disabled="disabled" onchange="alert('foo');"/>
<label for="foo-1" class="checkboxLabel">world</label>
<input type="checkbox" name="foo" value="foo" id="foo-2" disabled="disabled" onchange="alert('foo');"/>
@@ -1,6 +1,6 @@
<tr>
<td class="tdLabel"><label for="cb" class="label">mylabel:</label></td>
<td>
<td class="tdInput">
<script type="text/javascript">
function autoPopulate_cb(targetElement) {
targetElement.form.elements['foo'].value=targetElement.options[targetElement.selectedIndex].value;
@@ -1,6 +1,6 @@
<tr>
<td class="tdLabel"><label for="myFavouriteFruit" class="label">My Favourite Fruit:</label></td>
<td>
<td class="tdInput">
<script type="text/javascript">
function autoPopulate_myFavouriteFruit(targetElement) {
if (targetElement.options[targetElement.selectedIndex].value == '-1') {
@@ -1,6 +1,6 @@
<tr>
<td class="tdLabel"><label for="myFavouriteFruit" class="label">My Favourite Fruit:</label></td>
<td>
<td class="tdInput">
<script type="text/javascript">
function autoPopulate_myFavouriteFruit(targetElement) {
if (targetElement.options[targetElement.selectedIndex].value == '-1') {
@@ -1,6 +1,6 @@
<tr>
<td class="tdLabel"><label for="cb.bc" class="label">mylabel:</label></td>
<td>
<td class="tdInput">
<script type="text/javascript">
function autoPopulate_cb_bc(targetElement) {
targetElement.form.elements['foo'].value=targetElement.options[targetElement.selectedIndex].value;
@@ -2,7 +2,7 @@
<td class="tdLabel">
<label for="myFooValue" class="label">mylabel:</label>
</td>
<td>
<td class="tdInput">
<input type="text" name="myname" value="foo" id="myFooValue"/>
</td>
</tr>
@@ -2,7 +2,7 @@
<td class="tdLabel">
<label for="foo" class="label">mylabel:</label>
</td>
<td>
<td class="tdInput">
<input type="text" name="myname" value="foo" id="foo"/>
</td>
</tr>
@@ -1,6 +1,6 @@
<tr>
<td class="tdLabel"><label for="foo" class="label">mylabel:</label></td>
<td>
<td class="tdInput">
<select name="foo" id="foo" class="c1" style="s1" onmousedown="window.status='onmousedown';" onmouseup="window.status='onmouseup';" onmouseover="window.status='onmouseover';" onmousemove="window.status='onmousemove';" onmouseout="window.status='onmouseout';" onchange="fooRedirect(this.selectedIndex)">
<option value="BE">Belgium</option>
<option value="FR">France</option>
@@ -1,6 +1,6 @@
<tr>
<td class="tdLabel"><label for="foo" class="label">mylabel:</label></td>
<td>
<td class="tdInput">
<select name="foo" id="foo" onmousedown="window.status='onmousedown';" onmouseup="window.status='onmouseup';" onmouseover="window.status='onmouseover';" onmousemove="window.status='onmousemove';" onmouseout="window.status='onmouseout';" onchange="fooRedirect(this.selectedIndex)">
<option value="BE">Belgium</option>
<option value="FR" selected="selected">France</option>
@@ -1,6 +1,6 @@
<tr>
<td class="tdLabel"><label for="foo_bar" class="label">mylabel:</label></td>
<td>
<td class="tdInput">
<select name="foo.bar" id="foo_bar" onmousedown="window.status='onmousedown';" onmouseup="window.status='onmouseup';" onmouseover="window.status='onmouseover';" onmousemove="window.status='onmousemove';" onmouseout="window.status='onmouseout';" onchange="foo_barRedirect(this.selectedIndex)">
<option value="BE">Belgium</option>
<option value="FR">France</option>
@@ -1,6 +1,6 @@
<tr>
<td class="tdLabel"><label for="foo" class="label">mylabel:</label></td>
<td>
<td class="tdInput">
<select name="foo" id="foo" class="c1" style="s1" onmousedown="window.status='onmousedown';" onmouseup="window.status='onmouseup';" onmouseover="window.status='onmouseover';" onmousemove="window.status='onmousemove';" onmouseout="window.status='onmouseout';" onchange="fooRedirect(this.selectedIndex);window.status='onchange';">
<option value="BE">Belgium</option>
<option value="FR">France</option>

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