1. opensymphony
  2. webwork

Commits

rainerh  committed 83a3095

Multipart requests are not cleaned up correctly
o added a sample which works for me
Issue number: WW-1102
Obtained from:
Submitted by:
Reviewed by:

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@2102573baa09-0c28-0410-bef9-dab3c582ae83

  • Participants
  • Parent commits 67c49ae
  • Branches master

Comments (0)

Files changed (5)

File webapps/showcase/src/java/com/opensymphony/webwork/showcase/fileupload/FileUploadAction.java

View file
+/*
+ * Copyright (c) 2006, Your Corporation. All Rights Reserved.
+ */
+
+package com.opensymphony.webwork.showcase.fileupload;
+
+/**
+ * <code>FileUploadAction</code>
+ *
+ * @author <a href="mailto:hermanns@aixcept.de">Rainer Hermanns</a>
+ * @version $Id$
+ */
+public class FileUploadAction {
+
+
+    private String contentType;
+    private String fileName;
+    private String caption;
+
+    public String getContentType() {
+        return contentType;
+    }
+
+    public void setContentType(String contentType) {
+        this.contentType = contentType;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public String getCaption() {
+        return caption;
+    }
+
+    public void setCaption(String caption) {
+        this.caption = caption;
+    }
+
+    public String input() {
+        return "success";
+    }
+
+    public String upload() {
+        return "success";
+    }
+
+}

File webapps/showcase/src/webapp/WEB-INF/classes/xwork-fileupload.xml

View file
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE xwork PUBLIC
+	"-//OpenSymphony Group//XWork 1.1.1//EN"
+	"http://www.opensymphony.com/xwork/xwork-1.1.1.dtd">
+
+<xwork>
+	<include file="webwork-default.xml" />
+
+	<package name="fileupload" extends="webwork-default" namespace="/fileupload">
+
+        <action name="upload" class="com.opensymphony.webwork.showcase.fileupload.FileUploadAction" method="input">
+			<result>upload.jsp</result>
+		</action>
+
+        <action name="doUpload" class="com.opensymphony.webwork.showcase.fileupload.FileUploadAction" method="upload">
+			<result>upload-success.jsp</result>
+		</action>
+
+    </package>
+</xwork>
+
+

File webapps/showcase/src/webapp/WEB-INF/classes/xwork.xml

View file
 
     <include file="xwork-ajax.xml" />
 
+    <include file="xwork-fileupload.xml" />
+
     <include file="xwork-person.xml" />
 
     <package name="default" extends="webwork-default">

File webapps/showcase/src/webapp/fileupload/upload-success.jsp

View file
+<%@ taglib uri="/webwork" prefix="ww" %>
+<html>
+<head>
+    <title>Showcase</title>
+</head>
+
+<body>
+<h1>Fileupload sample</h1>
+
+<p>
+    <ul>
+        <li>ContentType: <ww:property value="contentType" /></li>
+        <li>FileName: <ww:property value="fileName" /></li>
+        <li>Caption:<ww:property value="caption" /></li>
+    </ul>
+</p>
+
+</body>
+</html>
+

File webapps/showcase/src/webapp/fileupload/upload.jsp

View file
+
+<%@ taglib uri="/webwork" prefix="ww" %>
+<html>
+<head>
+    <title>Showcase</title>
+</head>
+
+<body>
+    <h1>Fileupload sample</h1>
+
+    <ww:form action="doUpload" method="POST" enctype="multipart/form-data">
+        <ww:file name="fileName" label="File"/>
+        <ww:textfield name="caption" label="Caption"/>
+        <ww:submit />
+    </ww:form>
+</body>
+</html>
+