Compare commits

...

31 Commits

Author SHA1 Message Date
Ted Nathan Husted fe62eb0347 WW-1705 Tag r509051 as Struts 2.0.6
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_6@509057 13f79535-47bb-0310-9956-ffa450edef68
2007-02-19 01:56:17 +00:00
Ted Nathan Husted 611f7cf2c4 WW-1685 Tag r509051 as Struts 2.0.6
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_6@509053 13f79535-47bb-0310-9956-ffa450edef68
2007-02-19 01:34:29 +00:00
Ted Nathan Husted f13243a2bf WW-1705 Update POMs for 2.0.6 tag.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@509051 13f79535-47bb-0310-9956-ffa450edef68
2007-02-19 01:33:07 +00:00
Ted Nathan Husted b2496a566c WW-1685 Restore Tiles as a "mainstream" example.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@509048 13f79535-47bb-0310-9956-ffa450edef68
2007-02-19 01:26:47 +00:00
Ted Nathan Husted 756c2f58d5 WW-1685 Playtest Showcase and adjust status of verious examples.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@509047 13f79535-47bb-0310-9956-ffa450edef68
2007-02-19 01:22:52 +00:00
Ted Nathan Husted cac778c170 WW-1685 Playtest Showcase and adjust status of verious examples.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@509034 13f79535-47bb-0310-9956-ffa450edef68
2007-02-19 00:03:37 +00:00
Ted Nathan Husted 66479bc36e WW-1548 Remove continuation support from 2.0.x, which had been classified "sandbox" code.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@509029 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 23:26:15 +00:00
Thomas Schneider e023f033af WW-1699 added J2EE 5 compatibility to the StrutsMockServletContext
Contributor: Stepan Koltsov
Reviewed By: Tom Schneider

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508916 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 16:54:58 +00:00
Thomas Schneider 8199b1a3b7 WW-1740 added accessor for background process name to allow subclasses to override
Contributer: Thomas Micheline
Reviewed By: Tom Schneider

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508914 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 16:45:30 +00:00
Rainer Hermanns d078084107 bumped OGNL to version 2.6.11
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508901 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 13:55:11 +00:00
Thomas Schneider c990786a59 WW-1702 - fixed error handling in dispatcher
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508882 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 06:42:39 +00:00
Thomas Schneider 3f7dd2ef82 WW-1709 fixed nullpointer when scheme is null
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508880 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 06:33:26 +00:00
Thomas Schneider 7d8dfff8a1 WW-1709 fixed nullpointer when scheme is null
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508879 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 06:32:02 +00:00
Thomas Schneider 129e4559ce WW-1632 - added rtf support for jasper report result
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508875 13f79535-47bb-0310-9956-ffa450edef68
2007-02-18 06:02:23 +00:00
Musachy Barroso ff9bfe3bd4 WW-1633 Add "keyName" attribute to autocompleter (defaults to "${name}Key")
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508776 13f79535-47bb-0310-9956-ffa450edef68
2007-02-17 16:33:57 +00:00
Musachy Barroso e163098224 WW-1745 Add "templateCssPath" and "iconPath" attributes to Autocompleter
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508631 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 22:48:10 +00:00
Musachy Barroso dd200c173c - Add README file to META-INF
- Change path of generated TLD to target/classes/META-INF

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508608 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 22:00:17 +00:00
Musachy Barroso d7189a6648 WW-1729 Add "templateCssPath" attribute DateTimePicker
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508602 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 21:53:54 +00:00
Musachy Barroso 2cab82fafc WW-1688 Add "templateCssPath" attribute to tabbedPanel
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508570 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 20:42:17 +00:00
Musachy Barroso 1472a49a0f WW-1730 The refreshOnShow attribute in tabbedPanel does not work
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508556 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 20:15:05 +00:00
Rainer Hermanns 5e3464d467 select tag: current option is not selected if actual value to check is no String (aka: nameValue resolves to type other than String)
o added additional unit test submitted by Stuart Piltch 

WW-1711

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508509 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 17:35:12 +00:00
Rainer Hermanns d60e674046 select tag: current option is not selected if actual value to check is no String
(aka: nameValue resolves to type other than String)
o applied patch to submit.ftl submitted by Stuart Piltch 

