PR: MPGENAPP-9
Submitted by: Archimedes Trajano Added Struts with validation template. git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@348341 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
57a1136c03
commit
88b6e3b521
Binary file not shown.
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright 2001-2004 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" default="war">
|
||||
<preGoal name="java:compile">
|
||||
<mkdir dir="target\xdoclet\webdoclet\WEB-INF" />
|
||||
<attainGoal name="xdoclet:webdoclet" />
|
||||
</preGoal>
|
||||
</project>
|
||||
|
||||
@ -0,0 +1,37 @@
|
||||
# -------------------------------------------------------------------
|
||||
# Copyright 2001-2004 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.
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
maven.xdoc.date=left
|
||||
maven.eclipse.classpath.include=src/test-cactus,src/conf
|
||||
maven.war.webapp.dir=${maven.build.dir}/xdoclet/webdoclet
|
||||
maven.xdoclet.webdoclet.0=true
|
||||
maven.xdoclet.webdoclet.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF
|
||||
maven.xdoclet.webdoclet.0.mergeDir=src/merge
|
||||
maven.xdoclet.webdoclet.strutsconfigxml.0=true
|
||||
maven.xdoclet.webdoclet.strutsconfigxml.0.validateXML=true
|
||||
maven.xdoclet.webdoclet.strutsconfigxml.0.Version=1.1
|
||||
maven.xdoclet.webdoclet.strutsconfigxml.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF
|
||||
maven.xdoclet.webdoclet.strutsconfigxml.0.mergeDir=src/merge
|
||||
maven.xdoclet.webdoclet.strutsvalidationxml.0=true
|
||||
maven.xdoclet.webdoclet.strutsvalidationxml.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF
|
||||
maven.xdoclet.webdoclet.strutsvalidationxml.0.mergeDir=src/merge
|
||||
maven.xdoclet.webdoclet.jbosswebxml.0=true
|
||||
maven.xdoclet.webdoclet.jbosswebxml.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF
|
||||
maven.xdoclet.webdoclet.deploymentdescriptor.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF
|
||||
maven.xdoclet.webdoclet.deploymentdescriptor.0.mergeDir=src/merge
|
||||
maven.xdoclet.webdoclet.fileset.0.include=**/*.java
|
||||
maven.xdoclet.webdoclet.jsptaglib.0.destDir=${maven.build.dir}/xdoclet/webdoclet/WEB-INF/tld
|
||||
cactus.src.mergewebxml = src/conf/cactus-web.xml
|
||||
@ -0,0 +1,288 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright 2001-2004 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
|
||||
<project>
|
||||
<!-- the version of maven's project object model -->
|
||||
|
||||
<pomVersion>3</pomVersion>
|
||||
<!-- a unique name for this project -->
|
||||
|
||||
<id>@ID@</id>
|
||||
<groupId>@ID@</groupId>
|
||||
<!-- a short but descriptive name for the project -->
|
||||
|
||||
<name>@NAME@</name>
|
||||
|
||||
<!-- The version of the project under development, e.g.
|
||||
1.1, 1.2, 2.0-SNAPSHOT -->
|
||||
<currentVersion>1.0</currentVersion>
|
||||
|
||||
<!-- details about the organization that 'owns' the project -->
|
||||
<organization>
|
||||
<name>Apache Software Foundation</name>
|
||||
<url>http://www.apache.org/</url>
|
||||
<logo>http://maven.apache.org/images/jakarta-logo-blue.gif</logo>
|
||||
</organization>
|
||||
<!-- the year the project started -->
|
||||
|
||||
<inceptionYear>2004</inceptionYear>
|
||||
<package>@PACKAGE@</package>
|
||||
<logo>http://maven.apache.org/images/maven.jpg</logo>
|
||||
<description>A collection of example projects showing how to use maven in different situations</description>
|
||||
<!-- a short description of what the project does -->
|
||||
|
||||
<shortDescription>How to use maven in different situations</shortDescription>
|
||||
<!-- the project home page -->
|
||||
|
||||
<url>http://maven.apache.org/reference/plugins/examples/</url>
|
||||
<issueTrackingUrl>http://nagoya.apache.org/scarab/servlet/scarab/</issueTrackingUrl>
|
||||
<siteAddress>jakarta.apache.org</siteAddress>
|
||||
<siteDirectory>/www/maven.apache.org/reference/plugins/examples/</siteDirectory>
|
||||
<distributionDirectory>/www/maven.apache.org/builds/</distributionDirectory>
|
||||
<!-- the version control repository and http url for online access
|
||||
the connection element has the form:
|
||||
scm:<system>:<system specific connection string> -->
|
||||
|
||||
<repository>
|
||||
<connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven-plugins/examples</connection>
|
||||
<url>http://cvs.apache.org/viewcvs/maven-plugins/examples/</url>
|
||||
</repository>
|
||||
<!-- any mailing lists for the project -->
|
||||
|
||||
<mailingLists/>
|
||||
<!-- who the developers are for the project -->
|
||||
|
||||
<developers>
|
||||
</developers>
|
||||
<!-- jar files the project is dependent on -->
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<id>junit</id>
|
||||
<version>3.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<id>servletapi</id>
|
||||
<version>2.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<id>jstl</id>
|
||||
<version>1.0.2</version>
|
||||
<properties>
|
||||
<war.bundle>true</war.bundle>
|
||||
</properties>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>taglibs</groupId>
|
||||
<artifactId>standard</artifactId>
|
||||
<version>1.0.4</version>
|
||||
<properties>
|
||||
<war.bundle>true</war.bundle>
|
||||
</properties>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cactus</groupId>
|
||||
<artifactId>cactus</artifactId>
|
||||
<version>13-1.6dev-20040115</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.0.3</version>
|
||||
<properties>
|
||||
<war.bundle>true</war.bundle>
|
||||
</properties>
|
||||
</dependency>
|
||||
|
||||
<!-- Struts dependencies -->
|
||||
<dependency>
|
||||
<groupId>struts</groupId>
|
||||
<artifactId>struts</artifactId>
|
||||
<version>1.1</version>
|
||||
<properties>
|
||||
<war.bundle>true</war.bundle>
|
||||
</properties>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>struts</groupId>
|
||||
<artifactId>struts-bean</artifactId>
|
||||
<version>1.1</version>
|
||||
<type>tld</type>
|
||||
<properties>
|
||||
<war.bundle>true</war.bundle>
|
||||
</properties>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>struts</groupId>
|
||||
<artifactId>struts-html</artifactId>
|
||||
<version>1.1</version>
|
||||
<type>tld</type>
|
||||
<properties>
|
||||
<war.bundle>true</war.bundle>
|
||||
</properties>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>struts</groupId>
|
||||
<artifactId>struts-logic</artifactId>
|
||||
<version>1.1</version>
|
||||
<type>tld</type>
|
||||
<properties>
|
||||
<war.bundle>true</war.bundle>
|
||||
</properties>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>strutstestcase</groupId>
|
||||
<artifactId>strutstestcase</artifactId>
|
||||
<version>2.1-1.1-2.3</version>
|
||||
<properties>
|
||||
<cactus.bundle>true</cactus.bundle>
|
||||
</properties>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-beanutils</groupId>
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
<version>1.6</version>
|
||||
<properties>
|
||||
<war.bundle>true</war.bundle>
|
||||
</properties>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-digester</groupId>
|
||||
<artifactId>commons-digester</artifactId>
|
||||
<version>1.5</version>
|
||||
<properties>
|
||||
<war.bundle>true</war.bundle>
|
||||
</properties>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
<version>3.0</version>
|
||||
<properties>
|
||||
<war.bundle>true</war.bundle>
|
||||
</properties>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-validator</groupId>
|
||||
<artifactId>commons-validator</artifactId>
|
||||
<version>1.1.1</version>
|
||||
<properties>
|
||||
<war.bundle>true</war.bundle>
|
||||
</properties>
|
||||
</dependency>
|
||||
|
||||
<!-- XDoclet dependencies -->
|
||||
<dependency>
|
||||
<id>xdoclet</id>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>xdoclet</groupId>
|
||||
<artifactId>xdoclet-web-module</artifactId>
|
||||
<version>1.2</version>
|
||||
<url>http://xdoclet.sf.net/</url>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>xdoclet</groupId>
|
||||
<artifactId>xdoclet-ejb-module</artifactId>
|
||||
<version>1.2</version>
|
||||
<url>http://xdoclet.sf.net/</url>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>xdoclet</groupId>
|
||||
<artifactId>xdoclet-apache-module</artifactId>
|
||||
<version>1.2</version>
|
||||
<url>http://xdoclet.sf.net/</url>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>xdoclet</groupId>
|
||||
<artifactId>xjavadoc</artifactId>
|
||||
<version>1.0.2</version>
|
||||
<url>http://xdoclet.sf.net/</url>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>xdoclet</groupId>
|
||||
<artifactId>maven-xdoclet-plugin</artifactId>
|
||||
<version>1.2</version>
|
||||
<type>plugin</type>
|
||||
<url>http://xdoclet.sf.net/</url>
|
||||
</dependency>
|
||||
|
||||
<!-- HttpUnit dependencies -->
|
||||
<dependency>
|
||||
<groupId>httpunit</groupId>
|
||||
<artifactId>httpunit</artifactId>
|
||||
<version>1.5.4</version>
|
||||
<properties>
|
||||
<cactus.bundle>true</cactus.bundle>
|
||||
</properties>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>jtidy</groupId>
|
||||
<artifactId>jtidy</artifactId>
|
||||
<version>4aug2000r7-dev</version>
|
||||
<properties>
|
||||
<cactus.bundle>true</cactus.bundle>
|
||||
</properties>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<nagEmailAddress>turbine-maven-dev@jakarta.apache.org</nagEmailAddress>
|
||||
<sourceDirectory>src/java</sourceDirectory>
|
||||
<unitTestSourceDirectory>src/test</unitTestSourceDirectory>
|
||||
<unitTest>
|
||||
<includes>
|
||||
<include>**/*Test.java</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>**/NaughtyTest.java</exclude>
|
||||
</excludes>
|
||||
</unitTest>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/conf</directory>
|
||||
<includes>
|
||||
<include>*.properties</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
</project>
|
||||
@ -0,0 +1,35 @@
|
||||
# -------------------------------------------------------------------
|
||||
# Copyright 2001-2004 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.
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
title.page=The title @NAME@
|
||||
error.givenname=Given name must be provided
|
||||
|
||||
errors.required={0} is required.
|
||||
errors.minlength={0} can not be less than {1} characters.
|
||||
errors.maxlength={0} can not be greater than {1} characters.
|
||||
errors.invalid={0} is invalid.
|
||||
|
||||
errors.byte={0} must be a byte.
|
||||
errors.short={0} must be a short.
|
||||
errors.integer={0} must be an integer.
|
||||
errors.long={0} must be a long.
|
||||
errors.float={0} must be a float.
|
||||
errors.double={0} must be a double.
|
||||
|
||||
errors.date={0} is not a date.
|
||||
errors.range={0} is not in the range {1} through {2}.
|
||||
errors.creditcard={0} is an invalid credit card number.
|
||||
errors.email={0} is an invalid e-mail address.
|
||||
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright 2001-2004 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<!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>
|
||||
</web-app>
|
||||
@ -0,0 +1,64 @@
|
||||
package @PACKAGE@;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts.action.Action;
|
||||
import org.apache.struts.action.ActionForm;
|
||||
import org.apache.struts.action.ActionForward;
|
||||
import org.apache.struts.action.ActionMapping;
|
||||
import org.apache.struts.action.DynaActionForm;
|
||||
import org.apache.struts.validator.DynaValidatorActionForm;
|
||||
import org.apache.struts.validator.DynaValidatorForm;
|
||||
|
||||
/**
|
||||
* This is a simple struts action that simply redirects the input back to itself. It
|
||||
* also sets a bean value to the current date.
|
||||
*
|
||||
* @struts.action
|
||||
* name="TestForm"
|
||||
* path="/TestInput"
|
||||
* input="/WEB-INF/jsp/input.jsp"
|
||||
* validate="true"
|
||||
* @struts.action
|
||||
* name="TestForm"
|
||||
* path="/TestInputStart"
|
||||
* validate="false"
|
||||
* @struts.action-forward
|
||||
* name="success"
|
||||
* path="/WEB-INF/jsp/input.jsp"
|
||||
*
|
||||
* @author <a href="mailto:trajano@yahoo.com">Archimedes Trajano</a>
|
||||
* @version $Id$
|
||||
*/
|
||||
public class InputAction extends Action {
|
||||
|
||||
/**
|
||||
* Performs the simple action
|
||||
*
|
||||
* @param mapping
|
||||
* the action mappings where you find the return value of the
|
||||
* forward
|
||||
* @param actionForm
|
||||
* the action form used, in this example it will be an instance
|
||||
* of the DynaActionForm class
|
||||
* @param request
|
||||
* the HTTP servlet request
|
||||
* @param response
|
||||
* the HTTP servlet response
|
||||
*/
|
||||
public ActionForward execute(ActionMapping mapping, ActionForm actionForm,
|
||||
HttpServletRequest request, HttpServletResponse response)
|
||||
throws IOException, ServletException {
|
||||
if (actionForm != null) {
|
||||
System.out.println(actionForm.getClass());
|
||||
DynaActionForm form = (DynaActionForm) actionForm;
|
||||
form.set("theDate", new Date());
|
||||
}
|
||||
return (mapping.findForward("success"));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
<!--
|
||||
/*
|
||||
* Copyright 2001-2004 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.
|
||||
*/
|
||||
-->
|
||||
<servlet-mapping>
|
||||
<servlet-name>action</servlet-name>
|
||||
<url-pattern>*.do</url-pattern>
|
||||
</servlet-mapping>
|
||||
@ -0,0 +1,26 @@
|
||||
<!--
|
||||
/*
|
||||
* Copyright 2001-2004 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.
|
||||
*/
|
||||
-->
|
||||
<servlet>
|
||||
<servlet-name>action</servlet-name>
|
||||
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>config</param-name>
|
||||
<param-value>/WEB-INF/struts-config.xml</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
@ -0,0 +1,30 @@
|
||||
<!--
|
||||
/*
|
||||
* Copyright 2001-2004 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.
|
||||
*/
|
||||
-->
|
||||
<form-bean
|
||||
name="TestForm"
|
||||
type="org.apache.struts.validator.DynaValidatorActionForm">
|
||||
<form-property
|
||||
name="givenName"
|
||||
type="java.lang.String" />
|
||||
<form-property
|
||||
name="familyName"
|
||||
type="java.lang.String" />
|
||||
<form-property
|
||||
name="theDate"
|
||||
type="java.util.Date" />
|
||||
</form-bean>
|
||||
@ -0,0 +1,18 @@
|
||||
<!--
|
||||
/*
|
||||
* Copyright 2001-2004 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.
|
||||
*/
|
||||
-->
|
||||
<message-resources parameter="ApplicationResources"/>
|
||||
@ -0,0 +1,3 @@
|
||||
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
|
||||
<set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
|
||||
</plug-in>
|
||||
@ -0,0 +1,12 @@
|
||||
<formset>
|
||||
<form name="/TestInput">
|
||||
<field property="givenName" depends="required">
|
||||
<msg name="required" key="error.givenname"/>
|
||||
</field>
|
||||
</form>
|
||||
<form name="TestForm">
|
||||
<field property="givenName" depends="required">
|
||||
<msg name="required" key="error.givenname"/>
|
||||
</field>
|
||||
</form>
|
||||
</formset>
|
||||
@ -0,0 +1,51 @@
|
||||
package @PACKAGE@;
|
||||
|
||||
import org.apache.cactus.ServletTestCase;
|
||||
|
||||
import com.meterware.httpunit.WebConversation;
|
||||
import com.meterware.httpunit.WebForm;
|
||||
|
||||
/**
|
||||
* This tests the site using HttpUnit
|
||||
*
|
||||
* @author <a href="trajano@yahoo.com">Archimedes Trajano </a>
|
||||
* @version $Id$
|
||||
*/
|
||||
public class HttpUnitTest extends ServletTestCase {
|
||||
/**
|
||||
* This is a helper method to create the URL string for the initial web
|
||||
* conversation request
|
||||
*
|
||||
* @param relativeUrl
|
||||
* the relative URL including the leading"/"
|
||||
* @return the context url with the relative URL appended to it
|
||||
*/
|
||||
private String requestUrl(String relativeUrl) {
|
||||
StringBuffer url = request.getRequestURL();
|
||||
url.delete(url.lastIndexOf("/"), url.length());
|
||||
url.append(relativeUrl);
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* This tests if the sample struts form works properly
|
||||
*
|
||||
* @throws Exception
|
||||
* thrown when there is a problem with the test
|
||||
*/
|
||||
public void testStrutsPages() throws Exception {
|
||||
WebConversation wc = new WebConversation();
|
||||
wc.getResponse(requestUrl("/TestInput.do"));
|
||||
{
|
||||
WebForm form = wc.getCurrentPage().getForms()[0];
|
||||
form.setParameter("givenName", "Archie");
|
||||
form.setParameter("familyName", "Trajano");
|
||||
form.submit();
|
||||
}
|
||||
{
|
||||
WebForm form = wc.getCurrentPage().getForms()[0];
|
||||
assertEquals("Archie", form.getParameterValue("givenName"));
|
||||
assertEquals("Trajano", form.getParameterValue("familyName"));
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -0,0 +1,31 @@
|
||||
package @PACKAGE@;
|
||||
|
||||
import servletunit.struts.CactusStrutsTestCase;
|
||||
|
||||
/**
|
||||
* This tests the functionality of the StrutsTestCase
|
||||
*
|
||||
* @author <a href="trajano@yahoo.com">Archimedes Trajano </a>
|
||||
* @version $Id$
|
||||
*/
|
||||
public class StrutsTest extends CactusStrutsTestCase {
|
||||
|
||||
/**
|
||||
* Required constructor for CactusStrutsTestCase
|
||||
*
|
||||
* @param name
|
||||
* name of the test
|
||||
*/
|
||||
public StrutsTest(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public void testInputForm() throws Exception {
|
||||
setRequestPathInfo("/TestInput.do");
|
||||
addRequestParameter("givenName", "Archie");
|
||||
addRequestParameter("familyName", "Trajano");
|
||||
actionPerform();
|
||||
verifyForward("success");
|
||||
verifyNoActionErrors();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package @PACKAGE@;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
* This is a simple JUnit test case to ensure that the environment is okay.
|
||||
*
|
||||
* @author <a href="trajano@yahoo.com">Archimedes Trajano</a>
|
||||
* @version $Id$
|
||||
*/
|
||||
public class SanityTest extends TestCase {
|
||||
public void testSanity() {
|
||||
assertEquals( "test", "test" );
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
<%@ page contentType="text/html; charset=utf-8" %>
|
||||
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
|
||||
<%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %>
|
||||
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
|
||||
|
||||
<%@ taglib uri="/WEB-INF/tld/struts-bean-1.1.tld" prefix="bean" %>
|
||||
<%@ taglib uri="/WEB-INF/tld/struts-html-1.1.tld" prefix="html" %>
|
||||
<%@ taglib uri="/WEB-INF/tld/struts-logic-1.1.tld" prefix="logic" %>
|
||||
|
||||
<html:html xhtml="true">
|
||||
<head>
|
||||
<html:base/>
|
||||
<title><bean:message key="title.page"/></title>
|
||||
<script type="text/javascript">
|
||||
<html:javascript formName="TestForm" />
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>The name is <bean:write name="TestForm" property="familyName"/>, <bean:write name="TestForm" property="givenName"/> on <bean:write name="TestForm" property="theDate"/></p>
|
||||
<html:errors />
|
||||
<html:form action="/TestInput" onsubmit="return validateTestForm(this);">
|
||||
<html:text property="givenName" size="16"/>
|
||||
<html:text property="familyName" size="16"/>
|
||||
<html:submit/>
|
||||
</html:form>
|
||||
</body>
|
||||
</html:html>
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,20 @@
|
||||
# -------------------------------------------------------------------
|
||||
# Copyright 2001-2004 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.
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
maven.genapp.repackage=java,test,test-cactus
|
||||
maven.genapp.filter=project.xml,src/conf/cactus-web.xml,src/merge/**,src/conf/ApplicationResources.properties
|
||||
|
||||
maven.genapp.default.package=example.web
|
||||
@ -14,7 +14,7 @@
|
||||
# limitations under the License.
|
||||
# -------------------------------------------------------------------
|
||||
#templates to test
|
||||
templates=complex,default,ejb,struts,struts-jstl,tapestry,web,web-jstl,web-velocity
|
||||
templates=complex,default,ejb,struts,struts-jstl,struts-validation,tapestry,web,web-jstl,web-velocity
|
||||
#artifact genarated by a template
|
||||
template.tapestry.artifact=${maven.genapp.basedir}/target/${maven.genapp.template.id}.war
|
||||
# directory where it should be generated
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
<action dev="felipeal" type="fix" issue="MPGENAPP-17">Using <code>${maven.home.local}</code> instead of <code>${user.home}/.maven</code> for templates.</action>
|
||||
<action dev="aheritier" type="fix" issue="MPGENAPP-12" due-to="Filippo Vitale">An error "Artifact strutstest-2.1.0.jar doesn't exist" is thrown by struts projects generated by the plugin.</action>
|
||||
<action dev="felipeal" type="add" issue="MPGENAPP-10" due-to="Archimedes Trajano">Added Tapestry template.</action>
|
||||
<action dev="aheritier" type="add" issue="MPGENAPP-9" due-to="Archimedes Trajano">Added Struts with validation template.</action>
|
||||
<action dev="felipeal" type="add" issue="MPGENAPP-3" due-to="Sri Sankaran">Added prompt for project root.</action>
|
||||
<action dev="aheritier" type="update" issue="MAVEN-1712">Update dependencies to match ones in maven 1.1 core and to unify them between plugins. The following dependencies are updated :
|
||||
<ul>
|
||||
|
||||
@ -47,6 +47,10 @@
|
||||
<td>struts-jstl</td>
|
||||
<td>Generate a project to create a simple web app with Struts and JSTL.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>struts-validation</td>
|
||||
<td>Generate a project to create a simple web app with Struts and its Validator.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>tapestry</td>
|
||||
<td>Generate a project to create a simple web app with Tapestry.</td>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user