You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by ts...@apache.org on 2007/11/06 06:50:41 UTC

svn commit: r592294 - in /struts/sandbox/trunk/struts2-juel-plugin-example: ./ src/ src/main/ src/main/java/ src/main/java/example/ src/main/resources/ src/main/webapp/ src/main/webapp/WEB-INF/ src/main/webapp/example/

Author: tschneider
Date: Mon Nov  5 21:50:39 2007
New Revision: 592294

URL: http://svn.apache.org/viewvc?rev=592294&view=rev
Log:
adding example for struts2 juel plugin

Added:
    struts/sandbox/trunk/struts2-juel-plugin-example/pom.xml
    struts/sandbox/trunk/struts2-juel-plugin-example/src/
    struts/sandbox/trunk/struts2-juel-plugin-example/src/main/
    struts/sandbox/trunk/struts2-juel-plugin-example/src/main/java/
    struts/sandbox/trunk/struts2-juel-plugin-example/src/main/java/example/
    struts/sandbox/trunk/struts2-juel-plugin-example/src/main/java/example/SurveyAction.java
    struts/sandbox/trunk/struts2-juel-plugin-example/src/main/java/example/SurveyBean.java
    struts/sandbox/trunk/struts2-juel-plugin-example/src/main/resources/
    struts/sandbox/trunk/struts2-juel-plugin-example/src/main/resources/struts.xml
    struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/
    struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/WEB-INF/
    struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/WEB-INF/web.xml
    struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/example/
    struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/example/survey.jsp
    struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/example/surveyResults.jsp
    struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/index.html

Added: struts/sandbox/trunk/struts2-juel-plugin-example/pom.xml
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-juel-plugin-example/pom.xml?rev=592294&view=auto
==============================================================================
--- struts/sandbox/trunk/struts2-juel-plugin-example/pom.xml (added)
+++ struts/sandbox/trunk/struts2-juel-plugin-example/pom.xml Mon Nov  5 21:50:39 2007
@@ -0,0 +1,22 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>com.googlecode.struts2juel</groupId>
+	<artifactId>struts2-juel-plugin-example</artifactId>
+	<version>1.0.0-SNAPSHOT</version>
+	<packaging>war</packaging>
+	<name>Struts 2 Juel Plugin Example</name>
+	<dependencies>
+		<dependency>
+			<groupId>com.googlecode.struts2juel</groupId>
+			<artifactId>struts2-juel-plugin</artifactId>
+			<version>1.0.0-SNAPSHOT</version>
+		</dependency>
+		<dependency>
+			<groupId>de.odysseus.juel</groupId>
+			<artifactId>juel</artifactId>
+			<version>2.1.0</version>
+		</dependency>
+	</dependencies>
+</project>
\ No newline at end of file

Added: struts/sandbox/trunk/struts2-juel-plugin-example/src/main/java/example/SurveyAction.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-juel-plugin-example/src/main/java/example/SurveyAction.java?rev=592294&view=auto
==============================================================================
--- struts/sandbox/trunk/struts2-juel-plugin-example/src/main/java/example/SurveyAction.java (added)
+++ struts/sandbox/trunk/struts2-juel-plugin-example/src/main/java/example/SurveyAction.java Mon Nov  5 21:50:39 2007
@@ -0,0 +1,30 @@
+package example;
+
+import java.util.Date;
+import com.opensymphony.xwork2.ActionSupport;
+
+/**
+ * Simple Survey Action.
+ */
+public class SurveyAction extends ActionSupport {
+	private SurveyBean surveyBean = new SurveyBean();
+
+	public String edit() {
+		surveyBean.setAge(22);
+		surveyBean.setFirstName("Musachy");
+		surveyBean.setBirthdate(new Date());
+		return SUCCESS;
+	}
+
+	public String save() {
+		return SUCCESS;
+	}
+
+	public SurveyBean getSurveyBean() {
+		return surveyBean;
+	}
+
+	public void setSurveyBean(SurveyBean surveyBean) {
+		this.surveyBean = surveyBean;
+	}
+}

