• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error compiling code that uses MultipartRequest

 
Greg Kearn
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I've been trying to compile a simple prg that uses MultipartRequest class without success. The program has a problem with:
the error is "cannot resolve symbol"
symbol: constructor MultipartRequest (javax.servlet.http.HttpServletRequest)
MultipartRequest multi = new MultipartRequest(req, "/");
^
The code is a follows:
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
//import http.utils.multipartrequest.MultipartRequest;
//import http.utils.multipartrequest.ServletMultipartRequest;
import http.utils.multipartrequest.*;
public class UploadServlet extends HttpServlet {

public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
// Get output stream.
ServletOutputStream out = res.getOutputStream();
MultipartRequest multi = new MultipartRequest(req, "/");
...
Any ideas where I have gone wrong?
Thanks for the look.
Greg
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Umm, I'm not familiar with a package called 'http.utils.*', but the one that I prefer is from 'com.oreilly.servlet'

If http.utils.* is an actual package, then you need to make sure it appears in your CLASSPATH.
[This message has been edited by Mike Curwen (edited December 06, 2001).]
 
Greg Kearn
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I do have it in my classpath. Without it I get errors: cannot resolve symbol MultipartRequest.
Is there different set of class files I should be using?
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what do you mean without it you get errors. I might be misunderstanding something, but it recalls to mind a joke.

Patient: "it hurts when i do this."
doctor: "don't do that."

At first I thought you were mistakingly using HttpUtils package from javax.servlet., I had never heard of your package, but found it by googling.

I'd highly recommend the com.oreilly.servlet package from www.servlets.com/cos
 
Greg Kearn
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks you Mike for the info. I started over and down loaded as you suggest and I'm on my way again.
Thanks.
Greg
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!