tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "CPC Livelink Admin" <cpclv...@fitzpatrick.cc>
Subject RE: Multipart stuff - inside JSP?
Date Tue, 28 Nov 2000 02:13:14 GMT

I use it all the time in my JSPs.  I don't understand why you are trying to
embed the source in the JSP instead of just using it though - Here is how I
use it :



<%@
	page language="java"
	import="java.io.*, java.util.*"
	errorPage="load-action-docs-error.jsp"
%>
8< snip >8
<%
  String FileDestination = strMSUploadDir + java.io.File.separator +
session.getId();
  File fUploadDir = new File(FileDestination);
  fUploadDir.mkdirs();

  com.oreilly.servlet.MultipartRequest multi = new
com.oreilly.servlet.MultipartRequest(request, FileDestination,
iMSMaxFileSize);

  Enumeration files = multi.getFileNames();
  while (files.hasMoreElements()) {

    ... etc (like HTML) below ...

-----Original Message-----
From: Mike Kobe [mailto:winframe@iname.com]
Sent: Tuesday, November 28, 2000 01:36 PM
To: tomcat-user@jakarta.apache.org
Subject: Re: Multipart stuff - inside JSP?


Hi,

I was looking at the multipart request handler from oreilly,
(www.servlets.com), is it possible to use the same class INSIDE jsp? I mean
in the declaration tags

    <%!

        class MultipartRequest...

    %>


and then call it from there? This is giving me a hell lot of problems.
First, all the IMPORT tags in the class were giving me a problem, so I
removed all those, but now it gives me a problem with the "Hashtable" from
java.util.*, so I removed all of that, and the reference to all "Vectors"..

Now it doesnt work! ALways gives me the "premature ending" IOException..

Please help! Is there something that I cannot do inside the JSP declaration
tags? How to go around this?

Thanks!!!
Mike



Mime
View raw message