mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/struts
This commit is contained in:
+4
-10
@@ -86,8 +86,8 @@
|
||||
<version>3.3</version>
|
||||
<configuration>
|
||||
<encoding>UTF-8</encoding>
|
||||
<source>1.5</source>
|
||||
<target>1.5</target>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@@ -159,18 +159,12 @@
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>8.1.16.v20140903</version>
|
||||
<version>9.3.3.v20150827</version>
|
||||
<configuration>
|
||||
<stopKey>CTRL+C</stopKey>
|
||||
<stopPort>8999</stopPort>
|
||||
<systemProperties>
|
||||
<systemProperty>
|
||||
<name>xwork.loggerFactory</name>
|
||||
<value>com.opensymphony.xwork2.util.logging.log4j2.Log4j2LoggerFactory</value>
|
||||
</systemProperty>
|
||||
</systemProperties>
|
||||
<scanIntervalSeconds>10</scanIntervalSeconds>
|
||||
<webAppSourceDirectory>\${basedir}/src/main/webapp/</webAppSourceDirectory>
|
||||
<webAppConfig>
|
||||
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* 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 ${package}.actions;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
/**
|
||||
* <code>Set welcome message.</code>
|
||||
*/
|
||||
public class ApplicationAction extends ActionSupport {
|
||||
|
||||
private static final long serialVersionUID = -3243216917801206214L;
|
||||
|
||||
private boolean useMinifiedResources = false;
|
||||
|
||||
public String execute() throws Exception {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
public boolean isUseMinifiedResources() {
|
||||
return useMinifiedResources;
|
||||
}
|
||||
|
||||
public void setUseMinifiedResources(boolean useMinifiedResources) {
|
||||
this.useMinifiedResources = useMinifiedResources;
|
||||
}
|
||||
|
||||
}
|
||||
+11
-15
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* $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
|
||||
@@ -20,27 +18,25 @@
|
||||
*/
|
||||
package ${package}.actions;
|
||||
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.convention.annotation.Result;
|
||||
import org.apache.struts2.convention.annotation.Results;
|
||||
|
||||
@Results({
|
||||
@Result(name = Action.SUCCESS, location = "${redirectName}", type = "redirectAction")
|
||||
})
|
||||
/* Default action when enter the application */
|
||||
public class Index extends ActionSupport {
|
||||
|
||||
private static final long serialVersionUID = 6153177836211979662L;
|
||||
private static final long serialVersionUID = -3243216917801206214L;
|
||||
|
||||
private String redirectName;
|
||||
private boolean useMinifiedResources = false;
|
||||
|
||||
public String execute() {
|
||||
redirectName = "application";
|
||||
return Action.SUCCESS;
|
||||
public String execute() throws Exception {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
public String getRedirectName() {
|
||||
return redirectName;
|
||||
public boolean isUseMinifiedResources() {
|
||||
return useMinifiedResources;
|
||||
}
|
||||
|
||||
public void setUseMinifiedResources(boolean useMinifiedResources) {
|
||||
this.useMinifiedResources = useMinifiedResources;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-2
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* $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
|
||||
|
||||
+5
-13
@@ -16,17 +16,9 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package ${package}.actions;
|
||||
@ParentPackage("data")
|
||||
@Namespace("/data")
|
||||
package ${package}.actions.data;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.StrutsTestCase;
|
||||
|
||||
public class ApplicationActionTest extends StrutsTestCase {
|
||||
|
||||
public void testApplicationAction() throws Exception {
|
||||
ApplicationAction hello = new ApplicationAction();
|
||||
String result = hello.execute();
|
||||
assertTrue("Expected a success result!", ActionSupport.SUCCESS.equals(result));
|
||||
assertFalse(hello.isUseMinifiedResources());
|
||||
}
|
||||
}
|
||||
import org.apache.struts2.convention.annotation.Namespace;
|
||||
import org.apache.struts2.convention.annotation.ParentPackage;
|
||||
+3
-1
@@ -8,7 +8,9 @@
|
||||
<constant name="struts.devMode" value="true"/>
|
||||
|
||||
<constant name="struts.convention.default.parent.package" value="angularstruts"/>
|
||||
<package name="angularstruts" extends="json-default"></package>
|
||||
<package name="angularstruts" extends="json-default">
|
||||
<default-action-ref name="index" />
|
||||
</package>
|
||||
<package name="data" extends="angularstruts" namespace="/data"></package>
|
||||
|
||||
</struts>
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
<% response.sendRedirect("application"); %>
|
||||
<% response.sendRedirect("index"); %>
|
||||
+8
-5
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* $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
|
||||
@@ -21,14 +19,19 @@
|
||||
package ${package}.actions;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.StrutsTestCase;
|
||||
import org.apache.struts2.StrutsRestTestCase;
|
||||
import org.junit.Test;
|
||||
|
||||
public class IndexTest extends StrutsTestCase {
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class IndexTest extends StrutsRestTestCase<Index> {
|
||||
|
||||
@Test
|
||||
public void testIndex() throws Exception {
|
||||
Index index = new Index();
|
||||
String result = index.execute();
|
||||
assertTrue("Expected a success result!", ActionSupport.SUCCESS.equals(result));
|
||||
assertTrue("Expected the 'hello' action name!!", "application".equals(index.getRedirectName()));
|
||||
assertFalse(index.isUseMinifiedResources());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -72,4 +72,45 @@
|
||||
<default-interceptor-ref name="beanValidationDefaultStack"/>
|
||||
|
||||
</package>
|
||||
|
||||
<package name="struts-rest-bean-validation" extends="rest-default">
|
||||
<interceptors>
|
||||
<interceptor name="beanValidation" class="org.apache.struts.beanvalidation.validation.interceptor.BeanValidationInterceptor"/>
|
||||
|
||||
<interceptor-stack name="restBeanValidationStack">
|
||||
<interceptor-ref name="exception"/>
|
||||
<interceptor-ref name="alias"/>
|
||||
<interceptor-ref name="servletConfig"/>
|
||||
<interceptor-ref name="messages">
|
||||
<param name="operationMode">AUTOMATIC</param>
|
||||
</interceptor-ref>
|
||||
<interceptor-ref name="prepare"/>
|
||||
<interceptor-ref name="i18n"/>
|
||||
<interceptor-ref name="chain"/>
|
||||
<interceptor-ref name="debugging"/>
|
||||
<interceptor-ref name="profiling"/>
|
||||
<interceptor-ref name="actionMappingParams"/>
|
||||
<interceptor-ref name="scopedModelDriven"/>
|
||||
<interceptor-ref name="modelDriven">
|
||||
<param name="refreshModelBeforeResult">true</param>
|
||||
</interceptor-ref>
|
||||
<interceptor-ref name="fileUpload"/>
|
||||
<interceptor-ref name="checkbox"/>
|
||||
<interceptor-ref name="staticParams"/>
|
||||
<interceptor-ref name="params"/>
|
||||
<interceptor-ref name="rest" />
|
||||
<interceptor-ref name="conversionError"/>
|
||||
<interceptor-ref name="beanValidation">
|
||||
<param name="excludeMethods">input,back,cancel,browse,index,show,edit,editNew</param>
|
||||
</interceptor-ref>
|
||||
<interceptor-ref name="restWorkflow">
|
||||
<param name="excludeMethods">input,back,cancel,browse,index,show,edit,editNew</param>
|
||||
</interceptor-ref>
|
||||
</interceptor-stack>
|
||||
|
||||
</interceptors>
|
||||
|
||||
<default-interceptor-ref name="beanValidationDefaultStack"/>
|
||||
|
||||
</package>
|
||||
</struts>
|
||||
|
||||
@@ -92,9 +92,7 @@
|
||||
<interceptor-ref name="fileUpload"/>
|
||||
<interceptor-ref name="checkbox"/>
|
||||
<interceptor-ref name="staticParams"/>
|
||||
<interceptor-ref name="params">
|
||||
<param name="excludeParams">dojo\..*</param>
|
||||
</interceptor-ref>
|
||||
<interceptor-ref name="params"/>
|
||||
<interceptor-ref name="rest" />
|
||||
<interceptor-ref name="conversionError"/>
|
||||
<interceptor-ref name="validation">
|
||||
|
||||
Reference in New Issue
Block a user