mirror of
https://github.com/apache/struts.git
synced 2026-08-10 00:57:04 +00:00
Compare commits
91 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a614104a48 | |||
| 8bf687db8f | |||
| e57be3468a | |||
| a97043519c | |||
| fa2439b51c | |||
| c66b4ed34a | |||
| 621accb683 | |||
| 8f9b9df1f8 | |||
| 34d7c589ad | |||
| e72f299033 | |||
| 6265c55f3f | |||
| 5ea33eec93 | |||
| 8d6db00a11 | |||
| d30c2b02e2 | |||
| 2573b581c9 | |||
| 6fa2de7b14 | |||
| b721c64b5b | |||
| e563bd0e15 | |||
| 4286181668 | |||
| 236e897568 | |||
| 9f0b61b716 | |||
| 35ca3085a0 | |||
| f67d33a5d7 | |||
| 056ad9bdc0 | |||
| 7effcebbc4 | |||
| 20eada0259 | |||
| 53733757b4 | |||
| d568ae3b9b | |||
| 813659899c | |||
| cac4fcef2d | |||
| a95f9e4ccc | |||
| a7370c2f18 | |||
| 24b2a90fe8 | |||
| e22fb0f0fc | |||
| 7a398f6658 | |||
| 1d0102d83e | |||
| bf9abaa708 | |||
| ade8ee2974 | |||
| 39cd58cdae | |||
| d8c80fdcfe | |||
| 7928ea7792 | |||
| 8c9106addb | |||
| 4c92aff5d5 | |||
| 1002d5f2b2 | |||
| e4f2a73d1d | |||
| 5cef33a393 | |||
| 5478ca7558 | |||
| 532a03b9e0 | |||
| a7740aff49 | |||
| 149328321c | |||
| 2840e87cd2 | |||
| 32bc45dc42 | |||
| 65ca4e5780 | |||
| ed131f4f0e | |||
| 0cb5ae0ca1 | |||
| 6c63702c75 | |||
| 3204bffdd2 | |||
| d7dd9f4d66 | |||
| 57765bd9e0 | |||
| a34c6d37ca | |||
| 9b78008d68 | |||
| 62b4f23fe6 | |||
| 59c12d8477 | |||
| f979c8f0aa | |||
| 3167fd35e2 | |||
| 48dff9b7b4 | |||
| 6d1cf66ec7 | |||
| f3583fd38b | |||
| 3945930d11 | |||
| 89c6a27785 | |||
| aec83eae92 | |||
| 3fcfcad103 | |||
| 8fa10b63d8 | |||
| 4d304db99b | |||
| 5e3b8b0e3f | |||
| 2610fec870 | |||
| b758b9ff10 | |||
| fbcd87e5be | |||
| af34058f45 | |||
| 923f1cdde1 | |||
| 2db280d3be | |||
| 129530efc3 | |||
| c464a84845 | |||
| 22b4ce3deb | |||
| 8342d3e697 | |||
| 6b94787f9b | |||
| b35ac5150d | |||
| de072a889b | |||
| b4c0159f22 | |||
| 4c643130bf | |||
| ef999fe8fc |
-118
@@ -1,118 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.0.2</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-all</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Combined Struts 2 Jar</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>dependency-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>unjar-deps</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>unpack</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-core</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-api</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>
|
||||
struts2-config-browser-plugin
|
||||
</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>
|
||||
struts2-jasperreports-plugin
|
||||
</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>
|
||||
struts2-jfreechart-plugin
|
||||
</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>
|
||||
struts2-jsf-plugin
|
||||
</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>
|
||||
struts2-pell-multipart-plugin
|
||||
</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>
|
||||
struts2-plexus-plugin
|
||||
</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>
|
||||
struts2-sitegraph-plugin
|
||||
</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>
|
||||
struts2-sitemesh-plugin
|
||||
</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>
|
||||
struts2-struts1-plugin
|
||||
</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>
|
||||
struts2-tiles-plugin
|
||||
</artifactId>
|
||||
<version>${version}</version>
|
||||
</artifactItem>
|
||||
|
||||
</artifactItems>
|
||||
<outputDirectory>${project.build.directory}/classes</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.0.2</version>
|
||||
<version>2.0.3</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-api</artifactId>
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.0.2</version>
|
||||
<version>2.0.3</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-blank</artifactId>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.0.2</version>
|
||||
<version>2.0.3</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-mailreader</artifactId>
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
|
||||
<p>
|
||||
<i>
|
||||
This article is meant to introduce a new user to Apache Struts 2 by
|
||||
This article is meant to introduce a new user to Apache Struts 2 by
|
||||
"walking through" a simple, but functional, application.
|
||||
The article includes code snippets, but for the best result, you might
|
||||
want to install the MailReader application on your own development
|
||||
The article includes code snippets, but for the best result, you might
|
||||
want to install the MailReader application on your own development
|
||||
workstation and follow along.
|
||||
Of course, the full source code to the MailReader is included in the
|
||||
Of course, the full source code to the MailReader is included in the
|
||||
distribution.
|
||||
</i>
|
||||
</p>
|
||||
@@ -28,7 +28,7 @@
|
||||
<p>
|
||||
<i>
|
||||
The tour assumes the reader has a basic understanding of the Java
|
||||
language, JavaBeans, web applications, and JavaServer Pages. For
|
||||
language, JavaBeans, web applications, and JavaServer Pages. For
|
||||
background on these technologies, see the
|
||||
<a href="http://struts.apache.org/primer.html">
|
||||
Key Technologies Primer</a>.
|
||||
@@ -215,7 +215,7 @@
|
||||
<hr/>
|
||||
|
||||
<p>
|
||||
You might note taht the web.xml configuration does not specify which file extension
|
||||
You might note that the web.xml configuration does not specify which file extension
|
||||
to use with actions.
|
||||
The default extension for Struts 2 is ".action",
|
||||
but the extension can be changed in the struts.properties file.
|
||||
@@ -255,10 +255,10 @@
|
||||
<p>
|
||||
The actions are listed in one or more XML configuration files,
|
||||
the default configuration file being named "struts.xml".
|
||||
When the application loads, the struts.xml, and any other files
|
||||
it includes, are parsed, and the framework creates a set of
|
||||
configuration objects.
|
||||
Among other things, the configuration maps a request for a certain
|
||||
When the application loads, the struts.xml, and any other files
|
||||
it includes, are parsed, and the framework creates a set of
|
||||
configuration objects.
|
||||
Among other things, the configuration maps a request for a certain
|
||||
page to a certain action mapping.
|
||||
</p>
|
||||
|
||||
@@ -301,7 +301,7 @@
|
||||
<p>
|
||||
When the client requests "Welcome.do", the request is passed to the "struts2"
|
||||
FilterDispatcher (that we registered in the web.xml file).
|
||||
The FilterDispatcher retrieves the appropriate action mapping from the
|
||||
The FilterDispatcher retrieves the appropriate action mapping from the
|
||||
configuration.
|
||||
If we just wanted to forward to the Welcome page, we could use a simple
|
||||
configuration element.
|
||||
@@ -367,8 +367,8 @@
|
||||
<blockquote>
|
||||
<p>
|
||||
The Struts configuration lets us separate concerns and "say it once".
|
||||
The configuration helps us "normalize" an application,
|
||||
in much the same way we normalize a database schema.
|
||||
The configuration helps us "normalize" an application,
|
||||
in much the same way we normalize a database schema.
|
||||
</p>
|
||||
</blockquote>
|
||||
<hr/>
|
||||
@@ -429,7 +429,7 @@ public class Welcome extends MailreaderSupport {
|
||||
<hr/>
|
||||
|
||||
<p>
|
||||
Several common result names are predefined,
|
||||
Several common result names are predefined,
|
||||
including ERROR, SUCCESS, LOGIN, NONE, and INPUT,
|
||||
so that these tokens can be used consistently across Struts 2 applications.
|
||||
</p>
|
||||
@@ -541,7 +541,7 @@ public class Welcome extends MailreaderSupport {
|
||||
<hr/>
|
||||
|
||||
<p>
|
||||
If you change a message in the resource, and then rebuild and reload the
|
||||
If you change a message in the resource, and then rebuild and reload the
|
||||
application, the change will appear throughout the application.
|
||||
If you provide message resources for additional locales, you can
|
||||
localize your application.
|
||||
@@ -944,12 +944,12 @@ public class Welcome extends MailreaderSupport {
|
||||
<hr/>
|
||||
|
||||
<p>
|
||||
You may note that the DTD refers to "XWork".
|
||||
You may note that the DTD refers to "XWork".
|
||||
<a href="http://www.opensymphony.com/xwork/">
|
||||
Open Symphony XWork
|
||||
</a> is a generic command-pattern framework that can be used outside of a
|
||||
web environment. In practice, Struts 2 is a web-based extension of the
|
||||
XWork framework.
|
||||
</a> is a generic command-pattern framework that can be used outside of a
|
||||
web environment. Essentially, Struts 2 is a web-based extension of the
|
||||
XWork framework.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -959,7 +959,7 @@ public class Welcome extends MailreaderSupport {
|
||||
If the username is blank or absent, validation will fail and an error
|
||||
message is generated.
|
||||
The messages would be based on the "error.username.required" or
|
||||
"error.password.required" message templates, from the resource bundle.
|
||||
"error.password.required" message templates from the resource bundle.
|
||||
</p>
|
||||
|
||||
<!--
|
||||
@@ -1014,7 +1014,7 @@ public String <strong>execute()</strong> throws ExpiredPasswordException {
|
||||
|
||||
<p>
|
||||
Let's look at the relevant properties and methods from MailreaderSupport
|
||||
and another base class, <strong>ActionSupport</strong>, namely
|
||||
and another base class, <strong>ActionSupport</strong>, namely
|
||||
"getUsername", "getPassword", "findUser", "setUser", and "hasErrors".
|
||||
</p>
|
||||
|
||||
@@ -1101,7 +1101,7 @@ public void setPassword(String password) {
|
||||
When "findUser" returns,
|
||||
the Login Action looks to see if a valid (non-null) User object is returned.
|
||||
A valid User is passed to the <strong>User property</strong>.
|
||||
Although it is still a JavaBean property,
|
||||
Although it is still a JavaBean property,
|
||||
the User property is not implemented in quite the same way as Username and Password.
|
||||
</p>
|
||||
|
||||
@@ -1310,7 +1310,7 @@ public void <strong>setSession(Map value)</strong> {
|
||||
<p>
|
||||
Within the Login action element, the first result element is named "input".
|
||||
If validation or authentification fail,
|
||||
the Action class will return "input" and the framework will transfer control to the
|
||||
the Action class will return "input" and the framework will transfer control to the
|
||||
"Login.jsp" page.
|
||||
</p>
|
||||
|
||||
@@ -1473,7 +1473,7 @@ public class <strong>AuthenticationInterceptor</strong> implements Interceptor {
|
||||
<hr/>
|
||||
|
||||
<p>
|
||||
The <strong>user</strong> stacks require that the client be authenticated.
|
||||
The <strong>user</strong> stacks require that the client be authenticated.
|
||||
In other words, that a User object is present in the session.
|
||||
The actions using a <strong>guest</strong> stack can be accessed by any client.
|
||||
The <strong>-submit</strong> versions of each can be used with actions
|
||||
@@ -1483,7 +1483,7 @@ public class <strong>AuthenticationInterceptor</strong> implements Interceptor {
|
||||
<h5>Double Submits</h5>
|
||||
|
||||
<p>
|
||||
A common problem with designing web applications is that users are impatient
|
||||
A common problem with designing web applications is that users are impatient
|
||||
and response times can vary.
|
||||
Sometimes, people will press a submit button a second time.
|
||||
When this happens, the browser submits the request again,
|
||||
@@ -1518,11 +1518,11 @@ public class <strong>AuthenticationInterceptor</strong> implements Interceptor {
|
||||
|
||||
<p>
|
||||
Because the default interceptor stack will now authenticate the client,
|
||||
we need to specify the standard "defaultStack" for the three
|
||||
we need to specify the standard "defaultStack" for the three
|
||||
"guest actions", Welcome, Login, and Register.
|
||||
Requiring authentification by default is the better practice, since it
|
||||
means that we won't forget to enable it when creating new actions.
|
||||
Meanwhile, those pesky users will ensure that we don't forget to disable
|
||||
Requiring authentification by default is the better practice, since it
|
||||
means that we won't forget to enable it when creating new actions.
|
||||
Meanwhile, those pesky users will ensure that we don't forget to disable
|
||||
authentification for "guest" services.
|
||||
</p>
|
||||
|
||||
@@ -1654,7 +1654,7 @@ public class <strong>AuthenticationInterceptor</strong> implements Interceptor {
|
||||
The "test" tag is a convenient way to express presentation
|
||||
logic within your pages.
|
||||
Customized pages help to prevent user error,
|
||||
and dynamic customization reduces the number of server pages your
|
||||
and dynamic customization reduces the number of server pages your
|
||||
application needs to maintain, among other benefits.
|
||||
</font></p>
|
||||
</blockquote>
|
||||
@@ -1892,7 +1892,7 @@ public class <strong>AuthenticationInterceptor</strong> implements Interceptor {
|
||||
the value for the field is pushed onto the value stack.
|
||||
As a result, if the client enters text into an Integer field,
|
||||
the framework can still redisplay whatever was entered.
|
||||
An invalid input value is not stored in the field (even if it could be).
|
||||
An invalid input value is not stored in the field (even if it could be).
|
||||
The invalid input is pushed onto the stack for the scope of the request.
|
||||
</p>
|
||||
|
||||
@@ -2076,7 +2076,7 @@ public Subscription findSubscription(String host) {
|
||||
|
||||
<p>
|
||||
By keeping routine safety precautions out of the Action class,
|
||||
the all-important Actions becomes smaller and easier to maintain.
|
||||
the all-important Action becomes smaller and easier to maintain.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.0.2</version>
|
||||
<version>2.0.3</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
|
||||
+24
-5
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.0.2</version>
|
||||
<version>2.0.3</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-portlet</artifactId>
|
||||
@@ -25,14 +25,33 @@
|
||||
<version>1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-spring-plugin</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-portlet-plugin</artifactId>
|
||||
<artifactId>struts2-core</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>velocity</groupId>
|
||||
<artifactId>velocity</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>velocity-tools</groupId>
|
||||
<artifactId>velocity-tools</artifactId>
|
||||
<version>1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-digester</groupId>
|
||||
<artifactId>commons-digester</artifactId>
|
||||
<version>1.8</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4jFactory
|
||||
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategoryLog
|
||||
@@ -11,7 +11,7 @@
|
||||
<s:textfield name="tt2" label="Test Text2" />
|
||||
</s:form>
|
||||
</s:div>
|
||||
<s:div href="/view/ajaxData.action" id="ryh1" theme="ajax" label="remote one" />
|
||||
<s:div href="<s:url action="ajaxData"/>" id="ryh1" theme="ajax" label="remote one" />
|
||||
<s:div id="middle" label="middle" theme="ajax">
|
||||
middle tab<br/>
|
||||
<s:form >
|
||||
@@ -19,7 +19,7 @@
|
||||
<s:textfield name="tt2" label="Test Text442" />
|
||||
</s:form>
|
||||
</s:div>
|
||||
<s:div href="/view/ajaxData.action" id="ryh21" theme="ajax" label="remote right" />
|
||||
<s:div href="<s:url action="ajaxData"/>" id="ryh21" theme="ajax" label="remote right" />
|
||||
</s:tabbedPanel>
|
||||
|
||||
<p/>
|
||||
@@ -28,7 +28,7 @@ A DIV that waits for 5 seconds before loading the contents
|
||||
id="once"
|
||||
theme="ajax"
|
||||
cssStyle="border: 1px solid yellow;"
|
||||
href="/view/ajaxData.action"
|
||||
href="<s:url action="ajaxData"/>"
|
||||
delay="5000"
|
||||
loadingText="loading...">
|
||||
Waiting for data</s:div>
|
||||
@@ -37,10 +37,10 @@ A DIV that is updated every 2 seconds
|
||||
<s:div
|
||||
id="twoseconds"
|
||||
cssStyle="border: 1px solid yellow;"
|
||||
href="/view/ajaxData.action"
|
||||
href="<s:url action="ajaxData"/>"
|
||||
theme="ajax"
|
||||
delay="2000"
|
||||
updateInterval="2000"
|
||||
updateFreq="2000"
|
||||
errorText="There was an error"
|
||||
loadingText="loading...">Initial Content
|
||||
</s:div>
|
||||
|
||||
@@ -1 +1,4 @@
|
||||
Hello World from velocity!
|
||||
<p />
|
||||
#surl ("id=url" "action=index")
|
||||
<a href="${url}">Back to the front page</a>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.0.2</version>
|
||||
<version>2.0.3</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-showcase</artifactId>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
struts.date.format=yyyy/MM/dd hh:mm:ss
|
||||
+60
@@ -23,6 +23,7 @@ package org.apache.struts2.showcase;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
@@ -42,6 +43,11 @@ public class LotsOfOptiontransferselectAction extends ActionSupport {
|
||||
private List _favouriteCountriesKeys;
|
||||
private List _notFavouriteCountriesKeys;
|
||||
|
||||
private List _favouriteSportsKeys;
|
||||
private List _nonFavouriteSportsKeys;
|
||||
|
||||
private List _favouriteCities;
|
||||
|
||||
private List _prioritisedFavouriteCartoonCharacters;
|
||||
private List _prioritisedFavouriteCars;
|
||||
private List _prioritisedFavouriteCountries;
|
||||
@@ -188,6 +194,37 @@ public class LotsOfOptiontransferselectAction extends ActionSupport {
|
||||
_notFavouriteCountriesKeys = notFavouriteCountries;
|
||||
}
|
||||
|
||||
// Sports
|
||||
public Map getDefaultNonFavoriteSports() {
|
||||
Map m = new LinkedHashMap();
|
||||
m.put("basketball", "Basketball");
|
||||
m.put("football", "Football");
|
||||
m.put("baseball", "Baseball");
|
||||
return m;
|
||||
}
|
||||
|
||||
public Map getDefaultFavoriteSports() {
|
||||
return new LinkedHashMap();
|
||||
}
|
||||
|
||||
public List getFavouriteSports() {
|
||||
return _favouriteSportsKeys;
|
||||
}
|
||||
|
||||
public void setFavouriteSports(List favouriteSportsKeys) {
|
||||
this._favouriteSportsKeys = favouriteSportsKeys;
|
||||
}
|
||||
|
||||
public List getNonFavouriteSports() {
|
||||
return _nonFavouriteSportsKeys;
|
||||
}
|
||||
|
||||
public void setNonFavouriteSports(List notFavouriteSportsKeys) {
|
||||
this._nonFavouriteSportsKeys = notFavouriteSportsKeys;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public List getPrioritisedFavouriteCartoonCharacters() {
|
||||
return _prioritisedFavouriteCartoonCharacters;
|
||||
@@ -213,6 +250,29 @@ public class LotsOfOptiontransferselectAction extends ActionSupport {
|
||||
|
||||
|
||||
|
||||
public Map getAvailableCities() {
|
||||
Map map = new LinkedHashMap();
|
||||
map.put("boston", "Boston");
|
||||
map.put("new york", "New York");
|
||||
map.put("london", "London");
|
||||
map.put("rome", "Rome");
|
||||
return map;
|
||||
}
|
||||
|
||||
public List getDefaultFavouriteCities() {
|
||||
List list = new ArrayList();
|
||||
list.add("boston");
|
||||
list.add("rome");
|
||||
return list;
|
||||
}
|
||||
|
||||
public List getFavouriteCities() {
|
||||
return _favouriteCities;
|
||||
}
|
||||
|
||||
public void setFavouriteCities(List favouriteCities) {
|
||||
this._favouriteCities = favouriteCities;
|
||||
}
|
||||
|
||||
// actions
|
||||
|
||||
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
<field name="description1">
|
||||
<field-validator type="requiredstring">
|
||||
<message>Description1 Is Required !!!</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="description2">
|
||||
<field-validator type="requiredstring">
|
||||
<message>Description2 Is Required !!!</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="description3">
|
||||
<field-validator type="requiredstring">
|
||||
<message>Description3 Is Required !!!</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="description4">
|
||||
<field-validator type="requiredstring">
|
||||
<message>Description4 Is Required !!!</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.showcase;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class MoreSelectsAction extends ActionSupport {
|
||||
|
||||
|
||||
private List _prioritisedFavouriteCartoonCharacters;
|
||||
private List _prioritisedFavouriteCars;
|
||||
private List _prioritisedFavouriteCountries;
|
||||
private List favouriteNumbers;
|
||||
|
||||
|
||||
// Cartoon Characters
|
||||
public Map getDefaultFavouriteCartoonCharacters() {
|
||||
Map m = new LinkedHashMap();
|
||||
m.put("heMan", "He-Man");
|
||||
m.put("popeye", "Popeye");
|
||||
m.put("mockeyMouse", "Mickey Mouse");
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
// Cars
|
||||
public Map getDefaultFavouriteCars() {
|
||||
Map m = new LinkedHashMap();
|
||||
m.put("alfaRomeo", "Alfa Romeo");
|
||||
m.put("Toyota", "Toyota");
|
||||
m.put("Mitsubitshi", "Mitsubitshi");
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Countries
|
||||
public Map getDefaultFavouriteCountries() {
|
||||
Map m = new LinkedHashMap();
|
||||
m.put("england", "England");
|
||||
m.put("america", "America");
|
||||
m.put("brazil", "Brazil");
|
||||
return m;
|
||||
}
|
||||
|
||||
public List getDefaultFavouriteNumbers() {
|
||||
List list = new ArrayList();
|
||||
list.add("Three");
|
||||
list.add("Seven");
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List getPrioritisedFavouriteCartoonCharacters() {
|
||||
return _prioritisedFavouriteCartoonCharacters;
|
||||
}
|
||||
public void setPrioritisedFavouriteCartoonCharacters(List prioritisedFavouriteCartoonCharacters) {
|
||||
_prioritisedFavouriteCartoonCharacters = prioritisedFavouriteCartoonCharacters;
|
||||
}
|
||||
|
||||
public List getPrioritisedFavouriteCars() {
|
||||
return _prioritisedFavouriteCars;
|
||||
}
|
||||
public void setPrioritisedFavouriteCars(List prioritisedFavouriteCars) {
|
||||
_prioritisedFavouriteCars = prioritisedFavouriteCars;
|
||||
}
|
||||
|
||||
|
||||
public List getPrioritisedFavouriteCountries() {
|
||||
return _prioritisedFavouriteCountries;
|
||||
}
|
||||
public void setPrioritisedFavouriteCountries(List prioritisedFavouriteCountries) {
|
||||
_prioritisedFavouriteCountries = prioritisedFavouriteCountries;
|
||||
}
|
||||
|
||||
public List getFavouriteNumbers() {
|
||||
return favouriteNumbers;
|
||||
}
|
||||
|
||||
public void setFavouriteNumbers(List favouriteNumbers) {
|
||||
this.favouriteNumbers = favouriteNumbers;
|
||||
}
|
||||
|
||||
public Map getAvailableCities() {
|
||||
Map map = new LinkedHashMap();
|
||||
map.put("boston", "Boston");
|
||||
map.put("new york", "New York");
|
||||
map.put("london", "London");
|
||||
map.put("rome", "Rome");
|
||||
return map;
|
||||
}
|
||||
|
||||
public List getDefaultFavouriteCities() {
|
||||
List list = new ArrayList();
|
||||
list.add("boston");
|
||||
list.add("rome");
|
||||
return list;
|
||||
}
|
||||
|
||||
// actions
|
||||
|
||||
public String input() throws Exception {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
public String submit() throws Exception {
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
-1
@@ -1 +0,0 @@
|
||||
Element_friends = java.lang.String
|
||||
-1
@@ -1 +0,0 @@
|
||||
Element_selectedSkills=java.lang.String
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.dtd">
|
||||
<validators>
|
||||
<!-- Field-Validator Syntax -->
|
||||
<field name="currentEmployee.empId">
|
||||
<field-validator type="required">
|
||||
<message key="employee.id.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="currentEmployee.lastName">
|
||||
<field-validator type="requiredstring">
|
||||
<param name="trim">true</param>
|
||||
<message key="employee.lastName.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="currentEmployee.birthDate">
|
||||
<field-validator type="required">
|
||||
<message key="employee.birthDate.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
employee=Employee
|
||||
employee.firstName=First Name
|
||||
employee.lastName=Last Name
|
||||
employee.description=Description
|
||||
|
||||
employee.id.required=Id is required
|
||||
employee.lastName.required=Last Name is required
|
||||
employee.birthDate.required=Birthdate is required
|
||||
employee.backtolist=Back to Employee List
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
employee=Mitarbeiter
|
||||
employee.firstName=Vorname
|
||||
employee.lastName=Nachname
|
||||
employee.description=Beschreibung
|
||||
|
||||
employee.id.required=ID muß angegeben werden
|
||||
employee.lastName.required=Nachname wird benötigt
|
||||
employee.birthDate.required=Geburtsdatum wird benötigt
|
||||
employee.backtolist=Zurück zur Mitarbeiterliste
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.dtd">
|
||||
<validators>
|
||||
<!-- Field-Validator Syntax -->
|
||||
<field name="currentSkill.name">
|
||||
<field-validator type="requiredstring">
|
||||
<param name="trim">true</param>
|
||||
<message key="skill.name.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
@@ -1,6 +0,0 @@
|
||||
skill=Skill
|
||||
skill.name=Name
|
||||
skill.description=Description
|
||||
|
||||
skill.name.required=Name is required
|
||||
skill.backtolist=Back to Skill List
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
skill=Kenntnis
|
||||
skill.name=Name
|
||||
skill.description=Beschreibung
|
||||
|
||||
skill.name.required=Name muss angegeben werden
|
||||
skill.backtolist=Zurück zur Kenntnis Liste
|
||||
-1
@@ -1 +0,0 @@
|
||||
Element_persons=org.apache.struts2.showcase.conversion.Person
|
||||
+10
-5
@@ -27,15 +27,20 @@ import org.apache.struts2.ServletActionContext;
|
||||
import com.opensymphony.xwork2.Action;
|
||||
|
||||
/**
|
||||
* Action to demonstrate how to use file download.
|
||||
* <p/>
|
||||
* This action is used to download a jpeg file from the image folder.
|
||||
* Demonstrates file resource download.
|
||||
* Set filePath to the local file resource to download,
|
||||
* relative to the application root ("/images/struts.gif").
|
||||
*
|
||||
*/
|
||||
public class FileDownloadAction implements Action {
|
||||
|
||||
public InputStream getImageStream() throws Exception {
|
||||
return ServletActionContext.getServletContext().getResourceAsStream("/images/struts.gif");
|
||||
private String inputPath;
|
||||
public void setInputPath(String value) {
|
||||
inputPath = value;
|
||||
}
|
||||
|
||||
public InputStream getInputStream() throws Exception {
|
||||
return ServletActionContext.getServletContext().getResourceAsStream(inputPath);
|
||||
}
|
||||
|
||||
public String execute() throws Exception {
|
||||
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
<field name="value">
|
||||
<field-validator type="requiredstring">
|
||||
<param name="trim">true</param>
|
||||
<message>Value must not be empty</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
|
||||
<field name="count">
|
||||
<field-validator type="int">
|
||||
<message>Count must be an integer</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
|
||||
|
||||
-1
@@ -1 +0,0 @@
|
||||
dateValidatorField=java.util.Date
|
||||
-74
@@ -1,74 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//OpenSymphony Group//XWork Validator 1.0//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<!-- START SNIPPET: fieldValidatorsExample -->
|
||||
|
||||
<validators>
|
||||
<field name="requiredValidatorField">
|
||||
<field-validator type="required">
|
||||
<message><![CDATA[ required ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="requiredStringValidatorField">
|
||||
<field-validator type="requiredstring">
|
||||
<param name="trim">true</param>
|
||||
<message key="i18n.nothing.here"><![CDATA[ required and must be string ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="requiredStringValidatorField">
|
||||
<field-validator type="requiredstring">
|
||||
<param name="trim">true</param>
|
||||
<message key="i18n.requiredstring"><![CDATA[ required and must be string ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="integerValidatorField">
|
||||
<field-validator type="int">
|
||||
<param name="min">1</param>
|
||||
<param name="max">10</param>
|
||||
<message><![CDATA[ must be integer min 1 max 10 if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="dateValidatorField">
|
||||
<field-validator type="date">
|
||||
<param name="min">01/01/1990</param>
|
||||
<param name="max">01/01/2000</param>
|
||||
<message><![CDATA[ must be a min 01-01-1990 max 01-01-2000 if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="emailValidatorField">
|
||||
<field-validator type="email">
|
||||
<message><![CDATA[ must be a valid email if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="urlValidatorField">
|
||||
<field-validator type="url">
|
||||
<message><![CDATA[ must be a valid url if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="stringLengthValidatorField">
|
||||
<field-validator type="stringlength">
|
||||
<param name="maxLength">4</param>
|
||||
<param name="minLength">2</param>
|
||||
<param name="trim">true</param>
|
||||
<message><![CDATA[ must be a String of a specific greater than 1 less than 5 if specified ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="regexValidatorField">
|
||||
<field-validator type="regex">
|
||||
<param name="expression">.*\.txt</param>
|
||||
<message><![CDATA[ regexValidatorField must match a regexp (.*\.txt) if specified ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="fieldExpressionValidatorField">
|
||||
<field-validator type="fieldexpression">
|
||||
<param name="expression">(fieldExpressionValidatorField == requiredValidatorField)</param>
|
||||
<message><![CDATA[ must be the same as the Required Validator Field if specified ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
|
||||
<!-- END SNIPPET: fieldValidatorsExample -->
|
||||
|
||||
-68
@@ -1,68 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//OpenSymphony Group//XWork Validator 1.0//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<!-- START SNIPPET: fieldValidatorsExample -->
|
||||
|
||||
<validators>
|
||||
<field name="requiredValidatorField">
|
||||
<field-validator type="required">
|
||||
<message><![CDATA[ required ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="requiredStringValidatorField">
|
||||
<field-validator type="requiredstring">
|
||||
<param name="trim">true</param>
|
||||
<message><![CDATA[ required and must be string ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="integerValidatorField">
|
||||
<field-validator type="int">
|
||||
<param name="min">1</param>
|
||||
<param name="max">10</param>
|
||||
<message><![CDATA[ must be integer min 1 max 10 if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="dateValidatorField">
|
||||
<field-validator type="date">
|
||||
<param name="min">01/01/1990</param>
|
||||
<param name="max">01/01/2000</param>
|
||||
<message><![CDATA[ must be a min 01-01-1990 max 01-01-2000 if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="emailValidatorField">
|
||||
<field-validator type="email">
|
||||
<message><![CDATA[ must be a valid email if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="urlValidatorField">
|
||||
<field-validator type="url">
|
||||
<message><![CDATA[ must be a valid url if supplied ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="stringLengthValidatorField">
|
||||
<field-validator type="stringlength">
|
||||
<param name="maxLength">4</param>
|
||||
<param name="minLength">2</param>
|
||||
<param name="trim">true</param>
|
||||
<message><![CDATA[ must be a String of a specific greater than 1 less than 5 if specified ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="regexValidatorField">
|
||||
<field-validator type="regex">
|
||||
<param name="expression">.*\.txt</param>
|
||||
<message><![CDATA[ regexValidatorField must match a regexp (.*\.txt) if specified ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="fieldExpressionValidatorField">
|
||||
<field-validator type="fieldexpression">
|
||||
<param name="expression">(fieldExpressionValidatorField == requiredValidatorField)</param>
|
||||
<message><![CDATA[ must be the same as the Required Validator Field if specified ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
|
||||
<!-- END SNIPPET: fieldValidatorsExample -->
|
||||
|
||||
-1
@@ -1 +0,0 @@
|
||||
i18n.requiredstring=Test String for required Strings...
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//OpenSymphony Group//XWork Validator 1.0//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
|
||||
<!-- START SNIPPET: nonFieldValidatorsExample -->
|
||||
|
||||
<validators>
|
||||
<validator type="expression">
|
||||
<param name="expression"><![CDATA[ ( (someText == someTextRetype) && (someTextRetype == someTextRetypeAgain) ) ]]></param>
|
||||
<message><![CDATA[ all three text must be exactly the same ]]></message>
|
||||
</validator>
|
||||
</validators>
|
||||
|
||||
<!-- END SNIPPET: nonFieldValidatorsExample -->
|
||||
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<!-- START SNIPPET: quizValidators -->
|
||||
<!--
|
||||
Add the following DOCTYPE declaration as first line of your XXX-validation.xml file:
|
||||
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
-->
|
||||
<validators>
|
||||
<field name="name">
|
||||
<field-validator type="requiredstring">
|
||||
<message>You must enter a name</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="age">
|
||||
<field-validator type="int">
|
||||
<param name="min">13</param>
|
||||
<param name="max">19</param>
|
||||
<message>Only people ages 13 to 19 may take this quiz</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
|
||||
<!-- END SNIPPET: quizValidators -->
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//OpenSymphony Group//XWork Validator 1.0//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
<field name="name">
|
||||
<field-validator type="requiredstring">
|
||||
<message>Name Required</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="age">
|
||||
<field-validator type="int">
|
||||
<param name="min">1</param>
|
||||
<param name="max">100</param>
|
||||
<message>Age Required (1-100)</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="birthday">
|
||||
<field-validator type="date">
|
||||
<message>Birthday Required</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
|
||||
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//OpenSymphony Group//XWork Validator 1.0//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<!-- START SNIPPET: visitorValidatorsExample -->
|
||||
|
||||
<validators>
|
||||
<field name="user">
|
||||
<field-validator type="visitor">
|
||||
<param name="context">userContext</param>
|
||||
<param name="appendPrefix">true</param>
|
||||
<message>User:</message>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
|
||||
<!-- END SNIPPET: visitorValidatorExample -->
|
||||
|
||||
@@ -10,15 +10,24 @@
|
||||
<default-action-ref name="download"/>
|
||||
|
||||
<action name="download" class="org.apache.struts2.showcase.filedownload.FileDownloadAction">
|
||||
<param name="inputPath">\images\struts.gif</param>
|
||||
<result name="success" type="stream">
|
||||
<param name="contentType">image/jpeg</param>
|
||||
<param name="inputName">imageStream</param>
|
||||
<param name="contentDisposition">filename="logo.png"</param>
|
||||
<param name="contentType">image/gif</param>
|
||||
<param name="inputName">inputStream</param>
|
||||
<param name="contentDisposition">filename="struts.gif"</param>
|
||||
<param name="bufferSize">4096</param>
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="download2" class="org.apache.struts2.showcase.filedownload.FileDownloadAction">
|
||||
<param name="inputPath">\images\struts-gif.zip</param>
|
||||
<result name="success" type="stream">
|
||||
<param name="contentType">application/zip</param>
|
||||
<param name="inputName">inputStream</param>
|
||||
<param name="contentDisposition">filename="struts-gif.zip"</param>
|
||||
<param name="bufferSize">4096</param>
|
||||
</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
</struts>
|
||||
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
<result type="velocity">exampleSubmited.vm</result>
|
||||
<result name="input" type="velocity">example.vm</result>
|
||||
</action>
|
||||
|
||||
<action name="lotsOfOptiontransferselect" class="org.apache.struts2.showcase.LotsOfOptiontransferselectAction" method="input">
|
||||
<result>lotsOfOptiontransferselect.jsp</result>
|
||||
</action>
|
||||
@@ -29,7 +30,15 @@
|
||||
<result name="input">lotsOfOptiontransferselect.jsp</result>
|
||||
<result>lotsOfOptiontransferselectSubmit.jsp</result>
|
||||
</action>
|
||||
|
||||
|
||||
<action name="moreSelects" class="org.apache.struts2.showcase.MoreSelectsAction" method="input">
|
||||
<result>moreSelects.jsp</result>
|
||||
</action>
|
||||
<action name="moreSelectsSubmit" class="org.apache.struts2.showcase.MoreSelectsAction" method="submit">
|
||||
<result name="input">moreSelects.jsp</result>
|
||||
<result>moreSelectsSubmit.jsp</result>
|
||||
</action>
|
||||
|
||||
<!-- START SNIPPET: treeExampleDynamicXWorkXml -->
|
||||
|
||||
<action name="showDynamicTreeAction" class="org.apache.struts2.showcase.ShowDynamicTreeAction">
|
||||
|
||||
@@ -77,24 +77,25 @@
|
||||
<div class="wrapper">
|
||||
<h2 class="accessibility">Navigation</h2>
|
||||
<ul class="clearfix">
|
||||
<li><a href="<s:url value="/showcase.jsp"/>">Home</a></li>
|
||||
<li><a href="<s:url value="/ajax/index.jsp"/>">AJAX</a></li>
|
||||
<li><a href="<s:url action="actionChain1!input" namespace="/actionchaining" includeParams="none" />">Action Chaining</a></li>
|
||||
<li><a href="<s:url action="index" namespace="/config-browser" includeParams="none" />">Config Browser</a></li>
|
||||
<li><a href="<s:url value="/conversion/index.jsp"/>">Conversion</a></li>
|
||||
<li><a href="<s:url value="/empmanager/index.jsp"/>">CRUD</a></li>
|
||||
<li><a href="<s:url value="/wait/index.jsp"/>">Execute & Wait</a></li>
|
||||
<li><a href="<s:url value="/filedownload/index.jsp"/>">File Download</a></li>
|
||||
<li><a href="<s:url value="/fileupload" />">File Upload</a></li>
|
||||
<li><a href="<s:url value="/freemarker/index.jsp"/>">Freemarker</a>
|
||||
<li><a href="<s:url action="hangmanMenu" namespace="/hangman"/>">Hangman</a></li>
|
||||
<li><a href="<s:url value="/jsf/index.jsp"/>">JavaServer Faces</a></li>
|
||||
<li><a href="<s:url value="/person/index.jsp"/>">Person Manager</a></li>
|
||||
<li><a href="<s:url value="/tags/index.jsp"/>">Tags</a></li>
|
||||
<li><a href="<s:url value="/tiles/index.action" />">Tiles</a></li>
|
||||
<li><a href="<s:url value="/token/index.jsp"/>">Token</a></li>
|
||||
<li><a href="<s:url value="/validation/index.jsp"/>">Validation</a></li>
|
||||
<li class="last"><a href="<s:url value="/help.jsp"/>">Help</a></li>
|
||||
<li><a href="<s:url value="/showcase.jsp"/>">Home</a></li>
|
||||
<li><a href="<s:url value="/ajax/index.jsp"/>">Ajax</a></li>
|
||||
<li><a href="<s:url value="/chat/index.jsp"/>">Ajax Chat</a></li>
|
||||
<li><a href="<s:url action="actionChain1!input" namespace="/actionchaining" includeParams="none" />">Action Chaining</a></li>
|
||||
<li><a href="<s:url action="index" namespace="/config-browser" includeParams="none" />">Config Browser</a></li>
|
||||
<li><a href="<s:url value="/conversion/index.jsp"/>">Conversion</a></li>
|
||||
<li><a href="<s:url value="/empmanager/index.jsp"/>">CRUD</a></li>
|
||||
<li><a href="<s:url value="/wait/index.jsp"/>">Execute & Wait</a></li>
|
||||
<li><a href="<s:url value="/filedownload/index.jsp"/>">File Download</a></li>
|
||||
<li><a href="<s:url value="/fileupload" />">File Upload</a></li>
|
||||
<li><a href="<s:url value="/freemarker/index.jsp"/>">Freemarker</a>
|
||||
<li><a href="<s:url action="hangmanMenu" namespace="/hangman"/>">Hangman</a></li>
|
||||
<li><a href="<s:url value="/jsf/index.jsp"/>">JavaServer Faces</a></li>
|
||||
<li><a href="<s:url value="/person/index.jsp"/>">Person Manager</a></li>
|
||||
<li><a href="<s:url value="/tags/index.jsp"/>">Tags</a></li>
|
||||
<li><a href="<s:url value="/tiles/index.action" />">Tiles</a></li>
|
||||
<li><a href="<s:url value="/token/index.jsp"/>">Token</a></li>
|
||||
<li><a href="<s:url value="/validation/index.jsp"/>">Validation</a></li>
|
||||
<li class="last"><a href="<s:url value="/help.jsp"/>">Help</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Ajax Examples</title>
|
||||
|
||||
<!--// START SNIPPET: common-include-->
|
||||
<jsp:include page="/ajax/commonInclude.jsp"/>
|
||||
<!--// END SNIPPET: common-include-->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
This should have the month label all on one line (problem in IE) appears fine in FF though.
|
||||
<s:paneldatepicker id="foo" language="en-us" displayWeeks="1" staticDisplay="true"/>
|
||||
|
||||
<p>A calendar in your locale, or the closest thing to it we currently provide</p>
|
||||
<s:datepicker id="test" cssStyle="border:1px solid red;padding:1px;"/>
|
||||
|
||||
<p>Same as above, but Friday is the first day of the week. WOOHOO! value="today"</p>
|
||||
<s:datepicker value="today" weekStartsOn="5"/>
|
||||
|
||||
<p>Same as first, but with only 3 weeks displayed</p>
|
||||
<s:datepicker displayWeeks="3"/>
|
||||
|
||||
<p>Same as first, but with adjustWeeks="true"</p>
|
||||
<s:datepicker adjustWeeks="true"/>
|
||||
|
||||
<p>Same as first, with startDate of 10 September 2006</p>
|
||||
<s:datepicker startDate="2006-09-10"/>
|
||||
|
||||
<p>Same as first, with endDate of 10 September 2006</p>
|
||||
<s:datepicker endDate="2006-09-10"/>
|
||||
|
||||
<p>Same as first, with startDate of 1 January 2006 and endDate of 31 December 2006</p>
|
||||
|
||||
<s:datepicker startDate="2006-01-01" endDate="2006-12-31"/>
|
||||
|
||||
<p>Same as first, with startDate of 10 September 2006 and endDate of 24 September 2006 (note how the controls<br/>
|
||||
are disabled). This is considered a static display, because the range of startDate and endDate is less than the displayWeeks.</p>
|
||||
|
||||
<s:datepicker startDate="2006-09-10" endDate="2006-09-24"/>
|
||||
|
||||
<p>Same as first, with startDate of 23 September 2006 and endDate of 10 October 2006 (note where the calendar<br/>
|
||||
display starts since the range overlaps the end of a month and the beginning of a month and how the controls are disabled).<br/>
|
||||
This is considered a static display, because the range of startDate and endDate is less than the displayWeeks.</p>
|
||||
|
||||
<s:datepicker startDate="2006-09-23" endDate="2006-10-10"/>
|
||||
|
||||
<p>Same as first with staticDisplay=true and an initial of value="2005-12-25" (Sunday, December 25, 2005)</p>
|
||||
<s:datepicker staticDisplay="true" value="2005-12-25"/>
|
||||
|
||||
<p>now on to the locale stuff...</p>
|
||||
|
||||
<p>en-us locale</p>
|
||||
<s:datepicker language="en-us" />
|
||||
<p>nl-nl locale</p>
|
||||
<s:datepicker language="nl-nl" />
|
||||
|
||||
<s:include value="../footer.jsp"/>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,39 +0,0 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Ajax Examples</title>
|
||||
|
||||
<!--// START SNIPPET: common-include-->
|
||||
<jsp:include page="/ajax/commonInclude.jsp"/>
|
||||
<!--// END SNIPPET: common-include-->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>toggleTye="wipe":</p>
|
||||
<s:dropdowndatetimepicker value="2006-10-31" toggleType="wipe" toggleDuration="300" name="test"/>
|
||||
<p>toggleTye="explode":</p>
|
||||
<s:dropdowndatetimepicker value="2006-07-22" toggleType="explode" toggleDuration="500"/>
|
||||
<p>toggleTye="fade":</p>
|
||||
<s:dropdowndatetimepicker value="2006-06-30" toggleType="fade" toggleDuration="500"/>
|
||||
<p>With value="today"</p>
|
||||
<s:dropdowndatetimepicker name="dddp1" value="today" />
|
||||
<p>US format, empty</p>
|
||||
<s:dropdowndatetimepicker name="dddp2" language="en-us" />
|
||||
<p>US format with initial date of 2006-06-26</p>
|
||||
<s:dropdowndatetimepicker name="dddp3" value="2006-06-26" language="en-us" />
|
||||
<p>With initial date of 1969-04-25 and a custom format dd/MM/yyyy</p>
|
||||
<s:dropdowndatetimepicker name="dddp5" value="1969-04-25" displayFormat="dd/MM/yyyy" />
|
||||
<p>In German:</p>
|
||||
<s:dropdowndatetimepicker name="dddp7" value="2006-06-28" language="de" />
|
||||
<p>In Dutch:</p>
|
||||
<s:dropdowndatetimepicker name="dddp8" value="2006-06-28" language="nl" />
|
||||
<p>US format with initial date of 2006-06-26 and long formatting (parse not supported)</p>
|
||||
<s:dropdowndatetimepicker name="dddp12" value="2006-06-26" formatLength="long" language="en-us" />
|
||||
<p>German format with initial date of 2006-06-26 and long formatting (parse not supported)</p>
|
||||
<s:dropdowndatetimepicker name="dddp13" value="2006-06-26" formatLength="long" language="de" />
|
||||
<br/>
|
||||
<s:include value="../footer.jsp"/>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,45 +0,0 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Ajax Examples</title>
|
||||
|
||||
<!--// START SNIPPET: common-include-->
|
||||
<jsp:include page="/ajax/commonInclude.jsp"/>
|
||||
<!--// END SNIPPET: common-include-->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
toggleTye="wipe":
|
||||
<s:dropdowndatetimepicker type="time" value="10:30" toggleType="wipe" toggleDuration="300"/>
|
||||
<br/>
|
||||
|
||||
toggleTye="explode":
|
||||
<s:dropdowndatetimepicker type="time" value="13:00" toggleType="explode" toggleDuration="500"/>
|
||||
<br/>
|
||||
|
||||
toggleTye="fade":
|
||||
<s:dropdowndatetimepicker type="time" value="13:00" toggleType="fade" toggleDuration="500"/>
|
||||
<br/>
|
||||
|
||||
With value="today":
|
||||
<s:dropdowndatetimepicker type="time" name="dddp1" value="today" />
|
||||
<br/>
|
||||
|
||||
US format, empty
|
||||
<s:dropdowndatetimepicker type="time" name="dddp2" language="en-us" />
|
||||
<br/>
|
||||
|
||||
In German:
|
||||
<s:dropdowndatetimepicker type="time" name="dddp7" language="de" />
|
||||
<br/>
|
||||
|
||||
In Dutch:
|
||||
<s:dropdowndatetimepicker type="time" name="dddp8" language="nl" />
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<s:include value="../footer.jsp"/>
|
||||
</body>
|
||||
</html>
|
||||
@@ -5,21 +5,19 @@
|
||||
|
||||
<h1>AJAX Example</h1>
|
||||
|
||||
Note: these examples have only been tested under FireFox 1.5 and IE 6.
|
||||
<p>
|
||||
Note: The Ajax tags are experimental. These examples have only been tested under FireFox 1.5 and IE 6.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="remotediv">Remote div tag</a></li>
|
||||
<li><a href="autocompleter">Autocompleter combobox tag</a></li>
|
||||
<li><a href="remotebutton">Remote button tag</a></li>
|
||||
<li><a href="remotediv">Remote div tag</a></li>
|
||||
<li><a href="remotelink">Remote link tag</a></li>
|
||||
<li><a href="remotebutton">Remote button tag</a></li>
|
||||
<li><a href="tabbedpanel">Tabbed panel</a></li>
|
||||
<li><a href="datepicker">DatePicker</a></li>
|
||||
<li><a href="dropdowndatepicker">Dropdown DatePicker</a></li>
|
||||
<li><a href="timepicker">TimePicker</a></li>
|
||||
<li><a href="dropdowntimepicker">Dropdown TimePicker</a></li>
|
||||
<li><a href="remoteforms">Remote forms</a></li>
|
||||
<li><a href="widgets">Widgets </a> (experimental - may not work in all browsers
|
||||
<li><a href="widgets">Widgets </a> (may not work in all browsers!)
|
||||
see the <a href="http://www.dojotoolkit.org">dojo website</a> for more information</li>
|
||||
<li>(broken) <a href="remoteforms">Remote forms</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
<br/><br/>
|
||||
|
||||
<input type=button value="refresh" onclick="controller.refresh()">
|
||||
<input type=button value="start timer" onclick="controller.start()">
|
||||
<input type=button value="stop timer" onclick="controller.stop()">
|
||||
<input type=button value="start timer" onclick="controller.start()">
|
||||
|
||||
<s:url id="ajaxTest" value="/AjaxTest.action" />
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Ajax Examples</title>
|
||||
<jsp:include page="/ajax/commonInclude.jsp"/>
|
||||
<s:head theme="ajax"/>
|
||||
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
function doSomething() {
|
||||
@@ -59,7 +59,7 @@ Remote form evaluating suplied JS on completion:<br/>
|
||||
|
||||
<input type='text' name='data' value='Struts User'>
|
||||
|
||||
<s:submit value="GO4" theme="ajax" afterLoading="alert('form submitted');"/>
|
||||
<s:submit value="GO4" theme="ajax"/>
|
||||
|
||||
</s:form>
|
||||
|
||||
@@ -73,7 +73,7 @@ Remote form replacing the forms content after confirming results:<br/>
|
||||
|
||||
<input type='text' name='data' value='Struts User'>
|
||||
|
||||
<s:submit value="GO3" theme="ajax" targets="theForm5" beforeLoading="confirm('sure?');"/>
|
||||
<s:submit value="GO3" theme="ajax" targets="theForm5" />
|
||||
|
||||
</s:form>
|
||||
|
||||
@@ -87,7 +87,7 @@ Remote form replacing the forms content after running a function:<br/>
|
||||
|
||||
<input type='text' name='data' value='Struts User'>
|
||||
|
||||
<s:submit value="GO3" theme="ajax" targets="theForm6" beforeLoading="doSomething();"/>
|
||||
<s:submit value="GO3" theme="ajax" targets="theForm6" />
|
||||
|
||||
</s:form>
|
||||
|
||||
@@ -105,7 +105,5 @@ A form with no remote submit (so should not be ajaxified):<br/>
|
||||
|
||||
</s:form>
|
||||
|
||||
<s:include value="../footer.jsp"/>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
<p>
|
||||
<ol>
|
||||
<li><a href="example2.jsp">A local tabbed panel width fixed size (doLayout="true")</a></li>
|
||||
<li><a href="example3.jsp">A remote(href != "") and local tabbed panel</a></li>
|
||||
<li><a href="example3.jsp">A remote (href != "") and local tabbed panel</a></li>
|
||||
<li><a href="example1.jsp">Various remote and local tabbed panels (with enclosed tabbed pannels) with layout (doLayout="false")</a></li>
|
||||
<li><a href="example4.jsp">A local tabbed panel width fixed size (doLayout="true") with close button on tabs(closeButton="tab"), and tabs on the right (labelposition="righ")</a></li>
|
||||
<li><a href="example5.jsp">A local tabbed panel width fixed size (doLayout="true") with close button on the tab pane(closeButton="pane"), and tabs on the bottom (labelposition="bottom")</a></li>
|
||||
<li><a href="example4.jsp">A local tabbed panel width fixed size (doLayout="true") with close button on tabs(closeButton="tab"), and tabs on the right (labelposition="right")</a></li>
|
||||
<li><a href="example5.jsp">A local tabbed panel width fixed size (doLayout="true") with close button on the tab pane (closeButton="pane"), and tabs on the bottom (labelposition="bottom")</a></li>
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>TimePicker tag</title>
|
||||
<%@ include file="/ajax/commonInclude.jsp" %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h2>Examples</h2>
|
||||
|
||||
Normal English-US timepicker:
|
||||
<s:timepicker language="en-us"/>
|
||||
|
||||
<br>
|
||||
Set time to current time (useDefaultTime="true")
|
||||
<s:timepicker id="tp0" useDefaultTime="true"/>
|
||||
|
||||
<br>
|
||||
Set minutes to current time (useDefaultTime="true" and useDefaultMinutes="true")
|
||||
<s:timepicker id="tp1" useDefaultTime="true" useDefaultMinutes="true"/>
|
||||
|
||||
<br>
|
||||
Set time to 9:43(value="9:43")
|
||||
<s:timepicker id="tp2" value="9:43"/>
|
||||
|
||||
<br>
|
||||
Set time to 1:00PM(value="13:00")
|
||||
<s:timepicker id="tp3" value="13:00"/>
|
||||
|
||||
<br>
|
||||
<s:include value="../footer.jsp"/>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -23,7 +23,7 @@
|
||||
<s:textfield label="Employee Id" name="currentEmployee.empId"/>
|
||||
<s:textfield label="%{getText('employee.firstName')}" name="currentEmployee.firstName"/>
|
||||
<s:textfield label="%{getText('employee.lastName')}" name="currentEmployee.lastName"/>
|
||||
<s:datepicker label="Birthdate" name="currentEmployee.birthDate"/>
|
||||
<s:datetimepicker label="Birthdate" name="currentEmployee.birthDate"/>
|
||||
<s:textfield label="Salary" name="currentEmployee.salary"/>
|
||||
<s:checkbox fieldValue="true" label="Married" name="currentEmployee.married"/>
|
||||
<s:combobox list="availablePositions" label="Position" name="currentEmployee.position"/>
|
||||
|
||||
@@ -1,13 +1,22 @@
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Showcase</title>
|
||||
<title>Showcase - Fileupload</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>File Download Example</h1>
|
||||
|
||||
Click this <s:url id="url" action="download"/><s:a href="%{url}">link</s:a> to download Struts logo.
|
||||
<ul>
|
||||
<li>
|
||||
<s:url id="url" action="download"/><s:a href="%{url}">Download image file.</s:a>
|
||||
The browser should display the Struts logo.
|
||||
</li>
|
||||
<li>
|
||||
<s:url id="url" action="download2"/><s:a href="%{url}">Download ZIP file.</s:a>
|
||||
The browser should prompt for a location to save the ZIP file.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
</head>
|
||||
<body>
|
||||
<ul>
|
||||
<li>
|
||||
<@s.url id="url" action="hangmanAjax" namespace="/hangman" />
|
||||
<@s.a href="%{#url}">Hangman (Ajax)</@s.a>
|
||||
</li>
|
||||
<li>
|
||||
<@s.url id="url" action="hangmanNonAjax" namespace="/hangman" />
|
||||
<@s.a href="%{#url}">Hangman (Non Ajax)</@s.a>
|
||||
</li>
|
||||
<li>
|
||||
<@s.url id="url" action="hangmanAjax" namespace="/hangman" />
|
||||
<@s.a href="%{#url}">Hangman (Ajax - Experimental)</@s.a>
|
||||
</li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Binary file not shown.
@@ -12,33 +12,36 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>
|
||||
The Struts Showcase demonstrates a variety of use cases and tag usages.
|
||||
Essentially, the application exercises various framework features in isolation.
|
||||
<em>The Showcase is <strong>not</strong> meant as a "best practices" example.</em>
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
For more "by example" solutions,
|
||||
see the <a href="http://struts.apache.org/2.x/docs/cookbook.html">Struts Cookbook</a> pages.
|
||||
</li>
|
||||
<li>
|
||||
For a "best practices" example, see the
|
||||
<a href="http://planetstruts.org/struts2-mailreader/">MailReader application</a> Tour and source code.
|
||||
</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>
|
||||
The Struts Showcase demonstrates a variety of use cases and tag usages.
|
||||
Essentially, the application exercises various framework features in isolation.
|
||||
<em>The Showcase is <strong>not</strong> meant as a "best practices" example.</em>
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
For more "by example" solutions,
|
||||
see the <a href="http://struts.apache.org/2.x/docs/cookbook.html">Struts Cookbook</a> pages.
|
||||
</li>
|
||||
<li>
|
||||
For a "best practices" example, see the
|
||||
<a href="http://planetstruts.org/struts2-mailreader/">MailReader application</a> Tour and source code.
|
||||
</li>
|
||||
</ul>
|
||||
</blockquote>
|
||||
<p>
|
||||
<%-- THIS LIST IS MAINTAINED IN WEB-INF/decorators/main.jsp TO CREATE THE MENU BAR -- EDIT THERE AND COPY HERE --%>
|
||||
<ul>
|
||||
<li><a href="<s:url value="/showcase.jsp"/>">Home</a></li>
|
||||
<li><a href="<s:url value="/ajax/index.jsp"/>">AJAX</a></li>
|
||||
<li><a href="<s:url value="/showcase.jsp"/>">Home</a></li>
|
||||
<li><a href="<s:url value="/ajax/index.jsp" />">Ajax Theme for Struts Tags</a></li>
|
||||
<li><a href="<s:url value="/chat/index.jsp"/>">Ajax Chat</a>
|
||||
<li><a href="<s:url action="actionChain1!input" namespace="/actionchaining" includeParams="none" />">Action Chaining</a></li>
|
||||
<li><a href="<s:url action="index" namespace="/config-browser" includeParams="none" />">Config Browser</a></li>
|
||||
<li><a href="<s:url value="/conversion/index.jsp"/>">Conversion</a></li>
|
||||
<li><a href="<s:url value="/empmanager/index.jsp"/>">CRUD</a></li>
|
||||
<li><a href="<s:url value="/wait/index.jsp"/>">Execute & Wait</a></li>
|
||||
<li><a href="<s:url value="/filedownload/index.jsp"/>">File Download</a></li>
|
||||
<li><a href="<s:url value="/fileupload" />">File Upload</a></li>
|
||||
<li><a href="<s:url value="/fileupload/index.jsp" />">File Upload</a></li>
|
||||
<li><a href="<s:url value="/freemarker/index.jsp"/>">Freemarker</a>
|
||||
<li><a href="<s:url action="hangmanMenu" namespace="/hangman"/>">Hangman</a></li>
|
||||
<li><a href="<s:url value="/jsf/index.jsp"/>">JavaServer Faces</a></li>
|
||||
@@ -55,26 +58,7 @@
|
||||
These examples are under development and may not be fully operational.
|
||||
</p>
|
||||
<ul>
|
||||
<li>AJAX / Remote Forms</li>
|
||||
<li><a href="<s:url value="/chat/index.jsp"/>">Chat (AJAX)</a>
|
||||
<li><a href="<s:url action="guess" namespace="/continuations" />">Continuations</a></li>
|
||||
<li>Conversion<ul>
|
||||
<li>Address</li>
|
||||
<li>Java 5 Enum</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Tabs / Non-UI Tags<ul>
|
||||
<li>
|
||||
Action Prefix / Redirect Action
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
<li>Tags / UI Tags<ul>
|
||||
<li>UI Example</li>
|
||||
<li>UI Example (Velocity)</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</p>
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>UI Tags Example</title>
|
||||
<s:head />
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<s:datetimepicker label="toggleType='wipe'" value="2006-10-31" toggleType="wipe" toggleDuration="300" name="test"/>
|
||||
<s:datetimepicker label="toggleType='explode'" value="2006-07-22" toggleType="explode" toggleDuration="500"/>
|
||||
<s:datetimepicker label="toggleType='fade'" value="2006-06-30" toggleType="fade" toggleDuration="500"/>
|
||||
<s:datetimepicker label="With value='today'" name="dddp1" value="today" />
|
||||
<s:datetimepicker label="US format, empty" name="dddp2" language="en-us" />
|
||||
<s:datetimepicker label="US format with initial date of 2006-06-26" name="dddp3" value="2006-06-26" language="en-us" />
|
||||
<s:datetimepicker label="With initial date of 1969-04-25 and a custom format dd/MM/yyyy" name="dddp5" value="25/04/1969" displayFormat="dd/MM/yyyy" />
|
||||
<s:datetimepicker label="In German" name="dddp7" value="2006-06-28" language="de" />
|
||||
<s:datetimepicker label="In Dutch" name="dddp8" value="2006-06-28" language="nl" />
|
||||
<s:datetimepicker label="US format with initial date of 2006-06-26 and long formatting (parse not supported)" name="dddp12" value="2006-06-26" formatLength="long" language="en-us" />
|
||||
<s:datetimepicker label="German format with initial date of 2006-06-26 and long formatting (parse not supported)" name="dddp13" value="2006-06-26" formatLength="long" language="de" />
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -19,14 +19,14 @@
|
||||
name="name"
|
||||
tooltip="Enter your Name here" />
|
||||
|
||||
<s:datepicker
|
||||
<s:datetimepicker
|
||||
tooltip="Select Your Birthday"
|
||||
label="Birthday"
|
||||
name="birthday" />
|
||||
|
||||
<s:textarea
|
||||
tooltip="Enter your Biography"
|
||||
label="Biograph"
|
||||
label="Biography"
|
||||
name="bio"
|
||||
cols="20"
|
||||
rows="3"/>
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
|
||||
#sform ("action=exampleSubmitVelocity" "method=post" "enctype=multipart/form-data")
|
||||
#stextfield ("label=Name" "name=name")
|
||||
#sdatepicker ("label=Birthday" "name=birthday")
|
||||
#stextarea ("label=Biograph" "name=bio" "cols=20" "rows=3")
|
||||
#sdatetimepicker ("label=Birthday" "name=birthday")
|
||||
#stextarea ("label=Biography" "name=bio" "cols=20" "rows=3")
|
||||
#sselect ("label=Favourite Color" "list={'Red', 'Blue', 'Green'}" "name=favouriteColor" "emptyOption=true" "headerKey=None" "headerValue=None")
|
||||
#sselect ("label=Favourite Language" "list=favouriteLanguages" "name=favouriteLanguage" "listKey=key" "listValue=description" "emptyOption=true" "headerKey=None" "headerValue=None")
|
||||
#scheckboxlist ("label=Friends" "list={'Patrick', 'Jason', 'Jay', 'Toby', 'Rene'}" "name=friends")
|
||||
|
||||
@@ -11,9 +11,12 @@
|
||||
<li><s:url id="url" namespace="/tags/ui" action="example" method="input" /><s:a href="%{url}">UI Example</s:a></li>
|
||||
<li><s:url id="url" namespace="/tags/ui" action="exampleVelocity" method="input" /><s:a href="%{url}">UI Example (Velocity)</s:a></li>
|
||||
<li><s:url id="url" namespace="/tags/ui" action="lotsOfOptiontransferselect" method="input" /><s:a href="%{url}">Option Transfer Select UI Example</s:a></li>
|
||||
<li><s:url id="url" namespace="/tags/ui" action="moreSelects" method="input" /><s:a href="%{url}">More Select Box UI Examples</s:a></li>
|
||||
<li><s:url id="url" namespace="/tags/ui" value="treeExampleStatic.jsp" /><s:a href="%{url}">Tree Example (static)</s:a>
|
||||
<li><s:url id="url" namespace="/tags/ui" action="showDynamicTreeAction"/><s:a href="%{url}">Tree Example (dynamic)</s:a>
|
||||
<li><s:url id="url" value="componentTagExample.jsp"/><s:a href="%{#url}">Component Tag Example</s:a>
|
||||
<li><a href="datepicker">DateTime picker tag - Pick a date</a></li>
|
||||
<li><a href="timepicker">DateTime picker tag - Pick a time</a></li>
|
||||
<%--li><s:url id="url" namespace="/tags/ui" action="populateUsingIterator" method="input" /><s:a href="%{url}">UI population using iterator tag</s:a></li--%>
|
||||
</ul>
|
||||
</body>
|
||||
|
||||
@@ -68,42 +68,26 @@
|
||||
/>
|
||||
|
||||
<br/>
|
||||
|
||||
<s:updownselect
|
||||
tooltip="Prioritized Your Favourite Cartoon Characters"
|
||||
label="Prioritised Favourite Cartoon Characters"
|
||||
list="defaultFavouriteCartoonCharacters"
|
||||
name="prioritisedFavouriteCartoonCharacters"
|
||||
headerKey="-1"
|
||||
headerValue="--- Please Order ---"
|
||||
emptyOption="true" />
|
||||
|
||||
<br/>
|
||||
|
||||
<s:updownselect
|
||||
tooltip="Prioritise Your Favourite Cars"
|
||||
label="Prioritised Favourite Cars"
|
||||
list="defaultFavouriteCars"
|
||||
name="prioritisedFavouriteCars"
|
||||
headerKey="-10"
|
||||
headerValue="--- Please Order ---" />
|
||||
|
||||
<br/>
|
||||
|
||||
<s:updownselect
|
||||
tooltip="Prioritised Your Favourite Countries"
|
||||
label="Prioritised Favourite Countries"
|
||||
list="defaultFavouriteCountries"
|
||||
name="prioritisedFavouriteCountries"
|
||||
emptyOption="true"
|
||||
value="{'england', 'brazil'}" />
|
||||
|
||||
|
||||
<s:optiontransferselect
|
||||
tooltip="Pick One at a Time"
|
||||
label="Favourite Sport"
|
||||
leftTitle="Non Favourite Sports"
|
||||
rightTitle="Favourite Sports"
|
||||
name="nonFavouriteSports"
|
||||
list="defaultNonFavoriteSports"
|
||||
doubleName="favouriteSports"
|
||||
doubleList="defaultFavouriteSports"
|
||||
size="1" multiple="false"
|
||||
doubleSize="5" doubleMultiple="true"
|
||||
allowAddAllToLeft="false"
|
||||
allowAddAllToRight="false"
|
||||
allowSelectAll="false"
|
||||
/>
|
||||
<br/>
|
||||
|
||||
<s:submit value="Submit It" />
|
||||
|
||||
<br/>
|
||||
|
||||
</s:form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -71,26 +71,19 @@
|
||||
</s:iterator>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Prioritised Favourite Cartoon Characters:</td>
|
||||
<tr>
|
||||
<td>Favourite Sports:</td>
|
||||
<td>
|
||||
<s:iterator value="prioritisedFavouriteCartoonCharacters" status="stat">
|
||||
<s:iterator value="favouriteSports" status="stat">
|
||||
<s:property value="%{#stat.count}" />.<s:property />
|
||||
</s:iterator>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Prioritised Favourite Cars:</td>
|
||||
|
||||
<tr>
|
||||
<td>Non Favourite Sports:</td>
|
||||
<td>
|
||||
<s:iterator value="prioritisedFavouriteCars" status="stat">
|
||||
<s:property value="%{#stat.count}" />.<s:property />
|
||||
</s:iterator>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Prioritised Favourite Countries</td>
|
||||
<td>
|
||||
<s:iterator value="prioritisedFavouriteCountries" status="stat">
|
||||
<s:iterator value="nonfavouriteSports" status="stat">
|
||||
<s:property value="%{#stat.count}" />.<s:property />
|
||||
</s:iterator>
|
||||
</td>
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
<%@taglib prefix="s" uri="/struts-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Show Case - Tags - UI Tags - Optiontransferselect</title>
|
||||
<s:head />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<s:form action="moreSelectsSubmit" namespace="/tags/ui" method="post">
|
||||
|
||||
<s:updownselect
|
||||
tooltip="Prioritized Your Favourite Cartoon Characters"
|
||||
label="Prioritised Favourite Cartoon Characters"
|
||||
list="defaultFavouriteCartoonCharacters"
|
||||
name="prioritisedFavouriteCartoonCharacters"
|
||||
headerKey="-1"
|
||||
headerValue="--- Please Order ---"
|
||||
emptyOption="true" />
|
||||
|
||||
<br/>
|
||||
|
||||
<s:updownselect
|
||||
tooltip="Prioritise Your Favourite Cars"
|
||||
label="Prioritised Favourite Cars"
|
||||
list="defaultFavouriteCars"
|
||||
name="prioritisedFavouriteCars"
|
||||
headerKey="-10"
|
||||
headerValue="--- Please Order ---" />
|
||||
|
||||
<br/>
|
||||
|
||||
<s:updownselect
|
||||
tooltip="Prioritised Your Favourite Countries"
|
||||
label="Prioritised Favourite Countries"
|
||||
list="defaultFavouriteCountries"
|
||||
name="prioritisedFavouriteCountries"
|
||||
emptyOption="true"
|
||||
value="{'england', 'brazil'}" />
|
||||
|
||||
<br/>
|
||||
|
||||
<s:inputtransferselect
|
||||
list="defaultFavouriteNumbers"
|
||||
name="favouriteNumbers"
|
||||
label="Numbers"/>
|
||||
|
||||
<s:select label="Favourite Cities"
|
||||
list="availableCities"
|
||||
name="favouriteCities"
|
||||
value="%{defaultFavouriteCities}"
|
||||
multiple="true" size="4"/>
|
||||
|
||||
<s:submit value="Submit It" />
|
||||
|
||||
<br/>
|
||||
|
||||
</s:form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,53 @@
|
||||
<%@taglib prefix="s" uri="/struts-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Showcase - Tags - UI Tags - Select Boxes Result</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>Prioritised Favourite Cartoon Characters:</td>
|
||||
<td>
|
||||
<s:iterator value="prioritisedFavouriteCartoonCharacters" status="stat">
|
||||
<s:property value="%{#stat.count}" />.<s:property />
|
||||
</s:iterator>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Prioritised Favourite Cars:</td>
|
||||
<td>
|
||||
<s:iterator value="prioritisedFavouriteCars" status="stat">
|
||||
<s:property value="%{#stat.count}" />.<s:property />
|
||||
</s:iterator>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Prioritised Favourite Countries</td>
|
||||
<td>
|
||||
<s:iterator value="prioritisedFavouriteCountries" status="stat">
|
||||
<s:property value="%{#stat.count}" />.<s:property />
|
||||
</s:iterator>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Favourite Cities</td>
|
||||
<td>
|
||||
<s:iterator value="favouriteCities" status="stat">
|
||||
<s:property value="%{#stat.count}" />.<s:property />
|
||||
</s:iterator>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Favourite Numbers</td>
|
||||
<td>
|
||||
<s:iterator value="favouriteNumbers" status="stat">
|
||||
<s:property value="%{#stat.count}" />.<s:property />
|
||||
</s:iterator>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,20 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>UI Tags Example</title>
|
||||
<s:head />
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<s:datetimepicker label="toggleType='wipe'" type="time" value="10:30" toggleType="wipe" toggleDuration="300"/>
|
||||
<s:datetimepicker label="toggleType='explode'" type="time" value="13:00" toggleType="explode" toggleDuration="500"/>
|
||||
<s:datetimepicker label="toggleType='fade'" type="time" value="13:00" toggleType="fade" toggleDuration="500"/>
|
||||
<s:datetimepicker label="With value='today'" name="dddp4" type="time" value="today" />
|
||||
<s:datetimepicker label="US format, empty" name="dddp5" type="time" language="en-us" />
|
||||
<s:datetimepicker label="US format, 13:00 hours" name="dddp6" type="time" value="13:00" language="en-us" />
|
||||
<s:datetimepicker label="In German" name="dddp7" type="time" value="13:00" language="de" />
|
||||
<s:datetimepicker label="In Dutch" name="dddp8" type="time" value="13:00" language="nl" />
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -26,15 +26,15 @@
|
||||
<s:url id="storeMessageAcrossRequestExample" value="/validation/storeErrorsAcrossRequestExample.jsp" />
|
||||
|
||||
<ul>
|
||||
<li><s:a href="%{fieldValidatorUrl}">Field Validators</s:a></li>
|
||||
<li><s:a href="%{clientSideValidationUrl}">Field Validators with client-side JavaScript</s:a></li>
|
||||
<li><s:a href="%{nonFieldValidatorUrl}">Non Field Validator</s:a></li>
|
||||
<li><s:a href="%{storeMessageAcrossRequestExample}">Store across request using MessageStoreInterceptor (Example)</s:a></li>
|
||||
<li>(broken) <s:a href="%{quizAjax}">Validation (ajax)</s:a></li>
|
||||
<li><s:a href="%{quizBasic}">Validation (basic)</s:a></li>
|
||||
<li><s:a href="%{quizClient}">Validation (client)</s:a></li>
|
||||
<li><s:a href="%{quizClientCss}">Validation (client using css_xhtml theme)</s:a></li>
|
||||
<li><s:a href="%{quizAjax}">Validation (ajax)</s:a></li>
|
||||
<li><s:a href="%{fieldValidatorUrl}">Field Validators</s:a></li>
|
||||
<li><s:a href="%{nonFieldValidatorUrl}">Non Field Validator</s:a></li>
|
||||
<li><s:a href="%{visitorValidatorUrl}">Visitor Validator</s:a></li>
|
||||
<li><s:a href="%{clientSideValidationUrl}">Client side validation using JavaScript</s:a></li>
|
||||
<li><s:a href="%{storeMessageAcrossRequestExample}">Store across request using MessageStoreInterceptor (Example)</s:a></li>
|
||||
<li><s:a href="%{backToShowcase}">Back To Showcase</s:a>
|
||||
</ul>
|
||||
</body>
|
||||
|
||||
+24
-8
@@ -33,7 +33,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.0.2</version>
|
||||
<version>2.0.3</version>
|
||||
</parent>
|
||||
|
||||
<scm>
|
||||
@@ -103,7 +103,7 @@
|
||||
<groupId>opensymphony</groupId>
|
||||
<artifactId>xwork</artifactId>
|
||||
<classifier>javadoc</classifier>
|
||||
<version>2.0-RC1</version>
|
||||
<version>2.0.0</version>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
<outputDirectory>${project.build.directory}/xwork-apidocs</outputDirectory>
|
||||
@@ -111,6 +111,28 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>cwiki-docs</id>
|
||||
<phase>process-resources</phase>
|
||||
<configuration>
|
||||
<tasks>
|
||||
<mkdir dir="${project.build.directory}/cwiki"/>
|
||||
<get src="http://struts.apache.org/2.x/docs.zip"
|
||||
dest="${project.build.directory}/docs.zip"
|
||||
ignoreerrors="false"/>
|
||||
<unzip src="${project.build.directory}/docs.zip"
|
||||
dest="${project.build.directory}/cwiki"/>
|
||||
</tasks>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.0.1</version>
|
||||
@@ -142,12 +164,6 @@
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-all</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-config-browser-plugin</artifactId>
|
||||
|
||||
@@ -67,6 +67,12 @@
|
||||
<outputDirectory>docs/struts2-core</outputDirectory>
|
||||
</fileSet>
|
||||
|
||||
<!-- Include the Confluence docs in the assembly -->
|
||||
<fileSet>
|
||||
<directory>target/cwiki</directory>
|
||||
<outputDirectory>docs</outputDirectory>
|
||||
</fileSet>
|
||||
|
||||
<!-- Plugins -->
|
||||
<!--
|
||||
<fileSet>
|
||||
|
||||
+113
-41
@@ -48,6 +48,7 @@ and concurrency utilities
|
||||
<li>Enhanced for loop (for-each loop)</li>
|
||||
<li>Varargs (variable arguments)</li>
|
||||
<li>Covariant return types</li>
|
||||
<li>Formatted output</li>
|
||||
<li>Static import</li>
|
||||
<li>Concurrency utilities</li>
|
||||
<li>Collections framework enhancements</li>
|
||||
@@ -75,7 +76,7 @@ and concurrency utilities
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<p>The full command line syntax:<br>
|
||||
<p><a name="syntax">The full command line syntax:</a><br>
|
||||
<code>java -jar retrotranslator-transformer-<i>n.n.n</i>.jar <options></code>
|
||||
<br>or<br>
|
||||
<code>java -cp retrotranslator-transformer-<i>n.n.n</i>.jar net.sf.retrotranslator.transformer.Retrotranslator <options></code></p>
|
||||
@@ -117,7 +118,7 @@ and concurrency utilities
|
||||
<td>Off</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap><code>-advanced</code></td>
|
||||
<td nowrap><a name="option_advanced"><code>-advanced</code></a></td>
|
||||
<td>Allows to override Java 1.4 methods for better Java 5 compatibility.</td>
|
||||
<td>Off</td>
|
||||
</tr>
|
||||
@@ -155,6 +156,17 @@ and concurrency utilities
|
||||
or the implicit <code>valueOf</code> method call for autoboxing.</td>
|
||||
<td>Off</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap><code>-retainflags</code></td>
|
||||
<td>Asks the translator to keep Java 5 specific access modifiers.</td>
|
||||
<td>Off</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap><a name="option_backport"><code>-backport</code></a></td>
|
||||
<td>Informs the translator about <a href="#extension">user-defined</a> backport packages.
|
||||
Package names should be separated by semicolons.</td>
|
||||
<td>-</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
For example, if you have a Java 5 application <code>myapplication5.jar</code> you can use the following command
|
||||
@@ -247,6 +259,17 @@ and concurrency utilities
|
||||
or the implicit <code>valueOf</code> method call for autoboxing.</td>
|
||||
<td>Off</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>retainflags</code></td>
|
||||
<td>Asks the translator to keep Java 5 specific access modifiers.</td>
|
||||
<td>Off</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>backport</code></td>
|
||||
<td>Informs the translator about <a href="#extension">user-defined</a> backport packages.
|
||||
Package names should be separated by semicolons.</td>
|
||||
<td>-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>failonwarning</code></td>
|
||||
<td>Indicates whether the build will fail when there are verification warnings.</td>
|
||||
@@ -293,18 +316,22 @@ and concurrency utilities
|
||||
<li>
|
||||
If you want to run a JAR file with the JIT, execute:<br>
|
||||
<code>java -cp retrotranslator-transformer-<i>n.n.n</i>.jar
|
||||
net.sf.retrotranslator.transformer.JITRetrotranslator -jar <jarfile> [<args...>]</code>
|
||||
net.sf.retrotranslator.transformer.JITRetrotranslator <options> -jar <jarfile> [<args...>]</code>
|
||||
</li>
|
||||
<li>
|
||||
When the first option does not work or if you just want to run a class from your classpath, execute:<br>
|
||||
<code>java -cp retrotranslator-transformer-<i>n.n.n</i>.jar:<classpath>
|
||||
net.sf.retrotranslator.transformer.JITRetrotranslator <class> [<args...>]</code>
|
||||
net.sf.retrotranslator.transformer.JITRetrotranslator <options> <class> [<args...>]</code>
|
||||
</li>
|
||||
<li>
|
||||
Alternatively you may simply call <code>JITRetrotranslator.install()</code> from some JVM 1.4 compatible class
|
||||
Alternatively you may simply call <code>JITRetrotranslator.run()</code> from some JVM 1.4 compatible class
|
||||
before Java 5 classes are loaded.
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
JIT Retrotranslator can accept <code>-<a href="#option_advanced">advanced</a></code>
|
||||
and <code>-<a href="#option_backport">backport</a></code> options.
|
||||
</p>
|
||||
|
||||
<h4><a name="supported">What Java 5 classes and methods are supported?</a></h4>
|
||||
<table border="1" cellspacing="0" cellpadding="5">
|
||||
@@ -313,8 +340,9 @@ and concurrency utilities
|
||||
<tr><td><code>java.util.concurrent,<br>java.util.concurrent.atomic,<br>java.util.concurrent.locks</code></td>
|
||||
<td>almost all classes</td><td>almost all methods</td>
|
||||
<td>
|
||||
<a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php"> Backport of JSR 166</a><br>
|
||||
<code>Condition.awaitNanos(long)</code> method is supported but with
|
||||
Supported via the <a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php">
|
||||
Backport of JSR 166</a>.<br>
|
||||
The <code>Condition.awaitNanos(long)</code> method is supported with
|
||||
<a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/doc/api/edu/emory/mathcs/backport/java/util/concurrent/helpers/Utils.html#awaitNanos(edu.emory.mathcs.backport.java.util.concurrent.locks.Condition, long)">
|
||||
very little</a> accuracy guarantees.
|
||||
</td></tr>
|
||||
@@ -325,20 +353,25 @@ and concurrency utilities
|
||||
<code>new Flushable[...]</code> is replaced with <code>new Object[...]</code>
|
||||
</td></tr>
|
||||
<tr><td><code>PrintStream</code></td><td>
|
||||
<code>append(CharSequence), append(CharSequence, int, int), append(char)</code>
|
||||
* (11 new methods and constructors)
|
||||
</td><td> </td></tr>
|
||||
<tr><td><code>PrintWriter</code></td><td>
|
||||
<code>PrintWriter(File), PrintWriter(File, String), PrintWriter(String), PrintWriter(String, String)</code>
|
||||
</td><td> </td></tr>
|
||||
* (11 new methods and constructors)
|
||||
</td><td>
|
||||
The <code>PrintWriter.format</code> and <code>PrintWriter.printf</code> methods always flush the output buffer.
|
||||
</td></tr>
|
||||
<tr><td><code>Reader</code></td><td><code>read(CharBuffer)</code></td><td> </td></tr>
|
||||
<tr><td><code>Writer</code></td><td>
|
||||
<code>append(CharSequence), append(CharSequence, int, int), append(char)</code>
|
||||
<code>append(CharSequence),<br>
|
||||
append(CharSequence, int, int),<br>
|
||||
append(char)</code>
|
||||
</td><td> </td></tr>
|
||||
<tr><td rowspan="24"><code>java.lang</code></td><td><code>Appendable</code></td><td>*
|
||||
</td><td>
|
||||
<code>new Appendable[...]</code> is replaced with <code>new Object[...]</code>
|
||||
</td></tr>
|
||||
<tr><td><code>Boolean</code></td><td><code>parseBoolean(String), compareTo(Boolean)</code></td><td> </td></tr>
|
||||
<tr><td><code>Boolean</code></td><td><code>parseBoolean(String),<br>
|
||||
compareTo(Boolean)</code></td><td> </td></tr>
|
||||
<tr><td><code>Byte</code></td><td><code>valueOf(byte)</code></td><td> </td></tr>
|
||||
<tr><td><code>Character</code></td><td><code>valueOf(char)</code></td><td> </td></tr>
|
||||
<tr><td><code>Class</code></td><td>* (21 new methods)</td><td>
|
||||
@@ -353,38 +386,49 @@ and concurrency utilities
|
||||
IllegalArgumentException(Throwable)</code></td><td> </td></tr>
|
||||
<tr><td><code>IllegalStateException</code></td><td><code>IllegalStateException(String, Throwable),<br>
|
||||
IllegalStateException(Throwable)</code></td><td> </td></tr>
|
||||
<tr><td><code>Integer</code></td><td><code>valueOf(int)</code></td><td> </td></tr>
|
||||
<tr><td><code>Integer</code></td><td><code>valueOf(int), signum(int)</code></td><td> </td></tr>
|
||||
<tr><td><code>Iterable</code></td><td>*</td><td>
|
||||
<code>new Iterable[...]</code> is replaced with <code>new Object[...]</code>
|
||||
</td></tr>
|
||||
<tr><td><code>Long</code></td><td><code>valueOf(long)</code></td><td> </td></tr>
|
||||
<tr><td><code>Long</code></td><td><code>valueOf(long), signum(long)</code></td><td> </td></tr>
|
||||
<tr><td><code>Package</code></td><td>* (4 new methods)</td><td> </td></tr>
|
||||
<tr><td><code>Readable</code></td><td>*</td><td>
|
||||
<code>new Readable[...]</code> is replaced with <code>new Object[...]</code>
|
||||
</td></tr>
|
||||
<tr><td><code>Short</code></td><td><code>valueOf(short)</code></td><td> </td></tr>
|
||||
<tr><td><code>String</code></td><td><code>contains(CharSequence),<br> contentEquals(CharSequence),<br>
|
||||
replace(CharSequence, CharSequence)</code></td><td> </td></tr>
|
||||
<tr><td><code>String</code></td><td><code>contains(CharSequence),<br>
|
||||
contentEquals(CharSequence),<br>
|
||||
format(Locale, String, Object...),<br>
|
||||
format(String, Object...),<br>
|
||||
replace(CharSequence, CharSequence)
|
||||
</code></td><td> </td></tr>
|
||||
<tr><td><code>StringBuffer</code></td><td><code>
|
||||
StringBuffer(CharSequence), append(CharSequence), append(CharSequence, int, int),
|
||||
insert(int, CharSequence), insert(int, CharSequence, int, int)
|
||||
StringBuffer(CharSequence),<br>
|
||||
append(CharSequence),<br>
|
||||
append(CharSequence, int, int),<br>
|
||||
insert(int, CharSequence),<br>
|
||||
insert(int, CharSequence, int, int)
|
||||
</code></td><td> </td></tr>
|
||||
<tr><td><code>StringBuilder</code></td><td>
|
||||
All methods supported in <code>StringBuffer</code>
|
||||
</td><td><code>StringBuilder</code> is replaced with <code>StringBuffer</code></td></tr>
|
||||
<tr><td><code>SuppressWarnings</code></td><td>*</td><td> </td></tr>
|
||||
<tr><td><code>System</code></td><td><code>nanoTime(), clearProperty(String)</code></td><td>
|
||||
<a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php"> Backport of JSR 166</a><br>
|
||||
<code>System.nanoTime()</code> method precision
|
||||
<tr><td><code>System</code></td><td><code>nanoTime(),<br> clearProperty(String)</code></td><td>
|
||||
The <code>System.nanoTime()</code> method is supported via the
|
||||
<a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php">Backport of JSR 166</a>
|
||||
and its precision
|
||||
<a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/doc/api/edu/emory/mathcs/backport/java/util/concurrent/helpers/Utils.html#nanoTime()">
|
||||
may vary</a> on different platforms.
|
||||
</td></tr>
|
||||
<tr><td><code>Thread</code></td><td><code>getStackTrace(), getId()
|
||||
</code></td><td><code>Thread.getStackTrace()</code> returns non-empty stack trace only for the current thread;<br>
|
||||
<code>Thread.getId()</code> does not reflect the order in which threads are created.</td></tr>
|
||||
<tr><td><code>Thread</code></td><td><code>getStackTrace(),<br> getId()
|
||||
</code></td><td>The <code>Thread.getStackTrace()</code>
|
||||
method returns non-empty stack trace only for the current thread.<br>
|
||||
The <code>Thread.getId()</code> method does not reflect the order in which threads are created.</td></tr>
|
||||
<tr><td><code>TypeNotPresentException</code></td><td>*</td><td> </td></tr>
|
||||
|
||||
<tr><td rowspan="12"><code>java.lang.reflect</code></td><td><code>AnnotatedElement</code></td><td>*</td><td>
|
||||
<tr><td rowspan="13"><code>java.lang.reflect</code></td>
|
||||
<td><code>AccessibleObject</code></td><td>*</td><td> </td></tr>
|
||||
<tr><td><code>AnnotatedElement</code></td><td>*</td><td>
|
||||
<code>new AnnotatedElement[...]</code> is replaced with <code>new Object[...]</code>
|
||||
</td></tr>
|
||||
<tr><td><code>Constructor</code></td><td>* (11 new methods)</td><td> </td></tr>
|
||||
@@ -404,34 +448,47 @@ and concurrency utilities
|
||||
<tr><td><code>WildcardType</code></td><td>*</td><td> </td></tr>
|
||||
|
||||
<tr><td ><code>java.math</code></td><td><code>BigDecimal</code></td><td>
|
||||
<code>BigDecimal(int), BigDecimal(long), ZERO, ONE, TEN, divideAndRemainder(BigDecimal),
|
||||
divideToIntegralValue(BigDecimal), pow(int), remainder(BigDecimal), toPlainString(), valueOf(double),
|
||||
valueOf(long)</code></td><td><code>BigDecimal.setScale(int, int)</code> supports negative scales in advanced mode.</td></tr>
|
||||
|
||||
<code>BigDecimal(int),<br> BigDecimal(long),<br> ZERO, ONE, TEN,<br> divideAndRemainder(BigDecimal),<br>
|
||||
divideToIntegralValue(BigDecimal),<br> pow(int),<br> remainder(BigDecimal),<br>
|
||||
toPlainString(),<br> valueOf(double),<br>
|
||||
valueOf(long)</code></td><td>The <code>BigDecimal.setScale(int, int)</code>
|
||||
method supports negative scales in advanced mode.</td></tr>
|
||||
<tr><td ><code>java.rmi.server</code></td><td><code>RemoteObjectInvocationHandler</code></td>
|
||||
<td>*</td><td> </td></tr>
|
||||
|
||||
<tr><td ><code>java.net</code></td><td><code>URL</code></td>
|
||||
<td><code>toURI()</code></td><td> </td></tr>
|
||||
|
||||
<tr><td><code>java.util.nio</code></td><td><code>CharBuffer</code></td><td>
|
||||
<code>append(CharSequence), append(CharSequence, int, int), append(char), read(CharBuffer)</code>
|
||||
<code>append(CharSequence),<br> append(CharSequence, int, int),<br> append(char),<br> read(CharBuffer)</code>
|
||||
</td><td> </td></tr>
|
||||
|
||||
<tr><td rowspan="9"><code>java.util</code></td><td><code>AbstractQueue</code></td><td>*</td><td>
|
||||
</td></tr>
|
||||
<tr><td rowspan="10"><code>java.util</code></td><td><code>AbstractQueue</code></td><td>*</td><td>
|
||||
Supported via the <a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php">
|
||||
Backport of JSR 166</a>.
|
||||
</td></tr>
|
||||
<tr><td><code>Arrays</code></td><td>* (21 new methods)</td><td> </td></tr>
|
||||
<tr><td><code>Collections</code></td><td>* (13 new methods)</td><td>
|
||||
<a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php"> Backport of JSR 166</a>
|
||||
Supported via the <a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php">
|
||||
Backport of JSR 166</a>.
|
||||
</td></tr>
|
||||
<tr><td><code>EnumMap</code></td><td>*</td><td> </td></tr>
|
||||
<tr><td><code>EnumSet</code></td><td>*</td><td> </td></tr>
|
||||
<tr><td><code>Formatter</code></td><td>*</td><td> </td></tr>
|
||||
<tr><td><code>LinkedList</code></td><td>* (5 new methods)</td><td> </td></tr>
|
||||
<tr><td><code>PriorityQueue</code></td><td>*</td><td> </td></tr>
|
||||
<tr><td><code>PriorityQueue</code></td><td>*</td><td>
|
||||
Supported via the <a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php">
|
||||
Backport of JSR 166</a>.
|
||||
</td></tr>
|
||||
<tr><td><code>Queue</code></td><td>*</td><td>
|
||||
Supported via the <a href="http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php">
|
||||
Backport of JSR 166</a>.<br>
|
||||
<code>new Queue[...]</code> is replaced with <code>new Object[...]</code>
|
||||
</td></tr>
|
||||
<tr><td><code>UUID</code></td><td>*</td><td> </td></tr>
|
||||
|
||||
<tr><td rowspan="3"><code>java.util.regex</code></td><td><code>Matcher</code></td><td>
|
||||
<code>quoteReplacement(String), toMatchResult()</code></td><td> </td></tr>
|
||||
<code>quoteReplacement(String),<br> toMatchResult()</code></td><td> </td></tr>
|
||||
<tr><td><code>MatchResult</code></td><td>*</td><td>
|
||||
<code>new MatchResult[...]</code> is replaced with <code>new Object[...]</code>
|
||||
</td></tr>
|
||||
@@ -446,23 +503,33 @@ and concurrency utilities
|
||||
For example, all references to
|
||||
<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/EnumSet.html"><code>java.util.EnumSet</code></a>
|
||||
are replaced with references to
|
||||
<a href="http://cvs.sourceforge.net/viewcvs.py/retrotranslator/Retrotranslator/src/net/sf/retrotranslator/runtime/java/util/EnumSet_.java?view=markup">
|
||||
<a href="http://retrotranslator.cvs.sourceforge.net/retrotranslator/Retrotranslator/src/net/sf/retrotranslator/runtime/java/util/EnumSet_.java?view=markup">
|
||||
<code>net.sf.retrotranslator.runtime.java.util.EnumSet<b>_</b></code></a> (trailing underscore) if the latter can be found.
|
||||
But if you replace a whole class that exists in J2SE 1.4 you may encounter interoperability issues with other libraries.
|
||||
So, for example, support for Java 5 fields, methods, and constructors of
|
||||
<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigDecimal.html"><code>java.math.BigDecimal</code></a> is placed into
|
||||
|
||||
<a href="http://cvs.sourceforge.net/viewcvs.py/retrotranslator/Retrotranslator/src/net/sf/retrotranslator/runtime/java/math/_BigDecimal.java?view=markup">
|
||||
<a href="http://retrotranslator.cvs.sourceforge.net/retrotranslator/Retrotranslator/src/net/sf/retrotranslator/runtime/java/math/_BigDecimal.java?view=markup">
|
||||
<code>net.sf.retrotranslator.runtime.java.math.<b>_</b>BigDecimal</code></a> (leading underscore):
|
||||
</p>
|
||||
<ul>
|
||||
<li>For a static field there is a public static field with the same name and type.</li>
|
||||
<li>For a static method there is a public static method with the same signature.</li>
|
||||
<li>For an instance method there is a public static method with the same signature
|
||||
but with an additional first parameter representing an instance.</li>
|
||||
but with an additional first parameter representing the instance.</li>
|
||||
<li>For a constructor there is a public static <code>convertConstructorArguments</code> method that
|
||||
accepts constructor's arguments an returns an argument for a Java 1.4 constuctor.</li>
|
||||
</ul>
|
||||
<p>
|
||||
Another approach for constructor backporting is used by
|
||||
<a href="http://retrotranslator.cvs.sourceforge.net/retrotranslator/Retrotranslator/src/net/sf/retrotranslator/runtime/java/io/_PrintStream.java?view=markup">
|
||||
<code>net.sf.retrotranslator.runtime.java.io.<b>_</b>PrintStream</code></a>. There is a public static
|
||||
<code>createInstanceBuilder</code> method that accepts constructor's arguments an returns an object with public
|
||||
<code>argument1</code>...<code>argumentN</code> methods and optional public void <code>initialize</code> method.
|
||||
All <code>argumentX</code> methods provide arguments for a Java 1.4 constuctor and should not have any parameters.
|
||||
The <code>initialize</code> method has a single parameter for the created instance and may be used for postprocessing.
|
||||
|
||||
</p>
|
||||
<p>
|
||||
However, if the backported methods require access
|
||||
to non-public methods or fields of the instance, they cannot be fully handled by Retrotranslator.
|
||||
@@ -472,6 +539,9 @@ and concurrency utilities
|
||||
Also this approach cannot be used to replace instance field references.
|
||||
</p>
|
||||
<p>
|
||||
You can put your extensions into packages other than <code>net.sf.retrotranslator.runtime</code>.
|
||||
For example, to make Retrotranslator use <code>com.mycompany.internal.java.lang._String</code>
|
||||
just specify <code>-backport com.mycompany.internal</code> at the command line.
|
||||
If you have written an extension that does not contain copyrighted code, you may send
|
||||
a <a href="http://sourceforge.net/tracker/?group_id=153566&atid=788281">patch</a>
|
||||
under the <a href="#license">Retrotranslator license</a>.
|
||||
@@ -481,14 +551,16 @@ and concurrency utilities
|
||||
|
||||
<p>
|
||||
Basically, only classes, methods, and fields listed <a href="#supported">above</a> should work, and other features,
|
||||
like formatted input/output, are not supported. Known issues:
|
||||
like formatted input, are not supported. Known issues:
|
||||
</p>
|
||||
<ul>
|
||||
<li>Reflection-based tools may be unable to discover additional classes and methods introduced in Java 5 when running on JRE 1.4.</li>
|
||||
<li>Some applications enable all features only if they detect Java 5, so you may need to override system properties:<br>
|
||||
<code> java -Djava.version=1.5.0 -Djava.specification.version=1.5 -Djava.class.version=49.0 ...</code></li>
|
||||
<li>Translated code running on JRE 5.0 may be incompatible with other Java 5 code when Java 5 API is used.</li>
|
||||
<li>Reflection on generics and metadata may return incomplete information for dynamically generated classes.</li>
|
||||
<li>Access modifiers and constants inlined by a compiler are ignored during the verification.</li>
|
||||
<li>Upcasting may help to translate invocations of inherited methods introduced in Java 5: <br>
|
||||
<li>Constants inlined by a compiler and access modifiers are ignored during the verification.</li>
|
||||
<li>Inherited methods introduced in Java 5 may not work, however upcasting may help in some cases:<br>
|
||||
<code> ((Writer) new FileWriter("file.tmp")).append("Hello").close();</code></li>
|
||||
<li>Serialized objects produced by translated code may be incompatible with JRE 5.0.</li>
|
||||
</ul>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
java -jar retrotranslator-transformer-1.0.8.jar -srcjar ../lib/struts2-core-2.0.0.jar -destjar struts2-core-j4-2.0.0.jar
|
||||
java -jar retrotranslator-transformer-1.0.8.jar -srcjar ../lib/struts2-api-2.0.0.jar -destjar struts2-api-j4-2.0.0.jar
|
||||
java -jar retrotranslator-transformer-1.0.8.jar -srcjar ../lib/struts2-extras-2.0.0.jar -destjar struts2-extras-j4-2.0.0.jar
|
||||
java -jar retrotranslator-transformer-1.0.8.jar -srcjar ../lib/xwork-2.0-SNAPSHOT.jar -destjar xwork-j4-2.0-SNAPSHOT.jar
|
||||
java -jar retrotranslator-transformer-1.1.0.jar -srcjar ../lib/struts2-core-2.0.3.jar -destjar struts2-core-j4-2.0.3.jar
|
||||
java -jar retrotranslator-transformer-1.1.0.jar -srcjar ../lib/struts2-api-2.0.3.jar -destjar struts2-api-j4-2.0.3.jar
|
||||
java -jar retrotranslator-transformer-1.1.0.jar -srcjar ../lib/struts2-extras-2.0.3.jar -destjar struts2-extras-j4-2.0.3.jar
|
||||
java -jar retrotranslator-transformer-1.1.0.jar -srcjar ../lib/xwork-2.0.0.jar -destjar xwork-j4-2.0.0-RC1.jar
|
||||
|
||||
+152
-39
@@ -5,13 +5,13 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.0.2</version>
|
||||
<version>2.0.3</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-core</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Struts 2 Core</name>
|
||||
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/core/</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/core/</developerConnection>
|
||||
@@ -20,29 +20,42 @@
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.0</version>
|
||||
<configuration>
|
||||
<sourcepath>src/main/java;../../xwork/src/java</sourcepath>
|
||||
<groups>
|
||||
<group>
|
||||
<title>Struts Packages</title>
|
||||
<packages>org.apache.struts2*</packages>
|
||||
</group>
|
||||
<group>
|
||||
<title>XWork Packages</title>
|
||||
<packages>com.opensymphony.xwork2*</packages>
|
||||
</group>
|
||||
</groups>
|
||||
</configuration>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>2.0-alpha-1-SNAPSHOT</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>unpack-xwork</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>unpack</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>opensymphony</groupId>
|
||||
<artifactId>xwork</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<classifier>sources</classifier>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
<outputDirectory>${project.build.directory}/xwork-sources</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!--
|
||||
<plugin>
|
||||
<groupId>org.apache.myfaces.tobago</groupId>
|
||||
<artifactId>maven-apt-plugin</artifactId>
|
||||
<configuration>
|
||||
<A>uri=/struts-tags,tlibVersion=2.2.3,jspVersion=1.2,shortName=s,displayName="Struts Tags",outFile=${basedir}/src/main/resources/META-INF/struts-tags.tld, description="To make it easier to access dynamic data; the Apache Struts framework includes a library of custom tags. The tags interact with the framework's validation and internationalization features; to ensure that input is correct and output is localized. The Struts Tags can be used with JSP FreeMarker or Velocity."
|
||||
<A>uri=/struts-tags,tlibVersion=2.2.3,jspVersion=1.2,shortName=s,displayName="Struts Tags",
|
||||
outFile=${basedir}/src/main/resources/META-INF/struts-tags.tld,
|
||||
description="To make it easier to access dynamic data;
|
||||
the Apache Struts framework includes a library of custom tags.
|
||||
The tags interact with the framework's validation and internationalization features;
|
||||
to ensure that input is correct and output is localized.
|
||||
The Struts Tags can be used with JSP FreeMarker or Velocity.",
|
||||
outTemplatesDir=${basedir}/src/site/resources/tags
|
||||
</A>
|
||||
<resourceTargetPath>target</resourceTargetPath>
|
||||
<fork>false</fork>
|
||||
@@ -64,19 +77,48 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
-->
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.2</version>
|
||||
<configuration>
|
||||
<sourcepath>${basedir}/src/main/java;${basedir}/target/xwork-sources</sourcepath>
|
||||
<encoding>UTF-8</encoding>
|
||||
<groups>
|
||||
<group>
|
||||
<title>Struts Packages</title>
|
||||
<packages>org.apache.struts2*</packages>
|
||||
</group>
|
||||
<group>
|
||||
<title>XWork Packages</title>
|
||||
<packages>com.opensymphony.xwork2*</packages>
|
||||
</group>
|
||||
</groups>
|
||||
<show>private</show>
|
||||
<links>
|
||||
<link>http://java.sun.com/j2se/1.5.0/docs/api</link>
|
||||
<link>http://java.sun.com/javaee/5/docs/api/</link>
|
||||
<link>http://jakarta.apache.org/commons/logging/apidocs/</link>
|
||||
<link>http://logging.apache.org/log4j/docs/api/</link>
|
||||
</links>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<!--
|
||||
<!--
|
||||
Run the translator for Java 1.4 compatiblity
|
||||
|
||||
|
||||
Sample:
|
||||
$ cd struts/struts2/
|
||||
$ mvn clean install -Papps,j4 -Djava14.jar=$JAVA_HOME/../Classes/classes.jar
|
||||
|
||||
|
||||
-->
|
||||
<id>j4</id>
|
||||
<build>
|
||||
@@ -131,15 +173,86 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
|
||||
<profile>
|
||||
<id>alljars</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-source</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<sourcepath>${basedir}/src/main/java;${basedir}/target/xwork-sources</sourcepath>
|
||||
<encoding>UTF-8</encoding>
|
||||
<groups>
|
||||
<group>
|
||||
<title>Struts Packages</title>
|
||||
<packages>org.apache.struts2*</packages>
|
||||
</group>
|
||||
<group>
|
||||
<title>XWork Packages</title>
|
||||
<packages>com.opensymphony.xwork2*</packages>
|
||||
</group>
|
||||
</groups>
|
||||
<show>private</show>
|
||||
<links>
|
||||
<link>http://java.sun.com/j2se/1.5.0/docs/api</link>
|
||||
<link>http://java.sun.com/javaee/5/docs/api/</link>
|
||||
<link>http://jakarta.apache.org/commons/logging/apidocs/</link>
|
||||
<link>http://logging.apache.org/log4j/docs/api/</link>
|
||||
</links>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-source</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>default-tools.jar</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>java.vendor</name>
|
||||
<value>Sun Microsystems Inc.</value>
|
||||
</property>
|
||||
</activation>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.sun</groupId>
|
||||
<artifactId>tools</artifactId>
|
||||
<version>1.5.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${java.home}/../lib/tools.jar</systemPath>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
</profiles>
|
||||
|
||||
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>opensymphony</groupId>
|
||||
<artifactId>xwork</artifactId>
|
||||
<version>2.0-RC1</version>
|
||||
<version>2.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -147,7 +260,7 @@
|
||||
<artifactId>struts2-api</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>freemarker</groupId>
|
||||
<artifactId>freemarker</artifactId>
|
||||
@@ -173,20 +286,13 @@
|
||||
<artifactId>ognl</artifactId>
|
||||
<version>2.6.9</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.0.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<version>2.0</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- Ajax -->
|
||||
<dependency>
|
||||
<groupId>uk.ltd.getahead</groupId>
|
||||
@@ -305,7 +411,7 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency-->
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>jmock</groupId>
|
||||
<artifactId>jmock-cglib</artifactId>
|
||||
@@ -355,5 +461,12 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts-annotations</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -141,10 +141,6 @@ public final class StrutsConstants {
|
||||
|
||||
public static final String STRUTS_ACTIONPROXYFACTORY = "struts.actionProxyFactory";
|
||||
|
||||
public static final String STRUTS_TEMPLATE_ENGINES = "struts.templateEngines";
|
||||
|
||||
public static final String STRUTS_TAG_LIBRARIES = "struts.tagLibraries";
|
||||
|
||||
public static final String STRUTS_FREEMARKER_WRAPPER_ALT_MAP = "struts.freemarker.wrapper.altMap";
|
||||
|
||||
/** The name of the xwork converter implementation */
|
||||
|
||||
@@ -20,6 +20,8 @@ package org.apache.struts2.components;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
@@ -87,35 +89,18 @@ public abstract class AbstractRemoteCallUIBean extends ClosingUIBean implements
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.struts2.components.RemoteUICallBean#setListenTopics(java.lang.String)
|
||||
*/
|
||||
@StrutsTagAttribute(description="Topic that will trigger the remote call")
|
||||
public void setListenTopics(String listenTopics) {
|
||||
this.listenTopics = listenTopics;
|
||||
}
|
||||
|
||||
/**
|
||||
* The theme to use for the element. <b>This tag will usually use the ajax
|
||||
* theme.</b>
|
||||
*
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setTheme(String theme) {
|
||||
super.setTheme(theme);
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.struts2.components.RemoteUICallBean#setHref(java.lang.String)
|
||||
*/
|
||||
@StrutsTagAttribute(description="The URL to call to obtain the content. Note: If used with ajax context, the value must be set as an url tag value.")
|
||||
public void setHref(String href) {
|
||||
this.href = href;
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.struts2.components.RemoteUICallBean#setErrorText(java.lang.String)
|
||||
*/
|
||||
@StrutsTagAttribute(description="The text to display to the user if the is an error fetching the content")
|
||||
public void setErrorText(String errorText) {
|
||||
this.errorText = errorText;
|
||||
}
|
||||
@@ -137,59 +122,45 @@ public abstract class AbstractRemoteCallUIBean extends ClosingUIBean implements
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.struts2.components.RemoteUICallBean#setExecuteScripts(java.lang.String)
|
||||
*/
|
||||
@StrutsTagAttribute(description="Javascript code in the fetched content will be executed", type="Boolean", defaultValue="false")
|
||||
public void setExecuteScripts(String executeScripts) {
|
||||
this.executeScripts = executeScripts;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.struts2.components.RemoteUICallBean#setLoadingText(java.lang.String)
|
||||
*/
|
||||
@StrutsTagAttribute(description="Text to be shown while content is being fetched", defaultValue="Loading...")
|
||||
public void setLoadingText(String loadingText) {
|
||||
this.loadingText = loadingText;
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.struts2.components.RemoteUICallBean#setHandler(java.lang.String)
|
||||
*/
|
||||
@StrutsTagAttribute(description="Javascript function name that will make the request")
|
||||
public void setHandler(String handler) {
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.struts2.components.RemoteUICallBean#setFormFilter(java.lang.String)
|
||||
*/
|
||||
@StrutsTagAttribute(description="Function name used to filter the fields of the form.")
|
||||
public void setFormFilter(String formFilter) {
|
||||
this.formFilter = formFilter;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.struts2.components.RemoteUICallBean#setFormId(java.lang.String)
|
||||
*/
|
||||
@StrutsTagAttribute(description="Form id whose fields will be serialized and passed as parameters")
|
||||
public void setFormId(String formId) {
|
||||
this.formId = formId;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.struts2.components.RemoteUICallBean#setNotifyTopics(java.lang.String)
|
||||
*/
|
||||
@StrutsTagAttribute(description="Topics that will published when the remote call completes")
|
||||
public void setNotifyTopics(String notifyTopics) {
|
||||
this.notifyTopics = notifyTopics;
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.struts2.components.RemoteUICallBean#setShowErrorTransportText(java.lang.String)
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set whether errors will be shown or not", type="Boolean", defaultValue="true")
|
||||
public void setShowErrorTransportText(String showError) {
|
||||
this.showErrorTransportText = showError;
|
||||
}
|
||||
|
||||
|
||||
@StrutsTagAttribute(description="Id of element that will be shown while making request")
|
||||
public void setIndicator(String indicator) {
|
||||
this.indicator = indicator;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ import javax.servlet.jsp.PageContext;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.apache.struts2.dispatcher.Dispatcher;
|
||||
@@ -110,9 +112,8 @@ import com.opensymphony.xwork2.util.ValueStackFactory;
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @s.tag name="action" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ActionTag"
|
||||
* description="Execute an action from within a view"
|
||||
*/
|
||||
@StrutsTag(name="action", tldTagClass="org.apache.struts2.views.jsp.ActionTag", description="Execute an action from within a view")
|
||||
public class ActionComponent extends Component {
|
||||
private static final Log LOG = LogFactory.getLog(ActionComponent.class);
|
||||
|
||||
@@ -132,7 +133,7 @@ public class ActionComponent extends Component {
|
||||
this.req = req;
|
||||
this.res = res;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param actionProxyFactory the actionProxyFactory to set
|
||||
*/
|
||||
@@ -244,7 +245,7 @@ public class ActionComponent extends Component {
|
||||
ValueStack stack = getStack();
|
||||
// execute at this point, after params have been set
|
||||
try {
|
||||
|
||||
|
||||
proxy = actionProxyFactory.createActionProxy(namespace, actionName, createExtraContext(), executeResult, true);
|
||||
if (null != methodName) {
|
||||
proxy.setMethod(methodName);
|
||||
@@ -267,50 +268,27 @@ public class ActionComponent extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* the id (if speficied) to put the action under stack's context.
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setId(String id) {
|
||||
super.setId(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* name of the action to be executed (without the extension suffix eg. .action)
|
||||
* @s.tagattribute required="true" type="String"
|
||||
*/
|
||||
@StrutsTagAttribute(required=true,description="Name of the action to be executed (without the extension suffix eg. .action)")
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* namespace for action to call
|
||||
* @s.tagattribute required="false" type="String" default="namespace from where tag is used"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Namespace for action to call", defaultValue="namespace from where tag is used")
|
||||
public void setNamespace(String namespace) {
|
||||
this.namespace = namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* whether the result of this action (probably a view) should be executed/rendered
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Whether the result of this action (probably a view) should be executed/rendered", type="Boolean", defaultValue="false")
|
||||
public void setExecuteResult(boolean executeResult) {
|
||||
this.executeResult = executeResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* whether the request parameters are to be included when the action is invoked
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Whether the request parameters are to be included when the action is invoked", type="Boolean", defaultValue="false")
|
||||
public void setIgnoreContextParams(boolean ignoreContextParams) {
|
||||
this.ignoreContextParams = ignoreContextParams;
|
||||
}
|
||||
|
||||
/**
|
||||
* whether the writer should be flush upon end of action component tag, default to true.
|
||||
* @s.tagattribute required="false" type="Boolean" default="true"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Whether the writer should be flush upon end of action component tag, default to true", type="Boolean", defaultValue="true")
|
||||
public void setFlush(boolean flush) {
|
||||
this.flush = flush;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ package org.apache.struts2.components;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
@@ -46,9 +48,8 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @s.tag name="actionerror" tld-body-content="empty" tld-tag-class="org.apache.struts2.views.jsp.ui.ActionErrorTag"
|
||||
* description="Render action errors if they exists"
|
||||
*/
|
||||
@StrutsTag(name="actionerror", tldBodyContent="empty", tldTagClass="org.apache.struts2.views.jsp.ui.ActionErrorTag", description="Render action errors if they exists")
|
||||
public class ActionError extends UIBean {
|
||||
|
||||
public static final String TEMPLATE = "actionerror";
|
||||
|
||||
@@ -23,6 +23,8 @@ package org.apache.struts2.components;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
@@ -44,9 +46,8 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @s.tag name="actionmessage" tld-body-content="empty" tld-tag-class="org.apache.struts2.views.jsp.ui.ActionMessageTag"
|
||||
* description="Render action messages if they exists"
|
||||
*/
|
||||
@StrutsTag(name="actionmessage", tldBodyContent="empty", tldTagClass="org.apache.struts2.views.jsp.ui.ActionMessageTag", description="Render action messages if they exists")
|
||||
public class ActionMessage extends UIBean {
|
||||
|
||||
private static final String TEMPLATE = "actionmessage";
|
||||
|
||||
@@ -23,6 +23,9 @@ package org.apache.struts2.components;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
@@ -73,7 +76,7 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* <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>
|
||||
* <li>request: request javascript object, when type='load' or type='error'</li>
|
||||
* <ul>
|
||||
* </ul>
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
*
|
||||
* <p/> <b>Examples</b>
|
||||
@@ -121,11 +124,8 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* <!-- END SNIPPET: example3 -->
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @s.tag name="a" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.AnchorTag"
|
||||
* description="Render a HTML href element that when clicked calls a URL via remote XMLHttpRequest and updates its targets"
|
||||
*
|
||||
*/
|
||||
@StrutsTag(name="a", tldTagClass="org.apache.struts2.views.jsp.ui.AnchorTag", description="Render a HTML href element that when clicked can optionally call a URL via remote XMLHttpRequest and updates its targets")
|
||||
public class Anchor extends AbstractRemoteCallUIBean {
|
||||
public static final String OPEN_TEMPLATE = "a";
|
||||
public static final String TEMPLATE = "a-close";
|
||||
@@ -152,20 +152,19 @@ public class Anchor extends AbstractRemoteCallUIBean {
|
||||
addParameter("targets", findString(targets));
|
||||
}
|
||||
|
||||
/**
|
||||
* The id to assign the component
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setId(String id) {
|
||||
super.setId(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Comma delimited list of ids of the elements whose content will be updated
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Comma delimited list of ids of the elements whose content will be updated")
|
||||
public void setTargets(String targets) {
|
||||
this.targets = targets;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(name="onLoadJS", description="Deprecated. Use 'notifyTopics'. Javascript code execute after reload")
|
||||
public void setAfterLoading(String afterLoading) {
|
||||
this.afterLoading = afterLoading;
|
||||
}
|
||||
|
||||
|
||||
@StrutsTagAttribute(name="preInvokeJS", description="Deprecated. Use 'notifyTopics'. Javascript code execute before reload")
|
||||
public void setBeforeLoading(String beforeLoading) {
|
||||
this.beforeLoading = beforeLoading;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@ import java.util.List;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.components.Param.UnnamedParametric;
|
||||
import org.apache.struts2.util.AppendIteratorFilter;
|
||||
import org.apache.struts2.util.MakeIterator;
|
||||
@@ -112,9 +114,8 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* @see org.apache.struts2.util.AppendIteratorFilter
|
||||
* @see org.apache.struts2.views.jsp.iterator.AppendIteratorTag
|
||||
*
|
||||
* @s.tag name="append" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.iterator.AppendIteratorTag"
|
||||
* description="Append the values of a list of iterators to one iterator"
|
||||
*/
|
||||
@StrutsTag(name="append", tldTagClass="org.apache.struts2.views.jsp.iterator.AppendIteratorTag", description="Append the values of a list of iterators to one iterator")
|
||||
public class AppendIterator extends Component implements UnnamedParametric {
|
||||
|
||||
private static final Log _log = LogFactory.getLog(AppendIterator.class);
|
||||
@@ -161,10 +162,7 @@ public class AppendIterator extends Component implements UnnamedParametric {
|
||||
_parameters.add(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* the id of which if supplied will have the resultant appended iterator stored under in the stack's context
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="The id of which if supplied will have the resultant appended iterator stored under in the stack's context")
|
||||
public void setId(String id) {
|
||||
super.setId(id);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@ package org.apache.struts2.components;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
@@ -76,9 +79,8 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* <li>request: request javascript object, when type='load' or type='error'</li>
|
||||
* <ul>
|
||||
*
|
||||
* @s.tag name="autocompleter" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.AutocompleterTag"
|
||||
* description="Renders a combobox with autocomplete and AJAX capabilities"
|
||||
*/
|
||||
@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 {
|
||||
public static final String TEMPLATE = "autocompleter";
|
||||
final private static String COMPONENT_NAME = Autocompleter.class.getName();
|
||||
@@ -168,137 +170,90 @@ public class Autocompleter extends ComboBox {
|
||||
return (list != null) ? findValue(list, Object.class) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* sets if combobox must perform autocomplete
|
||||
* @s.tagattribute required="false" type="Boolean" default="true"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Whether autocompleter should make suggestion on the textbox", type="Boolean", defaultValue="false")
|
||||
public void setAutoComplete(String autoComplete) {
|
||||
this.autoComplete = autoComplete;
|
||||
}
|
||||
|
||||
/**
|
||||
* sets combobox to enabled or disabled
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Enable or disable autocompleter", type="Boolean", defaultValue="false")
|
||||
public void setDisabled(String disabled) {
|
||||
this.disabled = disabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* sets if user can enter a value that is not in a list
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Force selection to be one of the options", type="Boolean", defaultValue="false")
|
||||
public void setForceValidOption(String forceValidOption) {
|
||||
this.forceValidOption = forceValidOption;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL to call to obtain the content
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
@StrutsTagAttribute(description="The URL used to load the options")
|
||||
public void setHref(String href) {
|
||||
this.href = href;
|
||||
}
|
||||
|
||||
/**
|
||||
* set delay before making the search
|
||||
* @s.tagattribute required="false" type="Integer" default="100"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Delay before making the search", type="Integer", defaultValue="100")
|
||||
public void setDelay(String searchDelay) {
|
||||
this.delay = searchDelay;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* set how the search must be performed, options are: "startstring", "startword" and "substring"
|
||||
* @s.tagattribute required="false" default="stringstart" type="String"
|
||||
*/
|
||||
@StrutsTagAttribute(description="how the search must be performed, options are: 'startstring', 'startword' " +
|
||||
"and 'substring'", defaultValue="stringstart")
|
||||
public void setSearchType(String searchType) {
|
||||
this.searchType = searchType;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the height of the dropdown in pixels
|
||||
* @s.tagattribute required="false" default="120" type="Integer"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Dropdown's height in pixels", type="Integer", defaultValue="120")
|
||||
public void setDropdownHeight(String height) {
|
||||
this.dropdownHeight = height;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the width of the drodown, by default the same as the combobox
|
||||
* @s.tagattribute required="false" type="Integer"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Dropdown's width", type="Integer", defaultValue="same as textbox")
|
||||
public void setDropdownWidth(String width) {
|
||||
this.dropdownWidth = width;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function name used to filter the fields of the form.
|
||||
* This function takes as a parameter the element and returns true if the element
|
||||
* must be included.
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Function name used to filter the fields of the form")
|
||||
public void setFormFilter(String formFilter) {
|
||||
this.formFilter = formFilter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Form id whose fields will be serialized and passed as parameters
|
||||
*
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Form id whose fields will be serialized and passed as parameters")
|
||||
public void setFormId(String formId) {
|
||||
this.formId = formId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Topic that will trigger a re-fetch
|
||||
*
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Topic that will trigger a reload")
|
||||
public void setListenTopics(String listenTopics) {
|
||||
this.listenTopics = listenTopics;
|
||||
}
|
||||
|
||||
/**
|
||||
* Topic that will be published when content is fetched.
|
||||
* New Value is passed as parameter.
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Topics that will be published when content is reloaded")
|
||||
public void setNotifyTopics(String onValueChangedPublishTopic) {
|
||||
this.notifyTopics = onValueChangedPublishTopic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Id of element that will be shown while request is made
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Id of element that will be shown while request is made")
|
||||
public void setIndicator(String indicator) {
|
||||
this.indicator = indicator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Minimum number of characters that will force the content to be loaded
|
||||
* @s.tagattribute required="false" type="Integer" default="3"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Minimum number of characters that will force the content to be loaded", type="Integer", defaultValue="3")
|
||||
public void setLoadMinimumCount(String loadMinimumCount) {
|
||||
this.loadMinimumCount = loadMinimumCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options will be reloaded everytime a character is typed on the textbox.
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Options will be reloaded everytime a character is typed on the textbox", type="Boolean", defaultValue="true")
|
||||
public void setLoadOnTextChange(String loadOnType) {
|
||||
this.loadOnTextChange = loadOnType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show or hide the down arrow button
|
||||
* @s.tagattribute required="false" type="Boolean" default="true"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Show or hide the down arrow button", type="Boolean", defaultValue="true")
|
||||
public void setShowDownArrow(String showDownArrow) {
|
||||
this.showDownArrow = showDownArrow;
|
||||
}
|
||||
|
||||
// Override as not required
|
||||
@StrutsTagAttribute(description="Iteratable source to populate from.")
|
||||
public void setList(String list) {
|
||||
super.setList(list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,10 @@ import java.io.Writer;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import com.opensymphony.xwork2.util.ClassLoaderUtil;
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
import com.opensymphony.xwork2.util.OgnlUtil;
|
||||
@@ -89,19 +92,24 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* <!-- END SNIPPET: examplesdescription -->
|
||||
*
|
||||
* @see Param
|
||||
*
|
||||
* @s.tag name="bean" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.BeanTag"
|
||||
* description="Instantiate a JavaBean and place it in the context."
|
||||
*/
|
||||
@StrutsTag(name="bean", tldTagClass="org.apache.struts2.views.jsp.BeanTag",
|
||||
description="Instantiate a JavaBean and place it in the context")
|
||||
public class Bean extends Component {
|
||||
protected static Log log = LogFactory.getLog(Bean.class);
|
||||
|
||||
protected Object bean;
|
||||
protected String name;
|
||||
protected ObjectFactory objectFactory;
|
||||
|
||||
public Bean(ValueStack stack) {
|
||||
super(stack);
|
||||
}
|
||||
|
||||
@Inject
|
||||
public void setObjectFactory(ObjectFactory objectFactory) {
|
||||
this.objectFactory = objectFactory;
|
||||
}
|
||||
|
||||
public boolean start(Writer writer) {
|
||||
boolean result = super.start(writer);
|
||||
@@ -110,7 +118,7 @@ public class Bean extends Component {
|
||||
|
||||
try {
|
||||
String beanName = findString(name, "name", "Bean name is required. Example: com.acme.FooBean");
|
||||
bean = ObjectFactory.getObjectFactory().buildBean(ClassLoaderUtil.loadClass(beanName, getClass()), stack.getContext());
|
||||
bean = objectFactory.buildBean(ClassLoaderUtil.loadClass(beanName, getClass()), stack.getContext());
|
||||
} catch (Exception e) {
|
||||
log.error("Could not instantiate bean", e);
|
||||
|
||||
@@ -139,10 +147,8 @@ public class Bean extends Component {
|
||||
OgnlUtil.setProperty(key, value, bean, getStack().getContext());
|
||||
}
|
||||
|
||||
/**
|
||||
* the class name of the bean to be instantiated (must respect JavaBean specification)
|
||||
* @s.tagattribute required="true" type="String"
|
||||
*/
|
||||
@StrutsTagAttribute(description="The class name of the bean to be instantiated (must respect JavaBean specification)",
|
||||
required=true)
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@ package org.apache.struts2.components;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
@@ -46,9 +49,8 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @s.tag name="checkbox" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.CheckboxTag"
|
||||
* description="Render a checkbox input field"
|
||||
*/
|
||||
*/
|
||||
@StrutsTag(name="checkbox", tldTagClass="org.apache.struts2.views.jsp.ui.CheckboxTag", description="Render a checkbox input field")
|
||||
public class Checkbox extends UIBean {
|
||||
final public static String TEMPLATE = "checkbox";
|
||||
|
||||
@@ -74,10 +76,7 @@ public class Checkbox extends UIBean {
|
||||
return Boolean.class; // for checkboxes, everything needs to end up as a Boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* The actual HTML value attribute of the checkbox.
|
||||
* @s.tagattribute required="false" default="'true'"
|
||||
*/
|
||||
@StrutsTagAttribute(description="The actual HTML value attribute of the checkbox.", defaultValue="true")
|
||||
public void setFieldValue(String fieldValue) {
|
||||
this.fieldValue = fieldValue;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ package org.apache.struts2.components;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
@@ -40,9 +42,8 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @s.tag name="checkboxlist" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.CheckboxListTag"
|
||||
* description="Render a list of checkboxes"
|
||||
*/
|
||||
*/
|
||||
@StrutsTag(name="checkboxlist", tldTagClass="org.apache.struts2.views.jsp.ui.CheckboxListTag", description="Render a list of checkboxes")
|
||||
public class CheckboxList extends ListUIBean {
|
||||
final public static String TEMPLATE = "checkboxlist";
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
@@ -44,10 +45,7 @@ public abstract class ClosingUIBean extends UIBean {
|
||||
|
||||
public abstract String getDefaultOpenTemplate();
|
||||
|
||||
/**
|
||||
* Set template to use for opening the rendered html.
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set template to use for opening the rendered html.")
|
||||
public void setOpenTemplate(String openTemplate) {
|
||||
this.openTemplate = openTemplate;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@ import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.util.MakeIterator;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
@@ -85,9 +87,8 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @s.tag name="combobox" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.ComboBoxTag"
|
||||
* description="Widget that fills a text box from a select"
|
||||
*/
|
||||
*/
|
||||
@StrutsTag(name="combobox", tldTagClass="org.apache.struts2.views.jsp.ui.ComboBoxTag", description="Widget that fills a text box from a select")
|
||||
public class ComboBox extends TextField {
|
||||
final public static String TEMPLATE = "combobox";
|
||||
|
||||
@@ -165,50 +166,33 @@ public class ComboBox extends TextField {
|
||||
"Example: people or people.{name}");
|
||||
}
|
||||
|
||||
/**
|
||||
* Iteratable source to populate from. If this is missing, the select widget is simply not displayed.
|
||||
* @s.tagattribute required="true"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Iteratable source to populate from. " +
|
||||
"If this is missing, the select widget is simply not displayed.", required=true)
|
||||
public void setList(String list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decide if an empty option is to be inserted. Default false.
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Decide if an empty option is to be inserted. Default false.")
|
||||
public void setEmptyOption(String emptyOption) {
|
||||
this.emptyOption = emptyOption;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the header key for the header option.
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the header key for the header option.")
|
||||
public void setHeaderKey(String headerKey) {
|
||||
this.headerKey = headerKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the header value for the header option.
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the header value for the header option.")
|
||||
public void setHeaderValue(String headerValue) {
|
||||
this.headerValue = headerValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the key used to retrive the option key.
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the key used to retrive the option key.")
|
||||
public void setListKey(String listKey) {
|
||||
this.listKey = listKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the value used to retrive the option value.
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the value used to retrive the option value.")
|
||||
public void setListValue(String listValue) {
|
||||
this.listValue = listValue;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import java.util.Stack;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapper;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
||||
@@ -39,9 +40,6 @@ import org.apache.struts2.views.jsp.TagUtils;
|
||||
import org.apache.struts2.views.util.ContextUtil;
|
||||
import org.apache.struts2.views.util.UrlHelper;
|
||||
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
import com.opensymphony.xwork2.config.Configuration;
|
||||
import com.opensymphony.xwork2.inject.Container;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import com.opensymphony.xwork2.util.TextParseUtil;
|
||||
@@ -453,10 +451,7 @@ public class Component {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* id for referencing element. For UI and form tags it will be used as HTML id attribute
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="id for referencing element. For UI and form tags it will be used as HTML id attribute")
|
||||
public void setId(String id) {
|
||||
if (id != null) {
|
||||
this.id = findString(id);
|
||||
|
||||
@@ -30,6 +30,8 @@ import java.util.List;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.TextProvider;
|
||||
@@ -135,10 +137,8 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
*
|
||||
* <code>Date</code>
|
||||
*
|
||||
* @s.tag name="date" tld-body-content="empty"
|
||||
* tld-tag-class="org.apache.struts2.views.jsp.DateTag"
|
||||
* description="Render a formatted date."
|
||||
*/
|
||||
@StrutsTag(name="date", tldBodyContent="empty", tldTagClass="org.apache.struts2.views.jsp.DateTag", description="Render a formatted date.")
|
||||
public class Date extends Component {
|
||||
|
||||
private static final Log LOG = LogFactory.getLog(Date.class);
|
||||
@@ -336,20 +336,12 @@ public class Date extends Component {
|
||||
return super.end(writer, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Date or DateTime format pattern
|
||||
*
|
||||
* @s.tagattribute required="false" rtexprvalue="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Date or DateTime format pattern", rtexprvalue=false)
|
||||
public void setFormat(String format) {
|
||||
this.format = format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to print out the date nicely
|
||||
*
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Whether to print out the date nicely", type="Boolean", defaultValue="false")
|
||||
public void setNice(boolean nice) {
|
||||
this.nice = nice;
|
||||
}
|
||||
@@ -361,11 +353,7 @@ public class Date extends Component {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date value to format
|
||||
*
|
||||
* @s.tagattribute required="true" type="String"
|
||||
*/
|
||||
@StrutsTagAttribute(description="The date value to format", required=true)
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@@ -1,228 +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.components;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* <p>
|
||||
* Renders datepicker element.
|
||||
* </p>
|
||||
* <p>
|
||||
* A stand-alone DatePicker widget that makes it easy to select a date, or increment by week, month,
|
||||
* and/or year.
|
||||
* </p>
|
||||
* Dates attributes passed in the `RFC 3339` format:
|
||||
*
|
||||
* Renders datepicker element.</p>
|
||||
* Format supported by this component are:-
|
||||
* <table border="1">
|
||||
* <tr>
|
||||
* <td>Format</td>
|
||||
* <td>Description</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>#dd</td>
|
||||
* <td>Display day in two digits format</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>#d</td>
|
||||
* <td>Try to display day in one digit format, if cannot use 2 digit format</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>#MM</td>
|
||||
* <td>Display month in two digits format</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>#M</td>
|
||||
* <td>Try to display month in one digits format, if cannot use 2 digit format</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>#yyyy</td>
|
||||
* <td>Display year in four digits format</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>#yy</td>
|
||||
* <td>Display the last two digits of the yaer</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>#y</td>
|
||||
* <td>Display the last digits of the year</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* <p/>
|
||||
*
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
*
|
||||
* <b>Examples</b>
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: expl1 -->
|
||||
*
|
||||
* Example 1:
|
||||
* <s:datepicker name="order.date" label="Order Date" />
|
||||
* Example 2:
|
||||
* <s:datepicker name="delivery.date" label="Delivery Date" format="#yyyy-#MM-#dd" />
|
||||
*
|
||||
* <!-- END SNIPPET: expl1 -->
|
||||
* </pre>
|
||||
* <p/>
|
||||
*
|
||||
* <!-- START SNIPPET: expldesc2 -->
|
||||
*
|
||||
* The css could be changed by using the following :-
|
||||
*
|
||||
* <!-- END SNIPPET: expldesc2 -->
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: expl2 -->
|
||||
*
|
||||
* <s:datepicker name="birthday" label="Birthday" templateCss="...." />
|
||||
*
|
||||
* <!-- END SNIPPET: expl2 -->
|
||||
* </pre>
|
||||
*
|
||||
* @s.tag name="datepicker" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.DatePickerTag"
|
||||
* description="Render datepicker"
|
||||
*/
|
||||
public class DatePicker extends UIBean {
|
||||
|
||||
final public static String TEMPLATE = "datepicker";
|
||||
|
||||
protected String displayWeeks;
|
||||
protected String adjustWeeks;
|
||||
protected String startDate;
|
||||
protected String endDate;
|
||||
protected String weekStartsOn;
|
||||
protected String staticDisplay;
|
||||
protected String dayWidth;
|
||||
protected String language;
|
||||
|
||||
public DatePicker(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
}
|
||||
|
||||
protected String getDefaultTemplate() {
|
||||
return TEMPLATE;
|
||||
}
|
||||
|
||||
public void evaluateParams() {
|
||||
super.evaluateParams();
|
||||
|
||||
if(displayWeeks != null)
|
||||
addParameter("displayWeeks", findString(displayWeeks));
|
||||
if(adjustWeeks != null)
|
||||
addParameter("adjustWeeks", findValue(adjustWeeks, Boolean.class));
|
||||
if(startDate != null)
|
||||
addParameter("startDate", findString(startDate));
|
||||
if(endDate != null)
|
||||
addParameter("endDate", findString(endDate));
|
||||
if(weekStartsOn != null)
|
||||
addParameter("weekStartsOn", findString(weekStartsOn));
|
||||
if(staticDisplay != null)
|
||||
addParameter("staticDisplay", findValue(staticDisplay, Boolean.class));
|
||||
if(dayWidth != null)
|
||||
addParameter("dayWidth", findValue(dayWidth, Integer.class));
|
||||
if(language != null)
|
||||
addParameter("language", findString(language));
|
||||
if(value != null)
|
||||
addParameter("value", findString(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* If true, weekly size of calendar changes to acomodate the month if false, 42 day format is
|
||||
* used
|
||||
*
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
public void setAdjustWeeks(String adjustWeeks) {
|
||||
this.adjustWeeks = adjustWeeks;
|
||||
}
|
||||
|
||||
/**
|
||||
* How to render the names of the days in the header(narrow, abbr or wide)
|
||||
*
|
||||
* @s.tagattribute required="false" type="String" default="narrow"
|
||||
*/
|
||||
public void setDayWidth(String dayWidth) {
|
||||
this.dayWidth = dayWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total weeks to display
|
||||
*
|
||||
* @s.tagattribute required="false" type="Integer" default="6"
|
||||
*/
|
||||
public void setDisplayWeeks(String displayWeeks) {
|
||||
this.displayWeeks = displayWeeks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last available date in the calendar set
|
||||
*
|
||||
* @s.tagattribute required="false" type="Date" default="2941-10-12"
|
||||
*/
|
||||
public void setEndDate(String endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* First available date in the calendar set
|
||||
*
|
||||
* @s.tagattribute required="false" type="Date" default="1492-10-12"
|
||||
*/
|
||||
public void setStartDate(String startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable all incremental controls, must pick a date in the current display
|
||||
*
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
public void setStaticDisplay(String staticDisplay) {
|
||||
this.staticDisplay = staticDisplay;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjusts the first day of the week 0==Sunday..6==Saturday
|
||||
*
|
||||
* @s.tagattribute required="false" type="Integer" default="0"
|
||||
*/
|
||||
public void setWeekStartsOn(String weekStartsOn) {
|
||||
this.weekStartsOn = weekStartsOn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Language to display this widget in (like en-us).
|
||||
*
|
||||
* @s.tagattribute required="false" type="String" default="brower's specified preferred language"
|
||||
*/
|
||||
public void setLanguage(String language) {
|
||||
this.language = language;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,312 @@
|
||||
/*
|
||||
* $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.components;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* <p>
|
||||
* Renders a date/time picker in a dropdown container.
|
||||
* </p>
|
||||
* <p>
|
||||
* 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:
|
||||
*
|
||||
* 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>#dd</td>
|
||||
* <td>Display day in two digits format</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>#d</td>
|
||||
* <td>Try to display day in one digit format, if cannot use 2 digit format</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>#MM</td>
|
||||
* <td>Display month in two digits format</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>#M</td>
|
||||
* <td>Try to display month in one digits format, if cannot use 2 digit format</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>#yyyy</td>
|
||||
* <td>Display year in four digits format</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>#yy</td>
|
||||
* <td>Display the last two digits of the yaer</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>#y</td>
|
||||
* <td>Display the last digits of the year</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* <p>
|
||||
* 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 used by default, but other options are
|
||||
* available with saveFormat
|
||||
* </p>
|
||||
*
|
||||
* <p/>
|
||||
*
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
*
|
||||
* <b>Examples</b>
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: expl1 -->
|
||||
*
|
||||
* Example 1:
|
||||
* <s:datetimepicker name="order.date" label="Order Date" />
|
||||
* Example 2:
|
||||
* <s:datetimepicker name="delivery.date" label="Delivery Date" format="#yyyy-#MM-#dd" />
|
||||
*
|
||||
* <!-- END SNIPPET: expl1 -->
|
||||
* </pre>
|
||||
* <p/>
|
||||
*
|
||||
* <!-- START SNIPPET: expldesc2 -->
|
||||
*
|
||||
* The css could be changed by using the following :-
|
||||
*
|
||||
* <!-- END SNIPPET: expldesc2 -->
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: expl2 -->
|
||||
*
|
||||
* <s:datetimepicker name="birthday" label="Birthday" templateCss="...." />
|
||||
*
|
||||
* <!-- END SNIPPET: expl2 -->
|
||||
* </pre>
|
||||
*
|
||||
*/
|
||||
@StrutsTag(name="datetimepicker", tldTagClass="org.apache.struts2.views.jsp.ui.DateTimePickerTag", description="Render datetimepicker")
|
||||
public class DateTimePicker extends UIBean {
|
||||
|
||||
final public static String TEMPLATE = "datetimepicker";
|
||||
final private static SimpleDateFormat RFC3399_FORMAT = new SimpleDateFormat(
|
||||
"yyyy-MM-dd'T'HH:mm:ss");
|
||||
final protected static Log LOG = LogFactory.getLog(DateTimePicker.class);
|
||||
|
||||
protected String iconPath;
|
||||
protected String formatLength;
|
||||
protected String displayFormat;
|
||||
protected String toggleType;
|
||||
protected String toggleDuration;
|
||||
protected String type;
|
||||
|
||||
protected String displayWeeks;
|
||||
protected String adjustWeeks;
|
||||
protected String startDate;
|
||||
protected String endDate;
|
||||
protected String weekStartsOn;
|
||||
protected String staticDisplay;
|
||||
protected String dayWidth;
|
||||
protected String language;
|
||||
|
||||
public DateTimePicker(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
}
|
||||
|
||||
protected String getDefaultTemplate() {
|
||||
return TEMPLATE;
|
||||
}
|
||||
|
||||
public void evaluateParams() {
|
||||
super.evaluateParams();
|
||||
|
||||
if(displayWeeks != null)
|
||||
addParameter("displayWeeks", findString(displayWeeks));
|
||||
if(adjustWeeks != null)
|
||||
addParameter("adjustWeeks", findValue(adjustWeeks, Boolean.class));
|
||||
if(startDate != null)
|
||||
addParameter("startDate", findString(startDate));
|
||||
if(endDate != null)
|
||||
addParameter("endDate", findString(endDate));
|
||||
if(weekStartsOn != null)
|
||||
addParameter("weekStartsOn", findString(weekStartsOn));
|
||||
if(staticDisplay != null)
|
||||
addParameter("staticDisplay", findValue(staticDisplay, Boolean.class));
|
||||
if(dayWidth != null)
|
||||
addParameter("dayWidth", findValue(dayWidth, Integer.class));
|
||||
if(language != null)
|
||||
addParameter("language", findString(language));
|
||||
if(value != null)
|
||||
addParameter("value", findString(value));
|
||||
if(iconPath != null)
|
||||
addParameter("iconPath", iconPath);
|
||||
if(formatLength != null)
|
||||
addParameter("formatLength", findString(formatLength));
|
||||
if(displayFormat != null)
|
||||
addParameter("displayFormat", findString(displayFormat));
|
||||
if(toggleType != null)
|
||||
addParameter("toggleType", findString(toggleType));
|
||||
if(toggleDuration != null)
|
||||
addParameter("toggleDuration", findValue(toggleDuration,
|
||||
Integer.class));
|
||||
if(type != null)
|
||||
addParameter("type", findString(type));
|
||||
else
|
||||
addParameter("type", "date");
|
||||
|
||||
// format the value to RFC 3399
|
||||
if(parameters.containsKey("value")) {
|
||||
parameters.put("nameValue", format(parameters.get("value")));
|
||||
} else {
|
||||
if(name != null) {
|
||||
String expr = name;
|
||||
if(altSyntax()) {
|
||||
expr = "%{" + expr + "}";
|
||||
}
|
||||
addParameter("nameValue", format(findValue(expr)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="If true, weekly size of calendar changes to acomodate the month if false," +
|
||||
" 42 day format is used", type="Boolean", defaultValue="false")
|
||||
public void setAdjustWeeks(String adjustWeeks) {
|
||||
this.adjustWeeks = adjustWeeks;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="How to render the names of the days in the header(narrow, abbr or wide)", defaultValue="narrow")
|
||||
public void setDayWidth(String dayWidth) {
|
||||
this.dayWidth = dayWidth;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Total weeks to display", type="Integer", defaultValue="6")
|
||||
public void setDisplayWeeks(String displayWeeks) {
|
||||
this.displayWeeks = displayWeeks;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Last available date in the calendar set", type="Date", defaultValue="2941-10-12")
|
||||
public void setEndDate(String endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="First available date in the calendar set", type="Date", defaultValue="1492-10-12")
|
||||
public void setStartDate(String startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Disable all incremental controls, must pick a date in the current display", type="Boolean", defaultValue="false")
|
||||
public void setStaticDisplay(String staticDisplay) {
|
||||
this.staticDisplay = staticDisplay;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Adjusts the first day of the week 0==Sunday..6==Saturday", type="Integer", defaultValue="0")
|
||||
public void setWeekStartsOn(String weekStartsOn) {
|
||||
this.weekStartsOn = weekStartsOn;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Language to display this widget in", defaultValue="brower's specified preferred language")
|
||||
public void setLanguage(String language) {
|
||||
this.language = language;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="A pattern used for the visual display of the formatted date, e.g. dd/MM/yyyy")
|
||||
public void setDisplayFormat(String displayFormat) {
|
||||
this.displayFormat = displayFormat;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Type of formatting used for visual display. Possible values are " +
|
||||
"long, short, medium or full", defaultValue="short")
|
||||
public void setFormatLength(String formatLength) {
|
||||
this.formatLength = formatLength;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description=" Path to icon used for the dropdown")
|
||||
public void setIconPath(String iconPath) {
|
||||
this.iconPath = iconPath;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Duration of toggle in milliseconds", type="Integer", defaultValue="100")
|
||||
public void setToggleDuration(String toggleDuration) {
|
||||
this.toggleDuration = toggleDuration;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Defines the type of the picker on the dropdown. Possible values are 'date'" +
|
||||
" for a DateTimePicker, and 'time' for a timePicker", defaultValue="date")
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="oggle type of the dropdown. Possible values are plain,wipe,explode,fade", defaultValue="plain")
|
||||
public void setToggleType(String toggleType) {
|
||||
this.toggleType = toggleType;
|
||||
}
|
||||
|
||||
private String format(Object obj) {
|
||||
if(obj == null)
|
||||
return null;
|
||||
|
||||
if(obj instanceof Date) {
|
||||
return RFC3399_FORMAT.format((Date) obj);
|
||||
} else {
|
||||
// try to parse a date
|
||||
String dateStr = obj.toString();
|
||||
if(dateStr.equalsIgnoreCase("today"))
|
||||
return RFC3399_FORMAT.format(new Date());
|
||||
|
||||
try {
|
||||
Date date = null;
|
||||
if(this.displayFormat != null) {
|
||||
SimpleDateFormat format = new SimpleDateFormat(
|
||||
this.displayFormat);
|
||||
date = format.parse(dateStr);
|
||||
return RFC3399_FORMAT.format(date);
|
||||
} else {
|
||||
// last resource to assume already in correct/default format
|
||||
return dateStr;
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
LOG.error("Could not parse date", e);
|
||||
return dateStr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -31,9 +31,11 @@ import java.util.Map;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.StrutsException;
|
||||
|
||||
|
||||
@StrutsTag(name="debug", tldTagClass="org.apache.struts2.views.jsp.ui.DebugTag",
|
||||
description="Prints debugging information")
|
||||
public class Debug extends UIBean {
|
||||
public static final String TEMPLATE = "debug";
|
||||
|
||||
|
||||
@@ -23,17 +23,20 @@ package org.apache.struts2.components;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* The div tag when used on the ajax theme, provides a remote call
|
||||
* from the current page to update a section of content without having to refresh the entire page.<p/>
|
||||
*
|
||||
* from the current page to update a section of content without having to refresh the entire page.
|
||||
* <p>
|
||||
* It creates a HTML <DIV /> that obtains it's content via a remote XMLHttpRequest call via
|
||||
* the dojo framework.<p/>
|
||||
*
|
||||
* the dojo framework.
|
||||
* </p>
|
||||
* <div>
|
||||
* <!-- START SNIPPET: ajaxJavadoc -->
|
||||
* <B>THE FOLLOWING IS ONLY VALID WHEN AJAX IS CONFIGURED</B>
|
||||
* <ul>
|
||||
@@ -73,15 +76,14 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* '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>
|
||||
* '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>
|
||||
* <li>request: request javascript object, when type='load' or type='error'</li>
|
||||
* <ul>
|
||||
|
||||
* </ul>
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
* <p/> <b>Examples</b>
|
||||
* </div><p> <b>Examples</b>
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
@@ -98,10 +100,10 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
*></s:div>
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
* </p>
|
||||
*
|
||||
* @s.tag name="div" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.DivTag"
|
||||
* description="Render HTML div providing content from remote call via AJAX"
|
||||
*/
|
||||
@StrutsTag(name="div", tldTagClass="org.apache.struts2.views.jsp.ui.DivTag", description="Render HTML div providing content from remote call via AJAX")
|
||||
public class Div extends AbstractRemoteCallUIBean {
|
||||
|
||||
public static final String TEMPLATE = "div";
|
||||
@@ -144,57 +146,38 @@ public class Div extends AbstractRemoteCallUIBean {
|
||||
addParameter("stopTimerListenTopics", findString(stopTimerListenTopics));
|
||||
}
|
||||
|
||||
/**
|
||||
* Start timer automatically
|
||||
*
|
||||
* @s.tagattribute required="false" type="Boolean" default="true"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Start timer automatically", type="Boolean", defaultValue="true")
|
||||
public void setAutoStart(String autoStart) {
|
||||
this.autoStart = autoStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* How long to wait before fetching the content (in milliseconds)
|
||||
*
|
||||
* @s.tagattribute required="false" type="Integer" default="0"
|
||||
*/
|
||||
@StrutsTagAttribute(description="How long to wait before fetching the content (in milliseconds)", type="Integer")
|
||||
public void setDelay(String delay) {
|
||||
this.delay = delay;
|
||||
}
|
||||
|
||||
/**
|
||||
* How often to re-fetch the content (in milliseconds)
|
||||
*
|
||||
* @s.tagattribute required="false" type="Integer" default="0"
|
||||
*/
|
||||
@StrutsTagAttribute(description="How often to reload the content (in milliseconds)", type="Integer")
|
||||
public void setUpdateFreq(String updateInterval) {
|
||||
this.updateFreq = updateInterval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Topic that will start the timer (for autoupdate)
|
||||
*
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Topics that will start the timer (for autoupdate)")
|
||||
public void setStartTimerListenTopics(String startTimerListenTopic) {
|
||||
this.startTimerListenTopics = startTimerListenTopic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Topic that will stop the timer (for autoupdate)
|
||||
*
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Topics that will stop the timer (for autoupdate)")
|
||||
public void setStopTimerListenTopics(String stopTimerListenTopic) {
|
||||
this.stopTimerListenTopics = stopTimerListenTopic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Content will be loaded when div becomes visible
|
||||
*
|
||||
* @s.tagattribute required="false" type="String" default="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Content will be loaded when div becomes visible, used only inside tabbedPanel", type="Boolean", defaultValue="false")
|
||||
public void setRefreshOnShow(String refreshOnShow) {
|
||||
this.refreshOnShow = refreshOnShow;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Deprecated. Use 'notifyTopics'. Javascript code execute after reload")
|
||||
public void setAfterLoading(String afterLoading) {
|
||||
this.afterLoading = afterLoading;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@ import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
@@ -266,50 +268,32 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The second iterable source to populate from.
|
||||
* @s.tagattribute required="true"
|
||||
*/
|
||||
@StrutsTagAttribute(description="The second iterable source to populate from.", required=true)
|
||||
public void setDoubleList(String doubleList) {
|
||||
this.doubleList = doubleList;
|
||||
}
|
||||
|
||||
/**
|
||||
* The key expression to use for second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="The key expression to use for second list")
|
||||
public void setDoubleListKey(String doubleListKey) {
|
||||
this.doubleListKey = doubleListKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* The value expression to use for second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="The value expression to use for second list")
|
||||
public void setDoubleListValue(String doubleListValue) {
|
||||
this.doubleListValue = doubleListValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name for complete component
|
||||
* @s.tagattribute required="true"
|
||||
*/
|
||||
@StrutsTagAttribute(description="The name for complete component", required=true)
|
||||
public void setDoubleName(String doubleName) {
|
||||
this.doubleName = doubleName;
|
||||
}
|
||||
|
||||
/**
|
||||
* The value expression for complete component
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="The value expression for complete component")
|
||||
public void setDoubleValue(String doubleValue) {
|
||||
this.doubleValue = doubleValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* The form name this component resides in and populates to
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="The form name this component resides in and populates to")
|
||||
public void setFormName(String formName) {
|
||||
this.formName = formName;
|
||||
}
|
||||
@@ -318,10 +302,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return formName;
|
||||
}
|
||||
|
||||
/**
|
||||
* The css class for the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="The css class for the second list")
|
||||
public void setDoubleCssClass(String doubleCssClass) {
|
||||
this.doubleCssClass = doubleCssClass;
|
||||
}
|
||||
@@ -330,10 +311,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleCssClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* The css style for the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="The css style for the second list")
|
||||
public void setDoubleCssStyle(String doubleCssStyle) {
|
||||
this.doubleCssStyle = doubleCssStyle;
|
||||
}
|
||||
@@ -342,10 +320,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleCssStyle;
|
||||
}
|
||||
|
||||
/**
|
||||
* The header key for the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="The header key for the second list")
|
||||
public void setDoubleHeaderKey(String doubleHeaderKey) {
|
||||
this.doubleHeaderKey = doubleHeaderKey;
|
||||
}
|
||||
@@ -354,10 +329,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleHeaderKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* The header value for the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="The header value for the second list")
|
||||
public void setDoubleHeaderValue(String doubleHeaderValue) {
|
||||
this.doubleHeaderValue = doubleHeaderValue;
|
||||
}
|
||||
@@ -366,10 +338,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleHeaderValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decides if the second list will add an empty option
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Decides if the second list will add an empty option")
|
||||
public void setDoubleEmptyOption(String doubleEmptyOption) {
|
||||
this.doubleEmptyOption = doubleEmptyOption;
|
||||
}
|
||||
@@ -383,10 +352,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleDisabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decides if a disable attribute should be added to the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Decides if a disable attribute should be added to the second list")
|
||||
public void setDoubleDisabled(String doubleDisabled) {
|
||||
this.doubleDisabled = doubleDisabled;
|
||||
}
|
||||
@@ -395,10 +361,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleId;
|
||||
}
|
||||
|
||||
/**
|
||||
* The id of the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="The id of the second list")
|
||||
public void setDoubleId(String doubleId) {
|
||||
this.doubleId = doubleId;
|
||||
}
|
||||
@@ -407,10 +370,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleMultiple;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decides if multiple attribute should be set on the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description=" Decides if multiple attribute should be set on the second list")
|
||||
public void setDoubleMultiple(String doubleMultiple) {
|
||||
this.doubleMultiple = doubleMultiple;
|
||||
}
|
||||
@@ -419,10 +379,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleOnblur;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the onblur attribute of the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the onblur attribute of the second list")
|
||||
public void setDoubleOnblur(String doubleOnblur) {
|
||||
this.doubleOnblur = doubleOnblur;
|
||||
}
|
||||
@@ -431,10 +388,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleOnchange;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the onchange attribute of the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the onchange attribute of the second list")
|
||||
public void setDoubleOnchange(String doubleOnchange) {
|
||||
this.doubleOnchange = doubleOnchange;
|
||||
}
|
||||
@@ -443,10 +397,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleOnclick;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the onclick attribute of the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the onclick attribute of the second list")
|
||||
public void setDoubleOnclick(String doubleOnclick) {
|
||||
this.doubleOnclick = doubleOnclick;
|
||||
}
|
||||
@@ -455,10 +406,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleOndblclick;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the ondbclick attribute of the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the ondbclick attribute of the second list")
|
||||
public void setDoubleOndblclick(String doubleOndblclick) {
|
||||
this.doubleOndblclick = doubleOndblclick;
|
||||
}
|
||||
@@ -467,10 +415,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleOnfocus;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the onfocus attribute of the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the onfocus attribute of the second list")
|
||||
public void setDoubleOnfocus(String doubleOnfocus) {
|
||||
this.doubleOnfocus = doubleOnfocus;
|
||||
}
|
||||
@@ -479,10 +424,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleOnkeydown;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the onkeydown attribute of the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the onkeydown attribute of the second list")
|
||||
public void setDoubleOnkeydown(String doubleOnkeydown) {
|
||||
this.doubleOnkeydown = doubleOnkeydown;
|
||||
}
|
||||
@@ -491,10 +433,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleOnkeypress;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the onkeypress attribute of the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the onkeypress attribute of the second list")
|
||||
public void setDoubleOnkeypress(String doubleOnkeypress) {
|
||||
this.doubleOnkeypress = doubleOnkeypress;
|
||||
}
|
||||
@@ -503,10 +442,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleOnkeyup;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the onkeyup attribute of the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the onkeyup attribute of the second list")
|
||||
public void setDoubleOnkeyup(String doubleOnkeyup) {
|
||||
this.doubleOnkeyup = doubleOnkeyup;
|
||||
}
|
||||
@@ -515,10 +451,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleOnmousedown;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the onmousedown attribute of the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the onmousedown attribute of the second list")
|
||||
public void setDoubleOnmousedown(String doubleOnmousedown) {
|
||||
this.doubleOnmousedown = doubleOnmousedown;
|
||||
}
|
||||
@@ -527,10 +460,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleOnmousemove;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the onmousemove attribute of the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the onmousemove attribute of the second list")
|
||||
public void setDoubleOnmousemove(String doubleOnmousemove) {
|
||||
this.doubleOnmousemove = doubleOnmousemove;
|
||||
}
|
||||
@@ -539,10 +469,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleOnmouseout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the onmouseout attribute of the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the onmouseout attribute of the second list")
|
||||
public void setDoubleOnmouseout(String doubleOnmouseout) {
|
||||
this.doubleOnmouseout = doubleOnmouseout;
|
||||
}
|
||||
@@ -551,10 +478,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleOnmouseover;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the onmouseover attribute of the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the onmouseover attribute of the second list")
|
||||
public void setDoubleOnmouseover(String doubleOnmouseover) {
|
||||
this.doubleOnmouseover = doubleOnmouseover;
|
||||
}
|
||||
@@ -563,10 +487,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleOnmouseup;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the onmouseup attribute of the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the onmouseup attribute of the second list")
|
||||
public void setDoubleOnmouseup(String doubleOnmouseup) {
|
||||
this.doubleOnmouseup = doubleOnmouseup;
|
||||
}
|
||||
@@ -575,10 +496,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleOnselect;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the onselect attribute of the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the onselect attribute of the second list")
|
||||
public void setDoubleOnselect(String doubleOnselect) {
|
||||
this.doubleOnselect = doubleOnselect;
|
||||
}
|
||||
@@ -587,10 +505,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the size attribute of the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the size attribute of the second list")
|
||||
public void setDoubleSize(String doubleSize) {
|
||||
this.doubleSize = doubleSize;
|
||||
}
|
||||
@@ -599,10 +514,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the list key of the second attribute
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the list key of the second attribute")
|
||||
public String getDoubleListKey() {
|
||||
return doubleListKey;
|
||||
}
|
||||
@@ -619,51 +531,36 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
return doubleValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decides of an empty option is to be inserted in the second list
|
||||
* @s.tagattribute required="false" default="false" type="Boolean"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Decides of an empty option is to be inserted in the second list", type="Boolean", defaultValue="false")
|
||||
public void setEmptyOption(String emptyOption) {
|
||||
this.emptyOption = emptyOption;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the header key of the second list. Must not be empty! "'-1'" and "''" is correct, "" is bad.
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the header key of the second list. Must not be empty! " +
|
||||
"'-1' and '' is correct, '' is bad.")
|
||||
public void setHeaderKey(String headerKey) {
|
||||
this.headerKey = headerKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the header value of the second list
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description=" Set the header value of the second list")
|
||||
public void setHeaderValue(String headerValue) {
|
||||
this.headerValue = headerValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a multiple select. The tag will pre-select multiple values if the values are passed as an Array (of appropriate types) via the value attribute.
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Creates a multiple select. " +
|
||||
"The tag will pre-select multiple values if the values are passed as an Array " +
|
||||
"(of appropriate types) via the value attribute.")
|
||||
public void setMultiple(String multiple) {
|
||||
// TODO: Passing a Collection may work too?
|
||||
this.multiple = multiple;
|
||||
}
|
||||
|
||||
/**
|
||||
* Size of the element box (# of elements to show)
|
||||
* @s.tagattribute required="false" type="Integer"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Size of the element box (# of elements to show)", type="Integer")
|
||||
public void setSize(String size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the html accesskey attribute.
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set the html accesskey attribute.")
|
||||
public void setDoubleAccesskey(String doubleAccesskey) {
|
||||
this.doubleAccesskey = doubleAccesskey;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ package org.apache.struts2.components;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
@@ -39,9 +41,9 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @s.tag name="doubleselect" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.DoubleSelectTag"
|
||||
* description="Renders two HTML select elements with second one changing displayed values depending on selected entry of first one."
|
||||
*/
|
||||
@StrutsTag(name="doubleselect", tldTagClass="org.apache.struts2.views.jsp.ui.DoubleSelectTag", description="Renders two HTML select elements with second one changing displayed values depending on " +
|
||||
"selected entry of first one.")
|
||||
public class DoubleSelect extends DoubleListUIBean {
|
||||
final public static String TEMPLATE = "doubleselect";
|
||||
|
||||
|
||||
@@ -1,193 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright 2006 The Apache Software Foundation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* <p>
|
||||
* Renders picker(datepicker or timepicker) in a dropdown container.
|
||||
* </p>
|
||||
* <p>
|
||||
* 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 used by default, but other options are
|
||||
* available with saveFormat
|
||||
* </p>
|
||||
*
|
||||
* @s.tag name="dropdowndatetimepicker" tld-body-content="JSP"
|
||||
* tld-tag-class="org.apache.struts2.views.jsp.ui.DropdownDateTimePickerTag"
|
||||
* description="Render a dropdown picker(datepicker or timepicker)"
|
||||
*/
|
||||
public class DropdownDateTimePicker extends DatePicker {
|
||||
final public static String TEMPLATE = "dropdowndatetimepicker";
|
||||
final private static SimpleDateFormat RFC3399_FORMAT = new SimpleDateFormat(
|
||||
"yyyy-MM-dd'T'HH:mm:ss");
|
||||
|
||||
protected String iconPath;
|
||||
protected String formatLength;
|
||||
protected String displayFormat;
|
||||
protected String toggleType;
|
||||
protected String toggleDuration;
|
||||
protected String type;
|
||||
|
||||
protected static Log log = LogFactory.getLog(DropdownDateTimePicker.class);
|
||||
|
||||
public DropdownDateTimePicker(ValueStack stack, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
}
|
||||
|
||||
protected String getDefaultTemplate() {
|
||||
return TEMPLATE;
|
||||
}
|
||||
|
||||
public void evaluateParams() {
|
||||
super.evaluateParams();
|
||||
|
||||
if(iconPath != null)
|
||||
addParameter("iconPath", iconPath);
|
||||
if(formatLength != null)
|
||||
addParameter("formatLength", findString(formatLength));
|
||||
if(displayFormat != null)
|
||||
addParameter("displayFormat", findString(displayFormat));
|
||||
if(toggleType != null)
|
||||
addParameter("toggleType", findString(toggleType));
|
||||
if(toggleDuration != null)
|
||||
addParameter("toggleDuration", findValue(toggleDuration,
|
||||
Integer.class));
|
||||
if(type != null)
|
||||
addParameter("type", findString(type));
|
||||
else
|
||||
addParameter("type", "date");
|
||||
|
||||
// format the value to RFC 3399
|
||||
if(parameters.containsKey("value")) {
|
||||
parameters.put("nameValue", format(parameters.get("value")));
|
||||
} else {
|
||||
if(name != null) {
|
||||
String expr = name;
|
||||
if(altSyntax()) {
|
||||
expr = "%{" + expr + "}";
|
||||
}
|
||||
addParameter("nameValue", format(findValue(expr)));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private String format(Object obj) {
|
||||
if(obj == null)
|
||||
return null;
|
||||
|
||||
if(obj instanceof Date) {
|
||||
return RFC3399_FORMAT.format((Date) obj);
|
||||
} else {
|
||||
// try to parse a date
|
||||
String dateStr = obj.toString();
|
||||
if(dateStr.equalsIgnoreCase("today"))
|
||||
return RFC3399_FORMAT.format(new Date());
|
||||
|
||||
try {
|
||||
Date date = null;
|
||||
if(this.displayFormat != null) {
|
||||
SimpleDateFormat format = new SimpleDateFormat(
|
||||
this.displayFormat);
|
||||
date = format.parse(dateStr);
|
||||
} else {
|
||||
// last resource
|
||||
date = SimpleDateFormat.getInstance().parse(dateStr);
|
||||
}
|
||||
return RFC3399_FORMAT.format(date);
|
||||
} catch (ParseException e) {
|
||||
log.error("Could not parse date", e);
|
||||
return dateStr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A pattern used for the visual display of the formatted date, e.g.
|
||||
* dd/MM/yyyy.
|
||||
*
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setDisplayFormat(String displayFormat) {
|
||||
this.displayFormat = displayFormat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of formatting used for visual display, appropriate to locale (choice
|
||||
* of long, short, medium or full)
|
||||
*
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setFormatLength(String formatLength) {
|
||||
this.formatLength = formatLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* Path to icon used for the dropdown
|
||||
*
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
public void setIconPath(String iconPath) {
|
||||
this.iconPath = iconPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Duration of toggle in seconds
|
||||
*
|
||||
* @s.tagattribute required="false" type="Integer" default="100"
|
||||
*/
|
||||
public void setToggleDuration(String toggleDuration) {
|
||||
this.toggleDuration = toggleDuration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the type of the picker on the dropdown. Possible values are
|
||||
* "date" for a DatePicker, and "time" for a timePicker
|
||||
*
|
||||
* @s.tagattribute required="false" type="String" default="date"
|
||||
*/
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle type of the dropdown. Possible values are plain,wipe,explode,fade
|
||||
*
|
||||
* @s.tagattribute required="false" type="String" default="plain"
|
||||
*/
|
||||
public void setToggleType(String toggleType) {
|
||||
this.toggleType = toggleType;
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,8 @@ package org.apache.struts2.components;
|
||||
import java.io.Writer;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
@@ -54,8 +56,8 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @s.tag name="else" bodycontent="JSP" description="Else tag" tld-tag-class="org.apache.struts2.views.jsp.ElseTag"
|
||||
*/
|
||||
@StrutsTag(name="else", tldTagClass="org.apache.struts2.views.jsp.ElseTag", description="Else tag")
|
||||
public class Else extends Component {
|
||||
public Else(ValueStack stack) {
|
||||
super(stack);
|
||||
|
||||
@@ -22,6 +22,9 @@ package org.apache.struts2.components;
|
||||
|
||||
import java.io.Writer;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
@@ -58,8 +61,8 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @s.tag name="elseif" tld-body-content="JSP" description="Elseif tag" tld-tag-class="org.apache.struts2.views.jsp.ElseIfTag"
|
||||
*/
|
||||
@StrutsTag(name="elseif", tldTagClass="org.apache.struts2.views.jsp.ElseIfTag", description="Elseif tag")
|
||||
public class ElseIf extends Component {
|
||||
public ElseIf(ValueStack stack) {
|
||||
super(stack);
|
||||
@@ -97,10 +100,7 @@ public class ElseIf extends Component {
|
||||
return super.end(writer, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Expression to determine if body of tag is to be displayed
|
||||
* @s.tagattribute required="true" type="Boolean"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Expression to determine if body of tag is to be displayed", type="Boolean", required=true)
|
||||
public void setTest(String test) {
|
||||
this.test = test;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.components.Param.UnnamedParametric;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
@@ -80,9 +81,9 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* <!-- END SNIPPET: description -->
|
||||
* </pre>
|
||||
*
|
||||
* @s.tag name="fielderror" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.FieldErrorTag"
|
||||
* description="Render field error (all or partial depending on param tag nested)if they exists"
|
||||
*/
|
||||
@StrutsTag(name="fielderror", tldTagClass="org.apache.struts2.views.jsp.ui.FieldErrorTag", description="Render field error (all " +
|
||||
"or partial depending on param tag nested)if they exists")
|
||||
public class FieldError extends UIBean implements UnnamedParametric {
|
||||
|
||||
private List errorFieldNames = new ArrayList();
|
||||
|
||||
@@ -25,6 +25,8 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
@@ -42,9 +44,8 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @s.tag name="file" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.FileTag"
|
||||
* description="Render a file input field"
|
||||
*/
|
||||
@StrutsTag(name="file", tldTagClass="org.apache.struts2.views.jsp.ui.FileTag", description="Render a file input field")
|
||||
public class File extends UIBean {
|
||||
private final static Log log = LogFactory.getLog(File.class);
|
||||
|
||||
@@ -88,18 +89,12 @@ public class File extends UIBean {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* HTML accept attribute to indicate accepted file mimetypes
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="HTML accept attribute to indicate accepted file mimetypes")
|
||||
public void setAccept(String accept) {
|
||||
this.accept = accept;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTML size attribute
|
||||
* @s.tagattribute required="false" type="Integer"
|
||||
*/
|
||||
@StrutsTagAttribute(description="HTML size attribute", required=false, type="Integer")
|
||||
public void setSize(String size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
@@ -29,10 +29,10 @@ import java.util.Set;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.dispatcher.Dispatcher;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapper;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
||||
import org.apache.struts2.portlet.context.PortletActionContext;
|
||||
import org.apache.struts2.portlet.util.PortletUrlHelper;
|
||||
@@ -48,6 +48,7 @@ import com.opensymphony.xwork2.config.entities.InterceptorMapping;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptorUtil;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import com.opensymphony.xwork2.util.TextUtils;
|
||||
import com.opensymphony.xwork2.validator.ActionValidatorManagerFactory;
|
||||
import com.opensymphony.xwork2.validator.FieldValidator;
|
||||
import com.opensymphony.xwork2.validator.ValidationInterceptor;
|
||||
@@ -91,9 +92,8 @@ import com.opensymphony.xwork2.validator.Validator;
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
* @s.tag name="form" tld-body-content="JSP" tld-tag-class="org.apache.struts2.views.jsp.ui.FormTag"
|
||||
* description="Renders an input form"
|
||||
*/
|
||||
@StrutsTag(name="form", tldTagClass="org.apache.struts2.views.jsp.ui.FormTag", description="Renders an input form")
|
||||
public class Form extends ClosingUIBean {
|
||||
public static final String OPEN_TEMPLATE = "form";
|
||||
public static final String TEMPLATE = "form-close";
|
||||
@@ -110,7 +110,7 @@ public class Form extends ClosingUIBean {
|
||||
protected String portletMode;
|
||||
protected String windowState;
|
||||
protected String acceptcharset;
|
||||
|
||||
|
||||
protected boolean enableDynamicMethodInvocation = true;
|
||||
protected Configuration configuration;
|
||||
protected ObjectFactory objectFactory;
|
||||
@@ -130,17 +130,17 @@ public class Form extends ClosingUIBean {
|
||||
protected String getDefaultTemplate() {
|
||||
return TEMPLATE;
|
||||
}
|
||||
|
||||
|
||||
@Inject(StrutsConstants.STRUTS_ENABLE_DYNAMIC_METHOD_INVOCATION)
|
||||
public void setEnableDynamicMethodInvocation(String enable) {
|
||||
enableDynamicMethodInvocation = "true".equals(enable);
|
||||
}
|
||||
|
||||
|
||||
@Inject
|
||||
public void setConfiguration(Configuration configuration) {
|
||||
this.configuration = configuration;
|
||||
}
|
||||
|
||||
|
||||
@Inject
|
||||
public void setObjectFactory(ObjectFactory objectFactory) {
|
||||
this.objectFactory = objectFactory;
|
||||
@@ -369,7 +369,7 @@ public class Form extends ClosingUIBean {
|
||||
}
|
||||
|
||||
String type = "action";
|
||||
if (StringUtils.isNotEmpty(method)) {
|
||||
if (TextUtils.stringSet(method)) {
|
||||
if ("GET".equalsIgnoreCase(method.trim())) {
|
||||
type = "render";
|
||||
}
|
||||
@@ -435,93 +435,53 @@ public class Form extends ClosingUIBean {
|
||||
return sequence++;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* HTML onsubmit attribute
|
||||
*
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="HTML onsubmit attribute")
|
||||
public void setOnsubmit(String onsubmit) {
|
||||
this.onsubmit = onsubmit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set action nane to submit to, without .action suffix
|
||||
*
|
||||
* @s.tagattribute required="false" default="current action"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set action nane to submit to, without .action suffix", defaultValue="current action")
|
||||
public void setAction(String action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTML form target attribute
|
||||
*
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="HTML form target attribute")
|
||||
public void setTarget(String target) {
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTML form enctype attribute
|
||||
*
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="HTML form enctype attribute")
|
||||
public void setEnctype(String enctype) {
|
||||
this.enctype = enctype;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTML form method attribute
|
||||
*
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="HTML form method attribute")
|
||||
public void setMethod(String method) {
|
||||
this.method = method;
|
||||
}
|
||||
|
||||
/**
|
||||
* namespace for action to submit to
|
||||
*
|
||||
* @s.tagattribute required="false" default="current namespace"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Namespace for action to submit to", defaultValue="current namespace")
|
||||
public void setNamespace(String namespace) {
|
||||
this.namespace = namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether client side/remote validation should be performed. Only useful with theme xhtml/ajax
|
||||
*
|
||||
* @s.tagattribute required="false" type="Boolean" default="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Whether client side/remote validation should be performed. Only" +
|
||||
" useful with theme xhtml/ajax", type="Boolean", defaultValue="false")
|
||||
public void setValidate(String validate) {
|
||||
this.validate = validate;
|
||||
}
|
||||
|
||||
/**
|
||||
* The portlet mode to display after the form submit
|
||||
*
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="he portlet mode to display after the form submit")
|
||||
public void setPortletMode(String portletMode) {
|
||||
this.portletMode = portletMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* The window state to display after the form submit
|
||||
*
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="The window state to display after the form submit")
|
||||
public void setWindowState(String windowState) {
|
||||
this.windowState = windowState;
|
||||
}
|
||||
|
||||
/**
|
||||
* The accepted charsets for this form. The values may be comma or blank delimited.
|
||||
*
|
||||
* @s.tagattribute required="false"
|
||||
*/
|
||||
@StrutsTagAttribute(description="The accepted charsets for this form. The values may be comma or blank delimited.")
|
||||
public void setAcceptcharset(String acceptcharset) {
|
||||
this.acceptcharset = acceptcharset;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ package org.apache.struts2.components;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
@@ -139,38 +141,23 @@ public abstract class FormButton extends UIBean {
|
||||
*/
|
||||
protected abstract boolean supportsImageType();
|
||||
|
||||
/**
|
||||
* Set action attribute.
|
||||
*
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set action attribute.")
|
||||
public void setAction(String action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set method attribute.
|
||||
*
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
@StrutsTagAttribute(description="Set method attribute.")
|
||||
public void setMethod(String method) {
|
||||
this.method = method;
|
||||
}
|
||||
|
||||
/**
|
||||
* HTML align attribute.
|
||||
*
|
||||
* @s.tagattribute required="false" type="String"
|
||||
*/
|
||||
@StrutsTagAttribute(description="HTML align attribute.")
|
||||
public void setAlign(String align) {
|
||||
this.align = align;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of submit to use. Valid values are <i>input</i>, <i>button</i> and <i>image</i>.
|
||||
*
|
||||
* @s.tagattribute required="false" type="String" default="input"
|
||||
*/
|
||||
@StrutsTagAttribute(description="The type of submit to use. Valid values are <i>input</i>, " +
|
||||
"<i>button</i> and <i>image</i>.", defaultValue="input")
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user