mirror of
https://github.com/apache/struts.git
synced 2026-08-07 07:37:20 +00:00
Added the codebehind plugin and used it in the person manager example, cleaned imports
WW-1515 git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@476710 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -62,6 +62,12 @@
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-codebehind-plugin</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-spring-plugin</artifactId>
|
||||
@@ -137,7 +143,7 @@
|
||||
<artifactId>maven-jetty-plugin</artifactId>
|
||||
<version>6.0.1</version>
|
||||
<configuration>
|
||||
<scanIntervalSeconds>10</scanIntervalSeconds>
|
||||
<scanIntervalSeconds>1000000</scanIntervalSeconds>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
*/
|
||||
package org.apache.struts2.showcase;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
/**
|
||||
* <code>DateAction</code>
|
||||
*
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
*/
|
||||
package org.apache.struts2.showcase;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
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;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
// START SNIPPET: example
|
||||
public class Guess extends ActionSupport implements Preparable, ContinuableObject {
|
||||
int guess;
|
||||
|
||||
@@ -20,18 +20,19 @@
|
||||
*/
|
||||
package org.apache.struts2.showcase;
|
||||
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import com.opensymphony.xwork2.Validateable;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.File;
|
||||
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import com.opensymphony.xwork2.Validateable;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
*/
|
||||
|
||||
+4
-3
@@ -20,13 +20,14 @@
|
||||
*/
|
||||
package org.apache.struts2.showcase.action;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.showcase.dao.Dao;
|
||||
import org.apache.struts2.showcase.model.IdEntity;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.io.Serializable;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
/**
|
||||
* AbstractCRUDAction.
|
||||
|
||||
@@ -20,7 +20,11 @@
|
||||
*/
|
||||
package org.apache.struts2.showcase.action;
|
||||
|
||||
import com.opensymphony.xwork2.Preparable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.struts2.showcase.application.TestDataProvider;
|
||||
import org.apache.struts2.showcase.dao.Dao;
|
||||
@@ -28,10 +32,7 @@ import org.apache.struts2.showcase.dao.EmployeeDao;
|
||||
import org.apache.struts2.showcase.model.Employee;
|
||||
import org.apache.struts2.showcase.model.Skill;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import com.opensymphony.xwork2.Preparable;
|
||||
|
||||
/**
|
||||
* JsfEmployeeAction.
|
||||
|
||||
@@ -20,11 +20,12 @@
|
||||
*/
|
||||
package org.apache.struts2.showcase.action;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.struts2.showcase.dao.Dao;
|
||||
import org.apache.struts2.showcase.dao.SkillDao;
|
||||
import org.apache.struts2.showcase.model.Skill;
|
||||
|
||||
import com.opensymphony.xwork2.Preparable;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* SkillAction.
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
*/
|
||||
package org.apache.struts2.showcase.ajax.tree;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*/
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
*/
|
||||
package org.apache.struts2.showcase.ajax.tree;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
/**
|
||||
*/
|
||||
|
||||
+6
-7
@@ -20,19 +20,18 @@
|
||||
*/
|
||||
package org.apache.struts2.showcase.application;
|
||||
|
||||
import org.apache.struts2.showcase.exception.CreateException;
|
||||
import org.apache.struts2.showcase.exception.DuplicateKeyException;
|
||||
import org.apache.struts2.showcase.exception.StorageException;
|
||||
import org.apache.struts2.showcase.exception.UpdateException;
|
||||
import org.apache.struts2.showcase.model.IdEntity;
|
||||
import org.apache.struts2.showcase.application.Storage;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.struts2.showcase.exception.CreateException;
|
||||
import org.apache.struts2.showcase.exception.DuplicateKeyException;
|
||||
import org.apache.struts2.showcase.exception.StorageException;
|
||||
import org.apache.struts2.showcase.exception.UpdateException;
|
||||
import org.apache.struts2.showcase.model.IdEntity;
|
||||
|
||||
/**
|
||||
* MemoryStorage.
|
||||
* Very simple in-memory persistence emulation.
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
*/
|
||||
package org.apache.struts2.showcase.application;
|
||||
|
||||
import org.apache.struts2.showcase.model.IdEntity;
|
||||
import org.apache.struts2.showcase.exception.CreateException;
|
||||
import org.apache.struts2.showcase.exception.UpdateException;
|
||||
import org.apache.struts2.showcase.exception.StorageException;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.apache.struts2.showcase.exception.CreateException;
|
||||
import org.apache.struts2.showcase.exception.StorageException;
|
||||
import org.apache.struts2.showcase.exception.UpdateException;
|
||||
import org.apache.struts2.showcase.model.IdEntity;
|
||||
|
||||
/**
|
||||
* Storage. Interface.
|
||||
*
|
||||
|
||||
+5
-5
@@ -20,18 +20,18 @@
|
||||
*/
|
||||
package org.apache.struts2.showcase.application;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.struts2.showcase.dao.EmployeeDao;
|
||||
import org.apache.struts2.showcase.dao.SkillDao;
|
||||
import org.apache.struts2.showcase.exception.StorageException;
|
||||
import org.apache.struts2.showcase.model.Employee;
|
||||
import org.apache.struts2.showcase.model.Skill;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* TestDataProvider.
|
||||
*
|
||||
|
||||
@@ -20,15 +20,15 @@
|
||||
*/
|
||||
package org.apache.struts2.showcase.dao;
|
||||
|
||||
import org.apache.struts2.showcase.model.IdEntity;
|
||||
import org.apache.struts2.showcase.exception.CreateException;
|
||||
import org.apache.struts2.showcase.exception.UpdateException;
|
||||
import org.apache.struts2.showcase.exception.StorageException;
|
||||
import org.apache.struts2.showcase.application.Storage;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.apache.struts2.showcase.application.Storage;
|
||||
import org.apache.struts2.showcase.exception.CreateException;
|
||||
import org.apache.struts2.showcase.exception.StorageException;
|
||||
import org.apache.struts2.showcase.exception.UpdateException;
|
||||
import org.apache.struts2.showcase.model.IdEntity;
|
||||
|
||||
/**
|
||||
* AbstractDao.
|
||||
*
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
*/
|
||||
package org.apache.struts2.showcase.dao;
|
||||
|
||||
import org.apache.struts2.showcase.model.IdEntity;
|
||||
import org.apache.struts2.showcase.exception.CreateException;
|
||||
import org.apache.struts2.showcase.exception.UpdateException;
|
||||
import org.apache.struts2.showcase.exception.StorageException;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.apache.struts2.showcase.exception.CreateException;
|
||||
import org.apache.struts2.showcase.exception.StorageException;
|
||||
import org.apache.struts2.showcase.exception.UpdateException;
|
||||
import org.apache.struts2.showcase.model.IdEntity;
|
||||
|
||||
/**
|
||||
* Dao. Interface.
|
||||
*
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
*/
|
||||
package org.apache.struts2.showcase.dao;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.struts2.showcase.model.Employee;
|
||||
import org.apache.struts2.showcase.model.Skill;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* EmployeeDao.
|
||||
*
|
||||
|
||||
+4
-3
@@ -20,11 +20,12 @@
|
||||
*/
|
||||
package org.apache.struts2.showcase.filedownload;
|
||||
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import com.opensymphony.xwork2.Action;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import com.opensymphony.xwork2.Action;
|
||||
|
||||
/**
|
||||
* Action to demonstrate how to use file download.
|
||||
* <p/>
|
||||
|
||||
+2
-2
@@ -20,10 +20,10 @@
|
||||
*/
|
||||
package org.apache.struts2.showcase.fileupload;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
/**
|
||||
* Show case File Upload example's action. <code>FileUploadAction</code>
|
||||
*
|
||||
|
||||
+3
-3
@@ -19,11 +19,11 @@
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.showcase.fileupload;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
/**
|
||||
* Showcase action - multiple file upload using List
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
package org.apache.struts2.showcase.hangman;
|
||||
|
||||
import static org.apache.struts2.showcase.hangman.HangmanConstants.*;
|
||||
import static org.apache.struts2.showcase.hangman.HangmanConstants.HANGMAN_SESSION_KEY;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ package org.apache.struts2.showcase.integration;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.struts.action.ActionErrors;
|
||||
import org.apache.struts.action.ActionForm;
|
||||
import org.apache.struts.action.ActionMapping;
|
||||
import org.apache.struts.action.ActionMessage;
|
||||
import org.apache.struts.validator.ValidatorForm;
|
||||
|
||||
+1
-5
@@ -34,11 +34,7 @@ import com.opensymphony.xwork2.ActionSupport;
|
||||
* <code>EditPerson</code>
|
||||
*
|
||||
*/
|
||||
@Results({
|
||||
@Result(value="editPeople.jsp"),
|
||||
@Result(name="error",value="editPeople.jsp"),
|
||||
@Result(name="list", value="listPeople.action", type=ServletRedirectResult.class)
|
||||
})
|
||||
@Result(name="list", value="listPeople.action", type=ServletRedirectResult.class)
|
||||
public class EditPersonAction extends ActionSupport {
|
||||
|
||||
private static final long serialVersionUID = 7699491775215130850L;
|
||||
|
||||
@@ -28,7 +28,6 @@ import org.apache.struts2.views.freemarker.FreemarkerResult;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
@Result(value="listPeople.ftl", type=FreemarkerResult.class)
|
||||
public class ListPeopleAction extends ActionSupport {
|
||||
|
||||
private static final long serialVersionUID = 3608017189783645371L;
|
||||
|
||||
@@ -30,10 +30,6 @@ import com.opensymphony.xwork2.ActionSupport;
|
||||
/**
|
||||
*/
|
||||
@ParentPackage("person")
|
||||
@Results({
|
||||
@Result(value="newPerson.ftl", type=FreemarkerResult.class),
|
||||
@Result(name="input", value="newPerson.ftl", type=FreemarkerResult.class)
|
||||
})
|
||||
public class NewPersonAction extends ActionSupport {
|
||||
|
||||
private static final long serialVersionUID = 200410824352645515L;
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
*/
|
||||
package org.apache.struts2.showcase.person;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
*/
|
||||
|
||||
+2
-2
@@ -20,12 +20,12 @@
|
||||
*/
|
||||
package org.apache.struts2.showcase.sitemesh;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.opensymphony.module.sitemesh.Decorator;
|
||||
import com.opensymphony.module.sitemesh.Page;
|
||||
import com.opensymphony.module.sitemesh.mapper.AbstractDecoratorMapper;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public class NoneDecoratorMapper extends AbstractDecoratorMapper {
|
||||
public Decorator getDecorator(HttpServletRequest req, Page page) {
|
||||
if ("none".equals(req.getAttribute("decorator"))) {
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
*/
|
||||
package org.apache.struts2.showcase.token;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Example to illustrate the <code>token</code> and <code>token-session</code> interceptor.
|
||||
*
|
||||
|
||||
@@ -8,3 +8,4 @@ struts.url.http.port = 8080
|
||||
struts.freemarker.manager.classname=customFreemarkerManager
|
||||
struts.serve.static=true
|
||||
struts.serve.static.browserCache=false
|
||||
struts.codebehind.defaultPackage=person
|
||||
Reference in New Issue
Block a user