tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sam Seaver" <samsea...@hotmail.com>
Subject Error with multipartParser
Date Wed, 09 Oct 2002 18:08:53 GMT
I cannot work this out as I get no more in my error messages despite trying 
to use the usual ways of debugging the bean.  Basically I'm using a bean 
that extends HttpServlet and uses Hunter's MultipartParser, and the error 
ALWAYS occurs when I try to create an instance of the parser...

Error:

root cause

javax.servlet.ServletException: 
com/oreilly/servlet/multipart/MultipartParser
	at 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:497)

Code:

import java.io.*;
import java.util.*;
import javax.servlet.http.*;
import javax.servlet.*;

import com.oreilly.servlet.*;
import com.oreilly.servlet.multipart.*;

public class SimpleBean extends HttpServlet {

    private String fileName;
    private String name;
    private String type;
    private String output;

    public SimpleBean(){
	fileName="";
	name="";
	type="";
	output="";
    }

    public void setFileName(String x){
	fileName=x;
    }

    public void setName(String x){
	name=x;
    }

    public void setType(String x){
	type=x;
    }

    public void setOutput(String x){
	output=x;
    }

    public void appendOutput(String x){
	output=output+x;
    }

    public String getFileName(){
	return fileName;
    }

    public String getName(){
	return name;
    }

    public String getType(){
	return type;
    }

    public String getOutput(){
	return output;
    }

    public void doPost(HttpServletRequest req, HttpServletResponse res)
	throws ServletException, IOException{
	setOutput("Demo Parser Upload Bean");
	res.setContentType("text/html");
	ServletOutputStream out = res.getOutputStream();

	try{
	    MultipartParser mpParser = new MultipartParser(req, 10*1024*1024);
	}catch (Exception e){
	    StringWriter sw = new StringWriter();
	    PrintWriter pw = new PrintWriter(sw);
	    e.printStackTrace(pw);

	}



    }
}



"JC Rules"

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message