• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Package javax.sevlet.http not found in import.

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 289
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
On top of spaghetti all covered in cheese, there was this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic