From 0d93ceedf3d94ff855248d66ee394cbb53a280b6 Mon Sep 17 00:00:00 2001 From: Lukasz Lenart Date: Thu, 13 Dec 2012 07:24:06 +0000 Subject: [PATCH] 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 --- apps/rest-showcase/pom.xml | 5 +++++ .../struts2/config_browser/ActionNamesAction.java | 15 +++++++++++++++ .../config_browser/ListValidatorsAction.java | 10 ++++++++++ .../src/main/resources/struts-plugin.xml | 2 +- 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/apps/rest-showcase/pom.xml b/apps/rest-showcase/pom.xml index 4377f3e7e..b3f153e5c 100644 --- a/apps/rest-showcase/pom.xml +++ b/apps/rest-showcase/pom.xml @@ -47,6 +47,11 @@ struts2-convention-plugin ${project.version} + + org.apache.struts + struts2-config-browser-plugin + ${project.version} + junit junit diff --git a/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ActionNamesAction.java b/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ActionNamesAction.java index a03cb1391..a2b847c16 100644 --- a/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ActionNamesAction.java +++ b/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ActionNamesAction.java @@ -95,4 +95,19 @@ public class ActionNamesAction extends ActionSupport { actionNames = new TreeSet(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; + } + } diff --git a/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ListValidatorsAction.java b/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ListValidatorsAction.java index 75d8989b0..355310dd1 100644 --- a/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ListValidatorsAction.java +++ b/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ListValidatorsAction.java @@ -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 ) { diff --git a/plugins/config-browser/src/main/resources/struts-plugin.xml b/plugins/config-browser/src/main/resources/struts-plugin.xml index fcdcc7dbd..fb370814b 100644 --- a/plugins/config-browser/src/main/resources/struts-plugin.xml +++ b/plugins/config-browser/src/main/resources/struts-plugin.xml @@ -42,7 +42,7 @@ /config-browser/error.ftl - + actionNames