WW-3943 adds support for REST plugin

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1421096 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Lukasz Lenart
2012-12-13 07:24:06 +00:00
parent 6bd836ee2a
commit 0d93ceedf3
4 changed files with 31 additions and 1 deletions
+5
View File
@@ -47,6 +47,11 @@
<artifactId>struts2-convention-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-config-browser-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -95,4 +95,19 @@ public class ActionNamesAction extends ActionSupport {
actionNames = new TreeSet<String>(configHelper.getActionNames(namespace));
return SUCCESS;
}
/**
* Index action to support cooperation with REST plugin
*
* @return action result
* @throws Exception
*/
public String index() throws Exception {
return execute();
}
public String redirect() {
return SUCCESS;
}
}
@@ -83,6 +83,16 @@ public class ListValidatorsAction extends ActionSupport {
return super.execute();
}
/**
* Index action to support cooperation with REST plugin
*
* @return action result
* @throws Exception
*/
public String index() throws Exception {
return execute();
}
protected void loadValidators() {
Class value = getClassInstance();
if ( value != null ) {
@@ -42,7 +42,7 @@
<result name="input" type="freemarker">/config-browser/error.ftl</result>
</global-results>
<action name="index">
<action name="index" class="org.apache.struts2.config_browser.ActionNamesAction" method="redirect">
<result type="redirectAction">actionNames</result>
</action>