WW-1711

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508478 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 16:25:48 +00:00
Rainer Hermanns 6e81a692b7 Fixed broken Unit Test due to changes in xwork
WW-1615


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508465 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 16:12:32 +00:00
Rainer Hermanns fbedbdedbe Updated deps:
o OGNL 2.6.10
o XWork 2.0.1
Issue Number: WW-1615


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508441 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 15:14:16 +00:00
Musachy Barroso 1a2bd58e65 Remove redundant tag attribute annotation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508293 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 03:03:30 +00:00
Musachy Barroso 421ff8d068 WW-1570:
Add "showLoading" attribute to ajax tags

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@508280 13f79535-47bb-0310-9956-ffa450edef68
2007-02-16 02:07:56 +00:00
Ted Nathan Husted 0e7dbe0b62 [WW-1731] Checkin updated tag HTML docs.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@506210 13f79535-47bb-0310-9956-ffa450edef68
2007-02-12 01:33:59 +00:00
Ted Nathan Husted ae4e489d9e [WW-1731] Update POMs. Checkin updated tag HTML docs.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@506206 13f79535-47bb-0310-9956-ffa450edef68
2007-02-12 01:19:09 +00:00
Ted Nathan Husted dcc79d485d [WW-1731] Fix assembly/pom to include codebehind and spring plugins (Good catch Tom!).
[WW-1548] Remove continuations from the 2.0.x branch.
[WW-1700] Remove "new API" from 2.0.x branch (see also r505490 as to the HEAD/2.1.x). 
[WW-1731] Remove TLD as it is generated. 

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@506198 13f79535-47bb-0310-9956-ffa450edef68
2007-02-12 00:57:44 +00:00
Ted Nathan Husted 75b379d5d4 WW-1705 Branching at 2_0_5 tag (again)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@506174 13f79535-47bb-0310-9956-ffa450edef68
2007-02-11 23:34:04 +00:00
Ted Nathan Husted cb580fe614 WW-1685 Tag r503710 as Struts 2.0.5
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_5@503722 13f79535-47bb-0310-9956-ffa450edef68
2007-02-05 15:33:40 +00:00
64 changed files with 166 additions and 11433 deletions
-54
View File
@@ -1,54 +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.1.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-api</artifactId>
<packaging>jar</packaging>
<name>Struts 2 API</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/api/</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/api/</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/api/</url>
</scm>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
<!-- has to be compile for StrutsTestCase, which is part of the base package so others can write unit tests -->
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<scope>test</scope>
<version>2.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<showPackage>false</showPackage>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -1,65 +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;
/**
* Default action interface. Provided purely for user convenience. Struts does not require actions to implement any
* interfaces. Actions need only implement a public, no argument method which returns {@code String}. If a user does
* not specify a method name, Struts defaults to {@code execute()}.
*
* <p>For example:
*
* <pre>
* static import ResultNames.*;
*
* public class MyAction <b>implements Action</b> {
*
* public String execute() {
* return SUCCESS;
* }
* }
* </pre>
*
* <p>is equivalent to:
*
* <pre>
* static import ResultNames.*;
*
* public class MyAction {
*
* public String execute() {
* return SUCCESS;
* }
* }
* </pre>
*
* @author crazybob@google.com (Bob Lee)
*/
public interface Action {
/**
* Executes this action.
*
* @return result name which matches a result name from the action mapping in the configuration file. See {@link
* ResultNames} for common suggestions.
*/
String execute();
}
@@ -1,61 +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;
/**
* Implemented by actions which may need to record errors or messages.
*
* <pre>
* static import ResultNames.*;
*
* public class SetName implements MessageAware {
*
* Messages messages;
* String name;
*
* public String execute() {
* return SUCCESS;
* }
*
* public void setName(String name) {
* if ("".equals(name))
* messages.forField("name").addError("name.required");
*
* this.name = name;
* }
*
* public void setMessages(Messages messages) {
* this.messages = messages;
* }
* }
* </pre>
*
* @author crazybob@google.com (Bob Lee)
*/
public interface MessageAware {
/**
* Sets messages.
*
* @param messages messages
*/
void setMessages(Messages messages);
}
@@ -1,216 +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;
import java.util.List;
import java.util.Set;
import java.util.Map;
/**
* Collection of messages. Supports nesting messages by field name.
*
* <p>Uses keys when adding instead of actual messages to decouple code from messages.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface Messages {
// TODO: Use Object[] for args instead of String[].
/**
* Message severity.
*/
public enum Severity {
/**
* Informational messages.
*/
INFO,
/**
* Warning messages.
*/
WARN,
/**
* Error messages.
*/
ERROR,
}
/**
* Gets nested messages for the given field.
*
* <p>Supports dot notation to represent nesting. For example:
*
* <pre>
* messages.forField("foo").forField("bar") == messages.forField("foo.bar")
* </pre>
*
* @param fieldName name of the field
* @return nested {@code Messages} for given field name
*/
Messages forField(String fieldName);
/**
* Gets map of field name to messages for that field.
*
* @return map of field name to {@code Messages}
*/
Map<String, Messages> forFields();
/**
* Adds informational message.
*
* @param key message key
* @see Severity.INFO
*/
void addInformation(String key);
/**
* Adds informational message.
*
* @param key message key
* @param arguments message arguments
* @see Severity.INFO
*/
void addInformation(String key, String... arguments);
/**
* Adds warning message.
*
* @param key message key
* @see Severity.WARN
*/
void addWarning(String key);
/**
* Adds warning message.
*
* @param key message key
* @param arguments message arguments
* @see Severity.WARN
*/
void addWarning(String key, String... arguments);
/**
* Adds error message.
*
* @param key message key
* @see Severity.ERROR
*/
void addError(String key);
/**
* Adds error message.
*
* @param key message key
* @param arguments message arguments
* @see Severity.ERROR
*/
void addError(String key, String... arguments);
/**
* Adds message.
*
* @param severity message severity
* @param key message key
*/
void add(Severity severity, String key);
/**
* Adds request-scoped message.
*
* @param severity message severity
* @param key message key
* @param arguments message arguments
*/
void add(Severity severity, String key, String... arguments);
/**
* Gets set of severities for which this {@code Messages} instance has messages. Not recursive.
*
* @return unmodifiable set of {@link Severity} sorted from least to most severe
*/
Set<Severity> getSeverities();
/**
* Gets message strings for the given severity. Not recursive.
*
* @param severity message severity
* @return unmodifiable list of messages
*/
List<String> forSeverity(Severity severity);
/**
* Gets error message strings for this {@code Messages} instance. Not recursive.
*
* @return unmodifiable list of messages
*/
List<String> getErrors();
/**
* Gets error message strings for this {@code Messages} instance. Not recursive.
*
* @return unmodifiable list of messages
*/
List<String> getWarnings();
/**
* Gets informational message strings for this {@code Messages} instance. Not recursive.
*
* @return unmodifiable list of messages
*/
List<String> getInformation();
/**
* Returns true if this or a nested {@code Messages} instance has error messages.
*
* @see Severity.ERROR
*/
boolean hasErrors();
/**
* Returns true if this or a nested {@code Messages} instance has warning messages.
*
* @see Severity.WARN
*/
boolean hasWarnings();
/**
* Returns true if this or a nested {@code Messages} instance has informational messages.
*
* @see Severity.INFO
*/
boolean hasInformation();
/**
* Returns true if this and all nested {@code Messages} instances have no messages.
*/
boolean isEmpty();
/**
* Returns true if this and all nested {@code Messages} instances have no messages for the given severity.
*
* @param severity message severity
*/
boolean isEmpty(Severity severity);
}
@@ -1,56 +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;
/**
* Commonly used result names returned by action methods.
*
* @author crazybob@google.com (Bob Lee)
*/
public final class ResultNames {
private ResultNames() {}
/**
* The action executed successfully.
*/
public static final String SUCCESS = "success";
/**
* The action requires more input, i.e.&nbsp;a validation error occurred.
*/
public static final String INPUT = "input";
/**
* The action requires the user to log in before executing.
*/
public static final String LOGIN = "login";
/**
* The action execution failed irrecoverably.
*/
public static final String ERROR = "error";
/**
* The action executed successfully, but do not execute a result.
*/
public static final String NONE = "none";
}
@@ -1,37 +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;
import org.apache.struts2.MessageAware;
/**
* Implemented by actions which wish to execute some validation logic before their action method. Useful for
* cross-field validations.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface Validatable extends MessageAware {
/**
* Validates input. Executes before action method.
*/
public void validate();
}
@@ -1,38 +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.servlet;
import java.util.Map;
/**
* Implemented by actions which need direct access to the request parameters.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface ParameterAware {
/**
* Sets parameters.
*
* @param parameters map of parameter name to parameter values
*/
void setParameters(Map<String, String[]> parameters);
}
@@ -1,38 +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.servlet;
import javax.servlet.http.HttpServletRequest;
/**
* Implemented by actions which need direct access to the servlet request.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface ServletRequestAware {
/**
* Sets the servlet request.
*
* @param request servlet request.
*/
void setServletRequest(HttpServletRequest request);
}
@@ -1,38 +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.servlet;
import javax.servlet.http.HttpServletResponse;
/**
* Implemented by actions which need direct access to the servlet response.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface ServletResponseAware {
/**
* Sets the servlet response.
*
* @param response servlet response
*/
void setServletResponse(HttpServletResponse response);
}
@@ -1,79 +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.spi;
import java.lang.reflect.Method;
/**
* Context of an action execution.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface ActionContext {
/**
* Gets action instance.
*/
Object getAction();
/**
* Gets action method.
*/
Method getMethod();
/**
* Gets action name.
*/
String getActionName();
/**
* Gets the path for the action's namespace.
*/
String getNamespacePath();
/**
* Gets the {@link Result} instance for the action.
*
* @return {@link Result} instance or {@code null} if we don't have a result yet.
*/
Result getResult();
/**
* Adds a result interceptor for the action. Enables executing code before and after a result, executing an
* alternate result, etc.
*/
void addResultInterceptor(Result interceptor);
/**
* Gets context of action which chained to us.
*
* @return context of previous action or {@code null} if this is the first action in the chain
*/
ActionContext getPrevious();
/**
* Gets context of action which this action chained to.
*
* @return context of next action or {@code null} if we haven't chained to another action yet or this is the last
* action in the chain.
*/
ActionContext getNext();
}
@@ -1,36 +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.spi;
/**
* Intercepts an action request.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface Interceptor {
/**
* Intercepts an action request.
*
* @param requestContext current request context
*/
String intercept(RequestContext requestContext) throws Exception;
}
@@ -1,121 +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.spi;
import org.apache.struts2.Messages;
import javax.servlet.ServletContext;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Locale;
import java.util.Map;
/**
* Request context. A single request may span multiple actions with action chaining.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface RequestContext {
/**
* Gets context of the currently executing action.
*
* @return current action context
*/
ActionContext getActionContext();
/**
* Convenience method.&nbsp;Equivalent to {@code getActionContext().getAction()}.
*
* @return currently executing action
*/
Object getAction();
/**
* Gets map of request parameters.
*/
Map<String, String[]> getParameterMap();
/**
* Gets map of request attributes.
*/
Map<String, Object> getAttributeMap();
/**
* Gets map of session attributes.
*/
Map<String, Object> getSessionMap();
/**
* Gets map of application (servlet context) attributes.
*/
Map<String, Object> getApplicationMap();
/**
* Finds cookies with the given name,
*/
List<Cookie> findCookiesForName(String name);
/**
* Gets locale.
*/
Locale getLocale();
/**
* Sets locale. Stores the locale in the session for future requests.
*/
void setLocale(Locale locale);
/**
* Gets messages.
*/
Messages getMessages();
/**
* Gets the servlet request.
*/
HttpServletRequest getServletRequest();
/**
* Gets the servlet response.
*/
HttpServletResponse getServletResponse();
/**
* Gets the servlet context.
*/
ServletContext getServletContext();
/**
* Gets the value stack.
*/
ValueStack getValueStack();
/**
* Invokes the next interceptor or the action method if no more interceptors remain.
*
* @return result name
* @throws IllegalStateException if already invoked or called from the action
*/
String proceed() throws Exception;
}
@@ -1,39 +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.spi;
import org.apache.struts2.spi.RequestContext;
/**
* Implemented by actions that need access to the current {@link org.apache.struts2.spi.RequestContext}. Use
* judiciously.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface RequestContextAware {
/**
* Sets {@link org.apache.struts2.spi.RequestContext}.
*
* @param requestContext
*/
void setRequestContext(RequestContext requestContext);
}
@@ -1,38 +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.spi;
import org.apache.struts2.spi.RequestContext;
/**
* The result of an action request. Struts creates a new {@code Result} instance for each request.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface Result {
/**
* Executes result.
*
* @param requestContext
*/
void execute(RequestContext requestContext) throws Exception;
}
@@ -1,113 +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.spi;
/**
* A central fixture of the Struts framework, the {@code ValueStack} is a stack which contains the actions
* which have executed in addition to other objects. Users can get and set values on the stack using expressions. The
* {@code ValueStack} will search down the stack starting with the most recent objects until it finds an object to
* which the expression can apply.
*
* @author crazybob@google.com (Bob Lee)
*/
public interface ValueStack extends Iterable<Object> {
/**
* Gets the top, most recent object from the stack without changing the stack.
*
* @return the top object
*/
Object peek();
/**
* Removes the top, most recent object from the stack.
*
* @return the top object
*/
Object pop();
/**
* Pushes an object onto the stack.
*
* @param o
*/
void push(Object o);
/**
* Creates a shallow copy of this stack.
*
* @return a new stack which contains the same objects as this one
*/
ValueStack clone();
/**
* Queries the stack. Starts with the top, most recent object. If the expression can apply to the object, this
* method returns the result of evaluating the expression. If the expression does not apply, this method moves
* down the stack to the next object and repeats. Returns {@code null} if the expression doesn't apply to any
* objects.
*
* @param expression
* @return the evaluation of the expression against the first applicable object in the stack
*/
Object get(String expression);
/**
* Queries the stack and converts the result to the specified type. Starts with the top, most recent object. If
* the expression can apply to the object, this method returns the result of evaluating the expression converted
* to the specified type. If the expression does not apply, this method moves down the stack to the next object
* and repeats. Returns {@code null} if the expression doesn't apply to any objects.
*
* @param expression
* @param asType the type to convert the result to
* @return the evaluation of the expression against the first applicable object in the stack converted to the
* specified type
*/
<T> T get(String expression, Class<T> asType);
/**
* Queries the stack and converts the result to a {@code String}. Starts with the top, most recent object. If the
* expression can apply to the object, this method returns the result of evaluating the expression converted to a
* {@code String}. If the expression does not apply, this method moves down the stack to the next object and
* repeats. Returns {@code null} if the expression doesn't apply to any objects.
*
* @param expression
* @return the evaluation of the expression against the first applicable object in the stack converted to a {@code
* String}
*/
String getString(String expression);
/**
* Sets a value on an object from the stack. This method starts at the top, most recent object. If the expression
* applies to that object, this methods sets the given value on that object using the expression and converting
* the type as necessary. If the expression does not apply, this method moves to the next object and repeats.
*
* @param expression
* @param value
*/
void set(String expression, Object value);
/**
* Returns the number of object on the stack.
*
* @return size of stack
*/
int size();
}
-174
View File
@@ -1,174 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
-5
View File
@@ -1,5 +0,0 @@
Apache Struts
Copyright 2000-2007 The Apache Software Foundation
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-blank</artifactId>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-mailreader</artifactId>
+1 -1
View File
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-portlet</artifactId>
+1 -7
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-showcase</artifactId>
@@ -62,12 +62,6 @@
<version>${pom.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-continuations-plugin</artifactId>
<version>${pom.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-codebehind-plugin</artifactId>
@@ -1,71 +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.showcase;
import java.util.Random;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;
import com.uwyn.rife.continuations.ContinuableObject;
// START SNIPPET: example
public class Guess extends ActionSupport implements Preparable, ContinuableObject {
int guess;
public void prepare() throws Exception {
// We clear the error message state before the action.
// That is because with continuations, the original (or cloned) action is being
// executed, which will still have the old errors and potentially cause problems,
// such as with the workflow interceptor
clearErrorsAndMessages();
}
public String execute() throws Exception {
int answer = new Random().nextInt(100) + 1;
int tries = 5;
while (answer != guess && tries > 0) {
pause(Action.SUCCESS);
if (guess > answer) {
addFieldError("guess", "Too high!");
} else if (guess < answer) {
addFieldError("guess", "Too low!");
}
tries--;
}
if (answer == guess) {
addActionMessage("You got it!");
} else {
addActionMessage("You ran out of tries, the answer was " + answer);
}
return Action.SUCCESS;
}
public void setGuess(int guess) {
this.guess = guess;
}
}
// END SNIPPET: example
@@ -1,10 +0,0 @@
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="continuations" extends="struts-default" namespace="/continuations">
<action name="guess" class="org.apache.struts2.showcase.Guess">
<result type="freemarker">guess.ftl</result>
</action>
</package>
</struts>
+14 -16
View File
@@ -8,15 +8,13 @@
<struts>
<include file="struts-chat.xml" />
<include file="struts-hangman.xml" />
<include file="struts-continuations.xml"/>
<include file="struts-tags.xml"/>
<include file="struts-validation.xml" />
<include file="struts-actionchaining.xml" />
<include file="struts-ajax.xml" />
@@ -26,19 +24,19 @@
<include file="struts-person.xml" />
<include file="struts-wait.xml" />
<include file="struts-jsf.xml" />
<include file="struts-token.xml" />
<include file="struts-model-driven.xml" />
<include file="struts-integration.xml" />
<include file="struts-filedownload.xml" />
<include file="struts-conversion.xml" />
<include file="struts-freemarker.xml" />
<include file="struts-tiles.xml" />
@@ -48,17 +46,17 @@
<package name="default" extends="struts-default">
<interceptors>
<interceptor-stack name="crudStack">
<interceptor-ref name="checkbox" />
<interceptor-ref name="checkbox" />
<interceptor-ref name="params" />
<interceptor-ref name="static-params" />
<interceptor-ref name="static-params" />
<interceptor-ref name="defaultStack" />
</interceptor-stack>
</interceptors>
<action name="showcase">
<result>showcase.jsp</result>
</action>
<action name="viewSource" class="org.apache.struts2.showcase.source.ViewSourceAction">
<result>viewSource.jsp</result>
</action>
@@ -99,7 +97,7 @@
<interceptor-ref name="basicStack"/>
</action>
<action name="edit-*" class="org.apache.struts2.showcase.action.EmployeeAction">
<param name="empId">{1}</param>
<param name="empId">{1}</param>
<result>/empmanager/editEmployee.jsp</result>
<interceptor-ref name="crudStack"><param name="validation.excludeMethods">execute</param></interceptor-ref>
</action>
@@ -5,7 +5,7 @@
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
// Calculate the view sources url
String sourceUrl = request.getContextPath()+"/viewSource.action";
com.opensymphony.xwork2.ActionInvocation inv = com.opensymphony.xwork2.ActionContext.getContext().getActionInvocation();
@@ -14,9 +14,9 @@
com.opensymphony.xwork2.util.location.Location loc = inv.getProxy().getConfig().getLocation();
sourceUrl += "?config="+(loc != null ? loc.getURI()+":"+loc.getLineNumber() : "");
sourceUrl += "&className="+inv.getProxy().getConfig().getClassName();
if (inv.getResult() != null && inv.getResult() instanceof org.apache.struts2.dispatcher.StrutsResultSupport) {
sourceUrl += "&page="+mapping.getNamespace()+"/"+((org.apache.struts2.dispatcher.StrutsResultSupport)inv.getResult()).getLastFinalLocation();
sourceUrl += "&page="+mapping.getNamespace()+"/"+((org.apache.struts2.dispatcher.StrutsResultSupport)inv.getResult()).getLastFinalLocation();
}
} else {
sourceUrl += "?page="+request.getServletPath();
@@ -104,11 +104,11 @@
</div><!-- end content -->
<div>
<p>
<a href="<%=sourceUrl %>">View Sources</a>
</p>
</div>
<div>
<p>
<a href="<%=sourceUrl %>">View Sources</a>
</p>
</div>
<div id="footer" class="clearfix">
<p>Copyright &copy; 2003-<s:property value="#dateAction.now.year + 1900" /> The Apache Software Foundation.</p>
</div><!-- end footer -->
+2 -2
View File
@@ -15,9 +15,9 @@ Note: The Ajax tags are experimental. These examples have only been tested under
<li><a href="remotediv">Remote div tag</a></li>
<li><a href="remotelink">Remote link tag</a></li>
<li><a href="tabbedpanel">Tabbed panel</a></li>
<li><a href="widgets">Widgets </a> (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>
<li><a href="remoteforms">Remote forms</a></li>
</ul>
</body>
</html>
@@ -1,18 +0,0 @@
<!-- START SNIPPET: example -->
<html>
<head>
<title></title>
</head>
<body>
<#list actionMessages as msg>
${msg}
</#list>
<@s.form action="guess" method="post">
<@s.textfield label="Guess" name="guess"/>
<@s.submit value="Guess"/>
</@s.form>
</body>
</html>
<!-- END SNIPPET: example -->
@@ -11,7 +11,7 @@
</li>
<li>
<@s.url id="url" action="hangmanAjax" namespace="/hangman" />
<@s.a href="%{#url}">Hangman (Ajax - Experimental)</@s.a>
(broken) <@s.a href="%{#url}">Hangman (Ajax - Experimental)</@s.a>
</li>
</ul>
</body>
+3 -12
View File
@@ -1,6 +1,6 @@
<%--
<%--
showcase.jsp
@version $Date$ $Id$
--%>
@@ -32,7 +32,7 @@
<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="/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>
@@ -52,15 +52,6 @@
<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>
<h2>Sandbox</h2>
<p>
These examples are under development and may not be fully operational.
</p>
<ul>
<li><a href="<s:url action="guess" namespace="/continuations" />">Continuations</a></li>
</ul>
</p>
</body>
@@ -1,4 +1,4 @@
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%-- Show usage; Used in Header --%>
@@ -6,10 +6,10 @@
<html>
<head><title><tiles:getAsString name="title"/></title></head>
<body>
<tiles:attribute name="header"/>
<tiles:insertAttribute name="header"/>
<p id="body">
<tiles:attribute name="body"/>
<tiles:insertAttribute name="body"/>
</p>
</body>
</html>
+10 -10
View File
@@ -33,7 +33,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.0.6</version>
</parent>
<scm>
@@ -155,12 +155,13 @@
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-api</artifactId>
<artifactId>struts2-core</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<artifactId>struts2-codebehind-plugin</artifactId>
<version>${version}</version>
</dependency>
@@ -200,6 +201,12 @@
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitegraph-plugin</artifactId>
@@ -425,13 +432,6 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.rifers</groupId>
<artifactId>rife-continuations</artifactId>
<version>0.0.2</version>
<scope>provided</scope>
</dependency>
<!-- Exclude transitive dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
+1 -7
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
@@ -255,12 +255,6 @@
<version>2.0.1</version>
</dependency>
<!--<dependency>-->
<!--<groupId>org.apache.struts</groupId>-->
<!--<artifactId>struts2-api</artifactId>-->
<!--<version>${pom.version}</version>-->
<!--</dependency>-->
<dependency>
<groupId>freemarker</groupId>
<artifactId>freemarker</artifactId>
File diff suppressed because it is too large Load Diff
@@ -1,155 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
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.
-->
<html>
<head>
<link type="text/css" rel="stylesheet" href="$stylesheet">
<style type="text/css">
.footer {
background-image: url('$confluenceUri/images/border/border_bottom.gif');
background-repeat: repeat-x;
background-position: left top;
padding-top: 4px;
color: #666;
}
</style>
<script type="text/javascript" language="javascript">
var hide = null;
var show = null;
var children = null;
function init() {
/* Search form initialization */
var form = document.forms['search'];
if (form != null) {
form.elements['domains'].value = location.hostname;
form.elements['sitesearch'].value = location.hostname;
}
/* Children initialization */
hide = document.getElementById('hide');
show = document.getElementById('show');
children = document.all != null ?
document.all['children'] :
document.getElementById('children');
if (children != null) {
children.style.display = 'none';
show.style.display = 'inline';
hide.style.display = 'none';
}
}
function showChildren() {
children.style.display = 'block';
show.style.display = 'none';
hide.style.display = 'inline';
}
function hideChildren() {
children.style.display = 'none';
show.style.display = 'inline';
hide.style.display = 'none';
}
</script>
<title>$page.title</title>
</head>
<body onload="init()">
<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tr class="topBar">
<td align="left" valign="middle" class="topBarDiv" align="left" nowrap>
&nbsp;$autoexport.breadcrumbs($page)
</td>
<td align="right" valign="middle" nowrap>
<form name="search" action="http://www.google.com/search" method="get">
<input type="hidden" name="ie" value="UTF-8" />
<input type="hidden" name="oe" value="UTF-8" />
<input type="hidden" name="domains" value="" />
<input type="hidden" name="sitesearch" value="" />
<input type="text" name="q" maxlength="255" value="" />
<input type="submit" name="btnG" value="Google Search" />
</form>
</td>
</tr>
</table>
<div id="PageContent">
<div class="pageheader" style="padding: 6px 0px 0px 0px;">
<!-- We'll enable this once we figure out how to access (and save) the logo resource -->
<!--img src="/wiki/images/confluence_logo.gif" style="float: left; margin: 4px 4px 4px 10px;" border="0"-->
<div style="margin: 0px 10px 0px 10px" class="smalltext">$page.space.name</div>
<div style="margin: 0px 10px 8px 10px" class="pagetitle">$page.title</div>
<div class="greynavbar" align="right" style="padding: 2px 10px; margin: 0px;">
<a href="$confluenceUri/pages/editpage.action?pageId=$page.id">
<img src="$confluenceUri/images/icons/notep_16.gif"
height="16" width="16" border="0" align="absmiddle" title="Edit Page"></a>
<a href="$confluenceUri/pages/editpage.action?pageId=$page.id">Edit Page</a>
&nbsp;
<a href="$confluenceUri/pages/listpages.action?key=$page.spaceKey">
<img src="$confluenceUri/images/icons/browse_space.gif"
height="16" width="16" border="0" align="absmiddle" title="Browse Space"></a>
<a href="$confluenceUri/pages/listpages.action?key=$page.spaceKey">Browse Space</a>
&nbsp;
<a href="$confluenceUri/pages/createpage.action?spaceKey=$page.spaceKey&fromPageId=$page.id">
<img src="$confluenceUri/images/icons/add_page_16.gif"
height="16" width="16" border="0" align="absmiddle" title="Add Page"></a>
<a href="$confluenceUri/pages/createpage.action?spaceKey=$page.spaceKey&fromPageId=$page.id">Add Page</a>
&nbsp;
<a href="$confluenceUri/pages/createblogpost.action?spaceKey=$page.spaceKey&fromPageId=$page.id">
<img src="$confluenceUri/images/icons/add_blogentry_16.gif"
height="16" width="16" border="0" align="absmiddle" title="Add News"></a>
<a href="$confluenceUri/pages/createblogpost.action?spaceKey=$page.spaceKey&fromPageId=$page.id">Add News</a>
</div>
</div>
<div class="pagesubheading" style="margin: 0px 10px 0px 10px;">
#editReport()
</div>
<div class="pagecontent">
<div class="wiki-content">
$body
</div>
#if ($page.hasChildren())
<div class="tabletitle">
Children
<span class="smalltext" id="show" style="display: inline;">
<a href="javascript:showChildren()">Show Children</a></span>
<span class="smalltext" id="hide" style="display: none;">
<a href="javascript:hideChildren()">Hide Children</a></span>
</div>
<div class="greybox" id="children" style="display: none;">
#set ($children = $page.children)
#foreach ($child in $children)
$autoexport.link($child)
<span class="smalltext">($child.space.name)</span>
<br>
#end
</div>
#end
</div>
</div>
<div class="footer">
Generated by
$autoexport.confluenceInfo
$autoexport.autoexportInfo
</div>
</body>
</html>
@@ -40,7 +40,7 @@ public class TestAction extends ActionSupport {
private Collection collection2;
private Map map;
private String foo;
private Integer fooInt;
private String result;
private User user;
private String[] array;
@@ -62,7 +62,7 @@ public class TestAction extends ActionSupport {
public void setMap(Map map) {
this.map = map;
}
}private Integer fooInt;
public String getFoo() {
return foo;
@@ -135,7 +135,7 @@ public class TestAction extends ActionSupport {
public void setFooInt(Integer fooInt) {
this.fooInt = fooInt;
}
public String execute() throws Exception {
if (result == null) {
result = Action.SUCCESS;
@@ -379,7 +379,6 @@ public class SelectTest extends AbstractUITagTest {
verify(SelectTag.class.getResource("Select-6.txt"));
}
public void testSimpleInteger() throws Exception {
TestAction testAction = (TestAction) action;
@@ -466,7 +465,7 @@ public class SelectTest extends AbstractUITagTest {
return id;
}
}
private void prepareTagGeneric(SelectTag tag) {
TestAction testAction = (TestAction) action;
ArrayList collection = new ArrayList();
@@ -74,22 +74,6 @@ public class UrlHelperTest extends StrutsTestCase {
assertEquals(expectedUrl, result);
}
public void testBuildParametersStringWithUrlHavingSomeExistingParameters() throws Exception {
String expectedUrl = "http://localhost:8080/myContext/myPage.jsp?initParam=initValue&amp;param1=value1&amp;param2=value2";
Map parameters = new LinkedHashMap();
parameters.put("param1", "value1");
parameters.put("param2", "value2");
StringBuffer url = new StringBuffer("http://localhost:8080/myContext/myPage.jsp?initParam=initValue");
UrlHelper.buildParametersString(parameters, url);
assertEquals(
expectedUrl, url.toString());
}
public void testForceAddNullSchemeHostAndPort() throws Exception {
String expectedUrl = "http://localhost/contextPath/path1/path2/myAction.action";
@@ -109,8 +93,25 @@ public class UrlHelperTest extends StrutsTestCase {
null, true, true, true);
assertEquals(expectedUrl, result);
mockHttpServletRequest.verify();
}
public void testBuildParametersStringWithUrlHavingSomeExistingParameters() throws Exception {
String expectedUrl = "http://localhost:8080/myContext/myPage.jsp?initParam=initValue&amp;param1=value1&amp;param2=value2";
Map parameters = new LinkedHashMap();
parameters.put("param1", "value1");
parameters.put("param2", "value2");
StringBuffer url = new StringBuffer("http://localhost:8080/myContext/myPage.jsp?initParam=initValue");
UrlHelper.buildParametersString(parameters, url);
assertEquals(
expectedUrl, url.toString());
}
public void testBuildWithRootContext() {
String expectedUrl = "/MyAction.action";
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-codebehind-plugin</artifactId>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-config-browser-plugin</artifactId>
-36
View File
@@ -1,36 +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-plugins</artifactId>
<version>2.1.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-continuations-plugin</artifactId>
<packaging>jar</packaging>
<name>Struts 2 Continuations Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/trunk/plugins/continuations/</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/plugins/continuations/</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/plugins/continuations/</url>
</scm>
<dependencies>
<dependency>
<groupId>org.rifers</groupId>
<artifactId>rife-continuations</artifactId>
<version>0.0.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
<version>3.8.1</version>
</dependency>
</dependencies>
</project>
@@ -1,98 +0,0 @@
/*
* $Id: Dispatcher.java 484733 2006-12-08 20:16:16Z mrdon $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.continuations;
import java.util.Map;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionEventListener;
import com.opensymphony.xwork2.util.ValueStack;
import com.uwyn.rife.continuations.ContinuableObject;
import com.uwyn.rife.continuations.ContinuationConfig;
import com.uwyn.rife.continuations.ContinuationContext;
import com.uwyn.rife.continuations.ContinuationManager;
import com.uwyn.rife.continuations.exceptions.PauseException;
/**
* Hooks Rife continuations into key events in the Action instance lifecycle
*/
public class ContinuationsActionEventListener implements ActionEventListener {
ContinuationManager cm;
public ContinuationsActionEventListener() {
if (ContinuationConfig.getInstance() != null) {
cm = new ContinuationManager();
}
}
/**
* Sets the continuation context and loads the proper continuation action
*/
public Object prepare(Object action, ValueStack stack) {
Map params = ActionContext.getContext().getParameters();
String contId = (String) params.get(StrutsContinuationConfig.CONTINUE_PARAM);
if (contId != null) {
// remove the continue key from the params - we don't want to bother setting
// on the value stack since we know it won't work. Besides, this breaks devMode!
params.remove(StrutsContinuationConfig.CONTINUE_PARAM);
}
if (action instanceof ContinuableObject) {
ContinuationContext ctx = ContinuationContext.createInstance((ContinuableObject) action);
if (action instanceof NonCloningContinuableObject) {
ctx.setShouldClone(false);
}
}
try {
if (contId != null) {
ContinuationContext context = cm.getContext(contId);
if (context != null) {
ContinuationContext.setContext(context);
// use the original action instead
Object original = context.getContinuable();
action = original;
}
}
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return action;
}
/**
* Handles the normal continuation exception
*/
public String handleException(Throwable t, ValueStack stack) {
if (t instanceof PauseException) {
// continuations in effect!
PauseException pe = ((PauseException) t);
ContinuationContext context = pe.getContext();
String result = (String) pe.getParameters();
stack.getContext().put(StrutsContinuationConfig.CONTINUE_KEY, context.getId());
cm.addContext(context);
return result;
}
return null;
}
}
@@ -1,110 +0,0 @@
/*
* $Id: Dispatcher.java 484733 2006-12-08 20:16:16Z mrdon $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.continuations;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.StrutsConstants;
import com.opensymphony.xwork2.XWorkException;
import com.opensymphony.xwork2.inject.Inject;
/**
* Uses the Rife continuations classloader to bytecode enhance actions. Only
* enhances actions in the configured package.
*/
public class ContinuationsClassLoader extends ClassLoader {
private String base;
private ClassLoader parent;
private static final Log LOG = LogFactory.getLog(ContinuationsClassLoader.class);
@Inject(value=StrutsConstants.STRUTS_CONTINUATIONS_PACKAGE, required=false)
public void setContinuationPackage(String continuationPackage) {
// This reflection silliness is to ensure Rife is optional
Class contConfig = null;
try {
contConfig = Class.forName("com.uwyn.rife.continuations.ContinuationConfig");
} catch (ClassNotFoundException ex) {
throw new XWorkException("Unable to use continuations package, as the Rife " +
"continuations jar is missing", ex);
}
try {
Method m = contConfig.getMethod("setInstance", contConfig);
m.invoke(contConfig, new StrutsContinuationConfig());
} catch (NoSuchMethodException ex) {
throw new XWorkException("Incorrect version of the Rife continuation library", ex);
} catch (IllegalAccessException ex) {
throw new XWorkException("Incorrect version of the Rife continuation library", ex);
} catch (InvocationTargetException ex) {
throw new XWorkException("Unable to initialize the Rife continuation library", ex);
}
this.base = continuationPackage;
this.parent = Thread.currentThread().getContextClassLoader();
}
public Class loadClass(String name) throws ClassNotFoundException {
if (validName(name)) {
Class clazz = findLoadedClass(name);
if (clazz == null) {
try {
byte[] bytes = com.uwyn.rife.continuations.util.ClassByteUtil.getBytes(name, parent);
if (bytes == null) {
throw new ClassNotFoundException(name);
}
byte[] resume_bytes = null;
try {
resume_bytes = com.uwyn.rife.continuations.ContinuationInstrumentor.instrument(bytes, name, false);
} catch (ClassNotFoundException e) {
// this can happen when the Rife Continuations code gets broken (there are bugs in it still, ya know!)
// rather than making a big deal, we'll quietly log this and move on
// when more people are using continuations, perhaps we'll raise the log level
LOG.debug("Error instrumenting with RIFE/Continuations, " +
"loading class normally without continuation support", e);
}
if (resume_bytes == null) {
return parent.loadClass(name);
} else {
return defineClass(name, resume_bytes, 0, resume_bytes.length);
}
} catch (IOException e) {
throw new XWorkException("Continuation error", e);
}
} else {
return clazz;
}
} else {
return parent.loadClass(name);
}
}
private boolean validName(String name) {
return name.startsWith(base + ".");
}
}
@@ -1,44 +0,0 @@
/*
* $Id: URL.java 474191 2006-11-13 08:30:40Z mrdon $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.continuations;
import java.util.Collections;
import java.util.Map;
import org.apache.struts2.components.URL.ExtraParameterProvider;
import com.opensymphony.xwork2.ActionContext;
/**
* Injects the continuation id into the url parameters
*/
public class ContinuationsExtraParameterProvider implements ExtraParameterProvider {
public Map getExtraParameters() {
// tie in the continuation parameter
String continueId = (String) ActionContext.getContext().get(StrutsContinuationConfig.CONTINUE_KEY);
if (continueId != null) {
return Collections.singletonMap(StrutsContinuationConfig.CONTINUE_PARAM, continueId);
}
return Collections.EMPTY_MAP;
}
}
@@ -1,32 +0,0 @@
/*
* $Id: URL.java 474191 2006-11-13 08:30:40Z mrdon $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.continuations;
import com.uwyn.rife.continuations.ContinuableObject;
/**
* Implementing this interface indicates that the action should not be cloned, but instead should be re-used. This is
* needed when you are using objects, fields, and method variables that cannot be cloned. The downside to using this is
* that the advanced forward/backward historical support that normally automatically comes with continuations is no
* longer available.
*/
public interface NonCloningContinuableObject extends ContinuableObject {
}
@@ -1,51 +0,0 @@
/*
* $Id: URL.java 474191 2006-11-13 08:30:40Z mrdon $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.continuations;
import com.uwyn.rife.continuations.ContinuationConfig;
/**
* RIFE Continuation configuration.
*/
public class StrutsContinuationConfig extends ContinuationConfig {
public static final String CONTINUE_PARAM = "__continue";
public static final String CONTINUE_KEY = "__continue";
public String getContinuableClassInternalName() {
return "com.opensymphony.xwork2.ActionSupport";
}
public String getContinuableInterfaceInternalName() {
return "com.opensymphony.xwork2.Action";
}
public String getEntryMethod() {
return "execute()Ljava/lang/String;";
}
public String getContinuableClassOrInterfaceName() {
return "com.opensymphony.xwork2.ActionSupport";
}
public String getPauseSignature() {
return "(Ljava/lang/String;)V";
}
}
@@ -1,174 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
@@ -1,5 +0,0 @@
Apache Struts
Copyright 2000-2007 The Apache Software Foundation
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<bean type="java.lang.ClassLoader" name="objectFactory.classloader" class="org.apache.struts2.continuations.ContinuationsClassLoader" />
<bean type="org.apache.struts2.components.URL$ExtraParameterProvider" class="org.apache.struts2.continuations.ContinuationsExtraParameterProvider" />
<bean type="com.opensymphony.xwork2.ActionEventListener" class="org.apache.struts2.continuations.ContinuationsActionEventListener" />
</struts>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jasperreports-plugin</artifactId>
@@ -32,7 +32,14 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.sf.jasperreports.engine.*;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JRExporter;
import net.sf.jasperreports.engine.JRExporterParameter;
import net.sf.jasperreports.engine.JRParameter;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.export.JRCsvExporter;
import net.sf.jasperreports.engine.export.JRCsvExporterParameter;
import net.sf.jasperreports.engine.export.JRHtmlExporter;
@@ -44,11 +51,11 @@ import net.sf.jasperreports.engine.util.JRLoader;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.opensymphony.xwork2.util.TextUtils;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.dispatcher.StrutsResultSupport;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.util.TextUtils;
import com.opensymphony.xwork2.util.ValueStack;
/**
+61 -61
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jfreechart-plugin</artifactId>
@@ -19,68 +19,68 @@
</scm>
<profiles>
<profile>
<!--
Run the translator for Java 1.4 compatiblity
<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
Sample:
$ cd struts/struts2/
$ mvn clean install -Papps,j4 -Djava14.jar=$JAVA_HOME/../Classes/classes.jar
-->
<id>j4</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>retrotranslator-maven-plugin</artifactId>
<executions>
<execution>
<id>retrotranslate</id>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>create-j4-jar</id>
<goals><goal>jar</goal></goals>
<configuration>
<classesDirectory>${project.build.directory}/classes-retro</classesDirectory>
<classifier>j4</classifier>
<archive>
<manifestEntries>
<Extension-Name>${project.artifactId}-j4</Extension-Name>
<Specification-Vendor>${project.organization.name}</Specification-Vendor>
<Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
<Implementation-Title>${project.description}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
<Revision>${scm.revision}</Revision>
</manifestEntries>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>sun.jdk</groupId>
<artifactId>rt</artifactId>
<version>1.4.0</version>
<scope>system</scope>
<!-- path to rt.jar (on OSX, it's classes.jar) -->
<systemPath>${java14.jar}</systemPath>
</dependency>
<dependency>
<groupId>net.sf.retrotranslator</groupId>
<artifactId>retrotranslator-runtime</artifactId>
<version>1.0.8</version>
</dependency>
</dependencies>
</profile>
-->
<id>j4</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>retrotranslator-maven-plugin</artifactId>
<executions>
<execution>
<id>retrotranslate</id>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>create-j4-jar</id>
<goals><goal>jar</goal></goals>
<configuration>
<classesDirectory>${project.build.directory}/classes-retro</classesDirectory>
<classifier>j4</classifier>
<archive>
<manifestEntries>
<Extension-Name>${project.artifactId}-j4</Extension-Name>
<Specification-Vendor>${project.organization.name}</Specification-Vendor>
<Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
<Implementation-Title>${project.description}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
<Revision>${scm.revision}</Revision>
</manifestEntries>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>sun.jdk</groupId>
<artifactId>rt</artifactId>
<version>1.4.0</version>
<scope>system</scope>
<!-- path to rt.jar (on OSX, it's classes.jar) -->
<systemPath>${java14.jar}</systemPath>
</dependency>
<dependency>
<groupId>net.sf.retrotranslator</groupId>
<artifactId>retrotranslator-runtime</artifactId>
<version>1.0.8</version>
</dependency>
</dependencies>
</profile>
</profiles>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jsf-plugin</artifactId>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-pell-multipart-plugin</artifactId>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plexus-plugin</artifactId>
+1 -2
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
@@ -21,7 +21,6 @@
<modules>
<module>codebehind</module>
<module>config-browser</module>
<module>continuations</module>
<module>jasperreports</module>
<module>jfreechart</module>
<module>jsf</module>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitegraph-plugin</artifactId>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitemesh-plugin</artifactId>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-struts1-plugin</artifactId>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.0.6</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-tiles-plugin</artifactId>
@@ -80,12 +80,7 @@ public class StrutsTilesRequestContext extends TilesRequestContextWrapper {
}
public void dispatch(String include) throws IOException {
if (include.endsWith(mask)) {
// FIXME This way FreeMarker results still don't have a content-type!
include(include);
} else {
super.dispatch(include);
}
include(include);
}
/**
+2 -2
View File
@@ -32,7 +32,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>2.0.6</version>
<packaging>pom</packaging>
<name>Struts 2</name>
<url>http://struts.apache.org/struts2</url>
@@ -78,7 +78,7 @@
<modules>
<module>core</module>
<!--<module>assembly</module>-->
<module>api</module>
<!-- <module>api</module> -->
</modules>
<licenses>
+12 -51
View File
@@ -8,12 +8,13 @@
<bannerRight>
<name>Apache Struts</name>
<src>images/struts2.png</src>
<href>http://struts.apache.org/2.x/</href>
</bannerRight>
<href>http://struts.apache.org</href>
</bannerRight>
<body>
<links>
<item name="Apache" href="http://www.apache.org/" />
<item name="Struts" href="http://struts.apache.org/index.html" />
<item name="Apache" href="http://www.apache.org" />
<item name="Struts 2" href="http://struts.apache.org/2.x" />
<item name="Struts 1" href="http://struts.apache.org/1.x" />
</links>
<menu name="Struts 2">
<item
@@ -26,30 +27,30 @@
</menu>
<menu name="Documentation">
<item
name="Getting Started"
href="docs/home.html"
/>
/>
<item
name="Tutorials"
href="docs/tutorials.html"
/>
/>
<item
name="FAQs"
href="docs/faqs.html"
/>
/>
<item
name="Guides"
href="docs/guides.html"
/>
/>
<item
name="Release Notes"
href="docs/release-notes-206.html"
/>
href="docs/release-notes-205.html"
/>
</menu>
@@ -140,45 +141,5 @@
/>
</menu>
<menu name="Development">
<item
name="Struts 2.x Draft Docs"
href="http://struts.apache.org/2.x/index.html"/>
<item
name="How to Help FAQ"
href="http://struts.apache.org/helping.html"
/>
<item
name="Development Lists"
href="http://struts.apache.org/dev/dev-mail.html"
/>
<item
name="Source Code"
href="http://struts.apache.org/dev/builds.html"
/>
<item
name="Release Guidelines"
href="http://struts.apache.org/dev/releases.html"
/>
<item
name="Volunteers"
href="http://struts.apache.org/dev/volunteers.html"
/>
<item
name="PMC Charter"
href="http://struts.apache.org/dev/bylaws.html"
/>
<item
name="Sandbox"
href="http://struts.apache.org/struts-sandbox/index.html"
/>
<item
name="Source Repository"
href="http://svn.apache.org/viewcvs.cgi/struts/"
/>
</menu>
</body>
</project>