struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject RE: multipart/form-data problem
Date Fri, 14 Sep 2001 11:31:55 GMT
Thank you again for your suggestions.
I rewrote the upload example to do some testing:
- added validate() method to uploadForm
- changed struts-config :validate="true"; input="/upload/upload.jsp"
- modified upload.jsp (I even left off the html:file tag):

<%@ page language="java" %>
<%@ taglib uri="/struts-html.tld" prefix="html" %>
<%@ taglib uri="/struts-bean.tld" prefix="bean" %>

<html:html locale="true">
<title><bean:message key="index.title"/></title>
<bean:parameter id='testID' name='test'/>
<font color='red'><html:errors/></font><br>

<html:form action="" enctype="multipart/form-data" method="post">
<html:hidden property='test' value='<%=testID%>'/>
<html:text property="filePath" /><br /><br />


But the same thing happens: As soon as the validate method returns an error,
the original request parameter (Sorry for writing attribute in my last
mail...) gets lost:

javax.servlet.jsp.JspException: No parameter test was included in this
request 	at
at jsp_servlet._upload._upload._jspService( 	at

Again, if I remove  enctype="multipart/form-data" from the form tag, my
error message gets displayed properly and the request parameter is set.

Any other suggestion?

-----Original Message-----
From: []
Sent: Freitag, 14. September 2001 05:54
Subject: Re: multipart/form-data problem

Are you talking about request attributes, or request parameters? In your
original message, you talk about parameters, but in your follow-up you talk
about attributes.

Request attributes will be lost after the page is first displayed, so will
not be present when the page is redisplayed after a validation error.
Request parameters will be there as long as your page includes some means of
sending them from the browser.

I noticed that the exception you are seeing is being thrown from the
<template:insert> tag. Are you sure this problem is a result of the
multipart data, and not the fact that you are using templates?

Martin Cooper

View raw message