I am not familiar with the oracle tags in question, but my guess is that the
problem is caused by the fact that struts will parse a multipart request so
that it can create a request wrapper from which to populate the actionform.
I reckon that whats happening is that when the bean in question tries itself
to parse the request (by reading from its inputstream) it fails as struts
has already read the stream.

Now it may be possible to hack around and stop struts from reading the
stream and creating the request wrapper, *but* I predict that a problem with
that (if it can be done practically) is that struts would not then be able
to populate your form bean (as without parsing the stream it cant get the
parameter values as the servlet api doesnt handle this for you when doing
multipart requests)



-----Original Message-----
From: Irshad Buchh [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 5 May 2004 18:43
To: [EMAIL PROTECTED]
Subject: Problem with using HttpUploadBean with Struts
Importance: High


Hi,

I am trying to use HttpUploadBean and HttpDownloadBean of the Oracle JSP Tag
Library ojsputil.jar in a Struts application, but no luck. Are there any
issues about using these beans with Struts Action Classes.
I am getting this error:

04/04/28 18:40:10 Corrupt form data: premature ending

04/04/28 18:40:10 at
oracle.jsp.webutil.fileaccess.HttpUploadBean.upload(HttpUploadBean.java:70)

04/04/28 18:40:10 at
bookstore.testing.struts.action.UploadAction.execute(UploadAction.java:51)

04/04/28 18:40:10 at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
sor.java:484)

My form is like this:

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ page contentType="text/html;charset=windows-1252"%>
<html:html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
<title>File Upload | Example</title>
<link href="<html:rewrite page="/css/style.css"/>" rel="stylesheet"
type="text/css"/>
<html:base/>
</head>
<body>
<html:form action="upload.do" enctype="multipart/form-data" method="POST">
<br/>
<bean:message key="label.filename"/>:
<input type="FILE" name="file" size="20" maxlength="50"/>
<!-- <html:file property="file" size="20" maxlength="40" /> -->
<br/>
<br/>
<html:submit>
<bean:message key="button.submit"/>
</html:submit>
<html:cancel>
<bean:message key="button.cancel"/>
</html:cancel>
</html:form>
</body>
</html:html>

Regards,

Irshad



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to