Author: nilsga Date: Fri Aug 24 02:16:30 2007 New Revision: 569307 URL: http://svn.apache.org/viewvc?rev=569307&view=rev Log: Backported changes to portlet sample application from 2.1
Added: struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/java/org/apache/struts2/portlet/example/FormExampleModelDriven.java struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/java/org/apache/struts2/portlet/example/fileupload/ struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/java/org/apache/struts2/portlet/example/fileupload/FileUploadAction.java struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/java/org/apache/struts2/portlet/example/model/ struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/java/org/apache/struts2/portlet/example/model/Name.java struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/resources/struts-edit.xml struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/resources/struts-help.xml struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/resources/struts-view.xml struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/view/fileUpload.jsp struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/view/fileUploadSuccess.jsp struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/view/formExampleInputModelDriven.jsp Modified: struts/struts2/branches/STRUTS_2_0_X/apps/portlet/pom.xml struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/resources/struts.xml struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/portlet.xml struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/view/index.jsp struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/web.xml Modified: struts/struts2/branches/STRUTS_2_0_X/apps/portlet/pom.xml URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/apps/portlet/pom.xml?rev=569307&r1=569306&r2=569307&view=diff ============================================================================== --- struts/struts2/branches/STRUTS_2_0_X/apps/portlet/pom.xml (original) +++ struts/struts2/branches/STRUTS_2_0_X/apps/portlet/pom.xml Fri Aug 24 02:16:30 2007 @@ -8,7 +8,7 @@ <version>2.0.10-SNAPSHOT</version> </parent> <groupId>org.apache.struts</groupId> - <artifactId>struts2-portlet</artifactId> + <artifactId>struts2-portlet-branch</artifactId> <packaging>war</packaging> <name>Portlet Webapp</name> @@ -29,6 +29,12 @@ <groupId>org.apache.struts</groupId> <artifactId>struts2-spring-plugin</artifactId> <version>${pom.version}</version> +<exclusions> +<exclusion> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> +</exclusion> +</exclusions> </dependency> <dependency> <groupId>org.apache.struts</groupId> @@ -51,20 +57,25 @@ <artifactId>commons-digester</artifactId> <version>1.8</version> </dependency> - - - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.4</version> - <scope>provided</scope> - </dependency> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> - <version>2.0</version> + <version>2.1</version> </dependency> - - + <dependency> + <groupId>commons-fileupload</groupId> + <artifactId>commons-fileupload</artifactId> + <version>1.1.1</version> + </dependency> + <dependency> + <groupId>commons-collections</groupId> + <artifactId>commons-collections</artifactId> + <version>3.1</version> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.12</version> + </dependency> </dependencies> </project> Added: struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/java/org/apache/struts2/portlet/example/FormExampleModelDriven.java URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/java/org/apache/struts2/portlet/example/FormExampleModelDriven.java?rev=569307&view=auto ============================================================================== --- struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/java/org/apache/struts2/portlet/example/FormExampleModelDriven.java (added) +++ struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/java/org/apache/struts2/portlet/example/FormExampleModelDriven.java Fri Aug 24 02:16:30 2007 @@ -0,0 +1,37 @@ +/* + * $Id: FormExample.java 471756 2006-11-06 15:01:43Z husted $ + * + * 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. + */ +package org.apache.struts2.portlet.example; + +import org.apache.struts2.portlet.example.model.Name; + +import com.opensymphony.xwork2.ActionSupport; +import com.opensymphony.xwork2.ModelDriven; + +/** + */ +public class FormExampleModelDriven extends ActionSupport implements ModelDriven<Name> { + + private Name name = new Name(); + + public Name getModel() { + return name; + } +} Added: struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/java/org/apache/struts2/portlet/example/fileupload/FileUploadAction.java URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/java/org/apache/struts2/portlet/example/fileupload/FileUploadAction.java?rev=569307&view=auto ============================================================================== --- struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/java/org/apache/struts2/portlet/example/fileupload/FileUploadAction.java (added) +++ struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/java/org/apache/struts2/portlet/example/fileupload/FileUploadAction.java Fri Aug 24 02:16:30 2007 @@ -0,0 +1,81 @@ +/* + * $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. + */ +package org.apache.struts2.portlet.example.fileupload; + +import java.io.File; + +import org.apache.struts2.dispatcher.DefaultActionSupport; + +/** + * File Upload example's action. <code>FileUploadAction</code> + * + */ +public class FileUploadAction extends DefaultActionSupport { + + private static final long serialVersionUID = 5156288255337069381L; + + private String contentType; + private File upload; + private String fileName; + private String caption; + + // since we are using <s:file name="upload" .../> the file name will be + // obtained through getter/setter of <file-tag-name>FileName + public String getUploadFileName() { + return fileName; + } + public void setUploadFileName(String fileName) { + this.fileName = fileName; + } + + + // since we are using <s:file name="upload" ... /> the content type will be + // obtained through getter/setter of <file-tag-name>ContentType + public String getUploadContentType() { + return contentType; + } + public void setUploadContentType(String contentType) { + this.contentType = contentType; + } + + + // since we are using <s:file name="upload" ... /> the File itself will be + // obtained through getter/setter of <file-tag-name> + public File getUpload() { + return upload; + } + public void setUpload(File upload) { + this.upload = upload; + } + + + public String getCaption() { + return caption; + } + public void setCaption(String caption) { + this.caption = caption; + } + + public String upload() throws Exception { + return SUCCESS; + } + +} Added: struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/java/org/apache/struts2/portlet/example/model/Name.java URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/java/org/apache/struts2/portlet/example/model/Name.java?rev=569307&view=auto ============================================================================== --- struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/java/org/apache/struts2/portlet/example/model/Name.java (added) +++ struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/java/org/apache/struts2/portlet/example/model/Name.java Fri Aug 24 02:16:30 2007 @@ -0,0 +1,18 @@ +package org.apache.struts2.portlet.example.model; + +public class Name { + private String firstName; + private String lastName; + 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; + } +} Added: struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/resources/struts-edit.xml URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/resources/struts-edit.xml?rev=569307&view=auto ============================================================================== --- struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/resources/struts-edit.xml (added) +++ struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/resources/struts-edit.xml Fri Aug 24 02:16:30 2007 @@ -0,0 +1,48 @@ +<?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="edit" extends="struts-portlet-default" + namespace="/edit"> + <action name="index" + class="com.opensymphony.xwork2.ActionSupport"> + <result name="success">/WEB-INF/edit/index.jsp</result> + </action> + <action name="test" + class="com.opensymphony.xwork2.ActionSupport"> + <result name="success">/WEB-INF/edit/test.jsp</result> + </action> + <action name="formExampleEdit" + class="org.apache.struts2.portlet.example.FormExample" method="input"> + <result name="input"> + /WEB-INF/edit/formExampleInput.jsp + </result> + </action> + + <action name="processFormExampleEdit" + class="org.apache.struts2.portlet.example.FormExample"> + <result name="input"> + /WEB-INF/edit/formExampleInput.jsp + </result> + <result name="success"> + /edit/processFormExampleForward.action?firstName=${firstName}&lastName=${lastName} + </result> + </action> + + <action name="processFormExampleForward" + class="org.apache.struts2.portlet.example.FormExample"> + <result name="success"> + /WEB-INF/edit/formExample.jsp + </result> + </action> + </package> + + <package name="editTest" extends="edit" namespace="/edit/dummy/test"> + <action name="testAction" + class="com.opensymphony.xwork2.ActionSupport"> + <result name="success">/WEB-INF/edit/namespaceTest.jsp</result> + </action> + </package> +</struts> \ No newline at end of file Added: struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/resources/struts-help.xml URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/resources/struts-help.xml?rev=569307&view=auto ============================================================================== --- struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/resources/struts-help.xml (added) +++ struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/resources/struts-help.xml Fri Aug 24 02:16:30 2007 @@ -0,0 +1,14 @@ +<?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="help" extends="struts-portlet-default" + namespace="/help"> + <action name="index" + class="com.opensymphony.xwork2.ActionSupport"> + <result name="success">/WEB-INF/help/index.jsp</result> + </action> + </package> +</struts> \ No newline at end of file Added: struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/resources/struts-view.xml URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/resources/struts-view.xml?rev=569307&view=auto ============================================================================== --- struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/resources/struts-view.xml (added) +++ struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/resources/struts-view.xml Fri Aug 24 02:16:30 2007 @@ -0,0 +1,130 @@ +<?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="view" extends="struts-portlet-default" + namespace="/view"> + <action name="index" + class="com.opensymphony.xwork2.ActionSupport"> + <result name="success">/WEB-INF/view/index.jsp</result> + </action> + + <action name="formExample" + class="org.apache.struts2.portlet.example.FormExample" method="input"> + <result name="input"> + /WEB-INF/view/formExampleInput.jsp + </result> + </action> + + <action name="processFormExample" + class="org.apache.struts2.portlet.example.FormExample"> + <result name="input"> + /WEB-INF/view/formExampleInput.jsp + </result> + <result name="success"> + /WEB-INF/view/formExample.jsp + </result> + </action> + + <action name="formExamplePrg" class="org.apache.struts2.portlet.example.FormExample"> + <result name="input"> + /WEB-INF/view/formExampleInputPrg.jsp + </result> + <result name="success" type="redirectAction"> + <param name="actionName">formExamplePrg</param> + <param name="method">displayResult</param> + <param name="firstName">${firstName}</param> + <param name="lastName">${lastName}</param> + </result> + <result name="displayResult"> + /WEB-INF/view/formExample.jsp + </result> + </action> + + <action name="formExampleModelDriven" + class="org.apache.struts2.portlet.example.FormExampleModelDriven"> + <result name="input"> + /WEB-INF/view/formExampleInputModelDriven.jsp + </result> + <result name="success"> + /WEB-INF/view/formExample.jsp + </result> + </action> + + <action name="validationExample" + class="org.apache.struts2.portlet.example.FormExample" method="input"> + <result name="input"> + /WEB-INF/view/formExampleInputValidation.jsp + </result> + </action> + + <action name="processValidationExample" + class="org.apache.struts2.portlet.example.FormExample"> + <result name="success"> + /WEB-INF/view/formExample.jsp + </result> + <result name="input"> + /WEB-INF/view/formExampleInputValidation.jsp + </result> + </action> + + <action name="fileUpload" class="org.apache.struts2.portlet.example.fileupload.FileUploadAction"> + <result name="input"> + /WEB-INF/view/fileUpload.jsp + </result> + <result name="success"> + /WEB-INF/view/fileUploadSuccess.jsp + </result> + </action> + + <action name="tokenExample" + class="com.opensymphony.xwork2.ActionSupport" method="input"> + <result name="input"> + /WEB-INF/view/tokenExampleInput.jsp + </result> + </action> + + <action name="processTokenExample" + class="com.opensymphony.xwork2.ActionSupport"> + <result name="input"> + /WEB-INF/view/tokenExampleInput.jsp + </result> + <result name="invalid.token"> + /WEB-INF/view/tokenExampleInput.jsp + </result> + <result name="success"> + /WEB-INF/view/tokenExample.jsp + </result> + <interceptor-ref name="portletDefaultStackWithToken" /> + </action> + + <action name="springExample" class="springAction"> + <result name="success"> + /WEB-INF/view/springExample.jsp + </result> + </action> + + <action name="freeMarkerExample" + class="com.opensymphony.xwork2.ActionSupport" method="input"> + <result type="freemarker" name="input"> + /WEB-INF/view/freeMarkerExampleInput.ftl + </result> + </action> + + <action name="processFreeMarkerExample" + class="org.apache.struts2.portlet.example.FormExample"> + <result name="success">/view/processFreeMarkerView.action?firstName=${firstName}&lastName=${lastName}</result> + </action> + + <action name="processFreeMarkerView" class="org.apache.struts2.portlet.example.FormExample"> + <result type="freemarker" name="success">/WEB-INF/view/freeMarkerExample.ftl</result> + </action> + + <action name="velocityHelloWorld" class="com.opensymphony.xwork2.ActionSupport"> + <result type="velocity" name="success">/WEB-INF/view/helloWorld.vm</result> + </action> + + </package> +</struts> Modified: struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/resources/struts.xml URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/resources/struts.xml?rev=569307&r1=569306&r2=569307&view=diff ============================================================================== --- struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/resources/struts.xml (original) +++ struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/resources/struts.xml Fri Aug 24 02:16:30 2007 @@ -4,159 +4,8 @@ "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> - <include file="struts-portlet-default.xml" /> - - <package name="view" extends="struts-portlet-default" - namespace="/view"> - <action name="index" - class="com.opensymphony.xwork2.ActionSupport"> - <result name="success">/WEB-INF/view/index.jsp</result> - </action> - - <action name="formExample" - class="org.apache.struts2.portlet.example.FormExample" method="input"> - <result name="input"> - /WEB-INF/view/formExampleInput.jsp - </result> - </action> - - <action name="processFormExample" - class="org.apache.struts2.portlet.example.FormExample"> - <result name="input"> - /WEB-INF/view/formExampleInput.jsp - </result> - <result name="success"> - /WEB-INF/view/formExample.jsp - </result> - </action> - - <action name="validationExample" - class="org.apache.struts2.portlet.example.FormExample" method="input"> - <result name="input"> - /WEB-INF/view/formExampleInputValidation.jsp - </result> - </action> - - <action name="processValidationExample" - class="org.apache.struts2.portlet.example.FormExample"> - <result name="success"> - /WEB-INF/view/formExample.jsp - </result> - <result name="input"> - /WEB-INF/view/formExampleInputValidation.jsp - </result> - <interceptor-ref name="validationWorkflowStack" /> - </action> - - <action name="tokenExample" - class="com.opensymphony.xwork2.ActionSupport" method="input"> - <result name="input"> - /WEB-INF/view/tokenExampleInput.jsp - </result> - </action> - - <action name="processTokenExample" - class="com.opensymphony.xwork2.ActionSupport"> - <result name="input"> - /WEB-INF/view/tokenExampleInput.jsp - </result> - <result name="invalid.token"> - /WEB-INF/view/tokenExampleInput.jsp - </result> - <result name="success"> - /WEB-INF/view/tokenExample.jsp - </result> - <interceptor-ref name="token" /> - <interceptor-ref name="defaultStack" /> - </action> - - <action name="springExample" class="springAction"> - <result name="success"> - /WEB-INF/view/springExample.jsp - </result> - </action> - - <action name="ajaxExample" - class="com.opensymphony.xwork2.ActionSupport"> - <result name="success"> - /WEB-INF/view/ajaxExample.jsp - </result> - </action> - - <action name="ajaxData" - class="com.opensymphony.xwork2.ActionSupport"> - <result name="success">/WEB-INF/view/ajaxData.jsp</result> - </action> - - <action name="freeMarkerExample" - class="com.opensymphony.xwork2.ActionSupport" method="input"> - <result type="freemarker" name="input"> - /WEB-INF/view/freeMarkerExampleInput.ftl - </result> - </action> - - <action name="processFreeMarkerExample" - class="org.apache.struts2.portlet.example.FormExample"> - <result name="success">/view/processFreeMarkerView.action?firstName=${firstName}&lastName=${lastName}</result> - </action> - - <action name="processFreeMarkerView" class="org.apache.struts2.portlet.example.FormExample"> - <result type="freemarker" name="success">/WEB-INF/view/freeMarkerExample.ftl</result> - </action> - - <action name="velocityHelloWorld" class="com.opensymphony.xwork2.ActionSupport"> - <result type="velocity" name="success">/WEB-INF/view/helloWorld.vm</result> - </action> - - </package> - - <package name="edit" extends="struts-portlet-default" - namespace="/edit"> - <action name="index" - class="com.opensymphony.xwork2.ActionSupport"> - <result name="success">/WEB-INF/edit/index.jsp</result> - </action> - <action name="test" - class="com.opensymphony.xwork2.ActionSupport"> - <result name="success">/WEB-INF/edit/test.jsp</result> - </action> - <action name="formExampleEdit" - class="org.apache.struts2.portlet.example.FormExample" method="input"> - <result name="input"> - /WEB-INF/edit/formExampleInput.jsp - </result> - </action> - - <action name="processFormExampleEdit" - class="org.apache.struts2.portlet.example.FormExample"> - <result name="input"> - /WEB-INF/edit/formExampleInput.jsp - </result> - <result name="success"> - /edit/processFormExampleForward.action?firstName=${firstName}&lastName=${lastName} - </result> - </action> - - <action name="processFormExampleForward" - class="org.apache.struts2.portlet.example.FormExample"> - <result name="success"> - /WEB-INF/edit/formExample.jsp - </result> - </action> - </package> - - <package name="editTest" extends="edit" namespace="/edit/dummy/test"> - <action name="testAction" - class="com.opensymphony.xwork2.ActionSupport"> - <result name="success">/WEB-INF/edit/namespaceTest.jsp</result> - </action> - </package> - - <package name="help" extends="struts-portlet-default" - namespace="/help"> - <action name="index" - class="com.opensymphony.xwork2.ActionSupport"> - <result name="success">/WEB-INF/help/index.jsp</result> - </action> - </package> + <include file="struts-portlet-default.xml"/> + <include file="struts-view.xml"/> + <include file="struts-edit.xml"/> + <include file="struts-help.xml"/> </struts> Modified: struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/portlet.xml URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/portlet.xml?rev=569307&r1=569306&r2=569307&view=diff ============================================================================== --- struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/portlet.xml (original) +++ struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/portlet.xml Fri Aug 24 02:16:30 2007 @@ -56,6 +56,7 @@ <mime-type>text/html</mime-type> <portlet-mode>edit</portlet-mode> <portlet-mode>help</portlet-mode> + <portlet-mode>view</portlet-mode> </supports> <supported-locale>en</supported-locale> @@ -116,6 +117,7 @@ <mime-type>text/html</mime-type> <portlet-mode>edit</portlet-mode> <portlet-mode>help</portlet-mode> + <portlet-mode>view</portlet-mode> </supports> <supported-locale>en</supported-locale> Added: struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/view/fileUpload.jsp URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/view/fileUpload.jsp?rev=569307&view=auto ============================================================================== --- struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/view/fileUpload.jsp (added) +++ struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/view/fileUpload.jsp Fri Aug 24 02:16:30 2007 @@ -0,0 +1,13 @@ +<%@ taglib prefix="s" uri="/struts-tags" %> + + <h1>Fileupload sample</h1> + + <s:actionerror /> + <s:fielderror /> + <s:form action="fileUpload" method="POST" enctype="multipart/form-data"> + <s:file name="upload" label="File"/> + <s:textfield name="caption" label="Caption"/> + <s:submit /> + </s:form> + + Added: struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/view/fileUploadSuccess.jsp URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/view/fileUploadSuccess.jsp?rev=569307&view=auto ============================================================================== --- struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/view/fileUploadSuccess.jsp (added) +++ struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/view/fileUploadSuccess.jsp Fri Aug 24 02:16:30 2007 @@ -0,0 +1,14 @@ +<%@ taglib prefix="s" uri="/struts-tags" %> + +<h1>Fileupload sample</h1> + +<p> + <ul> + <li>ContentType: <s:property value="uploadContentType" /></li> + <li>FileName: <s:property value="uploadFileName" /></li> + <li>File: <s:property value="upload" /></li> + <li>Caption:<s:property value="caption" /></li> + </ul> +</p> + + Added: struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/view/formExampleInputModelDriven.jsp URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/view/formExampleInputModelDriven.jsp?rev=569307&view=auto ============================================================================== --- struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/view/formExampleInputModelDriven.jsp (added) +++ struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/view/formExampleInputModelDriven.jsp Fri Aug 24 02:16:30 2007 @@ -0,0 +1,8 @@ +<%@ taglib prefix="s" uri="/struts-tags" %> + +<H2>Input your name</H2> +<s:form action="formExampleModelDriven" method="POST"> + <s:textfield label="First name" name="firstName" value="%{firstName}"/> + <s:textfield label="Last name" name="lastName" value="%{lastName}"/> + <s:submit value="Submit the form"/> +</s:form> Modified: struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/view/index.jsp URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/view/index.jsp?rev=569307&r1=569306&r2=569307&view=diff ============================================================================== --- struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/view/index.jsp (original) +++ struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/view/index.jsp Fri Aug 24 02:16:30 2007 @@ -4,10 +4,11 @@ Here you'll find examples of what is possible with the Struts Portlet integration framework. <ul> <li><a href="<s:url action="formExample"/>">A simple form</a></li> +<li><a href="<s:url action="formExampleModelDriven" method="input"/>">Model driven example</li> <li><a href="<s:url action="validationExample"/>">Validation</a></li> <li><a href="<s:url action="tokenExample"/>">Token</a></li> <li><a href="<s:url action="springExample"/>">Spring integration</a></li> -<li><a href="<s:url action="ajaxExample"/>">Ajax</a></li> +<li><a href="<s:url action="fileUpload" method="input"/>">File upload</li> <li><a href="<s:url action="freeMarkerExample"/>">FreeMarker</a></li> <li><a href="<s:url action="velocityHelloWorld"/>">Velocity</a></li> <li><a href="<s:url action="index" portletMode="edit"/>">Go to edit mode and see what's there</a></li> Modified: struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/web.xml?rev=569307&r1=569306&r2=569307&view=diff ============================================================================== --- struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/web.xml (original) +++ struts/struts2/branches/STRUTS_2_0_X/apps/portlet/src/main/webapp/WEB-INF/web.xml Fri Aug 24 02:16:30 2007 @@ -26,14 +26,5 @@ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> - <servlet id="dwr"> - <servlet-name>dwr</servlet-name> - <servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class> - </servlet> - - <servlet-mapping> - <servlet-name>dwr</servlet-name> - <url-pattern>/dwr/*</url-pattern> - </servlet-mapping> </web-app>