http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/preparable_interface/src/main/webapp/edit.jsp ---------------------------------------------------------------------- diff --git a/preparable_interface/src/main/webapp/edit.jsp b/preparable_interface/src/main/webapp/edit.jsp deleted file mode 100644 index 67a9901..0000000 --- a/preparable_interface/src/main/webapp/edit.jsp +++ /dev/null @@ -1,30 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> -<%@ taglib prefix="s" uri="/struts-tags" %> - - - - - -Struts 2 Form Tags - Edit Person - - -

Update Information

- -

Use the form below to edit your information.

- - - - - - - - - - - - - - - - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/preparable_interface/src/main/webapp/index.jsp ---------------------------------------------------------------------- diff --git a/preparable_interface/src/main/webapp/index.jsp b/preparable_interface/src/main/webapp/index.jsp deleted file mode 100644 index 88209d8..0000000 --- a/preparable_interface/src/main/webapp/index.jsp +++ /dev/null @@ -1,16 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> -<%@ taglib prefix="s" uri="/struts-tags" %> - - - - -Struts 2 Form Tags - Welcome - - -

Welcome To Struts 2!

- -

Edit your information

- - - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/preparable_interface/src/main/webapp/thankyou.jsp ---------------------------------------------------------------------- diff --git a/preparable_interface/src/main/webapp/thankyou.jsp b/preparable_interface/src/main/webapp/thankyou.jsp deleted file mode 100644 index 5fa306f..0000000 --- a/preparable_interface/src/main/webapp/thankyou.jsp +++ /dev/null @@ -1,21 +0,0 @@ - -<%@ taglib prefix="s" uri="/struts-tags" %> -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> - - - - -Update Successful - - - -

Updated Information

- - -

Your information:

- -

Return to home page.

- - - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/restful2actionmapper/pom.xml ---------------------------------------------------------------------- diff --git a/restful2actionmapper/pom.xml b/restful2actionmapper/pom.xml index eadf8cc..cff5924 100644 --- a/restful2actionmapper/pom.xml +++ b/restful2actionmapper/pom.xml @@ -1,20 +1,26 @@ - - 4.0.0 - - struts.apache.org - struts2examples - 1.0.0 - + + 4.0.0 + + struts.apache.org + struts2examples + 1.0.0 + - restful2actionmapper - war - REST to Action Mapper Example Application - Example of using Rest style URLs for - Struts 2 Getting Started tutorials - - reststyleactionmapper - + restful2actionmapper + + war + + REST to Action Mapper Example Application + + Example of using Rest style URLs for + Struts 2 Getting Started tutorials + + + + reststyleactionmapper + http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring-struts/README.txt ---------------------------------------------------------------------- diff --git a/spring-struts/README.txt b/spring-struts/README.txt new file mode 100644 index 0000000..c9b1d9a --- /dev/null +++ b/spring-struts/README.txt @@ -0,0 +1,16 @@ +This is the example project referred to in the +Struts 2 documentation, Struts 2 Spring tutorial. +See: http://struts.apache.org. + +To build the application's war file run mvn clean package +from the project's root folder. + +The war file is created in the target sub-folder. + +Copy the war file to your Servlet container (e.g. Tomcat, GlassFish) and +then startup the Servlet container. + +In a web browser go to: http://localhost:8080/spring-struts/index.action. + +You should see a web page with Welcome to Struts 2! + http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring-struts/pom.xml ---------------------------------------------------------------------- diff --git a/spring-struts/pom.xml b/spring-struts/pom.xml new file mode 100644 index 0000000..0531b3a --- /dev/null +++ b/spring-struts/pom.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + + struts.apache.org + struts2examples + 1.0.0 + + + spring-struts + + Struts2 with Spring Integration + + war + + + + org.apache.struts + struts2-spring-plugin + ${struts2.version} + + + + spring-struts + + + http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring-struts/src/main/java/org/apache/struts/edit/action/EditAction.java ---------------------------------------------------------------------- diff --git a/spring-struts/src/main/java/org/apache/struts/edit/action/EditAction.java b/spring-struts/src/main/java/org/apache/struts/edit/action/EditAction.java new file mode 100644 index 0000000..8cd09f5 --- /dev/null +++ b/spring-struts/src/main/java/org/apache/struts/edit/action/EditAction.java @@ -0,0 +1,106 @@ +package org.apache.struts.edit.action; + +import com.opensymphony.xwork2.ActionSupport; +import org.apache.struts.edit.model.Person; +import org.apache.struts.edit.model.State; +import org.apache.struts.edit.service.EditService; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * Acts as a controller to handle actions + * related to editing a Person. + * @author bruce phillips + * + */ +public class EditAction extends ActionSupport { + + private static final long serialVersionUID = 1L; + + private EditService editService ; + + private Person personBean; + + private String [] sports = {"football", "baseball", "basketball" }; + + private String [] genders = {"male", "female", "not sure" }; + + private List states ; + + private String [] carModelsAvailable = {"Ford","Chrysler","Toyota","Nissan"}; + + public String execute() throws Exception { + + editService.savePerson( getPersonBean() ); + + return SUCCESS; + + } + + + public String input() throws Exception { + + setPersonBean( editService.getPerson() ); + + return INPUT; + } + + public Person getPersonBean() { + + + return personBean; + + } + + public void setPersonBean(Person person) { + + personBean = person; + + } + + + public List getSports() { + return Arrays.asList(sports); + } + + public List getGenders() { + + return Arrays.asList(genders); + + } + + + + public List getStates() { + + states = new ArrayList(); + states.add( new State("AZ", "Arizona") ); + states.add( new State("CA", "California") ); + states.add( new State("FL", "Florida") ); + states.add( new State("KS", "Kansas") ); + states.add( new State("NY", "New York") ); + + return states; + } + + + + public String [] getCarModelsAvailable() { + return carModelsAvailable; + } + + + public EditService getEditService() { + return editService; + } + + + public void setEditService(EditService editService) { + + this.editService = editService; + + } + +} http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring-struts/src/main/java/org/apache/struts/edit/model/Person.java ---------------------------------------------------------------------- diff --git a/spring-struts/src/main/java/org/apache/struts/edit/model/Person.java b/spring-struts/src/main/java/org/apache/struts/edit/model/Person.java new file mode 100644 index 0000000..392a8de --- /dev/null +++ b/spring-struts/src/main/java/org/apache/struts/edit/model/Person.java @@ -0,0 +1,96 @@ +package org.apache.struts.edit.model; + +import java.util.Arrays; + + +/** + * Models a Person who registers. + * @author bruce phillips + * + */ +public class Person +{ + private String firstName; + private String lastName; + private String sport; + private String gender; + private String residency; + private boolean over21; + private String [] carModels; + + + public String getFirstName() + { + return firstName; + } + + public void setFirstName(String firstName) + { + this.firstName = firstName; + } + + public String getLastName() + { + return lastName; + } + + public void setLastName(String lastName) + { + this.lastName = lastName; + } + + + + + public void setSport(String sport) { + this.sport = sport; + } + + public void setGender(String gender) { + this.gender = gender; + } + + public String getGender() { + return gender; + } + + public String getSport() { + return sport; + } + + public void setResidency(String residency) { + this.residency = residency; + } + + public String getResidency() { + return residency; + } + + public void setOver21(boolean over21) { + this.over21 = over21; + } + + public boolean isOver21() { + return over21; + } + + public void setCarModels(String [] carModels) { + this.carModels = carModels; + } + + public String [] getCarModels() { + return carModels; + } + + public String toString() + { + return "First Name: " + getFirstName() + " | " + + " Last Name: " + getLastName() + " | " + + " Favorite Sport: " + getSport() + " | " + + " Gender: " + getGender() + " | " + + " Residency: " + getResidency() + " | " + + " Over 21: " + isOver21() + " | " + + " Car models: " + Arrays.asList( getCarModels() ) ; + + } +} http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring-struts/src/main/java/org/apache/struts/edit/model/State.java ---------------------------------------------------------------------- diff --git a/spring-struts/src/main/java/org/apache/struts/edit/model/State.java b/spring-struts/src/main/java/org/apache/struts/edit/model/State.java new file mode 100644 index 0000000..bb927e1 --- /dev/null +++ b/spring-struts/src/main/java/org/apache/struts/edit/model/State.java @@ -0,0 +1,39 @@ +package org.apache.struts.edit.model; + +public class State { + + private String stateAbbr; + + private String stateName; + + public State (String stateAbbr, String stateName) { + + this.stateAbbr = stateAbbr; + this.stateName = stateName; + + } + + public void setStateAbbr(String stateAbbr) { + this.stateAbbr = stateAbbr; + } + + public String getStateAbbr() { + return stateAbbr; + } + + public void setStateName(String stateName) { + this.stateName = stateName; + } + + public String getStateName() { + return stateName; + } + + public String toString() { + + return getStateAbbr() ; + + } + + +} http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring-struts/src/main/java/org/apache/struts/edit/service/EditService.java ---------------------------------------------------------------------- diff --git a/spring-struts/src/main/java/org/apache/struts/edit/service/EditService.java b/spring-struts/src/main/java/org/apache/struts/edit/service/EditService.java new file mode 100644 index 0000000..a5b347b --- /dev/null +++ b/spring-struts/src/main/java/org/apache/struts/edit/service/EditService.java @@ -0,0 +1,12 @@ +package org.apache.struts.edit.service; + +import org.apache.struts.edit.model.Person; + +public interface EditService { + + + Person getPerson(); + + void savePerson(Person personBean); + +} http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring-struts/src/main/java/org/apache/struts/edit/service/EditServiceInMemory.java ---------------------------------------------------------------------- diff --git a/spring-struts/src/main/java/org/apache/struts/edit/service/EditServiceInMemory.java b/spring-struts/src/main/java/org/apache/struts/edit/service/EditServiceInMemory.java new file mode 100644 index 0000000..7638152 --- /dev/null +++ b/spring-struts/src/main/java/org/apache/struts/edit/service/EditServiceInMemory.java @@ -0,0 +1,51 @@ +package org.apache.struts.edit.service; + +import org.apache.struts.edit.model.Person; + +/** + * Implement Services needed to edit and save + * a Person object's state. In this implementation + * the Person object's state is stored in memory + * @author brucephillips + * + */ +public class EditServiceInMemory implements EditService { + + + private static Person person ; + private static String [] carModels = {"Ford","Nissan"}; + + + static { + + person = new Person(); + person.setFirstName("Bruce"); + person.setLastName("Phillips"); + person.setSport("basketball"); + person.setGender("not sure"); + person.setResidency("KS"); + person.setOver21(true); + person.setCarModels( carModels); + + } + + + public Person getPerson() { + + return EditServiceInMemory.person; + } + + + public void savePerson(Person personBean) { + + EditServiceInMemory.person.setFirstName(personBean.getFirstName() ); + EditServiceInMemory.person.setLastName(personBean.getLastName() ); + EditServiceInMemory.person.setSport(personBean.getSport() ); + EditServiceInMemory.person.setGender( personBean.getGender() ); + EditServiceInMemory.person.setResidency( personBean.getResidency() ); + EditServiceInMemory.person.setOver21( personBean.isOver21() ); + EditServiceInMemory.person.setCarModels(personBean.getCarModels() ); + + } + +} http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring-struts/src/main/resources/log4j.dtd ---------------------------------------------------------------------- diff --git a/spring-struts/src/main/resources/log4j.dtd b/spring-struts/src/main/resources/log4j.dtd new file mode 100644 index 0000000..1aabd96 --- /dev/null +++ b/spring-struts/src/main/resources/log4j.dtd @@ -0,0 +1,227 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring-struts/src/main/resources/log4j.xml ---------------------------------------------------------------------- diff --git a/spring-struts/src/main/resources/log4j.xml b/spring-struts/src/main/resources/log4j.xml new file mode 100644 index 0000000..2100cb2 --- /dev/null +++ b/spring-struts/src/main/resources/log4j.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring-struts/src/main/resources/org/apache/struts/edit/action/EditAction.properties ---------------------------------------------------------------------- diff --git a/spring-struts/src/main/resources/org/apache/struts/edit/action/EditAction.properties b/spring-struts/src/main/resources/org/apache/struts/edit/action/EditAction.properties new file mode 100644 index 0000000..0f08667 --- /dev/null +++ b/spring-struts/src/main/resources/org/apache/struts/edit/action/EditAction.properties @@ -0,0 +1,8 @@ +personBean.firstName=First name +personBean.lastName=Last name +personBean.sport=Favorite sport +personBean.gender=Gender +personBean.residency=State resident +personBean.over21=21 or older +personBean.carModels=Car models owned +submit=Save Changes \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring-struts/src/main/resources/struts.xml ---------------------------------------------------------------------- diff --git a/spring-struts/src/main/resources/struts.xml b/spring-struts/src/main/resources/struts.xml new file mode 100644 index 0000000..30c5e5d --- /dev/null +++ b/spring-struts/src/main/resources/struts.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + /index.jsp + + + + /edit.jsp + + + + /thankyou.jsp + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring-struts/src/main/webapp/META-INF/MANIFEST.MF ---------------------------------------------------------------------- diff --git a/spring-struts/src/main/webapp/META-INF/MANIFEST.MF b/spring-struts/src/main/webapp/META-INF/MANIFEST.MF new file mode 100644 index 0000000..254272e --- /dev/null +++ b/spring-struts/src/main/webapp/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring-struts/src/main/webapp/WEB-INF/applicationContext.xml ---------------------------------------------------------------------- diff --git a/spring-struts/src/main/webapp/WEB-INF/applicationContext.xml b/spring-struts/src/main/webapp/WEB-INF/applicationContext.xml new file mode 100644 index 0000000..7f3f278 --- /dev/null +++ b/spring-struts/src/main/webapp/WEB-INF/applicationContext.xml @@ -0,0 +1,10 @@ + + + + + + http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring-struts/src/main/webapp/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/spring-struts/src/main/webapp/WEB-INF/web.xml b/spring-struts/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..e8cb9ce --- /dev/null +++ b/spring-struts/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,25 @@ + + + Spring Struts 2 + + + index.jsp + + + + org.springframework.web.context.ContextLoaderListener + + + + struts2 + org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter + + + + struts2 + /* + + + http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring-struts/src/main/webapp/edit.jsp ---------------------------------------------------------------------- diff --git a/spring-struts/src/main/webapp/edit.jsp b/spring-struts/src/main/webapp/edit.jsp new file mode 100644 index 0000000..0cd05e4 --- /dev/null +++ b/spring-struts/src/main/webapp/edit.jsp @@ -0,0 +1,29 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> +<%@ taglib prefix="s" uri="/struts-tags" %> + + + + + +Struts 2 Form Tags - Edit Person + + + +

