mirror of
https://github.com/apache/struts.git
synced 2026-08-08 08:07:17 +00:00
Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fe62eb0347 | |||
| 611f7cf2c4 | |||
| fbd8a0a328 | |||
| 554a1b5ffc | |||
| 0c3c873c0f | |||
| d40fcd2641 | |||
| 697a3b3a1e | |||
| 6a5e493a45 | |||
| 0a388b18e4 | |||
| 9a80c9b381 | |||
| 18f41aab19 | |||
| 87c3af3654 | |||
| 8f9f1fbd42 | |||
| d8ea187a2a | |||
| 0534ae35d8 | |||
| bfa0d22c8c | |||
| 63be3b2a41 | |||
| da3e4b0280 | |||
| fba1a707d7 | |||
| 84863ffaae | |||
| 8b32755ba1 | |||
| 9872cc64db | |||
| 40ed474347 | |||
| 5ae4898a5d | |||
| 522961d993 | |||
| 02249e0558 | |||
| a5f3306e9b | |||
| 1432b02048 | |||
| 017537f20a | |||
| 80d3f05fe7 |
+2
-2
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.0.8</version>
|
||||
<version>2.0.6</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>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<struts>
|
||||
|
||||
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
|
||||
<constant name="struts.devMode" value="false" />
|
||||
<constant name="struts.devMode" value="true" />
|
||||
|
||||
<include file="example.xml"/>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.0.8</version>
|
||||
<version>2.0.6</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-mailreader</artifactId>
|
||||
@@ -31,6 +31,12 @@
|
||||
<artifactId>struts-mailreader-dao</artifactId>
|
||||
<version>1.3.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-spring-plugin</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans default-autowire="autodetect">
|
||||
<!-- add your spring beans here -->
|
||||
</beans>
|
||||
@@ -32,6 +32,8 @@ import org.apache.struts.apps.mailreader.dao.User;
|
||||
import org.apache.struts.apps.mailreader.dao.UserDatabase;
|
||||
import org.apache.struts.apps.mailreader.dao.impl.memory.MemorySubscription;
|
||||
import org.apache.struts.apps.mailreader.dao.impl.memory.MemoryUser;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -61,28 +63,6 @@ public class MailreaderSupport extends ActionSupport
|
||||
return Constants.CANCEL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method to copy User properties.
|
||||
**/
|
||||
protected void copyUser(User source, User target) {
|
||||
if ((source==null) || (target==null)) return;
|
||||
target.setFromAddress(source.getFromAddress());
|
||||
target.setFullName(source.getFullName());
|
||||
target.setPassword(source.getPassword());
|
||||
target.setReplyToAddress(source.getReplyToAddress());
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method to copy Subscription properties.
|
||||
**/
|
||||
protected void copySubscription(Subscription source, Subscription target) {
|
||||
if ((source==null) || (target==null)) return;
|
||||
target.setAutoConnect(source.getAutoConnect());
|
||||
target.setPassword(source.getPassword());
|
||||
target.setType(source.getType());
|
||||
target.setUsername(source.getUsername());
|
||||
}
|
||||
|
||||
|
||||
// ---- ApplicationAware ----
|
||||
|
||||
@@ -455,7 +435,7 @@ public class MailreaderSupport extends ActionSupport
|
||||
input.setPassword(_password);
|
||||
User user = createUser(_username, _password);
|
||||
if (null != user) {
|
||||
copyUser(input,user);
|
||||
BeanUtils.copyProperties(input,user);
|
||||
setUser(user);
|
||||
}
|
||||
}
|
||||
@@ -552,7 +532,7 @@ public class MailreaderSupport extends ActionSupport
|
||||
Subscription input = getSubscription();
|
||||
Subscription sub = createSubscription(host);
|
||||
if (null != sub) {
|
||||
copySubscription(input, sub);
|
||||
BeanUtils.copyProperties(input, sub);
|
||||
setSubscription(sub);
|
||||
setHost(sub.getHost());
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<constant name="struts.action.extension" value="do" />
|
||||
<constant name="struts.devMode" value="false" />
|
||||
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
|
||||
<constant name="struts.objectFactory" value="spring" />
|
||||
|
||||
<include file="mailreader-default.xml"/>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -4,6 +4,11 @@
|
||||
|
||||
<display-name>Struts 2 Mailreader</display-name>
|
||||
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>classpath*:applicationContext*.xml</param-value>
|
||||
</context-param>
|
||||
|
||||
<filter>
|
||||
<filter-name>Struts2</filter-name>
|
||||
<filter-class>
|
||||
@@ -13,16 +18,22 @@
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>Struts2</filter-name>
|
||||
<url-pattern>*.do</url-pattern>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<listener>
|
||||
<listener-class>
|
||||
org.springframework.web.context.ContextLoaderListener
|
||||
</listener-class>
|
||||
</listener>
|
||||
|
||||
<!-- Application Listener for Mailreader database -->
|
||||
<listener>
|
||||
<listener-class>
|
||||
mailreader2.ApplicationListener
|
||||
</listener-class>
|
||||
</listener>
|
||||
|
||||
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.html</welcome-file>
|
||||
</welcome-file-list>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -820,7 +820,7 @@ public class Welcome extends MailreaderSupport {
|
||||
</p>
|
||||
|
||||
<hr/>
|
||||
<pre><code><#if (actionErrors?exists && actionErrors?size > 0)>
|
||||
<pre><code><#if (actionErrors?exists && actionErrors?size > 0)>
|
||||
<ul>
|
||||
<#list actionErrors as error>
|
||||
<li><span class="errorMessage">${error}</span></li>
|
||||
@@ -837,7 +837,7 @@ public class Welcome extends MailreaderSupport {
|
||||
</p>
|
||||
|
||||
<hr/>
|
||||
<pre><code><#if (actionErrors?exists && actionErrors?size > 0)>
|
||||
<pre><code><#if (actionErrors?exists && actionErrors?size > 0)>
|
||||
<strong><table></strong>
|
||||
<#list actionErrors as error>
|
||||
<strong><tr><td></strong><span class="errorMessage">${error}</span><strong></td></tr></strong>
|
||||
@@ -1064,7 +1064,7 @@ public void setPassword(String password) {
|
||||
<pre><code>public User <strong>findUser</strong>(String username, String password)
|
||||
throws <strong>ExpiredPasswordException</strong> {
|
||||
User user = <strong>getDatabase().findUser(username)</strong>;
|
||||
if ((user != null) && !user.getPassword().equals(password)) {
|
||||
if ((user != null) && !user.getPassword().equals(password)) {
|
||||
user = null;
|
||||
}
|
||||
if (user == null) {
|
||||
@@ -1427,7 +1427,7 @@ public class <strong>AuthenticationInterceptor</strong> implements Interceptor {
|
||||
public String <strong>intercept</strong>(ActionInvocation actionInvocation) throws Exception {
|
||||
Map session = actionInvocation.getInvocationContext().getSession();
|
||||
User user = (User) session.get(Constants.USER_KEY);
|
||||
boolean isAuthenticated = (null!=user) && (null!=user.getDatabase());
|
||||
boolean isAuthenticated = (null!=user) && (null!=user.getDatabase());
|
||||
if (<strong>isAuthenticated</strong>) {
|
||||
return actionInvocation.invoke();
|
||||
}
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.0.8</version>
|
||||
<version>2.0.6</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.8</version>
|
||||
<version>2.0.6</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-portlet</artifactId>
|
||||
|
||||
@@ -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.8</version>
|
||||
<version>2.0.6</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.3</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-codebehind-plugin</artifactId>
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
<configuration>
|
||||
<!--
|
||||
QuickStart can be used to extend other QuickStart configurations.
|
||||
This is great for applications that have multiple "editions" and
|
||||
extend upon a base webapp or evven just a base set of classes.
|
||||
-->
|
||||
<!--<extendsConfig>../path/to/quickstart.xml</extendsConfig>-->
|
||||
|
||||
<!--
|
||||
QuickStart supports reading your IDEA module configuration and
|
||||
using the libraries there. This is especially useful for maven
|
||||
users who don't have a single directory in their project that
|
||||
contains all the libraries they need.
|
||||
-->
|
||||
<ideaConfig>../../../xwork/xwork.iml,../../core/struts2-core.iml,struts2-showcase.iml</ideaConfig>
|
||||
|
||||
<!-- The context in which to deploy the web application -->
|
||||
<context>/showcase</context>
|
||||
|
||||
<!-- The port in which to deploy the web application -->
|
||||
<port>8080</port>
|
||||
|
||||
<!--
|
||||
The libs directories can be a jar, a directory of jars, or even
|
||||
a directory of directories (searched recursively)
|
||||
<libs>
|
||||
<dir>../../lib</dir>
|
||||
</libs>
|
||||
-->
|
||||
|
||||
<!--
|
||||
Optional: the location where your source files are. If this is
|
||||
not included, the auto-recompiling feature of QuickStart will
|
||||
not be enabled. You may wish to do this anyway, as this feature
|
||||
has been known to cause strange side effects. If you don't
|
||||
specify your sources, you must specify where your classes are by
|
||||
using the classDirs and libs elements
|
||||
<sources>
|
||||
<dir>src/main/java</dir>
|
||||
</sources>
|
||||
-->
|
||||
|
||||
<!--
|
||||
The classDirs directories can be a jar or a directory of classes.
|
||||
The WEB-INF/classes directory for each webDir (below) will automatically
|
||||
be added if it exists.
|
||||
-->
|
||||
<classDirs>
|
||||
<dir>src/main/resources</dir>
|
||||
<dir>target/classes</dir>
|
||||
<dir>../../core/target/classes</dir>
|
||||
</classDirs>
|
||||
|
||||
<!--
|
||||
You can specify one or more directories where your webapp files
|
||||
are located. This is useful if you have your project split up in
|
||||
unique ways. You can also specify the path that the directory is
|
||||
mapped to, relative to the context.
|
||||
-->
|
||||
<webDirs>
|
||||
<webDir>
|
||||
<path>/</path>
|
||||
<dir>src/main/webapp</dir>
|
||||
</webDir>
|
||||
</webDirs>
|
||||
</configuration>
|
||||
+3
-3
@@ -57,7 +57,7 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
|
||||
|
||||
public String execute() throws MalformedURLException, IOException {
|
||||
|
||||
if (page != null && page.trim().length() > 0) {
|
||||
if (page != null) {
|
||||
|
||||
InputStream in = ClassLoaderUtil.getResourceAsStream(page.substring(page.indexOf("//")+1), getClass());
|
||||
page = page.replace("//", "/");
|
||||
@@ -72,7 +72,7 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
|
||||
pageLines = read(in, -1);
|
||||
}
|
||||
|
||||
if (className != null && className.trim().length() > 0) {
|
||||
if (className != null) {
|
||||
className = "/"+className.replace('.', '/') + ".java";
|
||||
InputStream in = getClass().getResourceAsStream(className);
|
||||
if (in == null) {
|
||||
@@ -81,7 +81,7 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
|
||||
classLines = read(in, -1);
|
||||
}
|
||||
|
||||
if (config != null && config.trim().length() > 0) {
|
||||
if (config != null) {
|
||||
int pos = config.lastIndexOf(':');
|
||||
configLine = Integer.parseInt(config.substring(pos+1));
|
||||
config = config.substring(0, pos).replace("//", "/");
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
struts.i18n.reload=true
|
||||
struts.devMode = true
|
||||
struts.configuration.xml.reload=true
|
||||
struts.continuations.package=org.apache.struts2.showcase
|
||||
struts.custom.i18n.resources=globalMessages
|
||||
#struts.action.extension=jspa
|
||||
struts.url.http.port = 8080
|
||||
struts.freemarker.manager.classname=customFreemarkerManager
|
||||
struts.serve.static=true
|
||||
struts.serve.static.browserCache=false
|
||||
struts.codebehind.defaultPackage=person
|
||||
@@ -7,23 +7,10 @@
|
||||
<!-- START SNIPPET: xworkSample -->
|
||||
<struts>
|
||||
|
||||
<!-- Some or all of these can be flipped to true for debugging -->
|
||||
<constant name="struts.i18n.reload" value="false" />
|
||||
<constant name="struts.devMode" value="false" />
|
||||
<constant name="struts.configuration.xml.reload" value="false" />
|
||||
<constant name="struts.custom.i18n.resources" value="globalMessages" />
|
||||
|
||||
<constant name="struts.codebehind.defaultPackage" value="person" />
|
||||
<constant name="struts.freemarker.manager.classname" value="customFreemarkerManager" />
|
||||
<constant name="struts.serve.static" value="true" />
|
||||
<constant name="struts.serve.static.browserCache" value="false" />
|
||||
|
||||
<include file="struts-chat.xml" />
|
||||
|
||||
<include file="struts-hangman.xml" />
|
||||
|
||||
<include file="struts-continuations.xml"/>
|
||||
|
||||
<include file="struts-tags.xml"/>
|
||||
|
||||
<include file="struts-validation.xml" />
|
||||
|
||||
@@ -28,15 +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"/>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ Using a JSON list returned from an action (href="/JSONList.action"), without aut
|
||||
|
||||
Reload on type (loadOnTextChange="true"), after 3 characters (loadMinimumCout="3", it is "3" by default), without the down arrow button (showDownArrow="false")
|
||||
<br/>
|
||||
<s:autocompleter name="state" theme="ajax" indicator="indicator" href="%{jsonList}" cssStyle="width: 200px;" autoComplete="false" loadOnTextChange="true" loadMinimumCount="3" showDownArrow="false"/>
|
||||
<s:autocompleter theme="ajax" indicator="indicator" href="%{jsonList}" cssStyle="width: 200px;" autoComplete="false" loadOnTextChange="true" loadMinimumCount="3" showDownArrow="false"/>
|
||||
<img id="indicator" src="${pageContext.request.contextPath}/images/indicator.gif" alt="Loading..." style="display:none"/>
|
||||
|
||||
<br/>
|
||||
|
||||
+3
-3
@@ -33,7 +33,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.0.8</version>
|
||||
<version>2.0.6</version>
|
||||
</parent>
|
||||
|
||||
<scm>
|
||||
@@ -103,7 +103,7 @@
|
||||
<groupId>opensymphony</groupId>
|
||||
<artifactId>xwork</artifactId>
|
||||
<classifier>javadoc</classifier>
|
||||
<version>2.0.3</version>
|
||||
<version>2.0.0</version>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
<outputDirectory>${project.build.directory}/xwork-apidocs</outputDirectory>
|
||||
@@ -384,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>
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/struts2-core-2.0.8.jar -destjar struts2-core-j4-2.0.8.jar
|
||||
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/xwork-2.0.3.jar -destjar xwork-j4-2.0.3.jar
|
||||
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/struts2-core-2.0.4.jar -destjar struts2-core-j4-2.0.4.jar
|
||||
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/struts2-api-2.0.4.jar -destjar struts2-api-j4-2.0.4.jar
|
||||
java -jar retrotranslator-transformer-1.2.0.jar -advanced -srcjar ../lib/xwork-2.0.0.jar -destjar xwork-j4-2.0.0.jar
|
||||
|
||||
+6
-7
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.0.8</version>
|
||||
<version>2.0.6</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>
|
||||
@@ -35,7 +35,7 @@
|
||||
<artifactItem>
|
||||
<groupId>opensymphony</groupId>
|
||||
<artifactId>xwork</artifactId>
|
||||
<version>2.0.3</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>
|
||||
@@ -253,7 +252,7 @@
|
||||
<dependency>
|
||||
<groupId>opensymphony</groupId>
|
||||
<artifactId>xwork</artifactId>
|
||||
<version>2.0.3</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>
|
||||
|
||||
|
||||
@@ -147,11 +147,4 @@ public final class StrutsConstants {
|
||||
public static final String STRUTS_XWORKCONVERTER = "struts.xworkConverter";
|
||||
|
||||
public static final String STRUTS_ALWAYS_SELECT_FULL_NAMESPACE = "struts.mapper.alwaysSelectFullNamespace";
|
||||
|
||||
/** 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";
|
||||
|
||||
}
|
||||
|
||||
@@ -29,10 +29,18 @@ import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* <p>The autocomplete tag is a combobox that can autocomplete text entered on the input box.
|
||||
* When used on the "simple" theme, the autocompleter can be used like the ComboBox.
|
||||
* When used on the "ajax" theme, the list can be retieved from an action. </p>
|
||||
* When used on the "ajax" theme, the list can be retieved from an action. This action must
|
||||
* return a JSON list in the format:</p>
|
||||
* <pre>
|
||||
* [
|
||||
* ["Text 1","Value1"],
|
||||
* ["Text 2","Value2"],
|
||||
* ["Text 3","Value3"]
|
||||
* ]
|
||||
* </pre>
|
||||
* <!-- START SNIPPET: ajaxJavadoc -->
|
||||
* <B>THE FOLLOWING IS ONLY VALID WHEN AJAX IS CONFIGURED</B>
|
||||
* <ul>
|
||||
* <li>href</li>
|
||||
@@ -62,27 +70,18 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* 'showErrorTransportText': whether errors should be displayed (on 'targets')<p/>
|
||||
* 'loadOnTextChange' options will be reloaded everytime a character is typed on the textbox<p/>
|
||||
* 'loadMinimumCount' minimum number of characters that will force the content to be loaded<p/>
|
||||
* 'showDownError' show or hide the down arrow button<p/>
|
||||
* 'showDownError' show or hide the down arrow button
|
||||
* 'searchType' how the search must be performed, options are: "startstring", "startword" and "substring"<p/>
|
||||
* 'keyName' name of the field to which the selected key will be assigned<p/>
|
||||
* 'iconPath' path of icon used for the dropdown<p/>
|
||||
* 'templateCssPath' path to css file used to customize Dojo's widget<p/>
|
||||
* 'dataFieldName' name of the field to be used as the list in the returned JSON string<p/>
|
||||
* 'iconPath' path of icon used for the dropdown
|
||||
* 'templateCssPath' path to css file used to customize Dojo's widget
|
||||
* 'notifyTopics' comma separated list of topics names, that will be published. Three parameters are passed:<p/>
|
||||
* <ul>
|
||||
* <li>data: selected value when type='valuechanged'</li>
|
||||
* <li>type: 'before' before the request is made, 'valuechanged' when selection changes, 'load' when the request succeeds, or 'error' when it fails</li>
|
||||
* <li>request: request javascript object, when type='load' or type='error'</li>
|
||||
* <ul>
|
||||
*<!-- END SNIPPET: javadoc -->
|
||||
*<!-- START SNIPPET: example -->
|
||||
*<p>Autocompleter that gets its list from an action:</p>
|
||||
*<s:autocompleter name="test" href="%{jsonList}" autoComplete="false"/>
|
||||
*<br/>
|
||||
**<p>Autocompleter that uses a list:</p>
|
||||
*<s:autocompleter name="test" list="{'apple','banana','grape','pear'}" autoComplete="false"/>
|
||||
*<br/>
|
||||
*<!-- END SNIPPET: example -->
|
||||
*
|
||||
*/
|
||||
@StrutsTag(name="autocompleter", tldTagClass="org.apache.struts2.views.jsp.ui.AutocompleterTag", description="Renders a combobox with autocomplete and AJAX capabilities")
|
||||
public class Autocompleter extends ComboBox {
|
||||
@@ -108,8 +107,6 @@ public class Autocompleter extends ComboBox {
|
||||
protected String templateCssPath;
|
||||
protected String iconPath;
|
||||
protected String keyName;
|
||||
protected String dataFieldName;
|
||||
protected String resultsLimit;
|
||||
|
||||
public Autocompleter(ValueStack stack, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
@@ -172,8 +169,6 @@ public class Autocompleter extends ComboBox {
|
||||
addParameter("templateCssPath", findString(templateCssPath));
|
||||
if(iconPath != null)
|
||||
addParameter("iconPath", findString(iconPath));
|
||||
if(dataFieldName != null)
|
||||
addParameter("dataFieldName", findString(dataFieldName));
|
||||
if(keyName != null)
|
||||
addParameter("keyName", findString(keyName));
|
||||
else {
|
||||
@@ -183,8 +178,6 @@ public class Autocompleter extends ComboBox {
|
||||
|
||||
String keyNameExpr = "%{" + keyName + "}";
|
||||
addParameter("key", findString(keyNameExpr));
|
||||
if(resultsLimit != null)
|
||||
addParameter("searchLimit", findString(resultsLimit));
|
||||
}
|
||||
|
||||
protected Object findListValue() {
|
||||
@@ -292,14 +285,4 @@ public class Autocompleter extends ComboBox {
|
||||
public void setKeyName(String keyName) {
|
||||
this.keyName = keyName;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Name of the field in the returned JSON object that contains the data array", defaultValue="Value specified in 'name'")
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,53 +43,51 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* A stand-alone DateTimePicker widget that makes it easy to select a date/time, or increment by week, month,
|
||||
* and/or year.
|
||||
* </p>
|
||||
* Dates attributes passed in the `RFC 3339` format:
|
||||
*
|
||||
* <p>
|
||||
* It is possible to customize the user-visible formatting with either the
|
||||
* 'formatLength' (long, short, medium or full) or 'displayFormat' attributes. By defaulty current
|
||||
* locale will be used.</p>
|
||||
* </p>
|
||||
*
|
||||
* Syntax supported by 'displayFormat' is (http://www.unicode.org/reports/tr35/tr35-4.html#Date_Format_Patterns):-
|
||||
* Renders date/time picker element.</p>
|
||||
* Format supported by this component are:-
|
||||
* <table border="1">
|
||||
* <tr>
|
||||
* <td>Format</td>
|
||||
* <td>Description</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>d</td>
|
||||
* <td>Day of the month</td>
|
||||
* <td>#dd</td>
|
||||
* <td>Display day in two digits format</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>D</td>
|
||||
* <td>Day of year</td>
|
||||
* <td>#d</td>
|
||||
* <td>Try to display day in one digit format, if cannot use 2 digit format</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>M</td>
|
||||
* <td>Month - Use one or two for the numerical month, three for the abbreviation, or four for the full name, or 5 for the narrow name.</td>
|
||||
* <td>#MM</td>
|
||||
* <td>Display month in two digits format</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>h</td>
|
||||
* <td>Hour [1-12].</td>
|
||||
* <td>#M</td>
|
||||
* <td>Try to display month in one digits format, if cannot use 2 digit format</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>H</td>
|
||||
* <td>Hour [0-23].</td>
|
||||
* <td>#yyyy</td>
|
||||
* <td>Display year in four digits format</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>m</td>
|
||||
* <td>Minute. Use one or two for zero padding.</td>
|
||||
* <td>#yy</td>
|
||||
* <td>Display the last two digits of the yaer</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>s</td>
|
||||
* <td>Second. Use one or two for zero padding.</td>
|
||||
* <td>#y</td>
|
||||
* <td>Display the last digits of the year</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* <p>
|
||||
* The value sent to the server is
|
||||
* It is possible to customize the user-visible formatting with either the
|
||||
* formatLength or displayFormat attributes. The value sent to the server is
|
||||
* typically a locale-independent value in a hidden field as defined by the name
|
||||
* attribute. RFC3339 representation is the format used.
|
||||
* attribute. RFC3339 representation is used by default, but other options are
|
||||
* available with saveFormat
|
||||
* </p>
|
||||
*
|
||||
* <p/>
|
||||
@@ -104,7 +102,7 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* Example 1:
|
||||
* <s:datetimepicker name="order.date" label="Order Date" />
|
||||
* Example 2:
|
||||
* <s:datetimepicker name="delivery.date" label="Delivery Date" format="yyyy-MM-dd" />
|
||||
* <s:datetimepicker name="delivery.date" label="Delivery Date" format="#yyyy-#MM-#dd" />
|
||||
*
|
||||
* <!-- END SNIPPET: expl1 -->
|
||||
* </pre>
|
||||
@@ -299,13 +297,13 @@ public class DateTimePicker extends UIBean {
|
||||
// try to parse a date
|
||||
String dateStr = obj.toString();
|
||||
if(dateStr.equalsIgnoreCase("today"))
|
||||
return RFC3339_FORMAT.format(new Date());
|
||||
return RFC3339_FORMAT.format(new Date());
|
||||
|
||||
try {
|
||||
Date date = null;
|
||||
if(this.displayFormat != null) {
|
||||
SimpleDateFormat format = new SimpleDateFormat(
|
||||
(String) getParameters().get("displayFormat"));
|
||||
this.displayFormat);
|
||||
date = format.parse(dateStr);
|
||||
return RFC3339_FORMAT.format(date);
|
||||
} else {
|
||||
|
||||
@@ -69,16 +69,15 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* 'formFilter' is the name of a function which will be used to filter the fields that will be
|
||||
* seralized. This function takes as a parameter the element and returns true if the element
|
||||
* should be included.<p/>
|
||||
* 'updateFreq' sets(in milliseconds) the update interval.<p/>
|
||||
* 'autoStart' if set to true(true by default) starts the timer automatically<p/>
|
||||
* 'startTimerListenTopics' is a comma-separated list of topics used to start the timer<p/>
|
||||
* 'stopTimerListenTopics' is a comma-separated list of topics used to stop the timer<p/>
|
||||
* 'listenTopics' comma separated list of topics names, that will trigger a request<p/>
|
||||
* 'indicator' element to be shown while the request executing<p/>
|
||||
* 'updateFreq' sets(in milliseconds) the update interval.
|
||||
* 'autoStart' if set to true(true by default) starts the timer automatically
|
||||
* 'startTimerListenTopics' is a comma-separated list of topics used to start the timer
|
||||
* 'stopTimerListenTopics' is a comma-separated list of topics used to stop the timer
|
||||
* 'listenTopics' comma separated list of topics names, that will trigger a request
|
||||
* 'indicator' element to be shown while the request executing
|
||||
* 'showErrorTransportText': whether errors should be displayed (on 'targets')</p>
|
||||
* 'showLoadingText' show loading text on targets</p>
|
||||
* 'separateScript' Run scripts in a separate scope, unique for each Div<p/>
|
||||
* 'notifyTopics' comma separated list of topics names, that will be published. Three parameters are passed:<p/>
|
||||
* 'notifyTopics' comma separated list of topics names, that will be published. Three parameters are passed:
|
||||
* <ul>
|
||||
* <li>data: html or json object when type='load' or type='error'</li>
|
||||
* <li>type: 'before' before the request is made, 'load' when the request succeeds, or 'error' when it fails</li>
|
||||
@@ -118,7 +117,6 @@ public class Div extends AbstractRemoteCallUIBean {
|
||||
protected String startTimerListenTopics;
|
||||
protected String stopTimerListenTopics;
|
||||
protected String refreshOnShow;
|
||||
protected String separateScripts;
|
||||
|
||||
public Div(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
@@ -147,8 +145,6 @@ public class Div extends AbstractRemoteCallUIBean {
|
||||
addParameter("startTimerListenTopics", findString(startTimerListenTopics));
|
||||
if (stopTimerListenTopics != null)
|
||||
addParameter("stopTimerListenTopics", findString(stopTimerListenTopics));
|
||||
if (separateScripts != null)
|
||||
addParameter("separateScripts", findValue(separateScripts, Boolean.class));
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Start timer automatically", type="Boolean", defaultValue="true")
|
||||
@@ -185,9 +181,4 @@ public class Div extends AbstractRemoteCallUIBean {
|
||||
public void setAfterLoading(String afterLoading) {
|
||||
this.afterLoading = afterLoading;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Run scripts in a separate scope, unique for each Div", defaultValue="true")
|
||||
public void setSeparateScripts(String separateScripts) {
|
||||
this.separateScripts = separateScripts;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,20 +20,20 @@
|
||||
*/
|
||||
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.util.LocalizedTextUtil;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
@@ -102,12 +102,10 @@ 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() {
|
||||
public Locale getLocale() {
|
||||
return locale;
|
||||
}
|
||||
getStack().push(new TextProviderSupport(bundle, new LocaleProvider() {
|
||||
public Locale getLocale() {
|
||||
return locale;
|
||||
}
|
||||
}));
|
||||
pushed = true;
|
||||
}
|
||||
|
||||
@@ -32,9 +32,7 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* <p>The set tag assigns a value to a variable in a specified scope. It is useful when you wish to assign a variable to a
|
||||
* complex expression and then simply reference that variable each time rather than the complex expression. This is
|
||||
* useful in both cases: when the complex expression takes time (performance improvement) or is hard to read (code
|
||||
* readability improvement).</p>
|
||||
* <p>If the tag is used with body content, the evaluation of the value parameter is omitted. Instead, the String to
|
||||
* which the body eveluates is set as value for the scoped variable.</p>
|
||||
* readability improvement).</P>
|
||||
*
|
||||
* The scopes available are as follows :-
|
||||
* <ul>
|
||||
@@ -77,7 +75,7 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* </pre>
|
||||
*
|
||||
*/
|
||||
@StrutsTag(name="set", tldBodyContent="JSP", tldTagClass="org.apache.struts2.views.jsp.SetTag", description="Assigns a value to a variable in a specified scope")
|
||||
@StrutsTag(name="set", tldBodyContent="empty", tldTagClass="org.apache.struts2.views.jsp.SetTag", description="Assigns a value to a variable in a specified scope")
|
||||
public class Set extends Component {
|
||||
protected String name;
|
||||
protected String scope;
|
||||
@@ -90,18 +88,11 @@ public class Set extends Component {
|
||||
public boolean end(Writer writer, String body) {
|
||||
ValueStack stack = getStack();
|
||||
|
||||
Object o;
|
||||
if (value == null) {
|
||||
if (body!=null && !body.equals("")) {
|
||||
o = body;
|
||||
} else {
|
||||
o = findValue("top");
|
||||
}
|
||||
} else {
|
||||
o = findValue(value);
|
||||
value = "top";
|
||||
}
|
||||
|
||||
body="";
|
||||
|
||||
Object o = findValue(value);
|
||||
|
||||
String name;
|
||||
if (altSyntax()) {
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.util.StringTokenizer;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapper;
|
||||
import org.apache.struts2.dispatcher.multipart.MultiPartRequest;
|
||||
import org.apache.struts2.views.freemarker.FreemarkerManager;
|
||||
@@ -33,7 +34,6 @@ import org.apache.struts2.views.velocity.VelocityManager;
|
||||
|
||||
import com.opensymphony.xwork2.ActionProxyFactory;
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
import com.opensymphony.xwork2.TextProvider;
|
||||
import com.opensymphony.xwork2.config.Configuration;
|
||||
import com.opensymphony.xwork2.config.ConfigurationException;
|
||||
import com.opensymphony.xwork2.config.ConfigurationProvider;
|
||||
@@ -41,10 +41,12 @@ import com.opensymphony.xwork2.inject.Container;
|
||||
import com.opensymphony.xwork2.inject.ContainerBuilder;
|
||||
import com.opensymphony.xwork2.inject.Context;
|
||||
import com.opensymphony.xwork2.inject.Factory;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import com.opensymphony.xwork2.inject.Scope;
|
||||
import com.opensymphony.xwork2.util.ClassLoaderUtil;
|
||||
import com.opensymphony.xwork2.util.LocalizedTextUtil;
|
||||
import com.opensymphony.xwork2.util.ObjectTypeDeterminer;
|
||||
import com.opensymphony.xwork2.util.ObjectTypeDeterminerFactory;
|
||||
import com.opensymphony.xwork2.util.XWorkConverter;
|
||||
import com.opensymphony.xwork2.util.location.LocatableProperties;
|
||||
|
||||
@@ -152,7 +154,6 @@ public class BeanSelectionProvider implements ConfigurationProvider {
|
||||
public void register(ContainerBuilder builder, LocatableProperties props) {
|
||||
alias(ObjectFactory.class, StrutsConstants.STRUTS_OBJECTFACTORY, builder, props);
|
||||
alias(XWorkConverter.class, StrutsConstants.STRUTS_XWORKCONVERTER, builder, props);
|
||||
alias(TextProvider.class, StrutsConstants.STRUTS_XWORKTEXTPROVIDER, builder, props);
|
||||
alias(ActionProxyFactory.class, StrutsConstants.STRUTS_ACTIONPROXYFACTORY, builder, props);
|
||||
alias(ObjectTypeDeterminer.class, StrutsConstants.STRUTS_OBJECTTYPEDETERMINER, builder, props);
|
||||
alias(ActionMapper.class, StrutsConstants.STRUTS_MAPPER_CLASS, builder, props);
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -52,7 +52,10 @@ import org.apache.struts2.util.ObjectFactoryDestroyable;
|
||||
import org.apache.struts2.views.freemarker.FreemarkerManager;
|
||||
|
||||
import com.opensymphony.xwork2.util.FileManager;
|
||||
import com.opensymphony.xwork2.*;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionProxy;
|
||||
import com.opensymphony.xwork2.ActionProxyFactory;
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
import com.opensymphony.xwork2.Result;
|
||||
import com.opensymphony.xwork2.config.Configuration;
|
||||
import com.opensymphony.xwork2.config.ConfigurationException;
|
||||
|
||||
@@ -123,7 +123,7 @@ import com.opensymphony.xwork2.ActionContext;
|
||||
* <li><b>actionPackages</b> - a comma-delimited list of Java packages to scan for Actions.</li>
|
||||
*
|
||||
* <li><b>configProviders</b> - a comma-delimited list of Java classes that implement the
|
||||
* {@link com.opensymphony.xwork2.config.ConfigurationProvider} interface that should be used for building the {@link com.opensymphony.xwork2.config.Configuration}.</li>
|
||||
* {@link ConfigurationProvider} interface that should be used for building the {@link Configuration}.</li>
|
||||
*
|
||||
* <li><b>*</b> - any other parameters are treated as framework constants.</li>
|
||||
*
|
||||
@@ -320,20 +320,20 @@ public class FilterDispatcher implements StrutsStatics, Filter {
|
||||
// prepare the request no matter what - this ensures that the proper character encoding
|
||||
// is used before invoking the mapper (see WW-9127)
|
||||
dispatcher.prepare(request, response);
|
||||
} else {
|
||||
|
||||
try {
|
||||
// Wrap request first, just in case it is multipart/form-data
|
||||
// parameters might not be accessible through before encoding (ww-1278)
|
||||
request = dispatcher.wrapRequest(request, getServletContext());
|
||||
} catch (IOException e) {
|
||||
String message = "Could not wrap servlet request with MultipartRequestWrapper!";
|
||||
LOG.error(message, e);
|
||||
throw new ServletException(message, e);
|
||||
}
|
||||
}
|
||||
else {
|
||||
dispatcher = du;
|
||||
}
|
||||
|
||||
try {
|
||||
// Wrap request first, just in case it is multipart/form-data
|
||||
// parameters might not be accessible through before encoding (ww-1278)
|
||||
request = dispatcher.wrapRequest(request, getServletContext());
|
||||
} catch (IOException e) {
|
||||
String message = "Could not wrap servlet request with MultipartRequestWrapper!";
|
||||
LOG.error(message, e);
|
||||
throw new ServletException(message, e);
|
||||
}
|
||||
|
||||
return request;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -536,7 +537,6 @@ public class FilterDispatcher implements StrutsStatics, Filter {
|
||||
while (-1 != (n = input.read(buffer))) {
|
||||
output.write(buffer, 0, n);
|
||||
}
|
||||
output.flush(); // WW-1526
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,277 +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.interceptor;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import com.opensymphony.xwork2.util.TextParseUtil;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: description -->
|
||||
*
|
||||
* The aim of this interceptor is to set values in the stack/action based on cookie name/value
|
||||
* of interest. <p/>
|
||||
*
|
||||
* If an asterik is present in cookiesName parameter, it will be assume that
|
||||
* all cookies name are to be injected into struts' action, even though
|
||||
* cookiesName is comma-separated by other values, eg (cookie1,*,cookie2). <p/>
|
||||
*
|
||||
* If cookiesName is left empty it will assume that no cookie will be injected
|
||||
* into Struts' action. <p/>
|
||||
*
|
||||
* If an asterik is present in cookiesValue parameter, it will assume that all
|
||||
* cookies name irrespective of its value will be injected into Struts' action so
|
||||
* long as the cookie name matches those specified in cookiesName parameter.<p/>
|
||||
*
|
||||
* If cookiesValue is left empty it will assume that all cookie that match the cookieName
|
||||
* parameter will be injected into Struts' action.<p/>
|
||||
*
|
||||
* The action could implements {@link CookiesAware} in order to have a {@link Map}
|
||||
* of filtered cookies set into it. <p/>
|
||||
*
|
||||
* <!-- END SNIPPET: description -->
|
||||
*
|
||||
*
|
||||
* <!-- START SNIPPET: parameters -->
|
||||
*
|
||||
* <ul>
|
||||
* <li>cookiesName (mandatory) - Name of cookies to be injected into the action. If more
|
||||
* than one cookie name is desired it could be comma-separated.
|
||||
* If all cookies name is desired, it could simply be *, an asterik.
|
||||
* When many cookies name are comma-separated either of the cookie
|
||||
* that match the name in the comma-separated list will be qualified.</li>
|
||||
* <li>cookiesValue (mandatory) - Value of cookies that if its name matches cookieName attribute
|
||||
* and its value matched this, will be injected into Struts'
|
||||
* action. If more than one cookie name is desired it could be
|
||||
* comma-separated. If left empty, it will assume any value would
|
||||
* be ok. If more than one value is specified (comma-separated)
|
||||
* it will assume a match if either value is matched.
|
||||
* </ul>
|
||||
*
|
||||
* <!-- END SNIPPET: parameters -->
|
||||
*
|
||||
*
|
||||
* <!-- START SNIPPET: extending -->
|
||||
*
|
||||
* <ul>
|
||||
* populateCookieValueIntoStack - this method will decide if this cookie value is qualified to be
|
||||
* populated into the value stack (hence into the action itself)
|
||||
* injectIntoCookiesAwareAction - this method will inject selected cookies (as a java.util.Map) into
|
||||
* action that implements {@link CookiesAware}.
|
||||
* </ul>
|
||||
*
|
||||
* <!-- END SNIPPET: extending -->
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
*
|
||||
* <!--
|
||||
* This example will inject cookies named either 'cookie1' or 'cookie2' whose
|
||||
* value could be either 'cookie1value' or 'cookie2value' into Struts' action.
|
||||
* -->
|
||||
* <action ... >
|
||||
* <interceptor-ref name="cookie">
|
||||
* <param name="cookiesName">cookie1, cookie2</param>
|
||||
* <param name="cookiesValue">cookie1value, cookie2value</param>
|
||||
* </interceptor-ref>
|
||||
* ....
|
||||
* </action>
|
||||
*
|
||||
*
|
||||
* <!--
|
||||
* This example will inject cookies named either 'cookie1' or 'cookie2'
|
||||
* regardless of their value into Struts' action.
|
||||
* -->
|
||||
* <action ... >
|
||||
* <interceptor-ref name="cookie">
|
||||
* <param name="cookiesName">cookie1, cookie2</param>
|
||||
* <param name="cookiesValue">*</param>
|
||||
* <interceptor-ref>
|
||||
* ...
|
||||
* </action>
|
||||
*
|
||||
*
|
||||
* <!--
|
||||
* This example will inject cookies named either 'cookie1' with value
|
||||
* 'cookie1value' or 'cookie2' with value 'cookie2value' into Struts'
|
||||
* action.
|
||||
* -->
|
||||
* <action ... >
|
||||
* <interceptor-ref name="cookie">
|
||||
* <param name="cookiesName">cookie1</param>
|
||||
* <param name="cookiesValue">cookie1value</param>
|
||||
* </interceptor-ref>
|
||||
* <interceptor-ref name="cookie">
|
||||
* <param name="cookiesName"<cookie2</param>
|
||||
* <param name="cookiesValue">cookie2value</param>
|
||||
* </interceptor-ref>
|
||||
* ....
|
||||
* </action>
|
||||
*
|
||||
* <!--
|
||||
* This example will inject any cookies regardless of its value into
|
||||
* Struts' action.
|
||||
* -->
|
||||
* <action ... >
|
||||
* <interceptor-ref name="cookie">
|
||||
* <param name="cookiesName">*</param>
|
||||
* <param name="cookiesValue">*</param>
|
||||
* </interceptor-ref>
|
||||
* ...
|
||||
* </action>
|
||||
*
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @see CookiesAware
|
||||
*/
|
||||
public class CookieInterceptor extends AbstractInterceptor {
|
||||
|
||||
private static final long serialVersionUID = 4153142432948747305L;
|
||||
|
||||
private static final Log LOG = LogFactory.getLog(CookieInterceptor.class);
|
||||
|
||||
private Set cookiesNameSet = Collections.EMPTY_SET;
|
||||
private Set cookiesValueSet = Collections.EMPTY_SET;
|
||||
|
||||
/**
|
||||
* Set the <code>cookiesName</code> which if matche will allow the cookie
|
||||
* to be injected into action, could be comma-separated string.
|
||||
*
|
||||
* @param cookiesName
|
||||
*/
|
||||
public void setCookiesName(String cookiesName) {
|
||||
if (cookiesName != null)
|
||||
this.cookiesNameSet = TextParseUtil.commaDelimitedStringToSet(cookiesName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the <code>cookiesValue</code> which if matched (together with matching
|
||||
* cookiesName) will caused the cookie to be injected into action, could be
|
||||
* comma-separated string.
|
||||
*
|
||||
* @param cookiesValue
|
||||
*/
|
||||
public void setCookiesValue(String cookiesValue) {
|
||||
if (cookiesValue != null)
|
||||
this.cookiesValueSet = TextParseUtil.commaDelimitedStringToSet(cookiesValue);
|
||||
}
|
||||
|
||||
|
||||
public String intercept(ActionInvocation invocation) throws Exception {
|
||||
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("start interception");
|
||||
|
||||
final ValueStack stack = ActionContext.getContext().getValueStack();
|
||||
HttpServletRequest request = ServletActionContext.getRequest();
|
||||
|
||||
// contains selected cookies
|
||||
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();
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
injectIntoCookiesAwareAction(invocation.getAction(), cookiesMap);
|
||||
|
||||
return invocation.invoke();
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook that populate cookie value into value stack (hence the action)
|
||||
* if the criteria is satisfied (if the cookie value matches with those configured).
|
||||
*
|
||||
* @param cookieName
|
||||
* @param cookieValue
|
||||
* @param cookiesMap
|
||||
* @param stack
|
||||
*/
|
||||
protected void populateCookieValueIntoStack(String cookieName, String cookieValue, Map cookiesMap, ValueStack stack) {
|
||||
if (cookiesValueSet.isEmpty() || cookiesValueSet.contains("*")) {
|
||||
// If the interceptor is configured to accept any cookie value
|
||||
// OR
|
||||
// no cookiesValue is defined, so as long as the cookie name match
|
||||
// we'll inject it into Struts' action
|
||||
if (LOG.isDebugEnabled()) {
|
||||
if (cookiesValueSet.isEmpty())
|
||||
LOG.debug("no cookie value is configured, cookie with name ["+cookieName+"] with value ["+cookieValue+"] will be injected");
|
||||
else if (cookiesValueSet.contains("*"))
|
||||
LOG.debug("interceptor is configured to accept any value, cookie with name ["+cookieName+"] with value ["+cookieValue+"] will be injected");
|
||||
}
|
||||
cookiesMap.put(cookieName, cookieValue);
|
||||
stack.setValue(cookieName, cookieValue);
|
||||
}
|
||||
else {
|
||||
// if cookiesValues is specified, the cookie's value must match before we
|
||||
// inject them into Struts' action
|
||||
if (cookiesValueSet.contains(cookieValue)) {
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("both configured cookie name and value matched, cookie ["+cookieName+"] with value ["+cookieValue+"] will be injected");
|
||||
cookiesMap.put(cookieName, cookieValue);
|
||||
stack.setValue(cookieName, cookieValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook that set the <code>cookiesMap</code> into action that implements
|
||||
* {@link CookiesAware}.
|
||||
*
|
||||
* @param action
|
||||
* @param cookiesMap
|
||||
*/
|
||||
protected void injectIntoCookiesAwareAction(Object action, Map cookiesMap) {
|
||||
if (action instanceof CookiesAware) {
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("action ["+action+"] implements CookiesAware, injecting cookies map ["+cookiesMap+"]");
|
||||
((CookiesAware)action).setCookiesMap(cookiesMap);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,27 +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.interceptor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface CookiesAware {
|
||||
void setCookiesMap(Map cookies);
|
||||
}
|
||||
@@ -202,30 +202,26 @@ public class ScopeInterceptor extends AbstractInterceptor implements PreResultLi
|
||||
super();
|
||||
}
|
||||
|
||||
// Since 2.0.7. Avoid null references on session serialization (WW-1803).
|
||||
private static class NULLClass implements Serializable {
|
||||
public String toString() {
|
||||
return "NULL";
|
||||
}
|
||||
public boolean equals(Object obj) {
|
||||
return obj == null || (obj instanceof NULLClass);
|
||||
}
|
||||
}
|
||||
|
||||
private static final Object NULL = new NULLClass();
|
||||
private static final Object NULL = new Serializable() {
|
||||
public String toString() {
|
||||
return "NULL";
|
||||
}
|
||||
};
|
||||
|
||||
private static final Object nullConvert(Object o) {
|
||||
if (o == null) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (o == NULL || NULL.equals(o)) {
|
||||
if (o == NULL) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
|
||||
private static Map locks = new IdentityHashMap();
|
||||
|
||||
static final void lock(Object o, ActionInvocation invocation) throws Exception {
|
||||
|
||||
@@ -23,7 +23,6 @@ package org.apache.struts2.interceptor;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.util.InvocationSessionStore;
|
||||
@@ -111,7 +110,6 @@ public class TokenSessionStoreInterceptor extends TokenInterceptor {
|
||||
ActionContext ac = invocation.getInvocationContext();
|
||||
|
||||
HttpServletRequest request = (HttpServletRequest) ac.get(ServletActionContext.HTTP_REQUEST);
|
||||
HttpServletResponse response = (HttpServletResponse) ac.get(ServletActionContext.HTTP_RESPONSE);
|
||||
String tokenName = TokenHelper.getTokenName();
|
||||
String token = TokenHelper.getToken(tokenName);
|
||||
|
||||
@@ -125,18 +123,12 @@ public class TokenSessionStoreInterceptor extends TokenInterceptor {
|
||||
if (savedInvocation != null) {
|
||||
// set the valuestack to the request scope
|
||||
ValueStack stack = savedInvocation.getStack();
|
||||
Map context = stack.getContext();
|
||||
request.setAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY, stack);
|
||||
|
||||
ActionContext savedContext = savedInvocation.getInvocationContext();
|
||||
savedContext.getContextMap().put(ServletActionContext.HTTP_REQUEST, request);
|
||||
savedContext.getContextMap().put(ServletActionContext.HTTP_RESPONSE, response);
|
||||
Result result = savedInvocation.getResult();
|
||||
|
||||
if ((result != null) && (savedInvocation.getProxy().getExecuteResult())) {
|
||||
synchronized (context) {
|
||||
result.execute(savedInvocation);
|
||||
}
|
||||
result.execute(savedInvocation);
|
||||
}
|
||||
|
||||
// turn off execution of this invocations result
|
||||
|
||||
@@ -80,7 +80,7 @@ public class ContainUtil {
|
||||
return true;
|
||||
}
|
||||
} else if (obj1 instanceof Collection) {
|
||||
if (((Collection) obj1).contains(obj2) || ((Collection) obj1).contains(obj2.toString())) {
|
||||
if (((Collection) obj1).contains(obj2)) {
|
||||
//log.debug("obj1 is a collection and contains obj2");
|
||||
return true;
|
||||
}
|
||||
@@ -94,9 +94,6 @@ public class ContainUtil {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else if (obj1.toString().equals(obj2.toString())) {
|
||||
//log.debug("obj1 is an object and it's String representation equals obj2's String representation.");
|
||||
return true;
|
||||
} else if (obj1.equals(obj2)) {
|
||||
//log.debug("obj1 is an object and equals obj2");
|
||||
return true;
|
||||
|
||||
@@ -115,7 +115,7 @@ public class StrutsModels {
|
||||
return comboBox;
|
||||
}
|
||||
|
||||
public AutocompleterModel getAutocompleter() {
|
||||
public AutocompleterModel getAutocompleterModel() {
|
||||
if (autocompleterModel == null) {
|
||||
autocompleterModel = new AutocompleterModel(stack, req, res);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -53,8 +53,6 @@ public class AutocompleterTag extends ComboBoxTag {
|
||||
protected String templateCssPath;
|
||||
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);
|
||||
@@ -83,8 +81,6 @@ public class AutocompleterTag extends ComboBoxTag {
|
||||
autocompleter.setTemplateCssPath(templateCssPath);
|
||||
autocompleter.setIconPath(iconPath);
|
||||
autocompleter.setKeyName(keyName);
|
||||
autocompleter.setDataFieldName(dataFieldName);
|
||||
autocompleter.setResultsLimit(resultsLimit);
|
||||
}
|
||||
|
||||
public void setAutoComplete(String autoComplete) {
|
||||
@@ -166,12 +162,4 @@ public class AutocompleterTag extends ComboBoxTag {
|
||||
public void setKeyName(String keyName) {
|
||||
this.keyName = keyName;
|
||||
}
|
||||
|
||||
public void setDataFieldName(String dataFieldName) {
|
||||
this.dataFieldName = dataFieldName;
|
||||
}
|
||||
|
||||
public void setResultsLimit(String resultsLimit) {
|
||||
this.resultsLimit = resultsLimit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,8 +38,7 @@ public class DivTag extends AbstractRemoteCallUITag {
|
||||
protected String startTimerListenTopics;
|
||||
protected String stopTimerListenTopics;
|
||||
protected String refreshOnShow;
|
||||
protected String separateScripts;
|
||||
|
||||
|
||||
public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new Div(stack, req, res);
|
||||
}
|
||||
@@ -54,7 +53,6 @@ public class DivTag extends AbstractRemoteCallUITag {
|
||||
div.setStartTimerListenTopics(startTimerListenTopics);
|
||||
div.setStopTimerListenTopics(stopTimerListenTopics);
|
||||
div.setRefreshOnShow(refreshOnShow);
|
||||
div.setSeparateScripts(separateScripts);
|
||||
}
|
||||
|
||||
public void setAutoStart(String autoStart) {
|
||||
@@ -80,8 +78,4 @@ public class DivTag extends AbstractRemoteCallUITag {
|
||||
public void setRefreshOnShow(String refreshOnShow) {
|
||||
this.refreshOnShow = refreshOnShow;
|
||||
}
|
||||
|
||||
public void setSeparateScripts(String separateScripts) {
|
||||
this.separateScripts = separateScripts;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,18 +159,18 @@ public class TextUtil {
|
||||
addMapping(0xa1, "¡", strings); //
|
||||
addMapping(0xa2, "¢", strings); //
|
||||
addMapping(0xa3, "£", strings); //
|
||||
addMapping(0xa9, "©", strings); //
|
||||
addMapping(0xae, "®", strings); //
|
||||
addMapping(0xa9, "©", strings); // �
|
||||
addMapping(0xae, "®", strings); // �
|
||||
addMapping(0xbf, "¿", strings); //
|
||||
|
||||
addMapping(0xc0, "À", strings); //
|
||||
addMapping(0xc1, "Á", strings); //
|
||||
addMapping(0xc2, "Â", strings); //
|
||||
addMapping(0xc3, "Ã", strings); //
|
||||
addMapping(0xc4, "Ä", strings); //
|
||||
addMapping(0xc5, "Å", strings); //
|
||||
addMapping(0xc6, "Æ", strings); //
|
||||
addMapping(0xc7, "Ç", strings); //
|
||||
addMapping(0xc0, "À", strings); // �
|
||||
addMapping(0xc1, "Á", strings); // �
|
||||
addMapping(0xc2, "Â", strings); // �
|
||||
addMapping(0xc3, "Ã", strings); // �
|
||||
addMapping(0xc4, "Ä", strings); // �
|
||||
addMapping(0xc5, "Å", strings); // �
|
||||
addMapping(0xc6, "Æ", strings); // �
|
||||
addMapping(0xc7, "Ç", strings); // �
|
||||
addMapping(0xc8, "È", strings); //
|
||||
addMapping(0xc9, "É", strings); //
|
||||
addMapping(0xca, "Ê", strings); //
|
||||
@@ -186,7 +186,7 @@ public class TextUtil {
|
||||
addMapping(0xd3, "Ó", strings); //
|
||||
addMapping(0xd4, "Ô", strings); //
|
||||
addMapping(0xd5, "Õ", strings); //
|
||||
addMapping(0xd6, "Ö", strings); //
|
||||
addMapping(0xd6, "Ö", strings); // �
|
||||
addMapping(0xd7, "×", strings); //
|
||||
addMapping(0xd8, "Ø", strings); //
|
||||
addMapping(0xd9, "Ù", strings); //
|
||||
@@ -201,8 +201,8 @@ public class TextUtil {
|
||||
addMapping(0xe1, "á", strings); //
|
||||
addMapping(0xe2, "â", strings); //
|
||||
addMapping(0xe3, "ã", strings); //
|
||||
addMapping(0xe4, "ä", strings); //
|
||||
addMapping(0xe5, "å", strings); //
|
||||
addMapping(0xe4, "ä", strings); // �
|
||||
addMapping(0xe5, "å", strings); // �
|
||||
addMapping(0xe6, "æ", strings); //
|
||||
addMapping(0xe7, "ç", strings); //
|
||||
addMapping(0xe8, "è", strings); //
|
||||
@@ -220,7 +220,7 @@ public class TextUtil {
|
||||
addMapping(0xf3, "ó", strings); //
|
||||
addMapping(0xf4, "ô", strings); //
|
||||
addMapping(0xf5, "õ", strings); //
|
||||
addMapping(0xf6, "ö", strings); //
|
||||
addMapping(0xf6, "ö", strings); // �
|
||||
addMapping(0xf7, "÷", strings); //
|
||||
addMapping(0xf8, "ø", strings); //
|
||||
addMapping(0xf9, "ù", strings); //
|
||||
|
||||
@@ -24,11 +24,9 @@ package org.apache.struts2.views.util;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -39,6 +37,7 @@ import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import com.opensymphony.xwork2.util.TextParseUtil;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
@@ -62,21 +61,21 @@ public class UrlHelper {
|
||||
private static final int DEFAULT_HTTPS_PORT = 443;
|
||||
|
||||
private static final String AMP = "&";
|
||||
|
||||
|
||||
private static int httpPort = DEFAULT_HTTP_PORT;
|
||||
private static int httpsPort = DEFAULT_HTTPS_PORT;
|
||||
private static String customEncoding;
|
||||
|
||||
|
||||
@Inject(StrutsConstants.STRUTS_URL_HTTP_PORT)
|
||||
public static void setHttpPort(String val) {
|
||||
httpPort = Integer.parseInt(val);
|
||||
}
|
||||
|
||||
|
||||
@Inject(StrutsConstants.STRUTS_URL_HTTPS_PORT)
|
||||
public static void setHttpsPort(String val) {
|
||||
httpsPort = Integer.parseInt(val);
|
||||
}
|
||||
|
||||
|
||||
@Inject(StrutsConstants.STRUTS_I18N_ENCODING)
|
||||
public static void setCustomEncoding(String val) {
|
||||
customEncoding = val;
|
||||
@@ -298,26 +297,7 @@ public class UrlHelper {
|
||||
}
|
||||
if (paramName != null) {
|
||||
String translatedParamValue = translateAndDecode(paramValue);
|
||||
|
||||
if(queryParams.containsKey(paramName)) {
|
||||
// WW-1619 append new param value to existing value(s)
|
||||
Object currentParam = queryParams.get(paramName);
|
||||
if(currentParam instanceof String) {
|
||||
queryParams.put(paramName, new String[] {
|
||||
(String) currentParam, translatedParamValue});
|
||||
} else {
|
||||
String currentParamValues[] = (String[]) currentParam;
|
||||
List paramList = new ArrayList(Arrays
|
||||
.asList(currentParamValues));
|
||||
paramList.add(translatedParamValue);
|
||||
String newParamValues[] = new String[paramList
|
||||
.size()];
|
||||
queryParams.put(paramName, paramList
|
||||
.toArray(newParamValues));
|
||||
}
|
||||
} else {
|
||||
queryParams.put(paramName, translatedParamValue);
|
||||
}
|
||||
queryParams.put(paramName, translatedParamValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
<script language="javascript">
|
||||
var baseUrl = "<@s.url value="/struts" includeParams="none"/>";
|
||||
window.open(baseUrl+"/webconsole.html", 'OGNL Console','width=500,height=450,'+
|
||||
'status=no,toolbar=no,menubar=no');
|
||||
|
||||
@@ -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};
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -21,15 +21,13 @@ struts.widget.ComboBoxDataProvider = function(/*Array*/ dataPairs, /*Number*/ li
|
||||
|
||||
this.formId = "";
|
||||
this.formFilter = "";
|
||||
this.firstRequest = true;
|
||||
|
||||
this.cbox = null;
|
||||
this.init = function(/*Widget*/ cbox, /*DomNode*/ node){
|
||||
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{
|
||||
@@ -61,57 +59,18 @@ struts.widget.ComboBoxDataProvider = function(/*Array*/ dataPairs, /*Number*/ li
|
||||
formNode: dojo.byId(this.formId),
|
||||
formFilter: window[this.formFilter],
|
||||
load: dojo.lang.hitch(this, function(type, data, evt) {
|
||||
//show indicator
|
||||
dojo.html.hide(this.cbox.indicator);
|
||||
//show indicator
|
||||
dojo.html.hide(this.cbox.indicator);
|
||||
|
||||
//if notifyTopics is published on the first request (onload)
|
||||
//the value of listeners will be reset
|
||||
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]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//try to find a match
|
||||
var tmpArrData = [];
|
||||
for(var key in data){
|
||||
//does it start with the field name? take it
|
||||
if(dojo.string.startsWith(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) {
|
||||
arrData = tmpArrData;
|
||||
}
|
||||
}
|
||||
|
||||
data = arrData;
|
||||
this.cbox.notify.apply(this.cbox, [data, type, evt]);
|
||||
if(!dojo.lang.isArray(data)){
|
||||
var arrData = [];
|
||||
for(var key in data){
|
||||
arrData.push([data[key], key]);
|
||||
}
|
||||
data = arrData;
|
||||
}
|
||||
this.setData(data);
|
||||
this.firstRequest = false;
|
||||
}),
|
||||
mimetype: "text/json"
|
||||
});
|
||||
@@ -208,13 +167,6 @@ struts.widget.ComboBoxDataProvider = function(/*Array*/ dataPairs, /*Number*/ li
|
||||
this.setData = function(/*Array*/ pdata){
|
||||
// populate this.data and initialize lookup structures
|
||||
this.data = pdata;
|
||||
//all ellements must be a key and value pair
|
||||
for(var i = 0; i < this.data.length; i++) {
|
||||
var element = this.data[i];
|
||||
if(!dojo.lang.isArray(element)) {
|
||||
this.data[i] = [element, element];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if(dataPairs){
|
||||
@@ -253,11 +205,8 @@ dojo.widget.defineWidget(
|
||||
//dojo has "stringstart" which is invalid
|
||||
searchType: "STARTSTRING",
|
||||
|
||||
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
|
||||
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
//If we use "TimePicker" for the name, Dojo get's confused and breaks
|
||||
//TODO remove this file on nect Dojo release
|
||||
|
||||
dojo.provide("struts.widget.StrutsTimePicker");
|
||||
|
||||
dojo.require("dojo.widget.DropdownTimePicker");
|
||||
|
||||
dojo.widget.defineWidget(
|
||||
"struts.widget.StrutsTimePicker",
|
||||
dojo.widget.DropdownTimePicker, {
|
||||
widgetType : "TimePicker",
|
||||
|
||||
inputName: "",
|
||||
name: "",
|
||||
|
||||
postCreate: function() {
|
||||
struts.widget.StrutsTimePicker.superclass.postCreate.apply(this, arguments);
|
||||
|
||||
if(this.value.toLowerCase() == "today") {
|
||||
this.value = dojo.date.toRfc3339(new Date());
|
||||
}
|
||||
|
||||
this.inputNode.name = this.name;
|
||||
this.valueNode.name = this.inputName;
|
||||
},
|
||||
|
||||
onSetTime: function() {
|
||||
struts.widget.StrutsTimePicker.superclass.onSetTime.apply(this, arguments);
|
||||
if(this.timePicker.selectedTime.anyTime){
|
||||
this.valueNode.value = "";
|
||||
} else {
|
||||
this.valueNode.value = dojo.date.toRfc3339(this.timePicker.time);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -3,6 +3,6 @@ dojo.kwCompoundRequire({
|
||||
"struts.widget.BindDiv",
|
||||
"struts.widget.BindAnchor",
|
||||
"struts.widget.ComboBox",
|
||||
"struts.widget.StrutsTimePicker"]
|
||||
"struts.widget.DatePicker"]
|
||||
});
|
||||
dojo.provide("struts.widget.*");
|
||||
|
||||
@@ -3,51 +3,49 @@
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
|
||||
<struts>
|
||||
<bean class="com.opensymphony.xwork2.ObjectFactory" name="xwork" />
|
||||
<bean type="com.opensymphony.xwork2.ObjectFactory" name="struts" class="org.apache.struts2.impl.StrutsObjectFactory" />
|
||||
|
||||
<bean type="com.opensymphony.xwork2.ActionProxyFactory" name="xwork" class="com.opensymphony.xwork2.DefaultActionProxyFactory"/>
|
||||
<bean type="com.opensymphony.xwork2.ActionProxyFactory" name="struts" class="org.apache.struts2.impl.StrutsActionProxyFactory"/>
|
||||
|
||||
<bean type="com.opensymphony.xwork2.util.ObjectTypeDeterminer" name="tiger" class="com.opensymphony.xwork2.util.GenericsObjectTypeDeterminer"/>
|
||||
<bean type="com.opensymphony.xwork2.util.ObjectTypeDeterminer" name="notiger" class="com.opensymphony.xwork2.util.DefaultObjectTypeDeterminer"/>
|
||||
<bean type="com.opensymphony.xwork2.util.ObjectTypeDeterminer" name="struts" class="com.opensymphony.xwork2.util.DefaultObjectTypeDeterminer"/>
|
||||
|
||||
<bean class="com.opensymphony.xwork2.ObjectFactory" name="xwork" />
|
||||
<bean type="com.opensymphony.xwork2.ObjectFactory" name="struts" class="org.apache.struts2.impl.StrutsObjectFactory" />
|
||||
|
||||
<bean type="com.opensymphony.xwork2.ActionProxyFactory" name="xwork" class="com.opensymphony.xwork2.DefaultActionProxyFactory"/>
|
||||
<bean type="com.opensymphony.xwork2.ActionProxyFactory" name="struts" class="org.apache.struts2.impl.StrutsActionProxyFactory"/>
|
||||
|
||||
<bean type="com.opensymphony.xwork2.util.ObjectTypeDeterminer" name="tiger" class="com.opensymphony.xwork2.util.GenericsObjectTypeDeterminer"/>
|
||||
<bean type="com.opensymphony.xwork2.util.ObjectTypeDeterminer" name="notiger" class="com.opensymphony.xwork2.util.DefaultObjectTypeDeterminer"/>
|
||||
<bean type="com.opensymphony.xwork2.util.ObjectTypeDeterminer" name="struts" class="com.opensymphony.xwork2.util.DefaultObjectTypeDeterminer"/>
|
||||
|
||||
<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="struts" class="org.apache.struts2.dispatcher.mapper.DefaultActionMapper" />
|
||||
<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="composite" class="org.apache.struts2.dispatcher.mapper.CompositeActionMapper" />
|
||||
<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="restful" class="org.apache.struts2.dispatcher.mapper.RestfulActionMapper" />
|
||||
<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="restful2" class="org.apache.struts2.dispatcher.mapper.Restful2ActionMapper" />
|
||||
|
||||
|
||||
<bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest" name="struts" class="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest" scope="default" optional="true"/>
|
||||
<bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest" name="jakarta" class="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest" scope="default" optional="true" />
|
||||
|
||||
|
||||
<bean type="org.apache.struts2.views.TagLibrary" name="s" class="org.apache.struts2.views.DefaultTagLibrary" />
|
||||
|
||||
|
||||
<bean class="org.apache.struts2.views.freemarker.FreemarkerManager" name="struts" optional="true"/>
|
||||
<bean class="org.apache.struts2.views.velocity.VelocityManager" name="struts" optional="true" />
|
||||
|
||||
|
||||
<bean class="org.apache.struts2.components.template.TemplateEngineManager" />
|
||||
<bean type="org.apache.struts2.components.template.TemplateEngine" name="ftl" class="org.apache.struts2.components.template.FreemarkerTemplateEngine" />
|
||||
<bean type="org.apache.struts2.components.template.TemplateEngine" name="vm" class="org.apache.struts2.components.template.VelocityTemplateEngine" />
|
||||
<bean type="org.apache.struts2.components.template.TemplateEngine" name="jsp" class="org.apache.struts2.components.template.JspTemplateEngine" />
|
||||
|
||||
<bean type="com.opensymphony.xwork2.util.XWorkConverter" name="xwork1" class="com.opensymphony.xwork2.util.XWorkConverter" />
|
||||
<bean type="com.opensymphony.xwork2.util.XWorkConverter" name="xwork1" class="com.opensymphony.xwork2.util.XWorkConverter" />
|
||||
<bean type="com.opensymphony.xwork2.util.XWorkConverter" name="struts" class="com.opensymphony.xwork2.util.AnnotationXWorkConverter" />
|
||||
<bean type="com.opensymphony.xwork2.TextProvider" name="xwork1" class="com.opensymphony.xwork2.TextProviderSupport" />
|
||||
<bean type="com.opensymphony.xwork2.TextProvider" name="struts" class="com.opensymphony.xwork2.TextProviderSupport" />
|
||||
|
||||
|
||||
<!-- Only have static injections -->
|
||||
<bean class="com.opensymphony.xwork2.ObjectFactory" static="true" />
|
||||
<bean class="com.opensymphony.xwork2.util.XWorkConverter" static="true" />
|
||||
<bean class="com.opensymphony.xwork2.util.OgnlValueStack" static="true" />
|
||||
<bean class="org.apache.struts2.dispatcher.Dispatcher" static="true" />
|
||||
<bean class="org.apache.struts2.components.Include" static="true" />
|
||||
<bean class="org.apache.struts2.dispatcher.FilterDispatcher" static="true" />
|
||||
<bean class="org.apache.struts2.views.util.ContextUtil" static="true" />
|
||||
<bean class="org.apache.struts2.views.util.UrlHelper" static="true" />
|
||||
|
||||
<bean class="com.opensymphony.xwork2.util.XWorkConverter" static="true" />
|
||||
<bean class="com.opensymphony.xwork2.ObjectFactory" static="true" />
|
||||
|
||||
<package name="struts-default">
|
||||
<result-types>
|
||||
<result-type name="chain" class="com.opensymphony.xwork2.ActionChainResult"/>
|
||||
@@ -55,53 +53,48 @@
|
||||
<result-type name="freemarker" class="org.apache.struts2.views.freemarker.FreemarkerResult"/>
|
||||
<result-type name="httpheader" class="org.apache.struts2.dispatcher.HttpHeaderResult"/>
|
||||
<result-type name="redirect" class="org.apache.struts2.dispatcher.ServletRedirectResult"/>
|
||||
<result-type name="redirectAction" class="org.apache.struts2.dispatcher.ServletActionRedirectResult"/>
|
||||
<result-type name="redirect-action" class="org.apache.struts2.dispatcher.ServletActionRedirectResult"/>
|
||||
<result-type name="stream" class="org.apache.struts2.dispatcher.StreamResult"/>
|
||||
<result-type name="velocity" class="org.apache.struts2.dispatcher.VelocityResult"/>
|
||||
<result-type name="xslt" class="org.apache.struts2.views.xslt.XSLTResult"/>
|
||||
<result-type name="plainText" class="org.apache.struts2.dispatcher.PlainTextResult" />
|
||||
<!-- Deprecated name form scheduled for removal in Struts 2.1.0. The camelCase versions are preferred. See ww-1707 -->
|
||||
<result-type name="redirect-action" class="org.apache.struts2.dispatcher.ServletActionRedirectResult"/>
|
||||
<result-type name="plaintext" class="org.apache.struts2.dispatcher.PlainTextResult" />
|
||||
</result-types>
|
||||
|
||||
|
||||
<interceptors>
|
||||
<interceptor name="alias" class="com.opensymphony.xwork2.interceptor.AliasInterceptor"/>
|
||||
<interceptor name="autowiring" class="com.opensymphony.xwork2.spring.interceptor.ActionAutowiringInterceptor"/>
|
||||
<interceptor name="chain" class="com.opensymphony.xwork2.interceptor.ChainingInterceptor"/>
|
||||
<interceptor name="conversionError" class="org.apache.struts2.interceptor.StrutsConversionErrorInterceptor"/>
|
||||
<interceptor name="cookie" class="org.apache.struts2.interceptor.CookieInterceptor"/>
|
||||
<interceptor name="createSession" class="org.apache.struts2.interceptor.CreateSessionInterceptor" />
|
||||
<interceptor name="debugging" class="org.apache.struts2.interceptor.debugging.DebuggingInterceptor" />
|
||||
<interceptor name="externalRef" class="com.opensymphony.xwork2.interceptor.ExternalReferencesInterceptor"/>
|
||||
<interceptor name="external-ref" class="com.opensymphony.xwork2.interceptor.ExternalReferencesInterceptor"/>
|
||||
<interceptor name="execAndWait" class="org.apache.struts2.interceptor.ExecuteAndWaitInterceptor"/>
|
||||
<interceptor name="exception" class="com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor"/>
|
||||
<interceptor name="fileUpload" class="org.apache.struts2.interceptor.FileUploadInterceptor"/>
|
||||
<interceptor name="i18n" class="com.opensymphony.xwork2.interceptor.I18nInterceptor"/>
|
||||
<interceptor name="logger" class="com.opensymphony.xwork2.interceptor.LoggingInterceptor"/>
|
||||
<interceptor name="modelDriven" class="com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor"/>
|
||||
<interceptor name="scopedModelDriven" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor"/>
|
||||
<interceptor name="model-driven" class="com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor"/>
|
||||
<interceptor name="scoped-model-driven" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor"/>
|
||||
<interceptor name="params" class="com.opensymphony.xwork2.interceptor.ParametersInterceptor"/>
|
||||
<interceptor name="prepare" class="com.opensymphony.xwork2.interceptor.PrepareInterceptor"/>
|
||||
<interceptor name="staticParams" class="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor"/>
|
||||
<interceptor name="static-params" class="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor"/>
|
||||
<interceptor name="scope" class="org.apache.struts2.interceptor.ScopeInterceptor"/>
|
||||
<interceptor name="servletConfig" class="org.apache.struts2.interceptor.ServletConfigInterceptor"/>
|
||||
<interceptor name="servlet-config" class="org.apache.struts2.interceptor.ServletConfigInterceptor"/>
|
||||
<interceptor name="sessionAutowiring" class="org.apache.struts2.spring.interceptor.SessionContextAutowiringInterceptor"/>
|
||||
<interceptor name="timer" class="com.opensymphony.xwork2.interceptor.TimerInterceptor"/>
|
||||
<interceptor name="token" class="org.apache.struts2.interceptor.TokenInterceptor"/>
|
||||
<interceptor name="tokenSession" class="org.apache.struts2.interceptor.TokenSessionStoreInterceptor"/>
|
||||
<interceptor name="token-session" class="org.apache.struts2.interceptor.TokenSessionStoreInterceptor"/>
|
||||
<interceptor name="validation" class="org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor"/>
|
||||
<interceptor name="workflow" class="com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor"/>
|
||||
<interceptor name="store" class="org.apache.struts2.interceptor.MessageStoreInterceptor" />
|
||||
<interceptor name="checkbox" class="org.apache.struts2.interceptor.CheckboxInterceptor" />
|
||||
<interceptor name="profiling" class="org.apache.struts2.interceptor.ProfilingActivationInterceptor" />
|
||||
<interceptor name="roles" class="org.apache.struts2.interceptor.RolesInterceptor" />
|
||||
|
||||
|
||||
<!-- Basic stack -->
|
||||
<interceptor-stack name="basicStack">
|
||||
<interceptor-ref name="exception"/>
|
||||
<interceptor-ref name="servletConfig"/>
|
||||
<interceptor-ref name="servlet-config"/>
|
||||
<interceptor-ref name="prepare"/>
|
||||
<interceptor-ref name="checkbox"/>
|
||||
<interceptor-ref name="params"/>
|
||||
@@ -123,7 +116,7 @@
|
||||
|
||||
<!-- Sample model-driven stack -->
|
||||
<interceptor-stack name="modelDrivenStack">
|
||||
<interceptor-ref name="modelDriven"/>
|
||||
<interceptor-ref name="model-driven"/>
|
||||
<interceptor-ref name="basicStack"/>
|
||||
</interceptor-stack>
|
||||
|
||||
@@ -155,14 +148,14 @@
|
||||
<interceptor-ref name="exception"/>
|
||||
<interceptor-ref name="alias"/>
|
||||
<interceptor-ref name="params"/>
|
||||
<interceptor-ref name="servletConfig"/>
|
||||
<interceptor-ref name="servlet-config"/>
|
||||
<interceptor-ref name="prepare"/>
|
||||
<interceptor-ref name="i18n"/>
|
||||
<interceptor-ref name="chain"/>
|
||||
<interceptor-ref name="modelDriven"/>
|
||||
<interceptor-ref name="model-driven"/>
|
||||
<interceptor-ref name="fileUpload"/>
|
||||
<interceptor-ref name="checkbox"/>
|
||||
<interceptor-ref name="staticParams"/>
|
||||
<interceptor-ref name="static-params"/>
|
||||
<interceptor-ref name="params"/>
|
||||
<interceptor-ref name="conversionError"/>
|
||||
<interceptor-ref name="validation">
|
||||
@@ -187,19 +180,19 @@
|
||||
<interceptor-stack name="defaultStack">
|
||||
<interceptor-ref name="exception"/>
|
||||
<interceptor-ref name="alias"/>
|
||||
<interceptor-ref name="servletConfig"/>
|
||||
<interceptor-ref name="servlet-config"/>
|
||||
<interceptor-ref name="prepare"/>
|
||||
<interceptor-ref name="i18n"/>
|
||||
<interceptor-ref name="chain"/>
|
||||
<interceptor-ref name="debugging"/>
|
||||
<interceptor-ref name="profiling"/>
|
||||
<interceptor-ref name="scopedModelDriven"/>
|
||||
<interceptor-ref name="modelDriven"/>
|
||||
<interceptor-ref name="scoped-model-driven"/>
|
||||
<interceptor-ref name="model-driven"/>
|
||||
<interceptor-ref name="fileUpload"/>
|
||||
<interceptor-ref name="checkbox"/>
|
||||
<interceptor-ref name="staticParams"/>
|
||||
<interceptor-ref name="static-params"/>
|
||||
<interceptor-ref name="params">
|
||||
<param name="excludeParams">dojo\..*</param>
|
||||
<param name="excludeParams">dojo\..*</param>
|
||||
</interceptor-ref>
|
||||
<interceptor-ref name="conversionError"/>
|
||||
<interceptor-ref name="validation">
|
||||
@@ -228,17 +221,9 @@
|
||||
<param name="excludeMethods">input,back,cancel</param>
|
||||
</interceptor-ref>
|
||||
</interceptor-stack>
|
||||
|
||||
<!-- Deprecated name forms scheduled for removal in Struts 2.1.0. The camelCase versions are preferred. See ww-1707 -->
|
||||
<interceptor name="external-ref" class="com.opensymphony.xwork2.interceptor.ExternalReferencesInterceptor"/>
|
||||
<interceptor name="model-driven" class="com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor"/>
|
||||
<interceptor name="static-params" class="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor"/>
|
||||
<interceptor name="scoped-model-driven" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor"/>
|
||||
<interceptor name="servlet-config" class="org.apache.struts2.interceptor.ServletConfigInterceptor"/>
|
||||
<interceptor name="token-session" class="org.apache.struts2.interceptor.TokenSessionStoreInterceptor"/>
|
||||
|
||||
|
||||
</interceptors>
|
||||
|
||||
|
||||
<default-interceptor-ref name="defaultStack"/>
|
||||
</package>
|
||||
|
||||
|
||||
@@ -86,12 +86,6 @@
|
||||
<#if parameters.templateCssPath?if_exists != "">
|
||||
templateCssPath="<@s.url value='${parameters.templateCssPath}' encode="false" includeParams='none'/>"
|
||||
</#if>
|
||||
<#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" />
|
||||
>
|
||||
|
||||
|
||||
@@ -17,9 +17,6 @@
|
||||
<#if parameters.refreshOnShow?exists>
|
||||
refreshOnShow="${parameters.refreshOnShow?string?html}"<#rt/>
|
||||
</#if>
|
||||
<#if parameters.separateScripts?exists>
|
||||
scriptSeparation="${parameters.separateScripts?string?html}"<#rt/>
|
||||
</#if>
|
||||
<#include "/${parameters.templateDir}/ajax/ajax-common.ftl" />
|
||||
<#include "/${parameters.templateDir}/simple/scripting-events.ftl" />
|
||||
>
|
||||
|
||||
@@ -9,6 +9,5 @@ dojo.require("struts.widget.Bind");
|
||||
dojo.require("struts.widget.BindDiv");
|
||||
dojo.require("struts.widget.BindAnchor");
|
||||
dojo.require("struts.widget.ComboBox");
|
||||
dojo.require("struts.widget.StrutsTimePicker")
|
||||
dojo.require("dojo.widget.Editor2");
|
||||
dojo.hostenv.writeIncludes(); // not needed, but allows the Venkman debugger to work with the includes
|
||||
|
||||
@@ -83,7 +83,7 @@ dojo.require("dojo.event.connect");
|
||||
Code that will add javascript needed for tooltips
|
||||
--><#t/>
|
||||
<#lt/><!-- javascript that is needed for tooltips -->
|
||||
<#lt/><script type="text/javascript">dojo.require("dojo.widget.Tooltip");dojo.require("dojo.fx.html");</script>
|
||||
<#lt/><script language="JavaScript" type="text/javascript">dojo.require("dojo.widget.html.Tooltip");dojo.require("dojo.fx.html");</script>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<#if parameters.validate?exists>
|
||||
<script type="text/javascript" src="${base}/struts/validationClient.js"></script>
|
||||
<script type="text/javascript" src="${base}/dwr/interface/validator.js"></script>
|
||||
<script type="text/javascript" src="${base}/dwr/engine.js"></script>
|
||||
<script type="text/javascript" src="${base}/struts/ajax/validation.js"></script>
|
||||
<script type="text/javascript" src="${base}/struts/${themeProperties.parent}/validation.js"></script>
|
||||
<script src="${base}/struts/validationClient.js"></script>
|
||||
<script src="${base}/dwr/interface/validator.js"></script>
|
||||
<script src="${base}/dwr/engine.js"></script>
|
||||
<script src="${base}/struts/ajax/validation.js"></script>
|
||||
<script src="${base}/struts/${themeProperties.parent}/validation.js"></script>
|
||||
</#if>
|
||||
<form<#rt/>
|
||||
<#if parameters.namespace?exists>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<#--include "/${parameters.templateDir}/xhtml/head.ftl" /-->
|
||||
<#include "/${parameters.templateDir}/${themeProperties.parent}/head.ftl" />
|
||||
<script type="text/javascript"
|
||||
<script language="JavaScript" type="text/javascript"
|
||||
src="<@s.url value='/struts/ajax/dojoRequire.js' includeParams='none' encode='false' />"></script>
|
||||
<script type="text/javascript"
|
||||
<script language="JavaScript" type="text/javascript"
|
||||
src="<@s.url value='/struts/CommonFunctions.js' includeParams='none' encode='false'/>"></script>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<script type="text/javascript">
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
<!--
|
||||
dojo.require("dojo.lang.*");
|
||||
dojo.require("dojo.widget.*");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
var tabpanelc_$!parameters.id = new TabContent( "$!parameters.id", $!parameters.remote );
|
||||
dojo.event.topic.subscribe( "$!parameters.subscribeTopicName", tabpanelc_$!parameters.id, "updateVisibility" );
|
||||
</script>
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<script type="text/javascript">
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
<!--
|
||||
function toggleDebug(debugId) {
|
||||
var debugDiv = document.getElementById(debugId);
|
||||
@@ -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,5 +1,5 @@
|
||||
<#if parameters.validate?default(false) == true>
|
||||
<script type="text/javascript" src="${base}/struts/css_xhtml/validation.js" type="text/javascript"></script>
|
||||
<script src="${base}/struts/css_xhtml/validation.js" type="text/javascript"></script>
|
||||
<#if parameters.onsubmit?exists>
|
||||
${tag.addParameter('onsubmit', "${parameters.onsubmit}; return validateForm_${parameters.id}();")}
|
||||
<#else>
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -1 +1 @@
|
||||
</a><#rt/>
|
||||
</a>
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
<a<#rt/>
|
||||
<#if parameters.id?if_exists != "">
|
||||
id="${parameters.id?html}"<#rt/>
|
||||
</#if>
|
||||
<#if parameters.href?if_exists != "">
|
||||
href="${parameters.href}"<#rt/>
|
||||
</#if>
|
||||
<a
|
||||
<#if parameters.id?if_exists != "">id="${parameters.id?html}"</#if>
|
||||
<#if parameters.href?if_exists != "">href="${parameters.href}"</#if>
|
||||
|
||||
<#if parameters.tabindex?exists>
|
||||
tabindex="${parameters.tabindex?html}"<#rt/>
|
||||
</#if>
|
||||
@@ -19,4 +16,4 @@
|
||||
</#if>
|
||||
<#include "/${parameters.templateDir}/simple/scripting-events.ftl" />
|
||||
<#include "/${parameters.templateDir}/simple/common-attributes.ftl" />
|
||||
><#rt/>
|
||||
>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<#if parameters.accesskey?exists>
|
||||
accesskey="${parameters.accesskey?html}"<#rt/>
|
||||
</#if>
|
||||
accesskey="${parameters.accesskey?html}"
|
||||
</#if>
|
||||
@@ -5,7 +5,7 @@
|
||||
<#if parameters.type?if_exists == "date">
|
||||
dojoType="dropdowndatepicker"<#rt/>
|
||||
<#else>
|
||||
dojoType="struts:StrutsTimePicker"<#rt/>
|
||||
dojoType="dropdowntimepicker"<#rt/>
|
||||
</#if>
|
||||
<#if parameters.id?if_exists != "">
|
||||
id="${parameters.id?html}"<#rt/>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<script type="text/javascript">
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
<!--
|
||||
function toggleDebug(debugId) {
|
||||
var debugDiv = document.getElementById(debugId);
|
||||
@@ -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/>
|
||||
|
||||
@@ -86,5 +86,5 @@ dojo.require("dojo.event.*");
|
||||
--><#t/>
|
||||
<#if (parameters.hasTooltip?default(false))><#t/>
|
||||
<#lt/><!-- javascript that is needed for tooltips -->
|
||||
<#lt/><script type="text/javascript">dojo.require("dojo.widget.Tooltip");dojo.require("dojo.fx.html");</script>
|
||||
<#lt/><script language="JavaScript" type="text/javascript">dojo.require("dojo.widget.html.Tooltip");dojo.require("dojo.fx.html");</script>
|
||||
</#if><#t/>
|
||||
|
||||
@@ -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/>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<script type="text/javascript">
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
// Dojo configuration
|
||||
djConfig = {
|
||||
baseRelativePath: "<@s.url includeParams='none' value='/struts/dojo' includeParams="none" encode='false'/>",
|
||||
@@ -7,7 +7,7 @@
|
||||
debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
<script language="JavaScript" type="text/javascript"
|
||||
src="<@s.url includeParams='none' value='/struts/dojo/dojo.js' includeParams="none" encode='false'/>"></script>
|
||||
<script type="text/javascript"
|
||||
<script language="JavaScript" type="text/javascript"
|
||||
src="<@s.url includeParams='none' value='/struts/simple/dojoRequire.js' includeParams="none" encode='false'/>"></script>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<#if !stack.findValue("#inputtransferselect_js_included")?exists><#t/>
|
||||
<script type="text/javascript" src="<@s.url value="/struts/inputtransferselect.js" encode='false' includeParams='none'/>"></script>
|
||||
<script language="javascript" src="<@s.url value="/struts/inputtransferselect.js" encode='false' includeParams='none'/>"></script>
|
||||
<#assign temporaryVariable = stack.setValue("#inputtransferselect_js_included", "true") /><#t/>
|
||||
</#if><#t/>
|
||||
<table border="0">
|
||||
<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}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<#if !stack.findValue("#optiontransferselect_js_included")?exists><#t/>
|
||||
<script type="text/javascript" src="<@s.url value="/struts/optiontransferselect.js" encode='false' includeParams='none'/>"></script>
|
||||
<script language="javascript" src="<@s.url value="/struts/optiontransferselect.js" encode='false' includeParams='none'/>"></script>
|
||||
<#assign temporaryVariable = stack.setValue("#optiontransferselect_js_included", "true") /><#t/>
|
||||
</#if><#t/>
|
||||
<table border="0">
|
||||
<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)>
|
||||
@@ -44,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}', '')" /><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/>
|
||||
@@ -53,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, '')" /><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/>
|
||||
@@ -66,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}', '')" /><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/>
|
||||
@@ -75,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, '')" /><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/>
|
||||
@@ -88,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}', '')" /><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/>
|
||||
@@ -97,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, '')" /><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/>
|
||||
@@ -110,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}', '')" /><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/>
|
||||
@@ -119,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, '')" /><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/>
|
||||
@@ -132,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}');" /><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/>
|
||||
@@ -141,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}'));" /><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/>
|
||||
@@ -150,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}');" /><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/>
|
||||
@@ -159,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}'));" /><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}"
|
||||
@@ -184,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}"
|
||||
|
||||
@@ -10,12 +10,8 @@
|
||||
<#else>
|
||||
<#assign itemValue = stack.findString('top')/>
|
||||
</#if>
|
||||
<input type="radio"<#rt/>
|
||||
<#if parameters.name?exists>
|
||||
name="${parameters.name?html}"<#rt/>
|
||||
</#if>
|
||||
id="${parameters.id?html}${itemKeyStr?html}"<#rt/>
|
||||
<#if tag.contains(parameters.nameValue, itemKeyStr)>
|
||||
<input type="radio" name="${parameters.name?html}" id="${parameters.id?html}${itemKeyStr?html}"<#rt/>
|
||||
<#if tag.contains(parameters.nameValue, itemKey)>
|
||||
checked="checked"<#rt/>
|
||||
</#if>
|
||||
<#if itemKey?exists>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
<#setting number_format="#.#####">
|
||||
<select<#rt/>
|
||||
name="${parameters.name?default("")?html}"<#rt/>
|
||||
<#if parameters.get("size")?exists>
|
||||
@@ -40,13 +39,13 @@
|
||||
</#if>
|
||||
<@s.iterator value="parameters.list">
|
||||
<#if parameters.listKey?exists>
|
||||
<#if stack.findValue(parameters.listKey)?exists>
|
||||
<#assign itemKey = stack.findValue(parameters.listKey)/>
|
||||
<#if stack.findString(parameters.listKey)?exists>
|
||||
<#assign itemKey = stack.findString(parameters.listKey).toString()/>
|
||||
<#else>
|
||||
<#assign itemKey = ''/>
|
||||
</#if>
|
||||
<#else>
|
||||
<#assign itemKey = stack.findValue('top')/>
|
||||
<#assign itemKey = stack.findValue('top').toString()/>
|
||||
</#if>
|
||||
<#if parameters.listValue?exists>
|
||||
<#if stack.findString(parameters.listValue)?exists>
|
||||
@@ -58,7 +57,7 @@
|
||||
<#assign itemValue = stack.findString('top')/>
|
||||
</#if>
|
||||
<option value="${itemKey?html}"<#rt/>
|
||||
<#if tag.contains(parameters.nameValue, itemKey) == true>
|
||||
<#if tag.contains(parameters.nameValue, itemKey) == true || (parameters.nameValue?exists && parameters.nameValue?string == itemKey)>
|
||||
selected="selected"<#rt/>
|
||||
</#if>
|
||||
>${itemValue?html}</option><#lt/>
|
||||
|
||||
@@ -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}"/>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user