mirror of
https://github.com/apache/struts.git
synced 2026-08-10 00:57:04 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| de154978ca | |||
| e3a6004b6d |
+2
-2
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.0.9</version>
|
||||
<version>2.0.7</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-blank</artifactId>
|
||||
@@ -47,7 +47,7 @@
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>maven-jetty-plugin</artifactId>
|
||||
<artifactId>maven-jetty6-plugin</artifactId>
|
||||
<configuration>
|
||||
<scanIntervalSeconds>10</scanIntervalSeconds>
|
||||
</configuration>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.0.9</version>
|
||||
<version>2.0.7</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-mailreader</artifactId>
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
<hr/>
|
||||
|
||||
<p>
|
||||
<a href="<s:url action="Welcome" includeParams="none"/>"><s:text name="index.title"/></a>
|
||||
<a href="<s:url action="Welcome" />"><s:text name="index.title"/></a>
|
||||
</p>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<s:hidden name="username"/>
|
||||
</s:else>
|
||||
|
||||
<s:password key="password" showPassword="true"/>
|
||||
<s:password key="password"/>
|
||||
<s:password key="password2"/>
|
||||
<s:textfield key="user.fullName"/>
|
||||
<s:textfield key="user.fromAddress"/>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<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"
|
||||
<link href="<s:url value="/css/mailreader.css"/>" rel="stylesheet"
|
||||
type="text/css"/>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>Struts2</filter-name>
|
||||
<url-pattern>*.do</url-pattern>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<!-- Application Listener for Mailreader database -->
|
||||
|
||||
@@ -44,12 +44,13 @@
|
||||
|
||||
<hr/>
|
||||
|
||||
<p><s:i18n name="alternate"><a href="http://struts.apache.org/">
|
||||
<p><s:i18n name="alternate">
|
||||
<img src="<s:text name="struts.logo.path"/>"
|
||||
alt="<s:text name="struts.logo.alt"/>" border="0px"/>
|
||||
</a>
|
||||
alt="<s:text name="struts.logo.alt"/>"/>
|
||||
</s:i18n></p>
|
||||
|
||||
<p><a href="<s:url action="Tour" />"><s:text name="index.tour"/></a></p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.0.9</version>
|
||||
<version>2.0.7</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.0.9</version>
|
||||
<version>2.0.7</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-portlet</artifactId>
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?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>
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE xwork PUBLIC
|
||||
"-//OpenSymphony Group//XWork 1.1.1//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-1.1.1.dtd">
|
||||
<xwork>
|
||||
<include file="struts-portlet-default.xml" />
|
||||
|
||||
<package name="view" extends="struts-portlet-default"
|
||||
@@ -130,7 +129,7 @@
|
||||
<action name="processFormExampleEdit"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="input">
|
||||
/WEB-INF/edit/formExampleInput.jsp
|
||||
/WEB-INF/edtt/formExampleInput.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/edit/processFormExampleForward.action?firstName=${firstName}&lastName=${lastName}
|
||||
@@ -159,4 +158,4 @@
|
||||
<result name="success">/WEB-INF/help/index.jsp</result>
|
||||
</action>
|
||||
</package>
|
||||
</struts>
|
||||
</xwork>
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//OpenSymphony Group//XWork Validator Config 1.0//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-config-1.0.dtd">
|
||||
<validators>
|
||||
<validator name="required" class="com.opensymphony.xwork2.validator.validators.RequiredFieldValidator"/>
|
||||
<validator name="requiredstring" class="com.opensymphony.xwork2.validator.validators.RequiredStringValidator"/>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.0.9</version>
|
||||
<version>2.0.7</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-showcase</artifactId>
|
||||
@@ -62,13 +62,6 @@
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.tiles</groupId>
|
||||
<artifactId>tiles-jsp</artifactId>
|
||||
<version>2.0.4</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-codebehind-plugin</artifactId>
|
||||
|
||||
+64
-64
@@ -1,73 +1,73 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//OpenSymphony Group//XWork Validator 1.0//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<!-- START SNIPPET: fieldValidatorsExample -->
|
||||
|
||||
"-//OpenSymphony Group//XWork Validator 1.0//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<!-- START SNIPPET: fieldValidatorsExample -->
|
||||
|
||||
<validators>
|
||||
<field name="requiredValidatorField">
|
||||
<field-validator type="required">
|
||||
<message><![CDATA[ required ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="requiredStringValidatorField">
|
||||
<field-validator type="requiredstring">
|
||||
<param name="trim">true</param>
|
||||
<field name="requiredValidatorField">
|
||||
<field-validator type="required">
|
||||
<message><![CDATA[ required ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="requiredStringValidatorField">
|
||||
<field-validator type="requiredstring">
|
||||
<param name="trim">true</param>
|
||||
<message key="i18n.nothing.here"><![CDATA[ required and must be string ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="requiredStringValidatorField">
|
||||
<field-validator type="requiredstring">
|
||||
<param name="trim">true</param>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="requiredStringValidatorField">
|
||||
<field-validator type="requiredstring">
|
||||
<param name="trim">true</param>
|
||||
<message key="i18n.requiredstring"><![CDATA[ required and must be string ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="integerValidatorField">
|
||||
<field-validator type="int">
|
||||
<param name="min">1</param>
|
||||
<param name="max">10</param>
|
||||
<message><![CDATA[ must be integer min 1 max 10 if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="dateValidatorField">
|
||||
<field-validator type="date">
|
||||
<param name="min">01/01/1990</param>
|
||||
<param name="max">01/01/2000</param>
|
||||
<message><![CDATA[ must be a min 01/01/1990 max 01/01/2000 if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="emailValidatorField">
|
||||
<field-validator type="email">
|
||||
<message><![CDATA[ must be a valid email if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="urlValidatorField">
|
||||
<field-validator type="url">
|
||||
<message><![CDATA[ must be a valid url if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="stringLengthValidatorField">
|
||||
<field-validator type="stringlength">
|
||||
<param name="maxLength">4</param>
|
||||
<param name="minLength">2</param>
|
||||
<param name="trim">true</param>
|
||||
<message><![CDATA[ must be a String of a specific greater than 1 less than 5 if specified ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="regexValidatorField">
|
||||
<field-validator type="regex">
|
||||
<param name="expression">.*\.txt</param>
|
||||
<message><![CDATA[ regexValidatorField must match a regexp (.*\.txt) if specified ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="fieldExpressionValidatorField">
|
||||
<field-validator type="fieldexpression">
|
||||
<param name="expression">(fieldExpressionValidatorField == requiredValidatorField)</param>
|
||||
<message><![CDATA[ must be the same as the Required Validator Field if specified ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="integerValidatorField">
|
||||
<field-validator type="int">
|
||||
<param name="min">1</param>
|
||||
<param name="max">10</param>
|
||||
<message><![CDATA[ must be integer min 1 max 10 if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="dateValidatorField">
|
||||
<field-validator type="date">
|
||||
<param name="min">01/01/1990</param>
|
||||
<param name="max">01/01/2000</param>
|
||||
<message><![CDATA[ must be a min 01-01-1990 max 01-01-2000 if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="emailValidatorField">
|
||||
<field-validator type="email">
|
||||
<message><![CDATA[ must be a valid email if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="urlValidatorField">
|
||||
<field-validator type="url">
|
||||
<message><![CDATA[ must be a valid url if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="stringLengthValidatorField">
|
||||
<field-validator type="stringlength">
|
||||
<param name="maxLength">4</param>
|
||||
<param name="minLength">2</param>
|
||||
<param name="trim">true</param>
|
||||
<message><![CDATA[ must be a String of a specific greater than 1 less than 5 if specified ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="regexValidatorField">
|
||||
<field-validator type="regex">
|
||||
<param name="expression">.*\.txt</param>
|
||||
<message><![CDATA[ regexValidatorField must match a regexp (.*\.txt) if specified ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="fieldExpressionValidatorField">
|
||||
<field-validator type="fieldexpression">
|
||||
<param name="expression">(fieldExpressionValidatorField == requiredValidatorField)</param>
|
||||
<message><![CDATA[ must be the same as the Required Validator Field if specified ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
|
||||
<!-- END SNIPPET: fieldValidatorsExample -->
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<default-action-ref name="download"/>
|
||||
|
||||
<action name="download" class="org.apache.struts2.showcase.filedownload.FileDownloadAction">
|
||||
<param name="inputPath">/images/struts.gif</param>
|
||||
<param name="inputPath">\images\struts.gif</param>
|
||||
<result name="success" type="stream">
|
||||
<param name="contentType">image/gif</param>
|
||||
<param name="inputName">inputStream</param>
|
||||
@@ -20,7 +20,7 @@
|
||||
</action>
|
||||
|
||||
<action name="download2" class="org.apache.struts2.showcase.filedownload.FileDownloadAction">
|
||||
<param name="inputPath">/images/struts-gif.zip</param>
|
||||
<param name="inputPath">\images\struts-gif.zip</param>
|
||||
<result name="success" type="stream">
|
||||
<param name="contentType">application/zip</param>
|
||||
<param name="inputName">inputStream</param>
|
||||
|
||||
@@ -17,10 +17,6 @@
|
||||
<result type="tiles">showcase.freemarker</result>
|
||||
</action>
|
||||
|
||||
<action name="freemarkerLayout">
|
||||
<result type="tiles">showcase.freemarkerLayout</result>
|
||||
</action>
|
||||
|
||||
<action name="sanity">
|
||||
<result type="redirect">/tiles/layout.jsp</result>
|
||||
<result type="redirect" name="success">/tiles/layout.jsp</result>
|
||||
|
||||
@@ -28,21 +28,15 @@
|
||||
<tiles-definitions>
|
||||
|
||||
<definition name="showcase.index" template="/tiles/layout.jsp">
|
||||
<put-attribute name="title" value="Tiles Showcase"/>
|
||||
<put-attribute name="header" value="/tiles/header.jsp"/>
|
||||
<put-attribute name="body" value="/tiles/body.jsp"/>
|
||||
<put name="title" value="Tiles Showcase"/>
|
||||
<put name="header" value="/tiles/header.jsp"/>
|
||||
<put name="body" value="/tiles/body.jsp"/>
|
||||
</definition>
|
||||
|
||||
<definition name="showcase.freemarker" template="/tiles/layout.jsp">
|
||||
<put-attribute name="title" value="Tiles/Freemarker Showcase"/>
|
||||
<put-attribute name="header" value="/tiles/header.jsp"/>
|
||||
<put-attribute name="body" value="/tiles/body.ftl"/>
|
||||
</definition>
|
||||
|
||||
<definition name="showcase.freemarkerLayout" template="/tiles/layout.ftl">
|
||||
<put-attribute name="title" value="Tiles/Freemarker Showcase"/>
|
||||
<put-attribute name="header" value="/tiles/header.jsp"/>
|
||||
<put-attribute name="body" value="/tiles/body.ftl"/>
|
||||
<put name="title" value="Tiles/Freemarker Showcase"/>
|
||||
<put name="header" value="/tiles/header.jsp"/>
|
||||
<put name="body" value="/tiles/body.ftl"/>
|
||||
</definition>
|
||||
|
||||
</tiles-definitions>
|
||||
|
||||
@@ -5,6 +5,11 @@
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
|
||||
|
||||
<display-name>Struts Showcase Application</display-name>
|
||||
|
||||
<context-param>
|
||||
<param-name>org.apache.tiles.CONTAINER_FACTORY</param-name>
|
||||
<param-value>org.apache.struts2.tiles.StrutsTilesContainerFactory</param-value>
|
||||
</context-param>
|
||||
|
||||
<filter>
|
||||
<filter-name>struts-cleanup</filter-name>
|
||||
@@ -52,7 +57,7 @@
|
||||
|
||||
<listener>
|
||||
<listener-class>
|
||||
org.apache.struts2.tiles.StrutsTilesListener
|
||||
org.apache.tiles.listener.TilesListener
|
||||
</listener-class>
|
||||
</listener>
|
||||
|
||||
@@ -80,12 +85,6 @@
|
||||
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
<servlet>
|
||||
<servlet-name>JspSupportServlet</servlet-name>
|
||||
<servlet-class>org.apache.struts2.views.JspSupportServlet</servlet-class>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
|
||||
<!-- JavaServer Faces Servlet Mapping, not called directly -->
|
||||
<servlet-mapping>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<@s.url id="url" action="hangmanAjax" namespace="/hangman" />
|
||||
<@s.a href="%{#url}">Hangman (Ajax - Experimental)</@s.a>
|
||||
(broken) <@s.a href="%{#url}">Hangman (Ajax - Experimental)</@s.a>
|
||||
</li>
|
||||
</ul>
|
||||
</body>
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
<li>
|
||||
<a href="freemarker.action">View FreeMarker Example</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="freemarkerLayout.action">View Example with a FreeMarker Layout</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@@ -1,12 +0,0 @@
|
||||
<#assign tiles=JspTaglibs["http://tiles.apache.org/tags-tiles"]>
|
||||
<@tiles.importAttribute name="title" scope="request"/>
|
||||
<html>
|
||||
<head><title><@tiles.getAsString name="title"/></title></head>
|
||||
<body>
|
||||
<@tiles.insertAttribute name="header"/>
|
||||
<p id="body">
|
||||
<@tiles.insertAttribute name="body"/>
|
||||
</p>
|
||||
<p>Notice that this is a layout made in FreeMarker</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -11,7 +11,5 @@
|
||||
<p id="body">
|
||||
<tiles:insertAttribute name="body"/>
|
||||
</p>
|
||||
|
||||
<p>Notice that this is a layout made in JSP</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<h1>Validation Examples</h1>
|
||||
|
||||
|
||||
<s:url id="quizBasic" namespace="/validation" action="quizBasic" method="input"/>
|
||||
<s:url id="quizClient" namespace="/validation" action="quizClient" method="input"/>
|
||||
<s:url id="quizClientCss" namespace="/validation" action="quizClientCss" method="input"/>
|
||||
@@ -24,13 +24,13 @@
|
||||
<s:url id="clientSideValidationUrl" action="clientSideValidationExample" namespace="/validation" />
|
||||
<s:url id="backToShowcase" action="showcase" namespace="/" />
|
||||
<s:url id="storeMessageAcrossRequestExample" value="/validation/storeErrorsAcrossRequestExample.jsp" />
|
||||
|
||||
|
||||
<ul>
|
||||
<li><s:a href="%{fieldValidatorUrl}">Field Validators</s:a></li>
|
||||
<li><s:a href="%{clientSideValidationUrl}">Field Validators with client-side JavaScript</s:a></li>
|
||||
<li><s:a href="%{nonFieldValidatorUrl}">Non Field Validator</s:a></li>
|
||||
<li><s:a href="%{storeMessageAcrossRequestExample}">Store across request using MessageStoreInterceptor (Example)</s:a></li>
|
||||
<li><s:a href="%{quizAjax}">Validation (ajax)</s:a></li>
|
||||
<li>(broken) <s:a href="%{quizAjax}">Validation (ajax)</s:a></li>
|
||||
<li><s:a href="%{quizBasic}">Validation (basic)</s:a></li>
|
||||
<li><s:a href="%{quizClient}">Validation (client)</s:a></li>
|
||||
<li><s:a href="%{quizClientCss}">Validation (client using css_xhtml theme)</s:a></li>
|
||||
|
||||
+4
-10
@@ -33,7 +33,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.0.9</version>
|
||||
<version>2.0.7</version>
|
||||
</parent>
|
||||
|
||||
<scm>
|
||||
@@ -100,10 +100,10 @@
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>com.opensymphony</groupId>
|
||||
<groupId>opensymphony</groupId>
|
||||
<artifactId>xwork</artifactId>
|
||||
<classifier>javadoc</classifier>
|
||||
<version>2.0.4</version>
|
||||
<version>2.0.0</version>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
<outputDirectory>${project.build.directory}/xwork-apidocs</outputDirectory>
|
||||
@@ -231,12 +231,6 @@
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.tiles</groupId>
|
||||
<artifactId>tiles-jsp</artifactId>
|
||||
<version>2.0.4</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Include optional dependencies -->
|
||||
<dependency>
|
||||
@@ -390,7 +384,7 @@
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-container-default</artifactId>
|
||||
<version>1.0-alpha-10</version>
|
||||
<version>1.0-alpha-10-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -58,10 +58,10 @@
|
||||
<directory>../target/site</directory>
|
||||
<outputDirectory>docs</outputDirectory>
|
||||
</fileSet>
|
||||
<!--fileSet>
|
||||
<fileSet>
|
||||
<directory>../api/target/site</directory>
|
||||
<outputDirectory>docs/struts2-api</outputDirectory>
|
||||
</fileSet-->
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>../core/target/site</directory>
|
||||
<outputDirectory>docs/struts2-core</outputDirectory>
|
||||
@@ -130,14 +130,14 @@
|
||||
<include>src/</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<!--fileSet>
|
||||
<fileSet>
|
||||
<directory>../api</directory>
|
||||
<outputDirectory>src/api</outputDirectory>
|
||||
<includes>
|
||||
<include>pom.xml</include>
|
||||
<include>src/</include>
|
||||
</includes>
|
||||
</fileSet-->
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>../apps</directory>
|
||||
<outputDirectory>src/apps</outputDirectory>
|
||||
|
||||
@@ -60,14 +60,14 @@
|
||||
<include>src/</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<!--fileSet>
|
||||
<fileSet>
|
||||
<directory>../api</directory>
|
||||
<outputDirectory>src/api</outputDirectory>
|
||||
<includes>
|
||||
<include>pom.xml</include>
|
||||
<include>src/</include>
|
||||
</includes>
|
||||
</fileSet-->
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>../apps</directory>
|
||||
<outputDirectory>src/apps</outputDirectory>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +1,2 @@
|
||||
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/struts2-core-2.0.9.jar -destjar struts2-core-j4-2.0.9.jar
|
||||
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/xwork-2.0.4.jar -destjar xwork-j4-2.0.4.jar
|
||||
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/struts2-core-2.0.6.jar -destjar struts2-core-j4-2.0.6.jar
|
||||
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/xwork-2.0.1.jar -destjar xwork-j4-2.0.1.jar
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/struts2-core-2.0.9.jar -destjar struts2-core-j4-2.0.9.jar
|
||||
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/xwork-2.0.4.jar -destjar xwork-j4-2.0.4.jar
|
||||
+8
-9
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.0.9</version>
|
||||
<version>2.0.7</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-core</artifactId>
|
||||
@@ -22,7 +22,7 @@
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>2.0-alpha-4</version>
|
||||
<version>2.0-alpha-1-SNAPSHOT</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>unpack-xwork</id>
|
||||
@@ -33,9 +33,9 @@
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>com.opensymphony</groupId>
|
||||
<groupId>opensymphony</groupId>
|
||||
<artifactId>xwork</artifactId>
|
||||
<version>2.0.4</version>
|
||||
<version>2.0.1</version>
|
||||
<classifier>sources</classifier>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
@@ -115,10 +115,9 @@
|
||||
<!--
|
||||
Run the translator for Java 1.4 compatiblity
|
||||
|
||||
Samples:
|
||||
Sample:
|
||||
$ cd struts/struts2/
|
||||
$ mvn clean install -Papps,j4 -Djava14.jar=$JAVA_HOME/../Classes/classes.jar
|
||||
$ mvn clean install -Papps,j4 -Djava14.jar="$JAVA_HOME/jre/lib/rt.jar"
|
||||
|
||||
-->
|
||||
<id>j4</id>
|
||||
@@ -251,9 +250,9 @@
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.opensymphony</groupId>
|
||||
<groupId>opensymphony</groupId>
|
||||
<artifactId>xwork</artifactId>
|
||||
<version>2.0.4</version>
|
||||
<version>2.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -462,7 +461,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts-annotations</artifactId>
|
||||
<version>1.0.2</version>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -151,7 +151,4 @@ public final class StrutsConstants {
|
||||
/** XWork default text provider */
|
||||
public static final String STRUTS_XWORKTEXTPROVIDER = "struts.xworkTextProvider";
|
||||
|
||||
/** The name of the parameter to create when mapping an id (used by some action mappers) */
|
||||
public static final String STRUTS_ID_PARAMETER_NAME = "struts.mapper.idParameterName";
|
||||
|
||||
}
|
||||
|
||||
@@ -109,7 +109,6 @@ public class Autocompleter extends ComboBox {
|
||||
protected String iconPath;
|
||||
protected String keyName;
|
||||
protected String dataFieldName;
|
||||
protected String resultsLimit;
|
||||
|
||||
public Autocompleter(ValueStack stack, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
@@ -173,7 +172,7 @@ public class Autocompleter extends ComboBox {
|
||||
if(iconPath != null)
|
||||
addParameter("iconPath", findString(iconPath));
|
||||
if(dataFieldName != null)
|
||||
addParameter("dataFieldName", findString(dataFieldName));
|
||||
addParameter("dataFieldName", findString(dataFieldName));
|
||||
if(keyName != null)
|
||||
addParameter("keyName", findString(keyName));
|
||||
else {
|
||||
@@ -183,8 +182,6 @@ public class Autocompleter extends ComboBox {
|
||||
|
||||
String keyNameExpr = "%{" + keyName + "}";
|
||||
addParameter("key", findString(keyNameExpr));
|
||||
if(resultsLimit != null)
|
||||
addParameter("searchLimit", findString(resultsLimit));
|
||||
}
|
||||
|
||||
protected Object findListValue() {
|
||||
@@ -297,9 +294,4 @@ public class Autocompleter extends ComboBox {
|
||||
public void setDataFieldName(String dataFieldName) {
|
||||
this.dataFieldName = dataFieldName;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Limit how many results are shown as autocompletion options", defaultValue="30")
|
||||
public void setResultsLimit(String resultsLimit) {
|
||||
this.resultsLimit = resultsLimit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ package org.apache.struts2.components;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Writer;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Stack;
|
||||
|
||||
@@ -65,7 +65,7 @@ public class Component {
|
||||
*/
|
||||
public Component(ValueStack stack) {
|
||||
this.stack = stack;
|
||||
this.parameters = new LinkedHashMap();
|
||||
this.parameters = new HashMap();
|
||||
getComponentStack().push(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -192,8 +192,6 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
}
|
||||
} else if (form != null) {
|
||||
addParameter("doubleId", form.getParameters().get("id") + "_" +escape(this.doubleName));
|
||||
} else {
|
||||
addParameter("doubleId", escape(doubleName !=null ? findString(doubleName) : null));
|
||||
}
|
||||
|
||||
if (doubleOnclick != null) {
|
||||
|
||||
@@ -20,20 +20,21 @@
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.LocaleProvider;
|
||||
import com.opensymphony.xwork2.TextProviderFactory;
|
||||
import com.opensymphony.xwork2.util.LocalizedTextUtil;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.apache.struts2.dispatcher.Dispatcher;
|
||||
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;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.StrutsException;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.LocaleProvider;
|
||||
import com.opensymphony.xwork2.TextProviderSupport;
|
||||
import com.opensymphony.xwork2.TextProviderFactory;
|
||||
import com.opensymphony.xwork2.util.LocalizedTextUtil;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
@@ -102,9 +103,7 @@ public class I18n extends Component {
|
||||
|
||||
if (bundle != null) {
|
||||
final Locale locale = (Locale) getStack().getContext().get(ActionContext.LOCALE);
|
||||
TextProviderFactory tpf = new TextProviderFactory();
|
||||
Dispatcher.getInstance().getContainer().inject(tpf);
|
||||
getStack().push(tpf.createInstance(bundle, new LocaleProvider() {
|
||||
getStack().push(TextProviderFactory.getInstance(bundle, new LocaleProvider() {
|
||||
public Locale getLocale() {
|
||||
return locale;
|
||||
}
|
||||
|
||||
@@ -123,14 +123,6 @@ public class OptionTransferSelect extends DoubleListUIBean {
|
||||
protected String rightUpLabel;
|
||||
protected String rightDownLabel;
|
||||
|
||||
protected String addToLeftOnclick;
|
||||
protected String addToRightOnclick;
|
||||
protected String addAllToLeftOnclick;
|
||||
protected String addAllToRightOnclick;
|
||||
protected String selectAllOnclick;
|
||||
protected String upDownOnLeftOnclick;
|
||||
protected String upDownOnRightOnclick;
|
||||
|
||||
|
||||
public OptionTransferSelect(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
@@ -260,34 +252,6 @@ public class OptionTransferSelect extends DoubleListUIBean {
|
||||
rightDownLabel != null ? findValue(rightDownLabel, String.class) : "v");
|
||||
|
||||
|
||||
// selectAllOnclick
|
||||
addParameter("selectAllOnclick",
|
||||
selectAllOnclick != null ? findValue(selectAllOnclick, String.class) : "");
|
||||
|
||||
// addToLeftOnclick
|
||||
addParameter("addToLeftOnclick",
|
||||
addToLeftOnclick != null ? findValue(addToLeftOnclick, String.class) : "");
|
||||
|
||||
// addToRightOnclick
|
||||
addParameter("addToRightOnclick",
|
||||
addToRightOnclick != null ? findValue(addToRightOnclick, String.class) : "");
|
||||
|
||||
// addAllToLeftOnclick
|
||||
addParameter("addAllToLeftOnclick",
|
||||
addAllToLeftOnclick != null ? findValue(addAllToLeftOnclick, String.class) : "");
|
||||
|
||||
// addAllToRightOnclick
|
||||
addParameter("addAllToRightOnclick",
|
||||
addAllToRightOnclick != null ? findValue(addAllToRightOnclick, String.class) : "");
|
||||
|
||||
// upDownOnLeftOnclick
|
||||
addParameter("upDownOnLeftOnclick",
|
||||
upDownOnLeftOnclick != null ? findValue(upDownOnLeftOnclick, String.class) : "");
|
||||
|
||||
// upDownOnRightOnclick
|
||||
addParameter("upDownOnRightOnclick",
|
||||
upDownOnRightOnclick != null ? findValue(upDownOnRightOnclick, String.class) : "");
|
||||
|
||||
|
||||
// inform the form component our select tag infos, so they know how to select
|
||||
// its elements upon onsubmit
|
||||
@@ -512,66 +476,5 @@ public class OptionTransferSelect extends DoubleListUIBean {
|
||||
return rightDownLabel;
|
||||
}
|
||||
|
||||
public String getAddAllToLeftOnclick() {
|
||||
return addAllToLeftOnclick;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Javascript to run after Add All To Left button pressed")
|
||||
public void setAddAllToLeftOnclick(String addAllToLeftOnclick) {
|
||||
this.addAllToLeftOnclick = addAllToLeftOnclick;
|
||||
}
|
||||
|
||||
public String getAddAllToRightOnclick() {
|
||||
return addAllToRightOnclick;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Javascript to run after Add All To Right button pressed")
|
||||
public void setAddAllToRightOnclick(String addAllToRightOnclick) {
|
||||
this.addAllToRightOnclick = addAllToRightOnclick;
|
||||
}
|
||||
|
||||
public String getAddToLeftOnclick() {
|
||||
return addToLeftOnclick;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Javascript to run after Add To Left button pressed")
|
||||
public void setAddToLeftOnclick(String addToLeftOnclick) {
|
||||
this.addToLeftOnclick = addToLeftOnclick;
|
||||
}
|
||||
|
||||
public String getAddToRightOnclick() {
|
||||
return addToRightOnclick;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Javascript to run after Add To Right button pressed")
|
||||
public void setAddToRightOnclick(String addToRightOnclick) {
|
||||
this.addToRightOnclick = addToRightOnclick;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Javascript to run after up / down on the left side buttons pressed")
|
||||
public void setUpDownOnLeftOnclick(String upDownOnLeftOnclick) {
|
||||
this.upDownOnLeftOnclick = upDownOnLeftOnclick;
|
||||
}
|
||||
|
||||
public String getUpDownOnLeftOnclick() {
|
||||
return this.upDownOnLeftOnclick;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Javascript to run after up / down on the right side buttons pressed")
|
||||
public void setUpDownOnRightOnclick(String upDownOnRightOnclick) {
|
||||
this.upDownOnRightOnclick = upDownOnRightOnclick;
|
||||
}
|
||||
|
||||
public String getUpDownOnRightOnclick() {
|
||||
return this.upDownOnRightOnclick;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Javascript to run after Select All button pressed")
|
||||
public void setSelectAllOnclick(String selectAllOnclick) {
|
||||
this.selectAllOnclick = selectAllOnclick;
|
||||
}
|
||||
|
||||
public String getSelectAllOnclick() {
|
||||
return this.selectAllOnclick;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,19 +48,19 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* <p/> <b>Examples</b>
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
* <s:submit value="%{'Submit the form'}" />
|
||||
* <s:submit value="%{'Submit'}" />
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example2 -->
|
||||
* Render an image submit:
|
||||
* <s:submit type="image" value="%{'Submit the form'}" src="submit.gif"/>
|
||||
* <s:submit type="image" value="%{'Submit'}" label="Submit the form" src="submit.gif"/>
|
||||
* <!-- END SNIPPET: example2 -->
|
||||
* </pre>
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example3 -->
|
||||
* Render an button submit:
|
||||
* <s:submit type="button" value="%{'Submit the form'}"/>
|
||||
* <s:submit type="button" value="%{'Submit'}" label="Submit the form"/>
|
||||
* <!-- END SNIPPET: example3 -->
|
||||
* </pre>
|
||||
*
|
||||
|
||||
@@ -98,7 +98,7 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
*
|
||||
* <-- Example 3-->
|
||||
* <s:url includeParams="get" >
|
||||
* <s:param name="id" value="%{'22'}" />
|
||||
* <:param name="id" value="%{'22'}" />
|
||||
* </s:url>
|
||||
*
|
||||
* <!-- END SNIPPET: example -->
|
||||
@@ -293,7 +293,7 @@ public class URL extends Component {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The action to generate the URL for, if not using value")
|
||||
@StrutsTagAttribute(description="he action generate url for, if not using value")
|
||||
public void setAction(String action) {
|
||||
this.action = action;
|
||||
}
|
||||
@@ -313,7 +313,7 @@ public class URL extends Component {
|
||||
this.encode = encode;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Whether actual context should be included in URL", type="Boolean", defaultValue="true")
|
||||
@StrutsTagAttribute(description="Whether actual context should be included in url", type="Boolean", defaultValue="true")
|
||||
public void setIncludeContext(boolean includeContext) {
|
||||
this.includeContext = includeContext;
|
||||
}
|
||||
@@ -328,7 +328,7 @@ public class URL extends Component {
|
||||
this.windowState = windowState;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Specifies if this should be a portlet render or action URL")
|
||||
@StrutsTagAttribute(description="Specifies if this should be a portlet render or action url")
|
||||
public void setPortletUrlType(String portletUrlType) {
|
||||
this.portletUrlType = portletUrlType;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ import java.util.Properties;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.apache.struts2.util.ClassLoaderUtils;
|
||||
|
||||
import com.opensymphony.xwork2.util.location.LocatableProperties;
|
||||
import com.opensymphony.xwork2.util.location.Location;
|
||||
@@ -54,7 +53,7 @@ class PropertiesSettings extends Settings {
|
||||
*/
|
||||
public PropertiesSettings(String name) {
|
||||
|
||||
URL settingsUrl = ClassLoaderUtils.getResource(name + ".properties", getClass());
|
||||
URL settingsUrl = Thread.currentThread().getContextClassLoader().getResource(name + ".properties");
|
||||
|
||||
if (settingsUrl == null) {
|
||||
LOG.debug(name + ".properties missing");
|
||||
|
||||
@@ -401,6 +401,9 @@ Caused by: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyExcepti
|
||||
ObjectTypeDeterminer objectTypeDeterminer = container.getInstance(ObjectTypeDeterminer.class);
|
||||
ObjectTypeDeterminerFactory.setInstance(objectTypeDeterminer);
|
||||
|
||||
TextProvider textProvider = container.getInstance(TextProvider.class);
|
||||
TextProviderFactory.setInstance(textProvider);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
|
||||
@@ -379,7 +379,7 @@ public class FilterDispatcher implements StrutsStatics, Filter {
|
||||
*/
|
||||
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
|
||||
|
||||
|
||||
|
||||
HttpServletRequest request = (HttpServletRequest) req;
|
||||
HttpServletResponse response = (HttpServletResponse) res;
|
||||
ServletContext servletContext = getServletContext();
|
||||
@@ -394,6 +394,7 @@ public class FilterDispatcher implements StrutsStatics, Filter {
|
||||
} catch (Exception ex) {
|
||||
LOG.error("error getting ActionMapping", ex);
|
||||
dispatcher.sendError(request, response, servletContext, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, ex);
|
||||
ActionContextCleanUp.cleanUp(req);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -416,15 +417,15 @@ public class FilterDispatcher implements StrutsStatics, Filter {
|
||||
return;
|
||||
}
|
||||
|
||||
dispatcher.serviceAction(request, response, servletContext, mapping);
|
||||
|
||||
} finally {
|
||||
try {
|
||||
ActionContextCleanUp.cleanUp(req);
|
||||
dispatcher.serviceAction(request, response, servletContext, mapping);
|
||||
} finally {
|
||||
UtilTimerStack.pop(timerKey);
|
||||
ActionContextCleanUp.cleanUp(req);
|
||||
}
|
||||
}
|
||||
finally {
|
||||
UtilTimerStack.pop(timerKey);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,7 +23,6 @@ package org.apache.struts2.dispatcher;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -46,6 +45,19 @@ import com.opensymphony.xwork2.inject.Inject;
|
||||
* standard redirect result.
|
||||
*
|
||||
* <p/>
|
||||
* @TODO - the below sentence is confusing and seems to be contradictory -- FIX ME
|
||||
* To pass parameters, use the <param> ... </param> tag. The following parameters will not be
|
||||
* passed because they are part of the config param for this particular result.
|
||||
*
|
||||
* <ul>
|
||||
* <li>actionName</li>
|
||||
* <li>namespace</li>
|
||||
* <li>method</li>
|
||||
* <li>encode</li>
|
||||
* <li>parse</li>
|
||||
* <li>location</li>
|
||||
* <li>prependServletContext</li>
|
||||
* </ul>
|
||||
*
|
||||
* See examples below for an example of how request parameters could be passed in.
|
||||
*
|
||||
@@ -124,7 +136,7 @@ public class ServletActionRedirectResult extends ServletRedirectResult {
|
||||
protected String namespace;
|
||||
protected String method;
|
||||
|
||||
private Map<String, String> requestParameters = new LinkedHashMap<String, String>();
|
||||
private Map<String, String> requestParameters = new HashMap<String, String>();
|
||||
|
||||
public ServletActionRedirectResult() {
|
||||
super();
|
||||
|
||||
@@ -117,7 +117,7 @@ public abstract class StrutsResultSupport implements Result, StrutsStatics {
|
||||
}
|
||||
|
||||
public StrutsResultSupport(String location) {
|
||||
this(location, true, false);
|
||||
this(location, false, false);
|
||||
}
|
||||
|
||||
public StrutsResultSupport(String location, boolean parse, boolean encode) {
|
||||
|
||||
@@ -485,17 +485,11 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
|
||||
return uri.toString();
|
||||
}
|
||||
|
||||
|
||||
public boolean isSlashesInActionNames() {
|
||||
return allowSlashesInActionNames;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Defines a parameter action prefix
|
||||
*/
|
||||
interface ParameterAction {
|
||||
void execute(String key, ActionMapping mapping);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
package org.apache.struts2.dispatcher.mapper;
|
||||
|
||||
import com.opensymphony.xwork2.config.ConfigurationManager;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
@@ -30,7 +29,6 @@ import java.net.URLDecoder;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: description -->
|
||||
@@ -58,25 +56,16 @@ import org.apache.struts2.StrutsConstants;
|
||||
* </action>
|
||||
* </pre>
|
||||
* <p>
|
||||
* This mapper supports the following parameters:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li><code>struts.mapper.idParameterName</code> - If set, this value will be the name
|
||||
* of the parameter under which the id is stored. The id will then be removed
|
||||
* from the action name. This allows restful actions to not require wildcards.
|
||||
* </li>
|
||||
* </ul>
|
||||
* <p>
|
||||
* The following URL's will invoke its methods:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li><code>GET: /movie/ => method="index"</code></li>
|
||||
* <li><code>GET: /movie => method="index"</code></li>
|
||||
* <li><code>GET: /movie/Thrillers => method="view", id="Thrillers"</code></li>
|
||||
* <li><code>GET: /movie/Thrillers!edit => method="edit", id="Thrillers"</code></li>
|
||||
* <li><code>GET: /movie/new => method="editNew"</code></li>
|
||||
* <li><code>POST: /movie/ => method="create"</code></li>
|
||||
* <li><code>PUT: /movie/Thrillers => method="update", id="Thrillers"</code></li>
|
||||
* <li><code>DELETE: /movie/Thrillers => method="remove", id="Thrillers"</code></li>
|
||||
* <li><code>GET: /movie/new => method="editNew"</code></li>
|
||||
* <li><code>POST: /movie/Thrillers => method="create"</code></li>
|
||||
* <li><code>PUT: /movie/ => method="update"</code></li>
|
||||
* <li><code>DELETE: /movie/Thrillers => method="remove"</code></li>
|
||||
* </ul>
|
||||
* <p>
|
||||
* To simulate the HTTP methods PUT and DELETE, since they aren't supported by HTML,
|
||||
@@ -94,13 +83,7 @@ import org.apache.struts2.StrutsConstants;
|
||||
public class Restful2ActionMapper extends DefaultActionMapper {
|
||||
|
||||
protected static final Log LOG = LogFactory.getLog(Restful2ActionMapper.class);
|
||||
public static final String HTTP_METHOD_PARAM = "__http_method";
|
||||
private String idParameterName = null;
|
||||
|
||||
public Restful2ActionMapper() {
|
||||
setSlashesInActionNames("true");
|
||||
}
|
||||
|
||||
private static final String HTTP_METHOD_PARAM = "__http_method";
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
@@ -109,9 +92,6 @@ public class Restful2ActionMapper extends DefaultActionMapper {
|
||||
*/
|
||||
public ActionMapping getMapping(HttpServletRequest request, ConfigurationManager configManager) {
|
||||
|
||||
if (!isSlashesInActionNames()) {
|
||||
throw new IllegalStateException("This action mapper requires the setting 'slashesInActionNames' to be set to 'true'");
|
||||
}
|
||||
ActionMapping mapping = super.getMapping(request, configManager);
|
||||
|
||||
if (mapping == null) {
|
||||
@@ -134,7 +114,7 @@ public class Restful2ActionMapper extends DefaultActionMapper {
|
||||
mapping.setMethod("index");
|
||||
|
||||
// Creating a new entry on POST e.g. foo/
|
||||
} else if (isPost(request)) {
|
||||
} else if (isPut(request)) {
|
||||
mapping.setMethod("create");
|
||||
}
|
||||
|
||||
@@ -149,25 +129,14 @@ public class Restful2ActionMapper extends DefaultActionMapper {
|
||||
} else if (isGet(request)) {
|
||||
mapping.setMethod("view");
|
||||
|
||||
// Updating an item e.g. foo/1
|
||||
} else if (isPost(request)) {
|
||||
mapping.setMethod("update");
|
||||
|
||||
// Removing an item e.g. foo/1
|
||||
} else if (isDelete(request)) {
|
||||
mapping.setMethod("remove");
|
||||
|
||||
// Updating an item e.g. foo/1
|
||||
} else if (isPut(request)) {
|
||||
mapping.setMethod("update");
|
||||
}
|
||||
|
||||
if (idParameterName != null) {
|
||||
if (mapping.getParams() == null) {
|
||||
mapping.setParams(new HashMap());
|
||||
}
|
||||
mapping.getParams().put(idParameterName, id);
|
||||
}
|
||||
}
|
||||
|
||||
if (idParameterName != null && lastSlashPos > -1) {
|
||||
actionName = actionName.substring(0, lastSlashPos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,15 +205,4 @@ public class Restful2ActionMapper extends DefaultActionMapper {
|
||||
}
|
||||
}
|
||||
|
||||
public String getIdParameterName() {
|
||||
return idParameterName;
|
||||
}
|
||||
|
||||
@Inject(required=false,value=StrutsConstants.STRUTS_ID_PARAMETER_NAME)
|
||||
public void setIdParameterName(String idParameterName) {
|
||||
this.idParameterName = idParameterName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -202,19 +202,17 @@ public class CookieInterceptor extends AbstractInterceptor {
|
||||
Map cookiesMap = new LinkedHashMap();
|
||||
|
||||
Cookie cookies[] = request.getCookies();
|
||||
if (cookies != null) {
|
||||
for (int a=0; a< cookies.length; a++) {
|
||||
String name = cookies[a].getName();
|
||||
String value = cookies[a].getValue();
|
||||
for (int a=0; a< cookies.length; a++) {
|
||||
String name = cookies[a].getName();
|
||||
String value = cookies[a].getValue();
|
||||
|
||||
if (cookiesNameSet.contains("*")) {
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("contains cookie name [*] in configured cookies name set, cookie with name ["+name+"] with value ["+value+"] will be injected");
|
||||
populateCookieValueIntoStack(name, value, cookiesMap, stack);
|
||||
}
|
||||
else if (cookiesNameSet.contains(cookies[a].getName())) {
|
||||
populateCookieValueIntoStack(name, value, cookiesMap, stack);
|
||||
}
|
||||
if (cookiesNameSet.contains("*")) {
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("contains cookie name [*] in configured cookies name set, cookie with name ["+name+"] with value ["+value+"] will be injected");
|
||||
populateCookieValueIntoStack(name, value, cookiesMap, stack);
|
||||
}
|
||||
else if (cookiesNameSet.contains(cookies[a].getName())) {
|
||||
populateCookieValueIntoStack(name, value, cookiesMap, stack);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,16 +31,15 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.components.ActionComponent;
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dispatcher.Dispatcher;
|
||||
|
||||
import com.opensymphony.xwork2.inject.Container;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
import freemarker.template.DefaultObjectWrapper;
|
||||
import freemarker.template.SimpleNumber;
|
||||
import freemarker.template.SimpleSequence;
|
||||
import freemarker.template.TemplateModel;
|
||||
import freemarker.template.TemplateModelException;
|
||||
import freemarker.template.TemplateTransformModel;
|
||||
|
||||
@@ -57,48 +56,18 @@ public abstract class TagModel implements TemplateTransformModel {
|
||||
this.res = res;
|
||||
}
|
||||
|
||||
public Writer getWriter(Writer writer, Map params)
|
||||
throws TemplateModelException, IOException {
|
||||
public Writer getWriter(Writer writer, Map params) throws TemplateModelException, IOException {
|
||||
Component bean = getBean();
|
||||
Container container = Dispatcher.getInstance().getConfigurationManager().getConfiguration().getContainer();
|
||||
container.inject(bean);
|
||||
|
||||
Map unwrappedParameters = unwrapParameters(params);
|
||||
bean.copyParams(unwrappedParameters);
|
||||
|
||||
Map basicParams = convertParams(params);
|
||||
bean.copyParams(basicParams);
|
||||
bean.addAllParameters(getComplexParams(params));
|
||||
return new CallbackWriter(bean, writer);
|
||||
}
|
||||
|
||||
protected abstract Component getBean();
|
||||
|
||||
protected Map unwrapParameters(Map params) {
|
||||
Map map = new HashMap(params.size());
|
||||
DefaultObjectWrapper objectWrapper = new DefaultObjectWrapper();
|
||||
for (Iterator iterator = params.entrySet().iterator(); iterator.hasNext();) {
|
||||
Map.Entry entry = (Map.Entry) iterator.next();
|
||||
|
||||
Object value = entry.getValue();
|
||||
|
||||
if (value != null) {
|
||||
// the value should ALWAYS be a decendant of TemplateModel
|
||||
if (value instanceof TemplateModel) {
|
||||
try {
|
||||
map.put(entry.getKey(), objectWrapper
|
||||
.unwrap((TemplateModel) value));
|
||||
} catch (TemplateModelException e) {
|
||||
LOG.error("failed to unwrap [" + value
|
||||
+ "] it will be ignored", e);
|
||||
}
|
||||
}
|
||||
// if it doesn't, we'll do it the old way by just returning the toString() representation
|
||||
else {
|
||||
map.put(entry.getKey(), value.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
protected Map convertParams(Map params) {
|
||||
HashMap map = new HashMap(params.size());
|
||||
for (Iterator iterator = params.entrySet().iterator(); iterator.hasNext();) {
|
||||
|
||||
@@ -25,7 +25,6 @@ import java.io.PrintWriter;
|
||||
import javax.servlet.jsp.tagext.BodyTagSupport;
|
||||
|
||||
import org.apache.struts2.util.FastByteArrayOutputStream;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.views.util.ContextUtil;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
@@ -39,7 +38,10 @@ public class StrutsBodyTagSupport extends BodyTagSupport {
|
||||
|
||||
private static final long serialVersionUID = -1201668454354226175L;
|
||||
|
||||
@StrutsTagAttribute(required=false,description="The id of the tag element")
|
||||
/**
|
||||
* @s.tagattribute required="false" type="String"
|
||||
* description="The id of the tag element."
|
||||
*/
|
||||
public void setId(String string) {
|
||||
super.setId(string);
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ public class SubsetIteratorTag extends StrutsBodyTagSupport {
|
||||
|
||||
// source
|
||||
Object source = null;
|
||||
if (sourceAttr == null || sourceAttr.length() == 0) {
|
||||
if (sourceAttr == null && sourceAttr.length() <= 0) {
|
||||
source = findValue("top");
|
||||
} else {
|
||||
source = findValue(sourceAttr);
|
||||
|
||||
@@ -54,7 +54,6 @@ public class AutocompleterTag extends ComboBoxTag {
|
||||
protected String iconPath;
|
||||
protected String keyName;
|
||||
protected String dataFieldName;
|
||||
protected String resultsLimit;
|
||||
|
||||
public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new Autocompleter(stack, req, res);
|
||||
@@ -84,7 +83,6 @@ public class AutocompleterTag extends ComboBoxTag {
|
||||
autocompleter.setIconPath(iconPath);
|
||||
autocompleter.setKeyName(keyName);
|
||||
autocompleter.setDataFieldName(dataFieldName);
|
||||
autocompleter.setResultsLimit(resultsLimit);
|
||||
}
|
||||
|
||||
public void setAutoComplete(String autoComplete) {
|
||||
@@ -170,8 +168,4 @@ public class AutocompleterTag extends ComboBoxTag {
|
||||
public void setDataFieldName(String dataFieldName) {
|
||||
this.dataFieldName = dataFieldName;
|
||||
}
|
||||
|
||||
public void setResultsLimit(String resultsLimit) {
|
||||
this.resultsLimit = resultsLimit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,13 +59,6 @@ public class OptionTransferSelectTag extends AbstractDoubleListTag {
|
||||
protected String rightUpLabel;
|
||||
protected String rightDownLabel;
|
||||
|
||||
protected String addToLeftOnclick;
|
||||
protected String addToRightOnclick;
|
||||
protected String addAllToLeftOnclick;
|
||||
protected String addAllToRightOnclick;
|
||||
protected String selectAllOnclick;
|
||||
protected String upDownOnLeftOnclick;
|
||||
protected String upDownOnRightOnclick;
|
||||
|
||||
public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new OptionTransferSelect(stack, req, res);
|
||||
@@ -98,14 +91,6 @@ public class OptionTransferSelectTag extends AbstractDoubleListTag {
|
||||
|
||||
optionTransferSelect.setLeftTitle(leftTitle);
|
||||
optionTransferSelect.setRightTitle(rightTitle);
|
||||
|
||||
optionTransferSelect.setAddToLeftOnclick(addToLeftOnclick);
|
||||
optionTransferSelect.setAddToRightOnclick(addToRightOnclick);
|
||||
optionTransferSelect.setAddAllToLeftOnclick(addAllToLeftOnclick);
|
||||
optionTransferSelect.setAddAllToRightOnclick(addAllToRightOnclick);
|
||||
optionTransferSelect.setSelectAllOnclick(selectAllOnclick);
|
||||
optionTransferSelect.setUpDownOnLeftOnclick(upDownOnLeftOnclick);
|
||||
optionTransferSelect.setUpDownOnRightOnclick(upDownOnRightOnclick);
|
||||
}
|
||||
|
||||
|
||||
@@ -287,60 +272,4 @@ public class OptionTransferSelectTag extends AbstractDoubleListTag {
|
||||
public String getButtonCssStyle() {
|
||||
return this.buttonCssStyle;
|
||||
}
|
||||
|
||||
public String getAddAllToLeftOnclick() {
|
||||
return this.addAllToLeftOnclick;
|
||||
}
|
||||
|
||||
public void setAddAllToLeftOnclick(String addAllToLeftOnclick) {
|
||||
this.addAllToLeftOnclick = addAllToLeftOnclick;
|
||||
}
|
||||
|
||||
public String getAddAllToRightOnclick() {
|
||||
return this.addAllToRightOnclick;
|
||||
}
|
||||
|
||||
public void setAddAllToRightOnclick(String addAllToRightOnclick) {
|
||||
this.addAllToRightOnclick = addAllToRightOnclick;
|
||||
}
|
||||
|
||||
public String getAddToLeftOnclick() {
|
||||
return this.addToLeftOnclick;
|
||||
}
|
||||
|
||||
public void setAddToLeftOnclick(String addToLeftOnclick) {
|
||||
this.addToLeftOnclick = addToLeftOnclick;
|
||||
}
|
||||
|
||||
public String getAddToRightOnclick() {
|
||||
return this.addToRightOnclick;
|
||||
}
|
||||
|
||||
public void setAddToRightOnclick(String addToRightOnclick) {
|
||||
this.addToRightOnclick = addToRightOnclick;
|
||||
}
|
||||
|
||||
public String getUpDownOnLeftOnclick() {
|
||||
return this.upDownOnLeftOnclick;
|
||||
}
|
||||
|
||||
public void setUpDownOnLeftOnclick(String upDownOnLeftOnclick) {
|
||||
this.upDownOnLeftOnclick = upDownOnLeftOnclick;
|
||||
}
|
||||
|
||||
public String getUpDownOnRightOnclick() {
|
||||
return this.upDownOnRightOnclick;
|
||||
}
|
||||
|
||||
public void setUpDownOnRightOnclick(String upDownOnRightOnclick) {
|
||||
this.upDownOnRightOnclick = upDownOnRightOnclick;
|
||||
}
|
||||
|
||||
public void setSelectAllOnclick(String selectAllOnclick) {
|
||||
this.selectAllOnclick = selectAllOnclick;
|
||||
}
|
||||
|
||||
public String getSelectAllOnclick() {
|
||||
return this.selectAllOnclick;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* </result></pre>
|
||||
*
|
||||
* <p>
|
||||
* Without it there would be endless x/y/x/y/x/y/... elements.
|
||||
* Without it there would be an endless x/y/x/y/x/y/... elements.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
@@ -231,7 +231,7 @@ public class XSLTResult implements Result {
|
||||
private String matchingPattern;
|
||||
|
||||
/** Indicates the property name patterns which should be excluded from the xml. */
|
||||
private String excludingPattern;
|
||||
private String exludingPattern;
|
||||
|
||||
/** Indicates the ognl expression respresenting the bean which is to be exposed as xml. */
|
||||
private String exposedValue;
|
||||
@@ -285,12 +285,12 @@ public class XSLTResult implements Result {
|
||||
this.matchingPattern = matchingPattern;
|
||||
}
|
||||
|
||||
public String getExcludingPattern() {
|
||||
return excludingPattern;
|
||||
public String getExludingPattern() {
|
||||
return exludingPattern;
|
||||
}
|
||||
|
||||
public void setExcludingPattern(String excludingPattern) {
|
||||
this.excludingPattern = excludingPattern;
|
||||
public void setExludingPattern(String exludingPattern) {
|
||||
this.exludingPattern = exludingPattern;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -249,123 +249,6 @@ dojo.widget.defineWidget(
|
||||
this.log("starting timer with update interval " + this.updateFreq);
|
||||
this.timer.start();
|
||||
}
|
||||
},
|
||||
|
||||
//from Dojo's ContentPane
|
||||
//TODO: remove when fixed on Dojo
|
||||
splitAndFixPaths:function (s, url) {
|
||||
var titles = [], scripts = [], tmp = [];
|
||||
var match = [], requires = [], attr = [], styles = [];
|
||||
var str = "", path = "", fix = "", tagFix = "", tag = "", origPath = "";
|
||||
if (!url) {
|
||||
url = "./";
|
||||
}
|
||||
if (s) {
|
||||
var regex = /<title[^>]*>([\s\S]*?)<\/title>/i;
|
||||
while (match = regex.exec(s)) {
|
||||
titles.push(match[1]);
|
||||
s = s.substring(0, match.index) + s.substr(match.index + match[0].length);
|
||||
}
|
||||
if (this.adjustPaths) {
|
||||
var regexFindTag = /<[a-z][a-z0-9]*[^>]*\s(?:(?:src|href|style)=[^>])+[^>]*>/i;
|
||||
var regexFindAttr = /\s(src|href|style)=(['"]?)([\w()\[\]\/.,\\'"-:;#=&?\s@!]+?)\2/i;
|
||||
var regexProtocols = /^(?:[#]|(?:(?:https?|ftps?|file|javascript|mailto|news):))/;
|
||||
while (tag = regexFindTag.exec(s)) {
|
||||
str += s.substring(0, tag.index);
|
||||
s = s.substring((tag.index + tag[0].length), s.length);
|
||||
tag = tag[0];
|
||||
tagFix = "";
|
||||
while (attr = regexFindAttr.exec(tag)) {
|
||||
path = "";
|
||||
origPath = attr[3];
|
||||
switch (attr[1].toLowerCase()) {
|
||||
case "src":
|
||||
case "href":
|
||||
if (regexProtocols.exec(origPath)) {
|
||||
path = origPath;
|
||||
} else {
|
||||
path = (new dojo.uri.Uri(url, origPath).toString());
|
||||
}
|
||||
break;
|
||||
case "style":
|
||||
path = dojo.html.fixPathsInCssText(origPath, url);
|
||||
break;
|
||||
default:
|
||||
path = origPath;
|
||||
}
|
||||
fix = " " + attr[1] + "=" + attr[2] + path + attr[2];
|
||||
tagFix += tag.substring(0, attr.index) + fix;
|
||||
tag = tag.substring((attr.index + attr[0].length), tag.length);
|
||||
}
|
||||
str += tagFix + tag;
|
||||
}
|
||||
s = str + s;
|
||||
}
|
||||
regex = /(?:<(style)[^>]*>([\s\S]*?)<\/style>|<link ([^>]*rel=['"]?stylesheet['"]?[^>]*)>)/i;
|
||||
while (match = regex.exec(s)) {
|
||||
if (match[1] && match[1].toLowerCase() == "style") {
|
||||
styles.push(dojo.html.fixPathsInCssText(match[2], url));
|
||||
} else {
|
||||
if (attr = match[3].match(/href=(['"]?)([^'">]*)\1/i)) {
|
||||
styles.push({path:attr[2]});
|
||||
}
|
||||
}
|
||||
s = s.substring(0, match.index) + s.substr(match.index + match[0].length);
|
||||
}
|
||||
var regex = /<script([^>]*)>([\s\S]*?)<\/script>/i;
|
||||
var regexSrc = /src=(['"]?)([^"']*)\1/i;
|
||||
var regexDojoJs = /.*(\bdojo\b\.js(?:\.uncompressed\.js)?)$/;
|
||||
var regexInvalid = /(?:var )?\bdjConfig\b(?:[\s]*=[\s]*\{[^}]+\}|\.[\w]*[\s]*=[\s]*[^;\n]*)?;?|dojo\.hostenv\.writeIncludes\(\s*\);?/g;
|
||||
var regexRequires = /dojo\.(?:(?:require(?:After)?(?:If)?)|(?:widget\.(?:manager\.)?registerWidgetPackage)|(?:(?:hostenv\.)?setModulePrefix|registerModulePath)|defineNamespace)\((['"]).*?\1\)\s*;?/;
|
||||
while (match = regex.exec(s)) {
|
||||
if (this.executeScripts && match[1]) {
|
||||
if (attr = regexSrc.exec(match[1])) {
|
||||
if (regexDojoJs.exec(attr[2])) {
|
||||
dojo.debug("Security note! inhibit:" + attr[2] + " from being loaded again.");
|
||||
} else {
|
||||
scripts.push({path:attr[2]});
|
||||
}
|
||||
}
|
||||
}
|
||||
if (match[2]) {
|
||||
var sc = match[2].replace(regexInvalid, "");
|
||||
if (!sc) {
|
||||
continue;
|
||||
}
|
||||
while (tmp = regexRequires.exec(sc)) {
|
||||
requires.push(tmp[0]);
|
||||
sc = sc.substring(0, tmp.index) + sc.substr(tmp.index + tmp[0].length);
|
||||
}
|
||||
if (this.executeScripts) {
|
||||
scripts.push(sc);
|
||||
}
|
||||
}
|
||||
s = s.substr(0, match.index) + s.substr(match.index + match[0].length);
|
||||
}
|
||||
if (this.extractContent) {
|
||||
match = s.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);
|
||||
if (match) {
|
||||
s = match[1];
|
||||
}
|
||||
}
|
||||
if (this.executeScripts && this.scriptSeparation) {
|
||||
var regex = /(<[a-zA-Z][a-zA-Z0-9]*\s[^>]*?\S=)((['"])[^>]*scriptScope[^>]*>)/;
|
||||
var regexAttr = /([\s'";:\(])scriptScope(.*)/;
|
||||
str = "";
|
||||
while (tag = regex.exec(s)) {
|
||||
tmp = ((tag[3] == "'") ? "\"" : "'");
|
||||
fix = "";
|
||||
str += s.substring(0, tag.index) + tag[1];
|
||||
while (attr = regexAttr.exec(tag[2])) {
|
||||
tag[2] = tag[2].substring(0, attr.index) + attr[1] + "dojo.widget.byId(" + tmp + this.widgetId + tmp + ").scriptScope" + attr[2];
|
||||
}
|
||||
str += tag[2];
|
||||
s = s.substr(tag.index + tag[0].length);
|
||||
}
|
||||
s = str + s;
|
||||
}
|
||||
}
|
||||
return {"xml":s, "styles":styles, "titles":titles, "requires":requires, "scripts":scripts, "url":url};
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -28,8 +28,7 @@ struts.widget.ComboBoxDataProvider = function(/*Array*/ dataPairs, /*Number*/ li
|
||||
this.cbox = cbox;
|
||||
this.formId = cbox.formId;
|
||||
this.formFilter = cbox.formFilter;
|
||||
this.searchLimit = cbox.searchLimit;
|
||||
|
||||
|
||||
if(!dojo.string.isBlank(cbox.dataUrl)){
|
||||
this.getData(cbox.dataUrl);
|
||||
}else{
|
||||
@@ -69,43 +68,25 @@ struts.widget.ComboBoxDataProvider = function(/*Array*/ dataPairs, /*Number*/ li
|
||||
if(!this.firstRequest) {
|
||||
this.cbox.notify.apply(this.cbox, [data, type, evt]);
|
||||
}
|
||||
var arrData = null;
|
||||
var dataByName = data[this.cbox.dataFieldName];
|
||||
if(!dojo.lang.isArray(data)) {
|
||||
//if there is a dataFieldName, take it
|
||||
if(dataByName) {
|
||||
if(dojo.lang.isArray(dataByName)) {
|
||||
//ok, it is an array
|
||||
arrData = dataByName;
|
||||
} else if(dojo.lang.isObject(dataByName)) {
|
||||
//it is an object, treat it like a map
|
||||
arrData = [];
|
||||
for(var key in dataByName){
|
||||
arrData.push([dataByName[key], key]);
|
||||
}
|
||||
}
|
||||
if(!dojo.string.isBlank(this.cbox.dataFieldName) && data[this.cbox.dataFieldName] != null) {
|
||||
arrData = data[this.cbox.dataFieldName];
|
||||
} else {
|
||||
//try to find a match
|
||||
var tmpArrData = [];
|
||||
var arrData = null;
|
||||
for(var key in data){
|
||||
//does it start with the field name? take it
|
||||
if(dojo.string.startsWith(key, this.cbox.name)) {
|
||||
if(key == this.cbox.name) {
|
||||
arrData = data[key];
|
||||
break;
|
||||
} else {
|
||||
//if nathing else is found, we will use values in this
|
||||
//object as the data
|
||||
tmpArrData.push([data[key], key]);
|
||||
}
|
||||
//grab the first array found, we will use it if nothing else
|
||||
//is found
|
||||
if(!arrData && dojo.lang.isArray(data[key]) && !dojo.lang.isString(data[key])) {
|
||||
arrData = data[key];
|
||||
if(!arrData && dojo.lang.isArray(data[key])) {
|
||||
arrData = data = data[key];
|
||||
}
|
||||
}
|
||||
if(!arrData) {
|
||||
arrData = tmpArrData;
|
||||
}
|
||||
}
|
||||
|
||||
data = arrData;
|
||||
@@ -256,8 +237,6 @@ dojo.widget.defineWidget(
|
||||
dataFieldName : "" ,
|
||||
keyName: "",
|
||||
templateCssPath: dojo.uri.dojoUri("struts/ComboBox.css"),
|
||||
|
||||
searchLimit : 30,
|
||||
//from Dojo's ComboBox
|
||||
showResultList: function() {
|
||||
// Our dear friend IE doesnt take max-height so we need to calculate that on our own every time
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<!ELEMENT struts (package|include|bean|constant)*>
|
||||
|
||||
<!ELEMENT package (result-types?, interceptors?, default-interceptor-ref?, default-action-ref?, default-class-ref?, global-results?, global-exception-mappings?, action*)>
|
||||
<!ELEMENT package (result-types?, interceptors?, default-interceptor-ref?, default-action-ref?, global-results?, global-exception-mappings?, action*)>
|
||||
<!ATTLIST package
|
||||
name CDATA #REQUIRED
|
||||
extends CDATA #IMPLIED
|
||||
@@ -39,7 +39,7 @@
|
||||
class CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT interceptor-stack (interceptor-ref*)>
|
||||
<!ELEMENT interceptor-stack (interceptor-ref+)>
|
||||
<!ATTLIST interceptor-stack
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
@@ -59,11 +59,6 @@
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT default-class-ref (param*)>
|
||||
<!ATTLIST default-class-ref
|
||||
class CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT global-results (result+)>
|
||||
|
||||
<!ELEMENT global-exception-mappings (exception-mapping+)>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<bean class="org.apache.struts2.views.util.ContextUtil" static="true" />
|
||||
<bean class="org.apache.struts2.views.util.UrlHelper" static="true" />
|
||||
|
||||
<package name="struts-default" abstract="true">
|
||||
<package name="struts-default">
|
||||
<result-types>
|
||||
<result-type name="chain" class="com.opensymphony.xwork2.ActionChainResult"/>
|
||||
<result-type name="dispatcher" class="org.apache.struts2.dispatcher.ServletDispatcherResult" default="true"/>
|
||||
|
||||
@@ -89,9 +89,6 @@
|
||||
<#if parameters.dataFieldName?if_exists != "">
|
||||
dataFieldName="${parameters.dataFieldName?html}"
|
||||
</#if>
|
||||
<#if parameters.searchLimit?if_exists != "">
|
||||
searchLimit="${parameters.searchLimit?html}"
|
||||
</#if>
|
||||
<#include "/${parameters.templateDir}/simple/scripting-events.ftl" />
|
||||
>
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#end
|
||||
<input type="checkbox" name="$!struts.htmlEncode($parameters.name)" value="$!struts.htmlEncode($itemKey)"
|
||||
#parse("/$parameters.templateDir/simple/scripting-events.vm")
|
||||
id="$!struts.htmlEncode($parameters.name)-$itemCount" #if( $tag.contains($parameters.nameValue, $itemKey) ) checked="checked" #end />
|
||||
id="$!struts.htmlEncode($parameters.name)-$itemCount" #if( $tag.contains($parameters.nameValue, $itemKey) ) checked="checked" #end/>
|
||||
<label for="$!struts.htmlEncode($parameters.name)-$itemCount" class="checkboxLabel">$!struts.htmlEncode($itemValue)</label><br />
|
||||
#set ($trash = $stack.pop())
|
||||
#end
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#if ($parameters.cssClass) class="$!struts.htmlEncode($parameters.cssClass)" #end
|
||||
#if ($parameters.cssStyle) style="$!struts.htmlEncode($parameters.cssStyle)" #end
|
||||
#parse("/$parameters.templateDir/simple/scripting-events.vm")
|
||||
/><br />
|
||||
/><br/>
|
||||
|
||||
#if ($parameters.list)
|
||||
<select onChange="this.form.elements['$!struts.htmlEncode($parameters.name)'].value=this.options[this.selectedIndex].value"
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
<p />
|
||||
<p/>
|
||||
|
||||
#set ($id = $parameters.id)
|
||||
#if ($id) #else #set ($id = 'debug') #end
|
||||
<a href="#" onclick="toggleDebug('$id');return false;">[Debug]</a>
|
||||
<div style="display:none" id="$id">
|
||||
<h2>Struts ValueStack Debug</h2>
|
||||
<p />
|
||||
<p/>
|
||||
|
||||
#set($contextMap = $stack.context)
|
||||
|
||||
@@ -60,6 +60,6 @@
|
||||
#set ($index = $index + 1)
|
||||
#end
|
||||
</table>
|
||||
<p />
|
||||
<p/>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#set ( $startCount = $startCount + 1)
|
||||
#end
|
||||
|
||||
<br />
|
||||
<br/>
|
||||
<select name="$!struts.htmlEncode($parameters.doubleName)"
|
||||
#if ($parameters.disabled) disabled="disabled" #end
|
||||
#if ($parameters.doubleTabindex) tabindex="$!struts.htmlEncode($parameters.doubleTabindex)" #end
|
||||
|
||||
@@ -31,12 +31,12 @@
|
||||
<td align="bottom">
|
||||
|
||||
#if(($webTable.sortColumn == $curColumn.offset) && ($webTable.sortOrder == 'ASC'))
|
||||
<img src="#tag( URL "value='/images/sorted_asc.gif'")" border="0" align="bottom" /> #else
|
||||
<img src="#tag( URL "value='/images/sorted_asc.gif'")" border="0" align="bottom"/> #else
|
||||
<a href="#bodytag( URL )
|
||||
#param( $webTable.sortColumnLinkName $curColumn.offset)
|
||||
#param( $webTable.sortOrderLinkName 'ASC')
|
||||
#end">
|
||||
<img src="#tag( URL "value='/images/unsorted_asc.gif'")" border="0" align="bottom" /></a>
|
||||
<img src="#tag( URL "value='/images/unsorted_asc.gif'")" border="0" align="bottom"/></a>
|
||||
#end
|
||||
</td>
|
||||
</tr>
|
||||
@@ -44,12 +44,12 @@
|
||||
|
||||
<td align="top">
|
||||
#if(($webTable.sortColumn == $curColumn.offset) && ($webTable.sortOrder == 'DESC'))
|
||||
<img src="#tag( URL "value='/images/sorted_desc.gif'")" border="0" align="top" />
|
||||
<img src="#tag( URL "value='/images/sorted_desc.gif'")" border="0" align="top"/>
|
||||
#else
|
||||
<a href="#bodytag( URL )
|
||||
#param( $webTable.sortColumnLinkName $curColumn.offset)
|
||||
#param( $webTable.sortOrderLinkName 'DESC')
|
||||
#end"><img src="#tag( URL "value='/images/unsorted_desc.gif'")" border="0" align="top" /></a>
|
||||
#end"><img src="#tag( URL "value='/images/unsorted_desc.gif'")" border="0" align="top"/></a>
|
||||
#end
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<#include "/${parameters.templateDir}/xhtml/tooltip.ftl" />
|
||||
</label><#t/>
|
||||
<#if parameters.labelposition?default("top") == 'top'>
|
||||
</div> <br /><#rt/>
|
||||
</div> <br/><#rt/>
|
||||
<#else>
|
||||
</span> <#rt/>
|
||||
</#if>
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
<link rel="stylesheet" href="<@s.url value='/struts/css_xhtml/styles.css' includeParams='none' encode='false' />" type="text/css" />
|
||||
<link rel="stylesheet" href="<@s.url value='/struts/css_xhtml/styles.css' includeParams='none' encode='false' />" type="text/css"/>
|
||||
<#include "/${parameters.templateDir}/simple/head.ftl" />
|
||||
|
||||
@@ -74,9 +74,6 @@
|
||||
<#if parameters.templateCssPath?if_exists != "">
|
||||
templateCssPath="<@s.url value='${parameters.templateCssPath}' encode="false" includeParams='none'/>"
|
||||
</#if>
|
||||
<#if parameters.searchLimit?if_exists != "">
|
||||
searchLimit="${parameters.searchLimit?html}"
|
||||
</#if>
|
||||
<#include "/${parameters.templateDir}/simple/scripting-events.ftl" />
|
||||
>
|
||||
<#if parameters.list?exists>
|
||||
|
||||
@@ -26,4 +26,4 @@
|
||||
<#include "/${parameters.templateDir}/simple/scripting-events.ftl" />
|
||||
<#include "/${parameters.templateDir}/simple/common-attributes.ftl" />
|
||||
/>
|
||||
<input type="hidden" name="__checkbox_${parameters.name?html}" value="${parameters.fieldValue?html}" />
|
||||
<input type="hidden" name="__checkbox_${parameters.name?html}" value="${parameters.fieldValue?html}"/>
|
||||
@@ -1,5 +1,5 @@
|
||||
<script type="text/javascript">
|
||||
function autoPopulate_${parameters.id?html}(targetElement) {
|
||||
function autoPopulate_${parameters.name?html}(targetElement) {
|
||||
<#if parameters.headerKey?exists && parameters.headerValue?exists>
|
||||
if (targetElement.options[targetElement.selectedIndex].value == '${parameters.headerKey?html}') {
|
||||
return;
|
||||
@@ -14,9 +14,9 @@
|
||||
}
|
||||
</script>
|
||||
<#include "/${parameters.templateDir}/simple/text.ftl" />
|
||||
<br />
|
||||
<br/>
|
||||
<#if parameters.list?exists>
|
||||
<select onChange="autoPopulate_${parameters.id?html}(this);"<#rt/>
|
||||
<select onChange="autoPopulate_${parameters.name?html}(this);"<#rt/>
|
||||
<#if parameters.disabled?default(false)>
|
||||
disabled="disabled"<#rt/>
|
||||
</#if>
|
||||
|
||||
@@ -13,12 +13,12 @@
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
<p />
|
||||
<p/>
|
||||
|
||||
<a href="#" onclick="toggleDebug('<#if parameters.id?if_exists != "">${parameters.id?html}<#else>debug</#if>');return false;">[Debug]</a>
|
||||
<div style="display:none" id="<#if parameters.id?if_exists != "">${parameters.id?html}<#else>debug</#if>">
|
||||
<h2>Struts ValueStack Debug</h2>
|
||||
<p />
|
||||
<p/>
|
||||
|
||||
<h3>Value Stack Contents</h3>
|
||||
<table border="0" cellpadding="2" cellspacing="0" width="400" bgcolor="#DDDDDD">
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
<#assign renderRow=false>
|
||||
<#list stackObject.value.keySet() as propertyName>
|
||||
<#if renderRow==true></tr><tr><#else> <#assign renderRow=false> </#if>
|
||||
<#if renderRow==true><tr><#else> <#assign renderRow=false> </#if>
|
||||
<td bgcolor="<#if (index % 2) == 0>#BBBBBB<#else>#CCCCCC</#if>">${propertyName}</td>
|
||||
<td bgcolor="<#if (index % 2) == 0>#BBBBBB<#else>#CCCCCC</#if>"><#if stackObject.value.get(propertyName)?exists>${stackObject.value.get(propertyName).toString()}<#else>null</#if></td>
|
||||
</tr>
|
||||
@@ -39,7 +39,7 @@
|
||||
</#list>
|
||||
</#list>
|
||||
</table>
|
||||
<p />
|
||||
<p/>
|
||||
|
||||
<h3>Stack Context</h3>
|
||||
<i>These items are available using the #key notation</i>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<#assign startCount = startCount + 1/>
|
||||
</#if>
|
||||
|
||||
<br />
|
||||
<br/>
|
||||
<select<#rt/>
|
||||
name="${parameters.doubleName?default("")?html}"<#rt/>
|
||||
<#if parameters.disabled?default(false)>
|
||||
@@ -19,11 +19,11 @@
|
||||
<#if parameters.doubleId?exists>
|
||||
id="${parameters.doubleId?html}"<#rt/>
|
||||
</#if>
|
||||
<#if parameters.doubleCss?exists>
|
||||
class="${parameters.doubleCss?html}"<#rt/>
|
||||
<#if parameters.cssClass?exists>
|
||||
class="${parameters.cssClass?html}"<#rt/>
|
||||
</#if>
|
||||
<#if parameters.doubleStyle?exists>
|
||||
style="${parameters.doubleStyle?html}"<#rt/>
|
||||
<#if parameters.cssStyle?exists>
|
||||
style="${parameters.cssStyle?html}"<#rt/>
|
||||
</#if>
|
||||
<#if parameters.title?exists>
|
||||
title="${parameters.title?html}"<#rt/>
|
||||
@@ -73,7 +73,7 @@
|
||||
<#assign itemCount = itemCount + 1/>
|
||||
</@s.iterator>
|
||||
|
||||
var ${parameters.id}Temp = document.${parameters.formName}.${parameters.doubleId};
|
||||
var ${parameters.id}Temp = document.${parameters.formName}.${parameters.doubleName};
|
||||
<#assign itemCount = startCount/>
|
||||
<#assign redirectTo = 0/>
|
||||
<@s.iterator value="parameters.list">
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<#if parameters.method?exists>
|
||||
method="${parameters.method?html}"<#rt/>
|
||||
<#else>
|
||||
method="post"<#rt/>
|
||||
method="POST"<#rt/>
|
||||
</#if>
|
||||
<#if parameters.enctype?exists>
|
||||
enctype="${parameters.enctype?html}"<#rt/>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<tr>
|
||||
<td>
|
||||
<#if parameters.leftTitle?exists><#t/>
|
||||
<label for="leftTitle">${parameters.leftTitle}</label><br />
|
||||
<label for="leftTitle">${parameters.leftTitle}</label><br/>
|
||||
</#if><#t/>
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<#if parameters.buttonCssStyle?exists>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
</#if><#t/>
|
||||
value="${addLabel}" onclick="addOption(document.getElementById('${parameters.id?html}_input'), document.getElementById('${parameters.id?html}'))" /><br /><br />
|
||||
value="${addLabel}" onclick="addOption(document.getElementById('${parameters.id?html}_input'), document.getElementById('${parameters.id?html}'))" /><br/><br/>
|
||||
<#t/>
|
||||
<#assign removeLabel=parameters.removeLabel?default("<-")?html /><#t/>
|
||||
<input type="button"
|
||||
@@ -58,7 +58,7 @@
|
||||
<#if parameters.buttonCssStyle?exists>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
</#if><#t/>
|
||||
value="${removeLabel}" onclick="removeOptions(document.getElementById('${parameters.id?html}'))" /><br /><br />
|
||||
value="${removeLabel}" onclick="removeOptions(document.getElementById('${parameters.id?html}'))" /><br/><br/>
|
||||
<#t/>
|
||||
<#assign removeAllLabel=parameters.removeAllLabel?default("<<--")?html /><#t/>
|
||||
<input type="button"
|
||||
@@ -68,11 +68,11 @@
|
||||
<#if parameters.buttonCssStyle?exists>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
</#if><#t/>
|
||||
value="${removeAllLabel}" onclick="removeAllOptions(document.getElementById('${parameters.id?html}'))" /><br /><br />
|
||||
value="${removeAllLabel}" onclick="removeAllOptions(document.getElementById('${parameters.id?html}'))" /><br/><br/>
|
||||
</td>
|
||||
<td>
|
||||
<#if parameters.rightTitle?exists><#t/>
|
||||
<label for="rightTitle">${parameters.rightTitle}</label><br />
|
||||
<label for="rightTitle">${parameters.rightTitle}</label><br/>
|
||||
</#if><#t/>
|
||||
<#include "/${parameters.templateDir}/simple/select.ftl" />
|
||||
<#if parameters.allowUpDown?default(true)>
|
||||
|
||||
@@ -14,9 +14,8 @@
|
||||
<#assign trash=stack.push(optGroupBean) />
|
||||
<#assign tmpKey=stack.findValue(optGroupInternalListUiBean.parameters.listKey) />
|
||||
<#assign tmpValue=stack.findValue(optGroupInternalListUiBean.parameters.listValue) />
|
||||
<#assign tmpKeyStr = tmpKey.toString() />
|
||||
<option value="${tmpKeyStr}"
|
||||
<#if tag.contains(parameters.nameValue, tmpKeyStr) == true>
|
||||
<option value="${tmpKey}"
|
||||
<#if tag.contains(parameters.nameValue, tmpKey) == true>
|
||||
selected="selected"
|
||||
</#if>
|
||||
>${tmpValue}
|
||||
|
||||
@@ -6,18 +6,26 @@
|
||||
<tr>
|
||||
<td>
|
||||
<#if parameters.leftTitle?exists><#t/>
|
||||
<label for="leftTitle">${parameters.leftTitle}</label><br />
|
||||
<label for="leftTitle">${parameters.leftTitle}</label><br/>
|
||||
</#if><#t/>
|
||||
<#include "/${parameters.templateDir}/simple/select.ftl" />
|
||||
<#if parameters.allowUpDownOnLeft?default(true)>
|
||||
<input type="button"
|
||||
onclick="moveOptionDown(document.getElementById('${parameters.id}'), 'key', <#if parameters.headerKey?exists>'${parameters.headerKey}'<#else>''</#if>);<#if parameters.upDownOnLeftOnclick?has_content>${parameters.upDownOnLeftOnclick};</#if>"
|
||||
<#if parameters.headerKey?exists>
|
||||
onclick="moveOptionDown(document.getElementById('${parameters.id}'), 'key', '${parameters.headerKey}');"
|
||||
<#else>
|
||||
onclick="moveOptionDown(document.getElementById('${parameters.id}'), 'key', '');"
|
||||
</#if>
|
||||
<#if parameters.leftDownLabel?exists>
|
||||
value="${parameters.leftDownLabel?html}"
|
||||
</#if>
|
||||
/>
|
||||
<input type="button"
|
||||
onclick="moveOptionUp(document.getElementById('${parameters.id}'), 'key', <#if parameters.headerKey?exists>'${parameters.headerKey}'<#else>''</#if>);<#if parameters.upDownOnLeftOnclick?has_content>${parameters.upDownOnLeftOnclick};</#if>"
|
||||
<#if parameters.headerKey?exists>
|
||||
onclick="moveOptionUp(document.getElementById('${parameters.id}'), 'key', '${parameters.headerKey}');"
|
||||
<#else>
|
||||
onclick="moveOptionUp(document.getElementById('${parameters.id}'), 'key', '');"
|
||||
</#if>
|
||||
<#if parameters.leftUpLabel?exists>
|
||||
value="${parameters.leftUpLabel?html}"
|
||||
</#if>
|
||||
@@ -36,7 +44,7 @@
|
||||
<#if parameters.buttonCssStyle?exists><#t/>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
</#if><#t/>
|
||||
value="${addToLeftLabel}" onclick="moveSelectedOptions(document.getElementById('${parameters.doubleId?html}'), document.getElementById('${parameters.id?html}'), false, '${parameters.doubleHeaderKey}', '');<#if parameters.addToLeftOnclick?has_content>${parameters.addToLeftOnclick};</#if>" /><br /><br />
|
||||
value="${addToLeftLabel}" onclick="moveSelectedOptions(document.getElementById('${parameters.doubleId?html}'), document.getElementById('${parameters.id?html}'), false, '${parameters.doubleHeaderKey}', '')" /><br/><br/>
|
||||
<#else><#t/>
|
||||
<input type="button"
|
||||
<#if parameters.buttonCssClass?exists><#t/>
|
||||
@@ -45,7 +53,7 @@
|
||||
<#if parameters.buttonCssStyle?exists><#t/>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
</#if><#t/>
|
||||
value="${addToLeftLabel}" onclick="moveSelectedOptions(document.getElementById('${parameters.doubleId?html}'), document.getElementById('${parameters.id?html}'), false, '');<#if parameters.addToLeftOnclick?has_content>${parameters.addToLeftOnclick};</#if>" /><br /><br />
|
||||
value="${addToLeftLabel}" onclick="moveSelectedOptions(document.getElementById('${parameters.doubleId?html}'), document.getElementById('${parameters.id?html}'), false, '')" /><br/><br/>
|
||||
</#if><#t/>
|
||||
</#if><#t/>
|
||||
<#if parameters.allowAddToRight?default(true)><#t/>
|
||||
@@ -58,7 +66,7 @@
|
||||
<#if parameters.buttonCssStyle?exists><#t/>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
</#if><#t/>
|
||||
value="${addToRightLabel}" onclick="moveSelectedOptions(document.getElementById('${parameters.id?html}'), document.getElementById('${parameters.doubleId?html}'), false, '${parameters.headerKey}', '');<#if parameters.addToRightOnclick?has_content>${parameters.addToRightOnclick};</#if>" /><br /><br />
|
||||
value="${addToRightLabel}" onclick="moveSelectedOptions(document.getElementById('${parameters.id?html}'), document.getElementById('${parameters.doubleId?html}'), false, '${parameters.headerKey}', '')" /><br/><br/>
|
||||
<#else><#t/>
|
||||
<input type="button"
|
||||
<#if parameters.buttonCssClass?exists><#t/>
|
||||
@@ -67,7 +75,7 @@
|
||||
<#if parameters.buttonCssStyle?exists>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
</#if><#t/>
|
||||
value="${addToRightLabel}" onclick="moveSelectedOptions(document.getElementById('${parameters.id?html}'), document.getElementById('${parameters.doubleId?html}'), false, '');<#if parameters.addToRightOnclick?has_content>${parameters.addToRightOnclick};</#if>" /><br /><br />
|
||||
value="${addToRightLabel}" onclick="moveSelectedOptions(document.getElementById('${parameters.id?html}'), document.getElementById('${parameters.doubleId?html}'), false, '')" /><br/><br/>
|
||||
</#if><#t/>
|
||||
</#if><#t/>
|
||||
<#if parameters.allowAddAllToLeft?default(true)><#t/>
|
||||
@@ -80,7 +88,7 @@
|
||||
<#if parameters.buttonCssStyle?exists><#t/>
|
||||
style="${parameters.buttonCssStyle}"
|
||||
</#if><#t/>
|
||||
value="${addAllToLeftLabel}" onclick="moveAllOptions(document.getElementById('${parameters.doubleId?html}'), document.getElementById('${parameters.id?html}'), false, '${parameters.doubleHeaderKey}', '');<#if parameters.addAllToLeftOnclick?has_content>${parameters.addAllToLeftOnclick};</#if>" /><br /><br />
|
||||
value="${addAllToLeftLabel}" onclick="moveAllOptions(document.getElementById('${parameters.doubleId?html}'), document.getElementById('${parameters.id?html}'), false, '${parameters.doubleHeaderKey}', '')" /><br/><br/>
|
||||
<#else><#t/>
|
||||
<input type="button"
|
||||
<#if parameters.buttonCssClass?exists><#t/>
|
||||
@@ -89,7 +97,7 @@
|
||||
<#if parameters.buttonCssStyle?exists><#t/>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
</#if><#t/>
|
||||
value="${addAllToLeftLabel}" onclick="moveAllOptions(document.getElementById('${parameters.doubleId?html}'), document.getElementById('${parameters.id?html}'), false, '');<#if parameters.addAllToLeftOnclick?has_content>${parameters.addAllToLeftOnclick};</#if>" /><br /><br />
|
||||
value="${addAllToLeftLabel}" onclick="moveAllOptions(document.getElementById('${parameters.doubleId?html}'), document.getElementById('${parameters.id?html}'), false, '')" /><br/><br/>
|
||||
</#if><#t/>
|
||||
</#if><#t/>
|
||||
<#if parameters.allowAddAllToRight?default(true)><#t/>
|
||||
@@ -102,7 +110,7 @@
|
||||
<#if parameters.buttonCssStyle?exists><#t/>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
</#if><#t/>
|
||||
value="${addAllToRightLabel}" onclick="moveAllOptions(document.getElementById('${parameters.id?html}'), document.getElementById('${parameters.doubleId?html}'), false, '${parameters.headerKey}', '');<#if parameters.addAllToRightOnclick?has_content>${parameters.addAllToRightOnclick};</#if>" /><br /><br />
|
||||
value="${addAllToRightLabel}" onclick="moveAllOptions(document.getElementById('${parameters.id?html}'), document.getElementById('${parameters.doubleId?html}'), false, '${parameters.headerKey}', '')" /><br/><br/>
|
||||
<#else><#t/>
|
||||
<input type="button"
|
||||
<#if parameters.buttonCssClass?exists><#t/>
|
||||
@@ -111,7 +119,7 @@
|
||||
<#if parameters.buttonCssStyle?exists><#t/>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
</#if><#t/>
|
||||
value="${addAllToRightLabel}" onclick="moveAllOptions(document.getElementById('${parameters.id?html}'), document.getElementById('${parameters.doubleId?html}'), false, '');<#if parameters.addAllToRightOnclick?has_content>${parameters.addAllToRightOnclick};</#if>" /><br /><br />
|
||||
value="${addAllToRightLabel}" onclick="moveAllOptions(document.getElementById('${parameters.id?html}'), document.getElementById('${parameters.doubleId?html}'), false, '')" /><br/><br/>
|
||||
</#if><#t/>
|
||||
</#if><#t/>
|
||||
<#if parameters.allowSelectAll?default(true)><#t/>
|
||||
@@ -124,7 +132,7 @@
|
||||
<#if parameters.buttonCssStyle?exists><#t/>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
</#if><#t/>
|
||||
value="${selectAllLabel}" onclick="selectAllOptionsExceptSome(document.getElementById('${parameters.id?html}'), 'key', '${parameters.headerKey}');selectAllOptionsExceptSome(document.getElementById('${parameters.doubleId?html}'), 'key', '${parameters.doubleHeaderKey}');<#if parameters.selectAllOnclick?has_content>${parameters.selectAllOnclick};</#if>" /><br /><br />
|
||||
value="${selectAllLabel}" onclick="selectAllOptionsExceptSome(document.getElementById('${parameters.id?html}'), 'key', '${parameters.headerKey}');selectAllOptionsExceptSome(document.getElementById('${parameters.doubleId?html}'), 'key', '${parameters.doubleHeaderKey}');" /><br/><br/>
|
||||
<#elseif parameters.headerKey?exists><#t/>
|
||||
<input type="button"
|
||||
<#if parameters.buttonCssClass?exists><#t/>
|
||||
@@ -133,7 +141,7 @@
|
||||
<#if parameters.buttonCssStyle?exists><#t/>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
</#if><#t/>
|
||||
value="${selectAllLabel}" onclick="selectAllOptionsExceptSome(document.getElementById('${parameters.id?html}'), 'key', '${parameters.headerKey}');selectAllOptions(document.getElementById('${parameters.doubleId?html}'));<#if parameters.selectAllOnclick?has_content>${parameters.selectAllOnclick};</#if>" /><br /><br />
|
||||
value="${selectAllLabel}" onclick="selectAllOptionsExceptSome(document.getElementById('${parameters.id?html}'), 'key', '${parameters.headerKey}');selectAllOptions(document.getElementById('${parameters.doubleId?html}'));" /><br/><br/>
|
||||
<#elseif parameters.doubleHeaderKey?exists><#t/>
|
||||
<input type="button"
|
||||
<#if parameters.buttonCssClass?exists><#t/>
|
||||
@@ -142,7 +150,7 @@
|
||||
<#if parameters.buttonCssStyle?exists><#t/>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
</#if><#t/>
|
||||
value="${selectAllLabel}" onclick="selectAllOptions(document.getElementById('${parameters.id?html}'));selectAllOptionsExceptSome(document.getElementById('${parameters.doubleId?html}'), 'key', '${parameters.doubleHeaderKey}');<#if parameters.selectAllOnclick?has_content>${parameters.selectAllOnclick};</#if>" /><br /><br />
|
||||
value="${selectAllLabel}" onclick="selectAllOptions(document.getElementById('${parameters.id?html}'));selectAllOptionsExceptSome(document.getElementById('${parameters.doubleId?html}'), 'key', '${parameters.doubleHeaderKey}');" /><br/><br/>
|
||||
<#else><#t/>
|
||||
<input type="button"
|
||||
<#if parameters.buttonCssClass?exists><#t/>
|
||||
@@ -151,13 +159,13 @@
|
||||
<#if parameters.buttonCssStyle?exists><#t/>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
</#if><#t/>
|
||||
value="${selectAllLabel}" onclick="selectAllOptions(document.getElementById('${parameters.id?html}'));selectAllOptions(document.getElementById('${parameters.doubleId?html}'));<#if parameters.selectAllOnclick?has_content>${parameters.selectAllOnclick};</#if>" /><br /><br />
|
||||
value="${selectAllLabel}" onclick="selectAllOptions(document.getElementById('${parameters.id?html}'));selectAllOptions(document.getElementById('${parameters.doubleId?html}'));" /><br/><br/>
|
||||
</#if><#t/>
|
||||
</#if><#t/>
|
||||
</td>
|
||||
<td>
|
||||
<#if parameters.rightTitle?exists><#t/>
|
||||
<label for="rightTitle">${parameters.rightTitle}</label><br />
|
||||
<label for="rightTitle">${parameters.rightTitle}</label><br/>
|
||||
</#if><#t/>
|
||||
<select
|
||||
name="${parameters.doubleName?default("")?html}"
|
||||
@@ -176,11 +184,11 @@
|
||||
<#if parameters.doubleId?exists><#t/>
|
||||
id="${parameters.doubleId?html}"
|
||||
</#if><#t/>
|
||||
<#if parameters.doubleCss?exists><#t/>
|
||||
class="${parameters.doubleCss?html}"
|
||||
<#if parameters.doubleCssClass?exists><#t/>
|
||||
class="${parameters.doubleCssClass?html}"
|
||||
</#if><#t/>
|
||||
<#if parameters.doubleStyle?exists><#t/>
|
||||
style="${parameters.doubleStyle?html}"
|
||||
<#if parameters.doubleCssStyle?exists><#t/>
|
||||
style="${parameters.doubleCssStyle?html}"
|
||||
</#if><#t/>
|
||||
<#if parameters.doubleOnclick?exists><#t/>
|
||||
onclick="${parameters.doubleOnclick?html}"
|
||||
@@ -252,13 +260,21 @@
|
||||
</select>
|
||||
<#if parameters.allowUpDownOnRight?default(true)>
|
||||
<input type="button"
|
||||
onclick="moveOptionDown(document.getElementById('${parameters.doubleId}'), 'key', <#if parameters.doubleHeaderKey?exists>'${parameters.doubleHeaderKey}'<#else>''</#if>);<#if parameters.upDownOnRightOnclick?has_content>${parameters.upDownOnRightOnclick};</#if>"
|
||||
<#if parameters.doubleHeaderKey?exists>
|
||||
onclick="moveOptionDown(document.getElementById('${parameters.doubleId}'), 'key', '${parameters.doubleHeaderKey}');"
|
||||
<#else>
|
||||
onclick="moveOptionDown(document.getElementById('${parameters.doubleId}'), 'key', '');"
|
||||
</#if>
|
||||
<#if parameters.rightDownLabel?exists>
|
||||
value="${parameters.rightDownLabel?html}"
|
||||
</#if>
|
||||
/>
|
||||
<input type="button"
|
||||
onclick="moveOptionUp(document.getElementById('${parameters.doubleId}'), 'key', <#if parameters.doubleHeaderKey?exists>'${parameters.doubleHeaderKey}'<#else>''</#if>);<#if parameters.upDownOnRightOnclick?has_content>${parameters.upDownOnRightOnclick};</#if>"
|
||||
<#if parameters.doubleHeaderKey?exists>
|
||||
onclick="moveOptionUp(document.getElementById('${parameters.doubleId}'), 'key', '${parameters.doubleHeaderKey}');"
|
||||
<#else>
|
||||
onclick="moveOptionUp(document.getElementById('${parameters.doubleId}'), 'key', '');"
|
||||
</#if>
|
||||
<#if parameters.rightUpLabel?exists>
|
||||
value="${parameters.rightUpLabel?html}"
|
||||
</#if>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
name="${parameters.name?html}"<#rt/>
|
||||
</#if>
|
||||
id="${parameters.id?html}${itemKeyStr?html}"<#rt/>
|
||||
<#if tag.contains(parameters.nameValue, itemKeyStr)>
|
||||
<#if tag.contains(parameters.nameValue, itemKey)>
|
||||
checked="checked"<#rt/>
|
||||
</#if>
|
||||
<#if itemKey?exists>
|
||||
|
||||
@@ -42,14 +42,11 @@
|
||||
<#if parameters.listKey?exists>
|
||||
<#if stack.findValue(parameters.listKey)?exists>
|
||||
<#assign itemKey = stack.findValue(parameters.listKey)/>
|
||||
<#assign itemKeyStr = itemKey.toString()/>
|
||||
<#else>
|
||||
<#assign itemKey = ''/>
|
||||
<#assign itemKeyStr = ''/>
|
||||
</#if>
|
||||
<#else>
|
||||
<#assign itemKey = stack.findValue('top')/>
|
||||
<#assign itemKeyStr = itemKey.toString()/>
|
||||
</#if>
|
||||
<#if parameters.listValue?exists>
|
||||
<#if stack.findString(parameters.listValue)?exists>
|
||||
@@ -60,7 +57,7 @@
|
||||
<#else>
|
||||
<#assign itemValue = stack.findString('top')/>
|
||||
</#if>
|
||||
<option value="${itemKeyStr?html}"<#rt/>
|
||||
<option value="${itemKey?html}"<#rt/>
|
||||
<#if tag.contains(parameters.nameValue, itemKey) == true>
|
||||
selected="selected"<#rt/>
|
||||
</#if>
|
||||
|
||||
@@ -9,18 +9,12 @@
|
||||
<#if parameters.nameValue?exists>
|
||||
value="<@s.property value="parameters.nameValue"/>"<#rt/>
|
||||
</#if>
|
||||
<#if parameters.disabled?default(false)>
|
||||
disabled="disabled"<#rt/>
|
||||
</#if>
|
||||
<#if parameters.cssClass?exists>
|
||||
class="${parameters.cssClass?html}"<#rt/>
|
||||
</#if>
|
||||
<#if parameters.cssStyle?exists>
|
||||
style="${parameters.cssStyle?html}"<#rt/>
|
||||
</#if>
|
||||
<#if parameters.tabindex?exists>
|
||||
tabindex="${parameters.tabindex?html}"<#rt/>
|
||||
</#if>
|
||||
<#include "/${parameters.templateDir}/simple/scripting-events.ftl"/>
|
||||
<#include "/${parameters.templateDir}/simple/common-attributes.ftl" />
|
||||
><#if parameters.body?length gt 0><@s.property value="parameters.body"/><#elseif parameters.label?exists><@s.property value="parameters.label"/><#rt/></#if></button>
|
||||
@@ -46,9 +40,6 @@
|
||||
<#if parameters.nameValue?exists>
|
||||
value="<@s.property value="parameters.nameValue"/>"<#rt/>
|
||||
</#if>
|
||||
<#if parameters.disabled?default(false)>
|
||||
disabled="disabled"<#rt/>
|
||||
</#if>
|
||||
<#if parameters.cssClass?exists>
|
||||
class="${parameters.cssClass?html}"<#rt/>
|
||||
</#if>
|
||||
@@ -58,9 +49,6 @@
|
||||
<#if parameters.title?exists>
|
||||
title="${parameters.title?html}"<#rt/>
|
||||
</#if>
|
||||
<#if parameters.tabindex?exists>
|
||||
tabindex="${parameters.tabindex?html}"<#rt/>
|
||||
</#if>
|
||||
<#include "/${parameters.templateDir}/simple/scripting-events.ftl" />
|
||||
<#include "/${parameters.templateDir}/simple/common-attributes.ftl" />
|
||||
/>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<tr>
|
||||
<td align="bottom">
|
||||
<#if false>
|
||||
<img src="images/sorted_asc.gif" border="0" align="bottom" />
|
||||
<img src="images/sorted_asc.gif" border="0" align="bottom"/>
|
||||
<#else>
|
||||
<a href="<@s.url><@s.param name="${webTable.sortColumnLinkName}" value="${curColumn.offset}"/><@s.param name="${webTable.sortOrderLinkName}" value="ASC"/></@s.url>"><img src="images/unsorted_asc.gif" border="0" align="bottom"/></a>
|
||||
</#if>
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
<input type="hidden" name="${parameters.tokenNameField?default("")}" value="${parameters.name?default("")?html}" />
|
||||
<input type="hidden" name="${parameters.name?default("")}" value="${parameters.token?default("")?html}" />
|
||||
<input type="hidden" name="${parameters.tokenNameField?default("")}" value="${parameters.name?default("")?html}"/>
|
||||
<input type="hidden" name="${parameters.name?default("")}" value="${parameters.token?default("")?html}"/>
|
||||
|
||||
@@ -427,14 +427,6 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Define required position of required form element (left|right)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">resultsLimit</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">30</td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Limit how many results are shown as autocompletion options</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">searchType</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
|
||||
@@ -43,14 +43,6 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Set Add To Left button label</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">addAllToLeftOnclick</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Javascript to run after Add All To Left button pressed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">addAllToRightLabel</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -59,14 +51,6 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Set Add All To Right button label</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">addAllToRightOnclick</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Javascript to run after Add All To Right button pressed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">addToLeftLabel</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -75,14 +59,6 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Set Add To Left button label</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">addToLeftOnclick</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Javascript to run after Add To Left button pressed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">addToRightLabel</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -91,14 +67,6 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Set Add To Right button label</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">addToRightOnclick</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Javascript to run after Add To Right button pressed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">allowAddAllToLeft</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -715,14 +683,6 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Set Select All button label</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">selectAllOnclick</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Javascript to run after Select All button pressed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">size</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -787,22 +747,6 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Set the tooltip configuration</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">upDownOnLeftOnclick</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Javascript to run after up / down on the left side buttons pressed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">upDownOnRightOnclick</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Javascript to run after up / down on the right side buttons pressed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">value</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
|
||||
@@ -35,14 +35,6 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">java.util.Comparator</td>
|
||||
<td align="left" valign="top">The comparator to use</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">id</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">The id of the tag element</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">source</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
|
||||
@@ -43,14 +43,6 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">org.apache.struts2.util.SubsetIteratorFilter.Decider</td>
|
||||
<td align="left" valign="top">Extension to plug-in a decider to determine if that particular entry is to be included in the resulting subset iterator</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">id</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">The id of the tag element</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">source</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
|
||||
@@ -33,7 +33,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">The action to generate the URL for, if not using value</td>
|
||||
<td align="left" valign="top">he action generate url for, if not using value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">anchor</td>
|
||||
@@ -65,7 +65,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">Boolean</td>
|
||||
<td align="left" valign="top">Whether actual context should be included in URL</td>
|
||||
<td align="left" valign="top">Whether actual context should be included in url</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">includeParams</td>
|
||||
@@ -105,7 +105,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Specifies if this should be a portlet render or action URL</td>
|
||||
<td align="left" valign="top">Specifies if this should be a portlet render or action url</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">scheme</td>
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package org.apache.struts2;
|
||||
|
||||
public enum SomeEnum {
|
||||
|
||||
INIT("init"), COMPLETED("completed");
|
||||
|
||||
private String displayName;
|
||||
|
||||
SomeEnum(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name();
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,6 @@
|
||||
*/
|
||||
package org.apache.struts2;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -48,7 +47,6 @@ public class TestAction extends ActionSupport {
|
||||
private String[][] list;
|
||||
private List list2;
|
||||
private List list3;
|
||||
private SomeEnum status = SomeEnum.COMPLETED;
|
||||
|
||||
public Collection getCollection() {
|
||||
return collection;
|
||||
@@ -150,16 +148,4 @@ public class TestAction extends ActionSupport {
|
||||
return INPUT;
|
||||
}
|
||||
|
||||
public SomeEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(SomeEnum status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public List<SomeEnum> getStatusList() {
|
||||
return Arrays.asList(SomeEnum.values());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ public class BaseTemplateEngineTest extends TestCase {
|
||||
public void testGetThemePropsThroughFileSystem() throws Exception {
|
||||
|
||||
URL dummyResourceUrl = getClass().getResource("dummy.properties");
|
||||
File dummyResourceFile = new File(dummyResourceUrl.getFile().replaceAll("%20", " "));
|
||||
File dummyResourceFile = new File(dummyResourceUrl.getFile());
|
||||
String themePropertiesDir = dummyResourceFile.getParent();
|
||||
|
||||
System.out.println("dummy resource url="+dummyResourceUrl);
|
||||
|
||||
@@ -33,8 +33,6 @@ import com.mockobjects.dynamic.Mock;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.util.OgnlUtil;
|
||||
import com.opensymphony.xwork2.util.XWorkConverter;
|
||||
import com.opensymphony.xwork2.util.ObjectTypeDeterminerFactory;
|
||||
|
||||
|
||||
/**
|
||||
@@ -56,8 +54,8 @@ public class HttpHeaderResultTest extends StrutsTestCase {
|
||||
|
||||
Map values = new HashMap();
|
||||
values.put("bar", "abc");
|
||||
|
||||
ActionContext.getContext().getValueStack().push(values);
|
||||
|
||||
OgnlUtil.setProperties(params, result);
|
||||
|
||||
responseMock.expect("addHeader", C.args(C.eq("foo"), C.eq("${bar}")));
|
||||
@@ -74,8 +72,8 @@ public class HttpHeaderResultTest extends StrutsTestCase {
|
||||
|
||||
Map values = new HashMap();
|
||||
values.put("bar", "abc");
|
||||
|
||||
ActionContext.getContext().getValueStack().push(values);
|
||||
|
||||
OgnlUtil.setProperties(params, result);
|
||||
|
||||
responseMock.expect("addHeader", C.args(C.eq("foo"), C.eq("abc")));
|
||||
@@ -98,14 +96,11 @@ public class HttpHeaderResultTest extends StrutsTestCase {
|
||||
response = (HttpServletResponse) responseMock.proxy();
|
||||
invocation = (ActionInvocation) new Mock(ActionInvocation.class).proxy();
|
||||
ServletActionContext.setResponse(response);
|
||||
|
||||
XWorkConverter.getInstance().setObjectTypeDeterminer(ObjectTypeDeterminerFactory.getInstance());
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
super.tearDown();
|
||||
ServletActionContext.setResponse(null);
|
||||
ActionContext.setContext(null);
|
||||
XWorkConverter.resetInstance();
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -102,7 +102,7 @@ public class ServletActionRedirectResultTest extends StrutsTestCase {
|
||||
control.replay();
|
||||
result.setActionMapper(container.getInstance(ActionMapper.class));
|
||||
result.execute(mockInvocation);
|
||||
assertEquals("/myNamespace/myAction.action?param1=value+1¶m2=value+2¶m3=value+3", res.getRedirectedUrl());
|
||||
assertEquals("/myNamespace/myAction.action?param2=value+2¶m1=value+1¶m3=value+3", res.getRedirectedUrl());
|
||||
|
||||
control.verify();
|
||||
}
|
||||
@@ -156,7 +156,7 @@ public class ServletActionRedirectResultTest extends StrutsTestCase {
|
||||
control.replay();
|
||||
result.setActionMapper(container.getInstance(ActionMapper.class));
|
||||
result.execute(mockInvocation);
|
||||
assertEquals("/myNamespace/myAction.action?param1=value+1¶m2=value+2¶m3=value+3", res.getRedirectedUrl());
|
||||
assertEquals("/myNamespace/myAction.action?param2=value+2¶m1=value+1¶m3=value+3", res.getRedirectedUrl());
|
||||
|
||||
control.verify();
|
||||
}
|
||||
|
||||
@@ -97,20 +97,6 @@ public class ServletRedirectResultTest extends StrutsTestCase implements StrutsS
|
||||
requestMock.verify();
|
||||
responseMock.verify();
|
||||
}
|
||||
|
||||
public void testMultipleParametersRedirect() throws Exception {
|
||||
view.setLocation("foo.jsp?foo=bar&baz=jim");
|
||||
requestMock.expectAndReturn("getParameterMap", new HashMap());
|
||||
requestMock.expectAndReturn("getServletPath", "/namespace/some.action");
|
||||
requestMock.expectAndReturn("getAttribute", C.ANY_ARGS, null);
|
||||
responseMock.expectAndReturn("encodeRedirectURL", "/context/namespace/foo.jsp?foo=bar&baz=jim", "/context/namespace/foo.jsp?foo=bar&baz=jim");
|
||||
responseMock.expect("sendRedirect", C.args(C.eq("/context/namespace/foo.jsp?foo=bar&baz=jim")));
|
||||
|
||||
view.execute(ai);
|
||||
|
||||
requestMock.verify();
|
||||
responseMock.verify();
|
||||
}
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
@@ -211,22 +211,6 @@ public class DefaultActionMapperTest extends StrutsTestCase {
|
||||
assertEquals("actionName", mapping.getName());
|
||||
assertNull(mapping.getMethod());
|
||||
}
|
||||
|
||||
public void testGetMappingWithNoExtensionButUriHasExtension() throws Exception {
|
||||
req.setupGetParameterMap(new HashMap());
|
||||
req.setupGetRequestURI("/my/namespace/actionName.html");
|
||||
req.setupGetServletPath("/my/namespace/actionName.html");
|
||||
req.setupGetAttribute(null);
|
||||
req.addExpectedGetAttributeName("javax.servlet.include.servlet_path");
|
||||
|
||||
DefaultActionMapper mapper = new DefaultActionMapper();
|
||||
mapper.setExtensions("");
|
||||
ActionMapping mapping = mapper.getMapping(req, configManager);
|
||||
|
||||
assertEquals("/my/namespace", mapping.getNamespace());
|
||||
assertEquals("actionName.html", mapping.getName());
|
||||
assertNull(mapping.getMethod());
|
||||
}
|
||||
|
||||
// =============================
|
||||
// === test name & namespace ===
|
||||
|
||||
+4
-98
@@ -88,111 +88,17 @@ public class Restful2ActionMapperTest extends StrutsTestCase {
|
||||
assertEquals("1", mapping.getParams().get("bar"));
|
||||
}
|
||||
|
||||
public void testPostCreate() throws Exception {
|
||||
req.setupGetRequestURI("/my/namespace/bar/1/foo/");
|
||||
req.setupGetServletPath("/my/namespace/bar/1/foo/");
|
||||
public void testPutCreate() throws Exception {
|
||||
req.setupGetRequestURI("/my/namespace/foo/");
|
||||
req.setupGetServletPath("/my/namespace/foo/");
|
||||
req.setupGetAttribute(null);
|
||||
req.addExpectedGetAttributeName("javax.servlet.include.servlet_path");
|
||||
req.setupGetMethod("POST");
|
||||
req.setupGetMethod("PUT");
|
||||
|
||||
ActionMapping mapping = mapper.getMapping(req, configManager);
|
||||
|
||||
assertEquals("/my/namespace", mapping.getNamespace());
|
||||
assertEquals("foo/", mapping.getName());
|
||||
assertEquals("create", mapping.getMethod());
|
||||
assertEquals(1, mapping.getParams().size());
|
||||
assertEquals("1", mapping.getParams().get("bar"));
|
||||
}
|
||||
|
||||
public void testPutUpdate() throws Exception {
|
||||
|
||||
req.setupGetRequestURI("/my/namespace/bar/1/foo/2");
|
||||
req.setupGetServletPath("/my/namespace/bar/1/foo/2");
|
||||
req.setupGetAttribute(null);
|
||||
req.addExpectedGetAttributeName("javax.servlet.include.servlet_path");
|
||||
req.setupGetMethod("PUT");
|
||||
|
||||
ActionMapping mapping = mapper.getMapping(req, configManager);
|
||||
|
||||
assertEquals("/my/namespace", mapping.getNamespace());
|
||||
assertEquals("foo/2", mapping.getName());
|
||||
assertEquals("update", mapping.getMethod());
|
||||
assertEquals(1, mapping.getParams().size());
|
||||
assertEquals("1", mapping.getParams().get("bar"));
|
||||
}
|
||||
|
||||
public void testPutUpdateWithIdParam() throws Exception {
|
||||
|
||||
mapper.setIdParameterName("id");
|
||||
req.setupGetRequestURI("/my/namespace/bar/1/foo/2");
|
||||
req.setupGetServletPath("/my/namespace/bar/1/foo/2");
|
||||
req.setupGetAttribute(null);
|
||||
req.addExpectedGetAttributeName("javax.servlet.include.servlet_path");
|
||||
req.setupGetMethod("PUT");
|
||||
|
||||
ActionMapping mapping = mapper.getMapping(req, configManager);
|
||||
|
||||
assertEquals("/my/namespace", mapping.getNamespace());
|
||||
assertEquals("foo", mapping.getName());
|
||||
assertEquals("update", mapping.getMethod());
|
||||
assertEquals(2, mapping.getParams().size());
|
||||
assertEquals("1", mapping.getParams().get("bar"));
|
||||
assertEquals("2", mapping.getParams().get("id"));
|
||||
|
||||
}
|
||||
|
||||
public void testPutUpdateWithFakePut() throws Exception {
|
||||
|
||||
req.setupGetRequestURI("/my/namespace/bar/1/foo/2");
|
||||
req.setupGetServletPath("/my/namespace/bar/1/foo/2");
|
||||
req.setupAddParameter(Restful2ActionMapper.HTTP_METHOD_PARAM, "put");
|
||||
req.setupAddParameter(Restful2ActionMapper.HTTP_METHOD_PARAM, "put");
|
||||
req.setupGetAttribute(null);
|
||||
req.addExpectedGetAttributeName("javax.servlet.include.servlet_path");
|
||||
req.setupGetMethod("POST");
|
||||
|
||||
ActionMapping mapping = mapper.getMapping(req, configManager);
|
||||
|
||||
assertEquals("/my/namespace", mapping.getNamespace());
|
||||
assertEquals("foo/2", mapping.getName());
|
||||
assertEquals("update", mapping.getMethod());
|
||||
assertEquals(1, mapping.getParams().size());
|
||||
assertEquals("1", mapping.getParams().get("bar"));
|
||||
}
|
||||
|
||||
public void testDeleteRemove() throws Exception {
|
||||
|
||||
req.setupGetRequestURI("/my/namespace/bar/1/foo/2");
|
||||
req.setupGetServletPath("/my/namespace/bar/1/foo/2");
|
||||
req.setupGetAttribute(null);
|
||||
req.addExpectedGetAttributeName("javax.servlet.include.servlet_path");
|
||||
req.setupGetMethod("DELETE");
|
||||
|
||||
ActionMapping mapping = mapper.getMapping(req, configManager);
|
||||
|
||||
assertEquals("/my/namespace", mapping.getNamespace());
|
||||
assertEquals("foo/2", mapping.getName());
|
||||
assertEquals("remove", mapping.getMethod());
|
||||
assertEquals(1, mapping.getParams().size());
|
||||
assertEquals("1", mapping.getParams().get("bar"));
|
||||
}
|
||||
|
||||
public void testDeleteRemoveWithFakeDelete() throws Exception {
|
||||
|
||||
req.setupGetRequestURI("/my/namespace/bar/1/foo/2");
|
||||
req.setupGetServletPath("/my/namespace/bar/1/foo/2");
|
||||
req.setupAddParameter(Restful2ActionMapper.HTTP_METHOD_PARAM, "DELETE");
|
||||
req.setupAddParameter(Restful2ActionMapper.HTTP_METHOD_PARAM, "DELETE");
|
||||
req.setupGetAttribute(null);
|
||||
req.addExpectedGetAttributeName("javax.servlet.include.servlet_path");
|
||||
req.setupGetMethod("POST");
|
||||
|
||||
ActionMapping mapping = mapper.getMapping(req, configManager);
|
||||
|
||||
assertEquals("/my/namespace", mapping.getNamespace());
|
||||
assertEquals("foo/2", mapping.getName());
|
||||
assertEquals("remove", mapping.getMethod());
|
||||
assertEquals(1, mapping.getParams().size());
|
||||
assertEquals("1", mapping.getParams().get("bar"));
|
||||
}
|
||||
}
|
||||
|
||||
+6
-6
@@ -64,7 +64,7 @@ public class ExecuteAndWaitInterceptorTest extends StrutsTestCase {
|
||||
private Map session;
|
||||
private ExecuteAndWaitInterceptor waitInterceptor;
|
||||
|
||||
public void testOneWait() throws Exception {
|
||||
public void _testOneWait() throws Exception {
|
||||
waitInterceptor.setDelay(0);
|
||||
waitInterceptor.setDelaySleepInterval(0);
|
||||
|
||||
@@ -79,7 +79,7 @@ public class ExecuteAndWaitInterceptorTest extends StrutsTestCase {
|
||||
assertEquals("success", result2);
|
||||
}
|
||||
|
||||
public void testTwoWait() throws Exception {
|
||||
public void _testTwoWait() throws Exception {
|
||||
waitInterceptor.setDelay(0);
|
||||
waitInterceptor.setDelaySleepInterval(0);
|
||||
|
||||
@@ -100,7 +100,7 @@ public class ExecuteAndWaitInterceptorTest extends StrutsTestCase {
|
||||
assertEquals("success", result3);
|
||||
}
|
||||
|
||||
public void testOneWaitWithDelay() throws Exception {
|
||||
public void _testOneWaitWithDelay() throws Exception {
|
||||
waitInterceptor.setDelay(200);
|
||||
waitInterceptor.setDelaySleepInterval(100);
|
||||
|
||||
@@ -118,7 +118,7 @@ public class ExecuteAndWaitInterceptorTest extends StrutsTestCase {
|
||||
assertEquals("success", result2);
|
||||
}
|
||||
|
||||
public void testTwoWaitWithDelay() throws Exception {
|
||||
public void _testTwoWaitWithDelay() throws Exception {
|
||||
waitInterceptor.setDelay(100);
|
||||
waitInterceptor.setDelaySleepInterval(100);
|
||||
|
||||
@@ -154,7 +154,7 @@ public class ExecuteAndWaitInterceptorTest extends StrutsTestCase {
|
||||
String result = proxy.execute();
|
||||
long diff = System.currentTimeMillis() - before;
|
||||
assertEquals("success", result);
|
||||
assertTrue("Job done already after 500 so there should not be such long delay", diff <= 1000);
|
||||
assertTrue("Job done already after 500 so there should not be such long delay", diff <= 750);
|
||||
}
|
||||
|
||||
public void testWaitDelayAndJobAlreadyDone2() throws Exception {
|
||||
@@ -166,7 +166,7 @@ public class ExecuteAndWaitInterceptorTest extends StrutsTestCase {
|
||||
String result = proxy.execute();
|
||||
long diff = System.currentTimeMillis() - before;
|
||||
assertEquals("success", result);
|
||||
assertTrue("Job done already after 500 so there should not be such long delay", diff <= 1000);
|
||||
assertTrue("Job done already after 500 so there should not be such long delay", diff <= 750);
|
||||
}
|
||||
|
||||
protected ActionProxy buildProxy(String actionName) throws Exception {
|
||||
|
||||
@@ -1,426 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.views.freemarker.tags;
|
||||
|
||||
import java.io.StringWriter;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.struts2.StrutsTestCase;
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.views.freemarker.tags.TagModel;
|
||||
import org.springframework.mock.web.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.MockHttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.OgnlValueStack;
|
||||
|
||||
import freemarker.ext.util.WrapperTemplateModel;
|
||||
import freemarker.template.AdapterTemplateModel;
|
||||
import freemarker.template.TemplateBooleanModel;
|
||||
import freemarker.template.TemplateCollectionModel;
|
||||
import freemarker.template.TemplateHashModel;
|
||||
import freemarker.template.TemplateModel;
|
||||
import freemarker.template.TemplateModelException;
|
||||
import freemarker.template.TemplateModelIterator;
|
||||
import freemarker.template.TemplateNumberModel;
|
||||
import freemarker.template.TemplateScalarModel;
|
||||
import freemarker.template.TemplateSequenceModel;
|
||||
|
||||
public class TagModelTest extends StrutsTestCase {
|
||||
|
||||
final Object ADAPTER_TEMPLATE_MODEL_CONTAINED_OBJECT = new Object();
|
||||
final Object WRAPPING_TEMPLATE_MODEL_CONTAINED_OBJECT = new Object();
|
||||
|
||||
public void testUnwrapMap() throws Exception {
|
||||
|
||||
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
OgnlValueStack stack = new OgnlValueStack();
|
||||
|
||||
Map params = new LinkedHashMap();
|
||||
|
||||
// Try to test out the commons Freemarker's Template Model
|
||||
|
||||
// TemplateBooleanModel
|
||||
params.put("property1", new TemplateBooleanModel() {
|
||||
public boolean getAsBoolean() throws TemplateModelException {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
params.put("property2", new TemplateBooleanModel() {
|
||||
public boolean getAsBoolean() throws TemplateModelException {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// TemplateScalarModel
|
||||
params.put("property3", new TemplateScalarModel() {
|
||||
public String getAsString() throws TemplateModelException {
|
||||
return "toby";
|
||||
}
|
||||
});
|
||||
params.put("property4", new TemplateScalarModel() {
|
||||
public String getAsString() throws TemplateModelException {
|
||||
return "phil";
|
||||
}
|
||||
});
|
||||
|
||||
// TemplateNumberModel
|
||||
params.put("property5", new TemplateNumberModel() {
|
||||
public Number getAsNumber() throws TemplateModelException {
|
||||
return new Integer("10");
|
||||
}
|
||||
});
|
||||
params.put("property6", new TemplateNumberModel() {
|
||||
public Number getAsNumber() throws TemplateModelException {
|
||||
return new Float("1.1");
|
||||
}
|
||||
});
|
||||
|
||||
// TemplateHashModel
|
||||
params.put("property7", new TemplateHashModel() {
|
||||
public TemplateModel get(String arg0) throws TemplateModelException {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isEmpty() throws TemplateModelException {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
// TemplateSequenceModel
|
||||
params.put("property8", new TemplateSequenceModel() {
|
||||
public TemplateModel get(int arg0) throws TemplateModelException {
|
||||
return null;
|
||||
}
|
||||
|
||||
public int size() throws TemplateModelException {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
|
||||
// TemplateCollectionModel
|
||||
params.put("property9", new TemplateCollectionModel() {
|
||||
public TemplateModelIterator iterator() throws TemplateModelException {
|
||||
return new TemplateModelIterator() {
|
||||
private Iterator i;
|
||||
{
|
||||
i = Collections.EMPTY_LIST.iterator();
|
||||
}
|
||||
|
||||
public boolean hasNext() throws TemplateModelException {
|
||||
return i.hasNext();
|
||||
}
|
||||
|
||||
public TemplateModel next() throws TemplateModelException {
|
||||
return (TemplateModel) i.next();
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// AdapterTemplateModel
|
||||
params.put("property10", new AdapterTemplateModel() {
|
||||
public Object getAdaptedObject(Class arg0) {
|
||||
return ADAPTER_TEMPLATE_MODEL_CONTAINED_OBJECT;
|
||||
}
|
||||
});
|
||||
|
||||
// WrapperTemplateModel
|
||||
params.put("property11", new WrapperTemplateModel() {
|
||||
public Object getWrappedObject() {
|
||||
return WRAPPING_TEMPLATE_MODEL_CONTAINED_OBJECT;
|
||||
}
|
||||
});
|
||||
|
||||
TagModel tagModel = new TagModel(stack, request, response) {
|
||||
protected Component getBean() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
Map result = tagModel.unwrapParameters(params);
|
||||
|
||||
assertNotNull(result);
|
||||
assertEquals(result.size(), 11);
|
||||
assertEquals(result.get("property1"), Boolean.TRUE);
|
||||
assertEquals(result.get("property2"), Boolean.FALSE);
|
||||
assertEquals(result.get("property3"), "toby");
|
||||
assertEquals(result.get("property4"), "phil");
|
||||
assertEquals(result.get("property5"), new Integer(10));
|
||||
assertEquals(result.get("property6"), new Float(1.1));
|
||||
assertNotNull(result.get("property7"));
|
||||
assertTrue(result.get("property7") instanceof Map);
|
||||
assertNotNull(result.get("property8"));
|
||||
assertTrue(result.get("property8") instanceof Collection);
|
||||
assertNotNull(result.get("property9"));
|
||||
assertTrue(result.get("property9") instanceof Collection);
|
||||
assertEquals(result.get("property10"),
|
||||
ADAPTER_TEMPLATE_MODEL_CONTAINED_OBJECT);
|
||||
assertEquals(result.get("property11"),
|
||||
WRAPPING_TEMPLATE_MODEL_CONTAINED_OBJECT);
|
||||
}
|
||||
|
||||
public void testGetWriter() throws Exception {
|
||||
|
||||
OgnlValueStack stack = new OgnlValueStack();
|
||||
|
||||
final InternalBean bean = new InternalBean(stack);
|
||||
|
||||
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
|
||||
Map params = new LinkedHashMap();
|
||||
|
||||
// Try to test out the commons Freemarker's Template Model
|
||||
|
||||
// TemplateBooleanModel
|
||||
params.put("property1", new TemplateBooleanModel() {
|
||||
public boolean getAsBoolean() throws TemplateModelException {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
params.put("property2", new TemplateBooleanModel() {
|
||||
public boolean getAsBoolean() throws TemplateModelException {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// TemplateScalarModel
|
||||
params.put("property3", new TemplateScalarModel() {
|
||||
public String getAsString() throws TemplateModelException {
|
||||
return "toby";
|
||||
}
|
||||
});
|
||||
params.put("property4", new TemplateScalarModel() {
|
||||
public String getAsString() throws TemplateModelException {
|
||||
return "phil";
|
||||
}
|
||||
});
|
||||
|
||||
// TemplateNumberModel
|
||||
params.put("property5", new TemplateNumberModel() {
|
||||
public Number getAsNumber() throws TemplateModelException {
|
||||
return new Integer("10");
|
||||
}
|
||||
});
|
||||
params.put("property6", new TemplateNumberModel() {
|
||||
public Number getAsNumber() throws TemplateModelException {
|
||||
return new Float("1.1");
|
||||
}
|
||||
});
|
||||
|
||||
// TemplateHashModel
|
||||
params.put("property7", new TemplateHashModel() {
|
||||
public TemplateModel get(String arg0) throws TemplateModelException {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isEmpty() throws TemplateModelException {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
// TemplateSequenceModel
|
||||
params.put("property8", new TemplateSequenceModel() {
|
||||
public TemplateModel get(int arg0) throws TemplateModelException {
|
||||
return null;
|
||||
}
|
||||
|
||||
public int size() throws TemplateModelException {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
|
||||
// TemplateCollectionModel
|
||||
params.put("property9", new TemplateCollectionModel() {
|
||||
public TemplateModelIterator iterator() throws TemplateModelException {
|
||||
return new TemplateModelIterator() {
|
||||
private Iterator i;
|
||||
{
|
||||
i = Collections.EMPTY_LIST.iterator();
|
||||
}
|
||||
|
||||
public boolean hasNext() throws TemplateModelException {
|
||||
return i.hasNext();
|
||||
}
|
||||
|
||||
public TemplateModel next() throws TemplateModelException {
|
||||
return (TemplateModel) i.next();
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// AdapterTemplateModel
|
||||
params.put("property10", new AdapterTemplateModel() {
|
||||
public Object getAdaptedObject(Class arg0) {
|
||||
return ADAPTER_TEMPLATE_MODEL_CONTAINED_OBJECT;
|
||||
}
|
||||
});
|
||||
|
||||
// WrapperTemplateModel
|
||||
params.put("property11", new WrapperTemplateModel() {
|
||||
public Object getWrappedObject() {
|
||||
return WRAPPING_TEMPLATE_MODEL_CONTAINED_OBJECT;
|
||||
}
|
||||
});
|
||||
|
||||
TagModel tagModel = new TagModel(stack, request, response) {
|
||||
protected Component getBean() {
|
||||
return bean;
|
||||
}
|
||||
};
|
||||
|
||||
tagModel.getWriter(new StringWriter(), params);
|
||||
|
||||
assertNotNull(bean);
|
||||
assertEquals(bean.getProperty1(), true);
|
||||
assertEquals(bean.getProperty2(), false);
|
||||
assertEquals(bean.getProperty3(), "toby");
|
||||
assertEquals(bean.getProperty4(), "phil");
|
||||
assertEquals(bean.getProperty5(), new Integer(10));
|
||||
assertEquals(bean.getProperty6(), new Float(1.1));
|
||||
assertNotNull(bean.getProperty7());
|
||||
assertTrue(bean.getProperty7() instanceof Map);
|
||||
assertNotNull(bean.getProperty8());
|
||||
assertTrue(bean.getProperty8() instanceof Collection);
|
||||
assertNotNull(bean.getProperty9());
|
||||
assertTrue(bean.getProperty9() instanceof Collection);
|
||||
assertEquals(bean.getProperty10(), ADAPTER_TEMPLATE_MODEL_CONTAINED_OBJECT);
|
||||
assertEquals(bean.getProperty11(), WRAPPING_TEMPLATE_MODEL_CONTAINED_OBJECT);
|
||||
}
|
||||
|
||||
public static class InternalBean extends Component {
|
||||
|
||||
public InternalBean(OgnlValueStack stack) {
|
||||
super(stack);
|
||||
}
|
||||
|
||||
private boolean property1 = false; // inverse of the expected result, so we could test that it works
|
||||
private boolean property2 = true; // inverse of the expected result, so we could test that it works
|
||||
|
||||
private String property3;
|
||||
private String property4;
|
||||
|
||||
private Integer property5;
|
||||
private Float property6;
|
||||
|
||||
private Map property7;
|
||||
private Collection property8;
|
||||
private Collection property9;
|
||||
|
||||
private Object property10;
|
||||
private Object property11;
|
||||
|
||||
public void setProperty1(boolean property1) {
|
||||
this.property1 = property1;
|
||||
}
|
||||
|
||||
public boolean getProperty1() {
|
||||
return property1;
|
||||
}
|
||||
|
||||
public void setProperty2(boolean property2) {
|
||||
this.property2 = property2;
|
||||
}
|
||||
|
||||
public boolean getProperty2() {
|
||||
return property2;
|
||||
}
|
||||
|
||||
public void setProperty3(String property3) {
|
||||
this.property3 = property3;
|
||||
}
|
||||
|
||||
public String getProperty3() {
|
||||
return this.property3;
|
||||
}
|
||||
|
||||
public void setProperty4(String property4) {
|
||||
this.property4 = property4;
|
||||
}
|
||||
|
||||
public String getProperty4() {
|
||||
return this.property4;
|
||||
}
|
||||
|
||||
public void setProperty5(Integer property5) {
|
||||
this.property5 = property5;
|
||||
}
|
||||
|
||||
public Integer getProperty5() {
|
||||
return this.property5;
|
||||
}
|
||||
|
||||
public void setProperty6(Float property6) {
|
||||
this.property6 = property6;
|
||||
}
|
||||
|
||||
public Float getProperty6() {
|
||||
return this.property6;
|
||||
}
|
||||
|
||||
public void setProperty7(Map property7) {
|
||||
this.property7 = property7;
|
||||
}
|
||||
|
||||
public Map getProperty7() {
|
||||
return property7;
|
||||
}
|
||||
|
||||
public void setProperty8(Collection property8) {
|
||||
this.property8 = property8;
|
||||
}
|
||||
|
||||
public Collection getProperty8() {
|
||||
return property8;
|
||||
}
|
||||
|
||||
public void setProperty9(Collection property9) {
|
||||
this.property9 = property9;
|
||||
}
|
||||
|
||||
public Collection getProperty9() {
|
||||
return this.property9;
|
||||
}
|
||||
|
||||
public void setProperty10(Object property10) {
|
||||
this.property10 = property10;
|
||||
}
|
||||
|
||||
public Object getProperty10() {
|
||||
return this.property10;
|
||||
}
|
||||
|
||||
public void setProperty11(Object property11) {
|
||||
this.property11 = property11;
|
||||
}
|
||||
|
||||
public Object getProperty11() {
|
||||
return this.property11;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -223,7 +223,7 @@ public class URLTagTest extends AbstractUITagTest {
|
||||
tag.component.addParameter("param1", "value1");
|
||||
tag.component.addParameter("param2", "value2");
|
||||
tag.doEndTag();
|
||||
assertEquals("/TestAction.action?param0=value0&param1=value1&param2=value2", writer.toString());
|
||||
assertEquals("/TestAction.action?param2=value2&param0=value0&param1=value1", writer.toString());
|
||||
}
|
||||
|
||||
public void testEvaluateValue() throws Exception {
|
||||
@@ -281,7 +281,7 @@ public class URLTagTest extends AbstractUITagTest {
|
||||
paramTag.doEndTag();
|
||||
urlTag.doEndTag();
|
||||
|
||||
assertEquals("/context/someAction.action?id=33&name=John", writer.getBuffer().toString());
|
||||
assertEquals(writer.getBuffer().toString(), "/context/someAction.action?name=John&id=33");
|
||||
}
|
||||
|
||||
public void testParamPrecedenceWithAnchor() throws Exception {
|
||||
@@ -304,7 +304,7 @@ public class URLTagTest extends AbstractUITagTest {
|
||||
paramTag.doEndTag();
|
||||
urlTag.doEndTag();
|
||||
|
||||
assertEquals("/context/someAction.action?id=33&name=John#testAnchor", writer.getBuffer().toString());
|
||||
assertEquals(writer.getBuffer().toString(), "/context/someAction.action?name=John&id=33#testAnchor");
|
||||
}
|
||||
|
||||
public void testPutId() throws Exception {
|
||||
@@ -391,7 +391,7 @@ public class URLTagTest extends AbstractUITagTest {
|
||||
|
||||
tag.doEndTag();
|
||||
|
||||
assertEquals("/team.action?section=team&company=acme+inc&year=2006", writer.toString());
|
||||
assertEquals("/team.action?section=team&year=2006&company=acme+inc", writer.toString());
|
||||
}
|
||||
|
||||
public void testRequestURINoActionIncludeAll() throws Exception {
|
||||
@@ -413,7 +413,7 @@ public class URLTagTest extends AbstractUITagTest {
|
||||
|
||||
tag.doEndTag();
|
||||
|
||||
assertEquals("/public/about?section=team&company=acme+inc&year=2006", writer.toString());
|
||||
assertEquals("/public/about?section=team&year=2006&company=acme+inc", writer.toString());
|
||||
}
|
||||
|
||||
public void testUnknownIncludeParam() throws Exception {
|
||||
|
||||
@@ -50,7 +50,6 @@ public class AutocompleterTest extends AbstractUITagTest {
|
||||
tag.setIconPath("i");
|
||||
tag.setTemplateCssPath("j");
|
||||
tag.setDataFieldName("k");
|
||||
tag.setResultsLimit("1");
|
||||
tag.doStartTag();
|
||||
tag.doEndTag();
|
||||
|
||||
@@ -74,7 +73,6 @@ public class AutocompleterTest extends AbstractUITagTest {
|
||||
tag.setName("f");
|
||||
tag.setIconPath("i");
|
||||
tag.setTemplateCssPath("j");
|
||||
tag.setResultsLimit("1");
|
||||
tag.doStartTag();
|
||||
tag.doEndTag();
|
||||
|
||||
|
||||
@@ -78,7 +78,6 @@ public class ComboBoxTest extends AbstractUITagTest {
|
||||
tag.setPageContext(pageContext);
|
||||
tag.setLabel("mylabel");
|
||||
tag.setName("foo");
|
||||
tag.setId("cb");
|
||||
tag.setList("collection");
|
||||
|
||||
tag.doStartTag();
|
||||
|
||||
@@ -84,12 +84,6 @@ public class DoubleSelectTest extends AbstractUITagTest {
|
||||
tag.setOnmouseover("window.status='onmouseover';");
|
||||
tag.setOnmouseup("window.status='onmouseup';");
|
||||
|
||||
//css style and class
|
||||
tag.setCssClass("c1");
|
||||
tag.setCssStyle("s1");
|
||||
tag.setDoubleCssClass("c2");
|
||||
tag.setDoubleCssStyle("s2");
|
||||
|
||||
tag.doStartTag();
|
||||
tag.doEndTag();
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public class FormTagTest extends AbstractUITagTest {
|
||||
FormTag tag = new FormTag();
|
||||
tag.setPageContext(pageContext);
|
||||
tag.setName("myForm");
|
||||
tag.setMethod("post");
|
||||
tag.setMethod("POST");
|
||||
tag.setAcceptcharset("UTF-8");
|
||||
tag.setAction("testAction");
|
||||
tag.setEnctype("myEncType");
|
||||
@@ -74,7 +74,7 @@ public class FormTagTest extends AbstractUITagTest {
|
||||
tag.setPageContext(pageContext);
|
||||
tag.setName("myForm");
|
||||
tag.setNamespace("/testNamespace");
|
||||
tag.setMethod("post");
|
||||
tag.setMethod("POST");
|
||||
tag.setAcceptcharset("UTF-8");
|
||||
tag.setAction("testNamespaceAction");
|
||||
tag.setEnctype("myEncType");
|
||||
@@ -98,7 +98,7 @@ public class FormTagTest extends AbstractUITagTest {
|
||||
FormTag tag = new FormTag();
|
||||
tag.setPageContext(pageContext);
|
||||
tag.setName("myForm");
|
||||
tag.setMethod("post");
|
||||
tag.setMethod("POST");
|
||||
tag.setAcceptcharset("UTF-8");
|
||||
tag.setAction("myAction");
|
||||
tag.setEnctype("myEncType");
|
||||
@@ -188,7 +188,7 @@ public class FormTagTest extends AbstractUITagTest {
|
||||
FormTag tag = new FormTag();
|
||||
tag.setPageContext(pageContext);
|
||||
tag.setName("myForm");
|
||||
tag.setMethod("post");
|
||||
tag.setMethod("POST");
|
||||
tag.setAction("myAction");
|
||||
tag.setAcceptcharset("UTF-8");
|
||||
tag.setEnctype("myEncType");
|
||||
@@ -293,7 +293,7 @@ public class FormTagTest extends AbstractUITagTest {
|
||||
FormTag tag = new FormTag();
|
||||
tag.setPageContext(pageContext);
|
||||
tag.setName("myForm");
|
||||
tag.setMethod("post");
|
||||
tag.setMethod("POST");
|
||||
tag.setAction("myAction");
|
||||
tag.setAcceptcharset("UTF-8");
|
||||
tag.setEnctype("myEncType");
|
||||
@@ -327,7 +327,7 @@ public class FormTagTest extends AbstractUITagTest {
|
||||
FormTag tag = new FormTag();
|
||||
tag.setPageContext(pageContext);
|
||||
tag.setName("myForm");
|
||||
tag.setMethod("post");
|
||||
tag.setMethod("POST");
|
||||
tag.setAction("myAction");
|
||||
tag.setEnctype("myEncType");
|
||||
tag.setTitle("mytitle");
|
||||
@@ -350,7 +350,7 @@ public class FormTagTest extends AbstractUITagTest {
|
||||
|
||||
/**
|
||||
* Testing that this: <p>
|
||||
* <a:form name="'myForm'" namespace="'/testNamespace'" action="'testNamespaceAction'" method="'post'">
|
||||
* <a:form name="'myForm'" namespace="'/testNamespace'" action="'testNamespaceAction'" method="'POST'">
|
||||
* <p/>
|
||||
* doesn't create an action of "/testNamespace/testNamespaceAction.action" when the "struts.action.extension"
|
||||
* config property is set to "jspa".
|
||||
@@ -366,7 +366,7 @@ public class FormTagTest extends AbstractUITagTest {
|
||||
tag.setPageContext(pageContext);
|
||||
tag.setNamespace("/testNamespace");
|
||||
tag.setAction("testNamespaceAction");
|
||||
tag.setMethod("post");
|
||||
tag.setMethod("POST");
|
||||
tag.setName("myForm");
|
||||
|
||||
tag.doStartTag();
|
||||
@@ -377,7 +377,7 @@ public class FormTagTest extends AbstractUITagTest {
|
||||
|
||||
/**
|
||||
* Testing that this: <p>
|
||||
* <a:form name="'myForm'" action="'/testNamespace/testNamespaceAction.jspa'" method="'post'">
|
||||
* <a:form name="'myForm'" action="'/testNamespace/testNamespaceAction.jspa'" method="'POST'">
|
||||
* <p/>
|
||||
* doesn't create an action of "/testNamespace/testNamespaceAction.action"
|
||||
*/
|
||||
@@ -387,7 +387,7 @@ public class FormTagTest extends AbstractUITagTest {
|
||||
FormTag tag = new FormTag();
|
||||
tag.setPageContext(pageContext);
|
||||
tag.setAction("/testNamespace/testNamespaceAction.jspa");
|
||||
tag.setMethod("post");
|
||||
tag.setMethod("POST");
|
||||
tag.setName("myForm");
|
||||
|
||||
tag.doStartTag();
|
||||
@@ -405,7 +405,7 @@ public class FormTagTest extends AbstractUITagTest {
|
||||
FormTag tag = new FormTag();
|
||||
tag.setPageContext(pageContext);
|
||||
tag.setName("myForm");
|
||||
tag.setMethod("post");
|
||||
tag.setMethod("POST");
|
||||
tag.setAction("testNamespaceAction");
|
||||
|
||||
tag.doStartTag();
|
||||
@@ -569,7 +569,7 @@ public class FormTagTest extends AbstractUITagTest {
|
||||
FormTag tag = new FormTag();
|
||||
tag.setPageContext(pageContext);
|
||||
tag.setAction("/testNamespace/testNamespaceAction.jspa");
|
||||
tag.setMethod("post");
|
||||
tag.setMethod("POST");
|
||||
tag.setName("myForm");
|
||||
|
||||
tag.doStartTag();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user