Update Information

+ +

Use the form below to edit your information.

+ + + + + + + + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring-struts/src/main/webapp/index.jsp ---------------------------------------------------------------------- diff --git a/spring-struts/src/main/webapp/index.jsp b/spring-struts/src/main/webapp/index.jsp new file mode 100644 index 0000000..88209d8 --- /dev/null +++ b/spring-struts/src/main/webapp/index.jsp @@ -0,0 +1,16 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> +<%@ taglib prefix="s" uri="/struts-tags" %> + + + + +Struts 2 Form Tags - Welcome + + +

Welcome To Struts 2!

+ +

Edit your information

+ + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring-struts/src/main/webapp/thankyou.jsp ---------------------------------------------------------------------- diff --git a/spring-struts/src/main/webapp/thankyou.jsp b/spring-struts/src/main/webapp/thankyou.jsp new file mode 100644 index 0000000..5fa306f --- /dev/null +++ b/spring-struts/src/main/webapp/thankyou.jsp @@ -0,0 +1,21 @@ + +<%@ taglib prefix="s" uri="/struts-tags" %> +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + +Update Successful + + + +

Updated Information

+ + +

Your information:

+ +

Return to home page.

+ + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring_struts/README.txt ---------------------------------------------------------------------- diff --git a/spring_struts/README.txt b/spring_struts/README.txt deleted file mode 100644 index cb5053d..0000000 --- a/spring_struts/README.txt +++ /dev/null @@ -1,16 +0,0 @@ -This is the example project referred to in the -Struts 2 documentation, Struts 2 Spring tutorial. -See: http://struts.apache.org. - -To build the application's war file run mvn clean package -from the project's root folder. - -The war file is created in the target sub-folder. - -Copy the war file to your Servlet container (e.g. Tomcat, GlassFish) and -then startup the Servlet container. - -In a web browser go to: http://localhost:8080/spring_struts/index.action. - -You should see a web page with Welcome to Struts 2! - http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring_struts/pom.xml ---------------------------------------------------------------------- diff --git a/spring_struts/pom.xml b/spring_struts/pom.xml deleted file mode 100644 index 6ba3a6b..0000000 --- a/spring_struts/pom.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - 4.0.0 - - struts.apache.org - struts2examples - 1.0.0 - - - spring_struts - - spring_struts - - war - - - - org.apache.struts - struts2-spring-plugin - ${struts2.version} - - - - spring_struts - - - http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring_struts/src/main/java/org/apache/struts/edit/action/EditAction.java ---------------------------------------------------------------------- diff --git a/spring_struts/src/main/java/org/apache/struts/edit/action/EditAction.java b/spring_struts/src/main/java/org/apache/struts/edit/action/EditAction.java deleted file mode 100644 index c157d9e..0000000 --- a/spring_struts/src/main/java/org/apache/struts/edit/action/EditAction.java +++ /dev/null @@ -1,108 +0,0 @@ -package org.apache.struts.edit.action; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.apache.struts.edit.model.Person; -import org.apache.struts.edit.model.State; -import org.apache.struts.edit.service.EditService; - - -import com.opensymphony.xwork2.ActionSupport; - -/** - * Acts as a controller to handle actions - * related to editing a Person. - * @author bruce phillips - * - */ -public class EditAction extends ActionSupport { - - private static final long serialVersionUID = 1L; - - private EditService editService ; - - private Person personBean; - - private String [] sports = {"football", "baseball", "basketball" }; - - private String [] genders = {"male", "female", "not sure" }; - - private List states ; - - private String [] carModelsAvailable = {"Ford","Chrysler","Toyota","Nissan"}; - - public String execute() throws Exception { - - editService.savePerson( getPersonBean() ); - - return SUCCESS; - - } - - - public String input() throws Exception { - - setPersonBean( editService.getPerson() ); - - return INPUT; - } - - public Person getPersonBean() { - - - return personBean; - - } - - public void setPersonBean(Person person) { - - personBean = person; - - } - - - public List getSports() { - return Arrays.asList(sports); - } - - public List getGenders() { - - return Arrays.asList(genders); - - } - - - - public List getStates() { - - states = new ArrayList(); - states.add( new State("AZ", "Arizona") ); - states.add( new State("CA", "California") ); - states.add( new State("FL", "Florida") ); - states.add( new State("KS", "Kansas") ); - states.add( new State("NY", "New York") ); - - return states; - } - - - - public String [] getCarModelsAvailable() { - return carModelsAvailable; - } - - - public EditService getEditService() { - return editService; - } - - - public void setEditService(EditService editService) { - - this.editService = editService; - - } - -} http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring_struts/src/main/java/org/apache/struts/edit/model/Person.java ---------------------------------------------------------------------- diff --git a/spring_struts/src/main/java/org/apache/struts/edit/model/Person.java b/spring_struts/src/main/java/org/apache/struts/edit/model/Person.java deleted file mode 100644 index 392a8de..0000000 --- a/spring_struts/src/main/java/org/apache/struts/edit/model/Person.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.apache.struts.edit.model; - -import java.util.Arrays; - - -/** - * Models a Person who registers. - * @author bruce phillips - * - */ -public class Person -{ - private String firstName; - private String lastName; - private String sport; - private String gender; - private String residency; - private boolean over21; - private String [] carModels; - - - public String getFirstName() - { - return firstName; - } - - public void setFirstName(String firstName) - { - this.firstName = firstName; - } - - public String getLastName() - { - return lastName; - } - - public void setLastName(String lastName) - { - this.lastName = lastName; - } - - - - - public void setSport(String sport) { - this.sport = sport; - } - - public void setGender(String gender) { - this.gender = gender; - } - - public String getGender() { - return gender; - } - - public String getSport() { - return sport; - } - - public void setResidency(String residency) { - this.residency = residency; - } - - public String getResidency() { - return residency; - } - - public void setOver21(boolean over21) { - this.over21 = over21; - } - - public boolean isOver21() { - return over21; - } - - public void setCarModels(String [] carModels) { - this.carModels = carModels; - } - - public String [] getCarModels() { - return carModels; - } - - public String toString() - { - return "First Name: " + getFirstName() + " | " + - " Last Name: " + getLastName() + " | " + - " Favorite Sport: " + getSport() + " | " + - " Gender: " + getGender() + " | " + - " Residency: " + getResidency() + " | " + - " Over 21: " + isOver21() + " | " + - " Car models: " + Arrays.asList( getCarModels() ) ; - - } -} http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring_struts/src/main/java/org/apache/struts/edit/model/State.java ---------------------------------------------------------------------- diff --git a/spring_struts/src/main/java/org/apache/struts/edit/model/State.java b/spring_struts/src/main/java/org/apache/struts/edit/model/State.java deleted file mode 100644 index bb927e1..0000000 --- a/spring_struts/src/main/java/org/apache/struts/edit/model/State.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.apache.struts.edit.model; - -public class State { - - private String stateAbbr; - - private String stateName; - - public State (String stateAbbr, String stateName) { - - this.stateAbbr = stateAbbr; - this.stateName = stateName; - - } - - public void setStateAbbr(String stateAbbr) { - this.stateAbbr = stateAbbr; - } - - public String getStateAbbr() { - return stateAbbr; - } - - public void setStateName(String stateName) { - this.stateName = stateName; - } - - public String getStateName() { - return stateName; - } - - public String toString() { - - return getStateAbbr() ; - - } - - -} http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring_struts/src/main/java/org/apache/struts/edit/service/EditService.java ---------------------------------------------------------------------- diff --git a/spring_struts/src/main/java/org/apache/struts/edit/service/EditService.java b/spring_struts/src/main/java/org/apache/struts/edit/service/EditService.java deleted file mode 100644 index f52e053..0000000 --- a/spring_struts/src/main/java/org/apache/struts/edit/service/EditService.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.apache.struts.edit.service; - -import org.apache.struts.edit.model.Person; - -public interface EditService { - - - Person getPerson() ; - - void savePerson(Person personBean); - -} http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring_struts/src/main/java/org/apache/struts/edit/service/EditServiceInMemory.java ---------------------------------------------------------------------- diff --git a/spring_struts/src/main/java/org/apache/struts/edit/service/EditServiceInMemory.java b/spring_struts/src/main/java/org/apache/struts/edit/service/EditServiceInMemory.java deleted file mode 100644 index 169b1d0..0000000 --- a/spring_struts/src/main/java/org/apache/struts/edit/service/EditServiceInMemory.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.apache.struts.edit.service; - -import org.apache.struts.edit.model.Person; - -/** - * Implement Services needed to edit and save - * a Person object's state. In this implementation - * the Person object's state is stored in memory - * @author brucephillips - * - */ -public class EditServiceInMemory implements EditService { - - - private static Person person ; - private static String [] carModels = {"Ford","Nissan"}; - - - static { - - person = new Person(); - person.setFirstName("Bruce"); - person.setLastName("Phillips"); - person.setSport("basketball"); - person.setGender("not sure"); - person.setResidency("KS"); - person.setOver21(true); - person.setCarModels( carModels); - - } - - - public Person getPerson() { - - return EditServiceInMemory.person; - } - - - public void savePerson(Person personBean) { - - EditServiceInMemory.person.setFirstName(personBean.getFirstName() ); - EditServiceInMemory.person.setLastName(personBean.getLastName() ); - EditServiceInMemory.person.setSport(personBean.getSport() ); - EditServiceInMemory.person.setGender( personBean.getGender() ); - EditServiceInMemory.person.setResidency( personBean.getResidency() ); - EditServiceInMemory.person.setOver21( personBean.isOver21() ); - EditServiceInMemory.person.setCarModels(personBean.getCarModels() ); - - } - -} http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring_struts/src/main/resources/log4j.dtd ---------------------------------------------------------------------- diff --git a/spring_struts/src/main/resources/log4j.dtd b/spring_struts/src/main/resources/log4j.dtd deleted file mode 100644 index 1aabd96..0000000 --- a/spring_struts/src/main/resources/log4j.dtd +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring_struts/src/main/resources/log4j.xml ---------------------------------------------------------------------- diff --git a/spring_struts/src/main/resources/log4j.xml b/spring_struts/src/main/resources/log4j.xml deleted file mode 100644 index 2100cb2..0000000 --- a/spring_struts/src/main/resources/log4j.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring_struts/src/main/resources/org/apache/struts/edit/action/EditAction.properties ---------------------------------------------------------------------- diff --git a/spring_struts/src/main/resources/org/apache/struts/edit/action/EditAction.properties b/spring_struts/src/main/resources/org/apache/struts/edit/action/EditAction.properties deleted file mode 100644 index 82869db..0000000 --- a/spring_struts/src/main/resources/org/apache/struts/edit/action/EditAction.properties +++ /dev/null @@ -1,8 +0,0 @@ -personBean.firstName=First name -personBean.lastName=Last name -personBean.sport=Favorite sport -personBean.gender=Gender -personBean.residency=State resident -personBean.over21=21 or older -personBean.carModels=Car models owned -submit=Save Changes \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring_struts/src/main/resources/struts.xml ---------------------------------------------------------------------- diff --git a/spring_struts/src/main/resources/struts.xml b/spring_struts/src/main/resources/struts.xml deleted file mode 100644 index 30c5e5d..0000000 --- a/spring_struts/src/main/resources/struts.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - /index.jsp - - - - /edit.jsp - - - - /thankyou.jsp - - - - - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring_struts/src/main/webapp/META-INF/MANIFEST.MF ---------------------------------------------------------------------- diff --git a/spring_struts/src/main/webapp/META-INF/MANIFEST.MF b/spring_struts/src/main/webapp/META-INF/MANIFEST.MF deleted file mode 100644 index 5e94951..0000000 --- a/spring_struts/src/main/webapp/META-INF/MANIFEST.MF +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -Class-Path: - http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring_struts/src/main/webapp/WEB-INF/applicationContext.xml ---------------------------------------------------------------------- diff --git a/spring_struts/src/main/webapp/WEB-INF/applicationContext.xml b/spring_struts/src/main/webapp/WEB-INF/applicationContext.xml deleted file mode 100644 index 7f3f278..0000000 --- a/spring_struts/src/main/webapp/WEB-INF/applicationContext.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring_struts/src/main/webapp/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/spring_struts/src/main/webapp/WEB-INF/web.xml b/spring_struts/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index e8cb9ce..0000000 --- a/spring_struts/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - Spring Struts 2 - - - index.jsp - - - - org.springframework.web.context.ContextLoaderListener - - - - struts2 - org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter - - - - struts2 - /* - - - http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring_struts/src/main/webapp/edit.jsp ---------------------------------------------------------------------- diff --git a/spring_struts/src/main/webapp/edit.jsp b/spring_struts/src/main/webapp/edit.jsp deleted file mode 100644 index 0cd05e4..0000000 --- a/spring_struts/src/main/webapp/edit.jsp +++ /dev/null @@ -1,29 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> -<%@ taglib prefix="s" uri="/struts-tags" %> - - - - - -Struts 2 Form Tags - Edit Person - - - -

