Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

uploald problem: NoClassDefFoundError: javax/servlet/ServletRequest  RSS feed

 
Rafael Fagundes
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!
Well, in the source code below:

<%@ page import="java.io.*,java.util.*"%>
<%@ page import="com.oreilly.servlet.*"%>
<%
try
{
MultipartRequest multi = new MultipartRequest(request, "\\", 5 * 1024 * 1024);
Enumeration e = multi.getParameterNames();

out.println("<h3>Parametros recebidos<h3>");
out.println("<pre>");
while (e.hasMoreElements())
...
...

I'm trying to make a file upload using the cos.jar to provide the class MultipartRequest, but I�m catching the following error:

java.lang.NoClassDefFoundError: javax/servlet/ServletRequest
at com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:116)
....

Doe's somebody know's why?

Thank's for your attention,
Rafael

PS: Sorry for my bad english!
 
Loveen Jain
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try including these two lines in your code.....
<% page import="javax.servlet.*" %>
<% page import="javax.servlet.http.*" %>
 
Rafael Fagundes
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Loveen jain:
try including these two lines in your code.....
<% page import="javax.servlet.*" %>
<% page import="javax.servlet.http.*" %>


Thank's but it didn't work out.....
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You dont require to import javax.servlet pkgs into a jsp, what u should do is to ensure that when u start the server, the jar files are in the cp. adjust the cp in the startApp script for ur server.

ram.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!