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
posted
0
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
posted
0
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
posted
0
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