Update Information

- -

Use the form below to edit your information.

- - - - - - - - - - - - - - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring_struts/src/main/webapp/index.jsp ---------------------------------------------------------------------- diff --git a/spring_struts/src/main/webapp/index.jsp b/spring_struts/src/main/webapp/index.jsp deleted file mode 100644 index 88209d8..0000000 --- a/spring_struts/src/main/webapp/index.jsp +++ /dev/null @@ -1,16 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> -<%@ taglib prefix="s" uri="/struts-tags" %> - - - - -Struts 2 Form Tags - Welcome - - -

Welcome To Struts 2!

- -

Edit your information

- - - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/spring_struts/src/main/webapp/thankyou.jsp ---------------------------------------------------------------------- diff --git a/spring_struts/src/main/webapp/thankyou.jsp b/spring_struts/src/main/webapp/thankyou.jsp deleted file mode 100644 index 5fa306f..0000000 --- a/spring_struts/src/main/webapp/thankyou.jsp +++ /dev/null @@ -1,21 +0,0 @@ - -<%@ taglib prefix="s" uri="/struts-tags" %> -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> - - - - -Update Successful - - - -

Updated Information

- - -

Your information:

- -

Return to home page.

- - - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes-override/README.txt ---------------------------------------------------------------------- diff --git a/themes-override/README.txt b/themes-override/README.txt new file mode 100644 index 0000000..2a1b48c --- /dev/null +++ b/themes-override/README.txt @@ -0,0 +1,16 @@ +This is the example project referred to in the +Struts 2 documentation, Struts 2 Themes tutorial. +See: http://struts.apache.org. + +To build the application's war file run mvn clean package +from the project's root folder. + +The war file is created in the target sub-folder. + +Copy the war file to your Servlet container (e.g. Tomcat, GlassFish) and +then startup the Servlet container. + +In a web browser go to: http://localhost:8080/themes-override/index.action. + +You should see a web page with Welcome to Struts 2! + http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes-override/pom.xml ---------------------------------------------------------------------- diff --git a/themes-override/pom.xml b/themes-override/pom.xml new file mode 100644 index 0000000..d39a1c9 --- /dev/null +++ b/themes-override/pom.xml @@ -0,0 +1,40 @@ + + + 4.0.0 + + struts.apache.org + struts2examples + 1.0.0 + + + themes-override + + Struts 2 Themes Override + + Struts 2 themes override example application for the Struts 2 getting started tutorials + + war + + + themes-override + + + org.mortbay.jetty + jetty-maven-plugin + 8.1.16.v20140903 + + CTRL+C + 8999 + 10 + + src/main/webapp/WEB-INF/web.xml + + + + + + + + http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes-override/src/main/java/org/apache/struts/edit/action/EditAction.java ---------------------------------------------------------------------- diff --git a/themes-override/src/main/java/org/apache/struts/edit/action/EditAction.java b/themes-override/src/main/java/org/apache/struts/edit/action/EditAction.java new file mode 100644 index 0000000..700b2f5 --- /dev/null +++ b/themes-override/src/main/java/org/apache/struts/edit/action/EditAction.java @@ -0,0 +1,95 @@ +package org.apache.struts.edit.action; + +import com.opensymphony.xwork2.ActionSupport; +import org.apache.struts.edit.model.Person; +import org.apache.struts.edit.model.State; +import org.apache.struts.edit.service.EditService; +import org.apache.struts.edit.service.EditServiceInMemory; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * Acts as a controller to handle actions + * related to editing a Person. + * @author bruce phillips + * + */ +public class EditAction extends ActionSupport { + + private static final long serialVersionUID = 1L; + + private EditService editService = new EditServiceInMemory(); + + private Person personBean; + + private String [] sports = {"football", "baseball", "basketball" }; + + private String [] genders = {"male", "female", "not sure" }; + + private List states ; + + private String [] carModelsAvailable = {"Ford","Chrysler","Toyota","Nissan"}; + + public String execute() throws Exception { + + editService.savePerson( getPersonBean() ); + + return SUCCESS; + + } + + + public String input() throws Exception { + + setPersonBean( editService.getPerson() ); + + return INPUT; + } + + public Person getPersonBean() { + + + return personBean; + + } + + public void setPersonBean(Person person) { + + personBean = person; + + } + + + public List getSports() { + return Arrays.asList(sports); + } + + public List getGenders() { + + return Arrays.asList(genders); + + } + + + + public List getStates() { + + states = new ArrayList(); + states.add( new State("AZ", "Arizona") ); + states.add( new State("CA", "California") ); + states.add( new State("FL", "Florida") ); + states.add( new State("KS", "Kansas") ); + states.add( new State("NY", "New York") ); + + return states; + } + + + + public String [] getCarModelsAvailable() { + return carModelsAvailable; + } + +} http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes-override/src/main/java/org/apache/struts/edit/model/Person.java ---------------------------------------------------------------------- diff --git a/themes-override/src/main/java/org/apache/struts/edit/model/Person.java b/themes-override/src/main/java/org/apache/struts/edit/model/Person.java new file mode 100644 index 0000000..392a8de --- /dev/null +++ b/themes-override/src/main/java/org/apache/struts/edit/model/Person.java @@ -0,0 +1,96 @@ +package org.apache.struts.edit.model; + +import java.util.Arrays; + + +/** + * Models a Person who registers. + * @author bruce phillips + * + */ +public class Person +{ + private String firstName; + private String lastName; + private String sport; + private String gender; + private String residency; + private boolean over21; + private String [] carModels; + + + public String getFirstName() + { + return firstName; + } + + public void setFirstName(String firstName) + { + this.firstName = firstName; + } + + public String getLastName() + { + return lastName; + } + + public void setLastName(String lastName) + { + this.lastName = lastName; + } + + + + + public void setSport(String sport) { + this.sport = sport; + } + + public void setGender(String gender) { + this.gender = gender; + } + + public String getGender() { + return gender; + } + + public String getSport() { + return sport; + } + + public void setResidency(String residency) { + this.residency = residency; + } + + public String getResidency() { + return residency; + } + + public void setOver21(boolean over21) { + this.over21 = over21; + } + + public boolean isOver21() { + return over21; + } + + public void setCarModels(String [] carModels) { + this.carModels = carModels; + } + + public String [] getCarModels() { + return carModels; + } + + public String toString() + { + return "First Name: " + getFirstName() + " | " + + " Last Name: " + getLastName() + " | " + + " Favorite Sport: " + getSport() + " | " + + " Gender: " + getGender() + " | " + + " Residency: " + getResidency() + " | " + + " Over 21: " + isOver21() + " | " + + " Car models: " + Arrays.asList( getCarModels() ) ; + + } +} http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes-override/src/main/java/org/apache/struts/edit/model/State.java ---------------------------------------------------------------------- diff --git a/themes-override/src/main/java/org/apache/struts/edit/model/State.java b/themes-override/src/main/java/org/apache/struts/edit/model/State.java new file mode 100644 index 0000000..bb927e1 --- /dev/null +++ b/themes-override/src/main/java/org/apache/struts/edit/model/State.java @@ -0,0 +1,39 @@ +package org.apache.struts.edit.model; + +public class State { + + private String stateAbbr; + + private String stateName; + + public State (String stateAbbr, String stateName) { + + this.stateAbbr = stateAbbr; + this.stateName = stateName; + + } + + public void setStateAbbr(String stateAbbr) { + this.stateAbbr = stateAbbr; + } + + public String getStateAbbr() { + return stateAbbr; + } + + public void setStateName(String stateName) { + this.stateName = stateName; + } + + public String getStateName() { + return stateName; + } + + public String toString() { + + return getStateAbbr() ; + + } + + +} http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes-override/src/main/java/org/apache/struts/edit/service/EditService.java ---------------------------------------------------------------------- diff --git a/themes-override/src/main/java/org/apache/struts/edit/service/EditService.java b/themes-override/src/main/java/org/apache/struts/edit/service/EditService.java new file mode 100644 index 0000000..a5b347b --- /dev/null +++ b/themes-override/src/main/java/org/apache/struts/edit/service/EditService.java @@ -0,0 +1,12 @@ +package org.apache.struts.edit.service; + +import org.apache.struts.edit.model.Person; + +public interface EditService { + + + Person getPerson(); + + void savePerson(Person personBean); + +} http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes-override/src/main/java/org/apache/struts/edit/service/EditServiceInMemory.java ---------------------------------------------------------------------- diff --git a/themes-override/src/main/java/org/apache/struts/edit/service/EditServiceInMemory.java b/themes-override/src/main/java/org/apache/struts/edit/service/EditServiceInMemory.java new file mode 100644 index 0000000..7638152 --- /dev/null +++ b/themes-override/src/main/java/org/apache/struts/edit/service/EditServiceInMemory.java @@ -0,0 +1,51 @@ +package org.apache.struts.edit.service; + +import org.apache.struts.edit.model.Person; + +/** + * Implement Services needed to edit and save + * a Person object's state. In this implementation + * the Person object's state is stored in memory + * @author brucephillips + * + */ +public class EditServiceInMemory implements EditService { + + + private static Person person ; + private static String [] carModels = {"Ford","Nissan"}; + + + static { + + person = new Person(); + person.setFirstName("Bruce"); + person.setLastName("Phillips"); + person.setSport("basketball"); + person.setGender("not sure"); + person.setResidency("KS"); + person.setOver21(true); + person.setCarModels( carModels); + + } + + + public Person getPerson() { + + return EditServiceInMemory.person; + } + + + public void savePerson(Person personBean) { + + EditServiceInMemory.person.setFirstName(personBean.getFirstName() ); + EditServiceInMemory.person.setLastName(personBean.getLastName() ); + EditServiceInMemory.person.setSport(personBean.getSport() ); + EditServiceInMemory.person.setGender( personBean.getGender() ); + EditServiceInMemory.person.setResidency( personBean.getResidency() ); + EditServiceInMemory.person.setOver21( personBean.isOver21() ); + EditServiceInMemory.person.setCarModels(personBean.getCarModels() ); + + } + +} http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes-override/src/main/resources/log4j.dtd ---------------------------------------------------------------------- diff --git a/themes-override/src/main/resources/log4j.dtd b/themes-override/src/main/resources/log4j.dtd new file mode 100644 index 0000000..1aabd96 --- /dev/null +++ b/themes-override/src/main/resources/log4j.dtd @@ -0,0 +1,227 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes-override/src/main/resources/log4j.xml ---------------------------------------------------------------------- diff --git a/themes-override/src/main/resources/log4j.xml b/themes-override/src/main/resources/log4j.xml new file mode 100644 index 0000000..2100cb2 --- /dev/null +++ b/themes-override/src/main/resources/log4j.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes-override/src/main/resources/org/apache/struts/edit/action/EditAction.properties ---------------------------------------------------------------------- diff --git a/themes-override/src/main/resources/org/apache/struts/edit/action/EditAction.properties b/themes-override/src/main/resources/org/apache/struts/edit/action/EditAction.properties new file mode 100644 index 0000000..0f08667 --- /dev/null +++ b/themes-override/src/main/resources/org/apache/struts/edit/action/EditAction.properties @@ -0,0 +1,8 @@ +personBean.firstName=First name +personBean.lastName=Last name +personBean.sport=Favorite sport +personBean.gender=Gender +personBean.residency=State resident +personBean.over21=21 or older +personBean.carModels=Car models owned +submit=Save Changes \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes-override/src/main/resources/struts.xml ---------------------------------------------------------------------- diff --git a/themes-override/src/main/resources/struts.xml b/themes-override/src/main/resources/struts.xml new file mode 100644 index 0000000..5c37a7b --- /dev/null +++ b/themes-override/src/main/resources/struts.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + /index.jsp + + + + /edit.jsp + + + + /thankyou.jsp + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes-override/src/main/webapp/META-INF/MANIFEST.MF ---------------------------------------------------------------------- diff --git a/themes-override/src/main/webapp/META-INF/MANIFEST.MF b/themes-override/src/main/webapp/META-INF/MANIFEST.MF new file mode 100644 index 0000000..254272e --- /dev/null +++ b/themes-override/src/main/webapp/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes-override/src/main/webapp/WEB-INF/template/simple/a-close.ftl ---------------------------------------------------------------------- diff --git a/themes-override/src/main/webapp/WEB-INF/template/simple/a-close.ftl b/themes-override/src/main/webapp/WEB-INF/template/simple/a-close.ftl new file mode 100644 index 0000000..84b5aae --- /dev/null +++ b/themes-override/src/main/webapp/WEB-INF/template/simple/a-close.ftl @@ -0,0 +1,45 @@ +<#-- +/* + * $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 + * 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. + */ +--> + +<#if parameters.id?if_exists != ""> + id="${parameters.id?html}"<#rt/> + +<#if parameters.href?if_exists != ""> + href="${parameters.href}"<#rt/> + +<#if parameters.tabindex??> + tabindex="${parameters.tabindex?html}"<#rt/> + +<#if parameters.cssClass??> + class="${parameters.cssClass?html}"<#rt/> + +<#if parameters.cssStyle??> + style="${parameters.cssStyle?html}"<#rt/> + +<#if parameters.title??> + title="${parameters.title?html}"<#rt/> + +<#include "/${parameters.templateDir}/${parameters.expandTheme}/scripting-events.ftl" /> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/common-attributes.ftl" /> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/dynamic-attributes.ftl" /> +>${parameters.body} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes-override/src/main/webapp/WEB-INF/template/simple/a.ftl ---------------------------------------------------------------------- diff --git a/themes-override/src/main/webapp/WEB-INF/template/simple/a.ftl b/themes-override/src/main/webapp/WEB-INF/template/simple/a.ftl new file mode 100644 index 0000000..dcf27d2 --- /dev/null +++ b/themes-override/src/main/webapp/WEB-INF/template/simple/a.ftl @@ -0,0 +1,22 @@ +<#-- +/* + * $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 + * 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. + */ +--> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-examples/blob/433ea016/themes-override/src/main/webapp/WEB-INF/template/simple/actionerror.ftl ---------------------------------------------------------------------- diff --git a/themes-override/src/main/webapp/WEB-INF/template/simple/actionerror.ftl b/themes-override/src/main/webapp/WEB-INF/template/simple/actionerror.ftl new file mode 100644 index 0000000..6563876 --- /dev/null +++ b/themes-override/src/main/webapp/WEB-INF/template/simple/actionerror.ftl @@ -0,0 +1,43 @@ +<#-- +/* + * $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 + * 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. + */ +--> +<#if (actionErrors?? && actionErrors?size > 0)> + +<#if parameters.id?if_exists != ""> + id="${parameters.id?html}"<#rt/> + +<#if parameters.cssClass??> + class="${parameters.cssClass?html}"<#rt/> +<#else> + class="errorMessage"<#rt/> + +<#if parameters.cssStyle??> + style="${parameters.cssStyle?html}"<#rt/> + +> + <#list actionErrors as error> + <#if error?if_exists != ""> +
  • <#if parameters.escape>${error!?html}<#else>${error!}<#rt/>
  • <#rt/> + + + + \ No newline at end of file