Author: husted
Date: Wed Sep 6 03:31:28 2006
New Revision: 440679
URL: http://svn.apache.org/viewvc?view=rev&rev=440679
Log:
WW-1340 Move starter to the sandbox since it now overlaps both blank and the
archetype.
Added:
struts/sandbox/trunk/struts2/apps/starter/
struts/sandbox/trunk/struts2/apps/starter/README.txt
struts/sandbox/trunk/struts2/apps/starter/pom.xml
struts/sandbox/trunk/struts2/apps/starter/src/
struts/sandbox/trunk/struts2/apps/starter/src/main/
struts/sandbox/trunk/struts2/apps/starter/src/main/java/
struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/
struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/
struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/example/
struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/example/CounterBean.java
struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/example/HelloMatrixAction-helloMatrixSubmit-validation.xml
struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/example/HelloMatrixAction.java
struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/example/HomeAction.java
struts/sandbox/trunk/struts2/apps/starter/src/main/resources/
struts/sandbox/trunk/struts2/apps/starter/src/main/resources/struts.properties
struts/sandbox/trunk/struts2/apps/starter/src/main/resources/struts.xml
struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/
struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/
struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/applicationContext.xml
struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/pages/
struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/pages/hellomatrix-success.ftl
struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/pages/hellomatrix.jsp
struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/pages/home.jsp
struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/web.xml
struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/index.jsp
Added: struts/sandbox/trunk/struts2/apps/starter/README.txt
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2/apps/starter/README.txt?view=auto&rev=440679
==============================================================================
--- struts/sandbox/trunk/struts2/apps/starter/README.txt (added)
+++ struts/sandbox/trunk/struts2/apps/starter/README.txt Wed Sep 6 03:31:28
2006
@@ -0,0 +1,10 @@
+README.txt - starter
+
+This is an "hello world" application that you can deploy and review, and
+perhaps use as the basis of your own application.
+
+For more on getting started with Struts, see
+
+* http://cwiki.apache.org/WW/home.html
+
+----------------------------------------------------------------------------
\ No newline at end of file
Added: struts/sandbox/trunk/struts2/apps/starter/pom.xml
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2/apps/starter/pom.xml?view=auto&rev=440679
==============================================================================
--- struts/sandbox/trunk/struts2/apps/starter/pom.xml (added)
+++ struts/sandbox/trunk/struts2/apps/starter/pom.xml Wed Sep 6 03:31:28 2006
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+ <parent>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-apps</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-starter</artifactId>
+ <packaging>war</packaging>
+ <name>Starter Webapp</name>
+ <dependencies>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.0.0rc3</version>
+ <configuration>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-j2ee_1.4_spec</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added:
struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/example/CounterBean.java
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/example/CounterBean.java?view=auto&rev=440679
==============================================================================
---
struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/example/CounterBean.java
(added)
+++
struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/example/CounterBean.java
Wed Sep 6 03:31:28 2006
@@ -0,0 +1,36 @@
+/*
+ * $Id: CounterBean.java 391220 2006-04-04 03:54:09Z mrdon $
+ *
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+package com.foo.example;
+
+/**
+ * <code>CounterBean</code>
+ *
+ * @author Rainer Hermanns
+ */
+public class CounterBean {
+
+ private static int count = 0;
+
+ public int getCount() {
+ return count;
+ }
+
+ public void increment() {
+ count++;
+ }
+}
Added:
struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/example/HelloMatrixAction-helloMatrixSubmit-validation.xml
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/example/HelloMatrixAction-helloMatrixSubmit-validation.xml?view=auto&rev=440679
==============================================================================
---
struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/example/HelloMatrixAction-helloMatrixSubmit-validation.xml
(added)
+++
struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/example/HelloMatrixAction-helloMatrixSubmit-validation.xml
Wed Sep 6 03:31:28 2006
@@ -0,0 +1,9 @@
+<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+
+<validators>
+ <field name="hello">
+ <field-validator type="requiredstring">
+ <message>You must enter a name</message>
+ </field-validator>
+ </field>
+</validators>
Added:
struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/example/HelloMatrixAction.java
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/example/HelloMatrixAction.java?view=auto&rev=440679
==============================================================================
---
struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/example/HelloMatrixAction.java
(added)
+++
struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/example/HelloMatrixAction.java
Wed Sep 6 03:31:28 2006
@@ -0,0 +1,81 @@
+/*
+ * $Id: HelloMatrixAction.java 420385 2006-07-10 00:57:05Z mrdon $
+ *
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+package com.foo.example;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+/**
+ * <code>HelloMatrixAction</code>
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Rainer Hermanns</a>
+ * @version $Id: HelloMatrixAction.java 420385 2006-07-10 00:57:05Z mrdon $
+ */
+public class HelloMatrixAction extends ActionSupport {
+
+ /** Spring managed bean reference */
+ private CounterBean counterBean;
+
+ /**
+ * IoC setter for the spring managed CounterBean.
+ *
+ * @param counterBean
+ */
+ public void setCounterBean(CounterBean counterBean) {
+ this.counterBean = counterBean;
+ }
+
+ private String hello;
+ private String message;
+
+ public String getHello() {
+ return hello;
+ }
+
+ public void setHello(String hello) {
+ this.hello = hello;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public int getCount() {
+ return counterBean.getCount();
+ }
+
+ /**
+ * A default implementation that does nothing an returns "success".
+ *
+ * @return [EMAIL PROTECTED] #SUCCESS}
+ */
+ public String execute() throws Exception {
+ return SUCCESS;
+ }
+
+ /**
+ * Sample sayHello method.
+ *
+ * @return [EMAIL PROTECTED] #SUCCESS}
+ */
+ public String sayHello() throws Exception {
+
+ message = "users already took the red pill...";
+ counterBean.increment();
+ return SUCCESS;
+ }
+}
Added:
struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/example/HomeAction.java
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/example/HomeAction.java?view=auto&rev=440679
==============================================================================
---
struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/example/HomeAction.java
(added)
+++
struts/sandbox/trunk/struts2/apps/starter/src/main/java/com/foo/example/HomeAction.java
Wed Sep 6 03:31:28 2006
@@ -0,0 +1,37 @@
+/*
+ * $Id: HomeAction.java 420385 2006-07-10 00:57:05Z mrdon $
+ *
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+package com.foo.example;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+/**
+ * <code>HomeAction</code>
+ *
+ * @author Rainer Hermanns
+ */
+public class HomeAction extends ActionSupport {
+
+ /**
+ * A default implementation that does nothing an returns "success".
+ *
+ * @return [EMAIL PROTECTED] #SUCCESS}
+ */
+ public String execute() throws Exception {
+ return SUCCESS;
+ }
+}
Added:
struts/sandbox/trunk/struts2/apps/starter/src/main/resources/struts.properties
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2/apps/starter/src/main/resources/struts.properties?view=auto&rev=440679
==============================================================================
---
struts/sandbox/trunk/struts2/apps/starter/src/main/resources/struts.properties
(added)
+++
struts/sandbox/trunk/struts2/apps/starter/src/main/resources/struts.properties
Wed Sep 6 03:31:28 2006
@@ -0,0 +1,2 @@
+struts.devMode = true
+struts.enable.DynamicMethodInvocation = false
Added: struts/sandbox/trunk/struts2/apps/starter/src/main/resources/struts.xml
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2/apps/starter/src/main/resources/struts.xml?view=auto&rev=440679
==============================================================================
--- struts/sandbox/trunk/struts2/apps/starter/src/main/resources/struts.xml
(added)
+++ struts/sandbox/trunk/struts2/apps/starter/src/main/resources/struts.xml Wed
Sep 6 03:31:28 2006
@@ -0,0 +1,30 @@
+<?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>
+ <include file="struts-default.xml"/>
+
+ <package name="default" extends="struts-default">
+
+ <default-action-ref name="home" />
+
+ <action name="home" class="com.foo.example.HomeAction">
+ <result>/WEB-INF/pages/home.jsp</result>
+ </action>
+
+ <action name="helloMatrix" class="com.foo.example.HelloMatrixAction">
+ <result name="success">/WEB-INF/pages/hellomatrix.jsp</result>
+ </action>
+
+ <action name="helloMatrixSubmit"
class="com.foo.example.HelloMatrixAction" method="sayHello">
+ <interceptor-ref name="validationWorkflowStack"/>
+ <result name="input">/WEB-INF/pages/hellomatrix.jsp</result>
+ <result name="error">/WEB-INF/pages/hellomatrix.jsp</result>
+ <result name="success"
type="freemarker">/WEB-INF/pages/hellomatrix-success.ftl</result>
+ </action>
+
+ </package>
+</struts>
Added:
struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/applicationContext.xml
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/applicationContext.xml?view=auto&rev=440679
==============================================================================
---
struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/applicationContext.xml
(added)
+++
struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/applicationContext.xml
Wed Sep 6 03:31:28 2006
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
+<beans default-autowire="autodetect">
+ <bean id="counterBean" class="com.foo.example.CounterBean"
singleton="true" />
+ <!-- add your spring beans here -->
+</beans>
Added:
struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/pages/hellomatrix-success.ftl
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/pages/hellomatrix-success.ftl?view=auto&rev=440679
==============================================================================
---
struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/pages/hellomatrix-success.ftl
(added)
+++
struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/pages/hellomatrix-success.ftl
Wed Sep 6 03:31:28 2006
@@ -0,0 +1,12 @@
+<html>
+ <head>
+ <title>Hello Matrix: Success</title>
+ </head>
+ <body>
+ <h1>${hello} just entered the matrix!</h1>
+
+ <p>
+ ${count} ${message}
+ </p>
+ </body>
+</html>
Added:
struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/pages/hellomatrix.jsp
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/pages/hellomatrix.jsp?view=auto&rev=440679
==============================================================================
---
struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/pages/hellomatrix.jsp
(added)
+++
struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/pages/hellomatrix.jsp
Wed Sep 6 03:31:28 2006
@@ -0,0 +1,20 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<html>
+ <head>
+ <title>Enter the Matrix</title>
+ </head>
+ <body>
+ <h1>Enter the Matrix sample</h1>
+
+ <p>
+ <fieldset>
+ <legend>Matrix Form</legend>
+ <s:form name="helloWorldForm" action="helloMatrixSubmit">
+ <s:textfield name="hello" label="Enter your name" />
+ <s:submit />
+ </s:form>
+ </fieldset>
+ </p>
+ </body>
+</html>
Added:
struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/pages/home.jsp
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/pages/home.jsp?view=auto&rev=440679
==============================================================================
---
struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/pages/home.jsp
(added)
+++
struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/pages/home.jsp
Wed Sep 6 03:31:28 2006
@@ -0,0 +1,20 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<html>
+ <head>
+ <title>Welcome</title>
+ </head>
+ <body>
+ <h1>Welcome to the starter webapp</h1>
+
+ <p>
+ <fieldset>
+ <legend>Example action</legend>
+ <p>
+ <s:url id="helloURL" action="helloMatrix" />
+ <s:a href="%{helloURL}">Enter the matrix</s:a>
+ </p>
+ </fieldset>
+ </p>
+ </body>
+</html>
Added: struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/web.xml
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/web.xml?view=auto&rev=440679
==============================================================================
--- struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/web.xml
(added)
+++ struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/WEB-INF/web.xml
Wed Sep 6 03:31:28 2006
@@ -0,0 +1,51 @@
+<?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>Acme Corp</display-name>
+
+ <!-- START SNIPPET: example -->
+ <filter>
+ <filter-name>action2</filter-name>
+
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>action2</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <!-- END SNIPPET: example -->
+
+ <listener>
+
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+ </listener>
+
+
+ <!-- START SNIPPET: freemarkerSupport -->
+ <servlet>
+ <servlet-name>JspSupportServlet</servlet-name>
+
<servlet-class>org.apache.struts2.views.JspSupportServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <!-- END SNIPPET: freemarkerSupport -->
+
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ <welcome-file>default.jsp</welcome-file>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+
+ <!-- START SNIPPET: taglib -->
+ <!--
+ This typically isn't required, as the taglib is included in
struts-action-2.0.jar.
+ If you really need a taglib configuration within web.xml, copy
struts/src/java/META-INF/taglib.tld
+ to the WEB-INF directory as tags.tld.
+ -->
+ <!--
+ <taglib>
+ <taglib-uri>tags</taglib-uri>
+ <taglib-location>/WEB-INF/tags.tld</taglib-location>
+ </taglib>
+ -->
+ <!-- END SNIPPET: taglib -->
+</web-app>
Added: struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/index.jsp
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/index.jsp?view=auto&rev=440679
==============================================================================
--- struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/index.jsp (added)
+++ struts/sandbox/trunk/struts2/apps/starter/src/main/webapp/index.jsp Wed Sep
6 03:31:28 2006
@@ -0,0 +1 @@
+<% response.sendRedirect(request.getContextPath() + "/home.action"); %>