Added: struts/sandbox/trunk/struts2-juel-plugin-example/src/main/java/example/SurveyBean.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-juel-plugin-example/src/main/java/example/SurveyBean.java?rev=592294&view=auto
==============================================================================
--- struts/sandbox/trunk/struts2-juel-plugin-example/src/main/java/example/SurveyBean.java (added)
+++ struts/sandbox/trunk/struts2-juel-plugin-example/src/main/java/example/SurveyBean.java Mon Nov  5 21:50:39 2007
@@ -0,0 +1,42 @@
+package example;
+
+import java.util.Date;
+
+public class SurveyBean {
+	private String firstName;
+	private String lastName;
+	private int age;
+	private Date birthdate;
+
+	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 int getAge() {
+		return age;
+	}
+
+	public void setAge(int age) {
+		this.age = age;
+	}
+
+	public Date getBirthdate() {
+		return birthdate;
+	}
+
+	public void setBirthdate(Date birthdate) {
+		this.birthdate = birthdate;
+	}
+}

Added: struts/sandbox/trunk/struts2-juel-plugin-example/src/main/resources/struts.xml
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-juel-plugin-example/src/main/resources/struts.xml?rev=592294&view=auto
==============================================================================
--- struts/sandbox/trunk/struts2-juel-plugin-example/src/main/resources/struts.xml (added)
+++ struts/sandbox/trunk/struts2-juel-plugin-example/src/main/resources/struts.xml Mon Nov  5 21:50:39 2007
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE struts PUBLIC
+    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
+    "http://struts.apache.org/dtds/struts-2.0.dtd">
+
+<struts>
+	<package name="example" namespace="/example"
+		extends="struts-default">
+
+		<action name="SurveyEdit"
+			class="example.SurveyAction" method="edit">
+			<result name="success">/example/survey.jsp</result>
+		</action>
+
+		<action name="SurveySave"
+			class="example.SurveyAction" method="save">
+			<result name="success">/example/surveyResults.jsp</result>
+		</action>
+
+	</package>
+</struts>

Added: struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/WEB-INF/web.xml?rev=592294&view=auto
==============================================================================
--- struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/WEB-INF/web.xml (added)
+++ struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/WEB-INF/web.xml Mon Nov  5 21:50:39 2007
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+
+    <display-name>Struts2 Juel Plugin Example</display-name>
+
+    <filter>
+        <filter-name>struts2</filter-name>
+        <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
+    </filter>
+
+    <filter-mapping>
+        <filter-name>struts2</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+
+    <welcome-file-list>
+        <welcome-file>index.html</welcome-file>
+    </welcome-file-list>
+</web-app>

Added: struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/example/survey.jsp
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/example/survey.jsp?rev=592294&view=auto
==============================================================================
--- struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/example/survey.jsp (added)
+++ struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/example/survey.jsp Mon Nov  5 21:50:39 2007
@@ -0,0 +1,21 @@
+<%@ page contentType="text/html; charset=UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<html>
+<head>
+    <title>Survey</title>
+</head>
+
+<body>
+<h3>Please fill out Survey</h3>
+<p>
+  <s:form action="SurveySave" method="get">
+  	<s:textfield label="First Name" name="surveyBean.firstName"></s:textfield>
+  	<s:textfield label="Last Name" name="surveyBean.lastName"></s:textfield>
+  	<s:textfield label="Age" name="surveyBean.age"></s:textfield>
+  	<s:textfield label="Birthday" name="surveyBean.birthdate"></s:textfield>
+  	<s:submit value="Submit"></s:submit>
+  </s:form>
+</p>
+</body>
+</html>

Added: struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/example/surveyResults.jsp
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/example/surveyResults.jsp?rev=592294&view=auto
==============================================================================
--- struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/example/surveyResults.jsp (added)
+++ struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/example/surveyResults.jsp Mon Nov  5 21:50:39 2007
@@ -0,0 +1,16 @@
+<%@ page contentType="text/html; charset=UTF-8"%>
+<%@ taglib prefix="s" uri="/struts-tags"%>
+
+<html>
+<head>
+<title>Survey</title>
+</head>
+
+<body>
+<h3>Results</h3>
+First Name: <s:property value="surveyBean.firstName" /><br />
+Last Name: <s:property value="surveyBean.lastName" /><br />
+Age: <s:property value="surveyBean.age" /><br />
+Birthday: <s:property value="surveyBean.birthdate" /><br />
+</body>
+</html>

Added: struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/index.html
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/index.html?rev=592294&view=auto
==============================================================================
--- struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/index.html (added)
+++ struts/sandbox/trunk/struts2-juel-plugin-example/src/main/webapp/index.html Mon Nov  5 21:50:39 2007
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+    <META HTTP-EQUIV="Refresh" CONTENT="0;URL=example/SurveyEdit.action">
+</head>
+
+<body>
+<p>Loading ...</p>
+</body>
+</html>