mirror of
https://github.com/apache/struts.git
synced 2026-08-07 07:37:20 +00:00
WW-3241: ShowCase demo application still uses the CodeBehind plugin.
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1096885 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -103,7 +103,7 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-codebehind-plugin</artifactId>
|
||||
<artifactId>struts2-convention-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
+7
-4
@@ -24,17 +24,20 @@ import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.struts2.config.Result;
|
||||
import org.apache.struts2.config.Results;
|
||||
import org.apache.struts2.dispatcher.ServletRedirectResult;
|
||||
import org.apache.struts2.convention.annotation.ParentPackage;
|
||||
import org.apache.struts2.convention.annotation.Result;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.convention.annotation.Results;
|
||||
|
||||
/**
|
||||
* <code>EditPerson</code>
|
||||
*
|
||||
*/
|
||||
@Result(name="list", value="listPeople.action", type=ServletRedirectResult.class)
|
||||
@Results({
|
||||
@Result(name="list", location="list-people.action", type="redirect"),
|
||||
@Result(name="input", location="new-person.ftl", type="freemarker")
|
||||
})
|
||||
public class EditPersonAction extends ActionSupport {
|
||||
|
||||
private static final long serialVersionUID = 7699491775215130850L;
|
||||
|
||||
+3
-3
@@ -23,11 +23,11 @@ package org.apache.struts2.showcase.person;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.struts2.config.Result;
|
||||
import org.apache.struts2.views.freemarker.FreemarkerResult;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.convention.annotation.ParentPackage;
|
||||
import org.apache.struts2.convention.annotation.Result;
|
||||
|
||||
@Result(location="list-people.ftl", type="freemarker")
|
||||
public class ListPeopleAction extends ActionSupport {
|
||||
|
||||
private static final long serialVersionUID = 3608017189783645371L;
|
||||
|
||||
@@ -20,16 +20,13 @@
|
||||
*/
|
||||
package org.apache.struts2.showcase.person;
|
||||
|
||||
import org.apache.struts2.config.ParentPackage;
|
||||
import org.apache.struts2.config.Result;
|
||||
import org.apache.struts2.config.Results;
|
||||
import org.apache.struts2.convention.annotation.ParentPackage;
|
||||
import org.apache.struts2.convention.annotation.Result;
|
||||
import org.apache.struts2.views.freemarker.FreemarkerResult;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
/**
|
||||
*/
|
||||
@ParentPackage("person")
|
||||
@Result(name="input", location="new-person.ftl", type="freemarker")
|
||||
public class NewPersonAction extends ActionSupport {
|
||||
|
||||
private static final long serialVersionUID = 200410824352645515L;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
@ParentPackage("person")
|
||||
@Namespace("/person")
|
||||
package org.apache.struts2.showcase.person;
|
||||
|
||||
import org.apache.struts2.convention.annotation.Namespace;
|
||||
import org.apache.struts2.convention.annotation.ParentPackage;
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
<constant name="struts.custom.i18n.resources" value="globalMessages" />
|
||||
<constant name="struts.action.extension" value="action,," />
|
||||
|
||||
<constant name="struts.codebehind.defaultPackage" value="person" />
|
||||
<constant name="struts.convention.package.locators.basePackage" value="org.apache.struts2.showcase.person" />
|
||||
<constant name="struts.convention.result.path" value="/" />
|
||||
|
||||
<constant name="struts.freemarker.manager.classname" value="customFreemarkerManager" />
|
||||
<constant name="struts.serve.static" value="true" />
|
||||
<constant name="struts.serve.static.browserCache" value="false" />
|
||||
|
||||
<constant name="actionPackages" value="org.apache.struts2.showcase.person"/>
|
||||
|
||||
<include file="struts-chat.xml" />
|
||||
|
||||
<include file="struts-interactive.xml" />
|
||||
|
||||
@@ -9,10 +9,6 @@
|
||||
<filter>
|
||||
<filter-name>struts-prepare</filter-name>
|
||||
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>actionPackages</param-name>
|
||||
<param-value>org.apache.struts2.showcase.person</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
|
||||
<filter>
|
||||
|
||||
+3
-3
@@ -6,7 +6,7 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<s:form action="editPerson" theme="simple" validate="false">
|
||||
<s:form action="edit-person" theme="simple" validate="false">
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
@@ -33,8 +33,8 @@
|
||||
</s:form>
|
||||
|
||||
<ul>
|
||||
<li><a href="newPerson!input.action">Create</a> a new person</li>
|
||||
<li><a href="listPeople.action">List</a> all people</li>
|
||||
<li><a href="new-person!input.action">Create</a> a new person</li>
|
||||
<li><a href="list-people.action">List</a> all people</li>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
<body>
|
||||
<ul>
|
||||
<li><a href="newPerson!input.action">Create</a> a new person</li>
|
||||
<li><a href="listPeople.action">List</a> all people</li>
|
||||
<li><a href="new-person!input.action">Create</a> a new person</li>
|
||||
<li><a href="list-people.action">List</a> all people</li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+2
-2
@@ -21,8 +21,8 @@ There are ${peopleCount} people...
|
||||
</table>
|
||||
|
||||
<ul>
|
||||
<li><a href="editPerson.action">Edit people</a></li>
|
||||
<li><a href="newPerson!input.action">Create</a> a new person</li>
|
||||
<li><a href="edit-person.action">Edit people</a></li>
|
||||
<li><a href="new-person!input.action">Create</a> a new person</li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
+3
-3
@@ -4,15 +4,15 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<@s.form action="newPerson">
|
||||
<@s.form action="new-person">
|
||||
<@s.textfield label="First Name" name="person.name"/>
|
||||
<@s.textfield label="Last Name" name="person.lastName"/>
|
||||
<@s.submit value="Create person"/>
|
||||
</@s.form>
|
||||
|
||||
<ul>
|
||||
<li><a href="editPerson.action">Edit people</a></li>
|
||||
<li><a href="listPeople.action">List</a> all people</li>
|
||||
<li><a href="edit-person.action">Edit people</a></li>
|
||||
<li><a href="list-people.action">List</a> all people</li>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
Reference in New Issue
Block a user