Hi,

I'm writing jsp under Tomcat 4.0.  
In my jsp I create an instance of a class TestFileUpload and pass it request
(javax.servlet.http.HttpServletRequest)object.


 <%
        TestFileUpload b = new TestFileUpload();
        b.doUpload(request);

 %>

class TestFileUpload looks something like this:

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

public class TestFileUpload{
        ...
        public void doUpload(HttpServletRequest request) throws IOException
{
                ServletInputStream in = request.getInputStream();
                        ...
        }
}

executing this jsp always results in 
 
java.lang.NoClassDefFoundError: javax/servlet/ServletRequest
        at
org.apache.jsp.m_0005fpreview3$jsp._jspService(m_0005fpreview3$jsp.java:88)
        ...

when I comment out 
        ServletInputStream in = request.getInputStream();
                        and instead do something like
                BufferedReader rd = request.getReader();

I stop getting above exception. I'm assuming that packages javax.serlvet.*,
javax.servlet.http.*  are implicitly imported 
therefore anything defined in them should be loaded by Tomcat,
that's why getting NoClassDefFoundError for javax.servlet.ServletRequest
is really strange. 
 
If anyone knows how to fix this I would appreciate your help.
Thanks so much.

kate

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

Reply via email to