File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Package javax.sevlet.http not found in import. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Package javax.sevlet.http not found in import." Watch "Package javax.sevlet.http not found in import." New topic
Author

Package javax.sevlet.http not found in import.

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi all
I have this servlet class in the bottom ,i set the classpath to :
c:\jdk1.2.2\lib\tools.jar;c:\jswdk-1.0.1\libservlet.jar
in the classpath under environment tab,then i restart my computer.
what i'm getting is :javax.servlet.http not found in import.
Please help with it and i appreciate your help.
import java.io.*;
import javax.servlet.*;
import javax.sevlet.http.*;
public class HelloBrowser extends HttpServlet
{
public void doGet(HttpServletRequest request,HttpServletResponse response)
throws IOException,ServletException
{
response.setContentType("test/html");
PrinterWriter out = response.getWriter();
String title = request.getHeader("User-Agent ");
if(title == null | | title.equals(""))
{
title="Unknown Browser ";
}
title = "Hello,"+ title +"!";
out.println("<HTML>");
out.println("<HEAD>");
}
}
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I think it should be
c:\jdk1.2.2\lib\tools.jar;c:\jswdk-1.0.1\lib\servlet.jar
instead of
c:\jdk1.2.2\lib\tools.jar;c:\jswdk-1.0.1\libservlet.jar
Herbert Maosa
Ranch Hand

Joined: May 03, 2000
Posts: 289
From what I see, you have misspelled the package as javax.sevlet.http.*; instead of javax.servlet.http.*;
You might have to correct this as well.
Herbert.
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
You are right,thanks alot,but here what i'm getting:
Thanks alot,just i download jsdk2.1 and it compiled well,but
i'm trying to run it using Tomcat 3.1AND I'M geting problems ,here is what i did:
1- I went to server.xml and i changed the port from 8080 to 80
2- I put this the following line in top of startup.bat script,before (@echo off)
"SET JAVA_HOME=d\jdk1.2.2 "
3- I put the HelloBrowser.class in classes directory under
WEB_INF
4- I start the server by double click startup.bat from explore
5- I put in the browser:http://localhost:80/servlet/HelloBrowser
I got this error,I did not any result,
i hope you see the problem,i appreciate your help
 
 
subject: Package javax.sevlet.http not found in import.
 
Similar Threads
Problem in compiling servlet
How to use body background in a HTML page thru servlet
New to servlets
package javax.servlet. does not exist
Pls help : I get error when i try to access servlet directly