Dear Friends, i want to do a program on JAVA servlets . I've JSDK2.0 downloaded. I'd set the classpath to CLASSPATH=C:\jdk1.2.2\bin\trials;c:\jsdk2.0\lib\jsdk.jar; Whenever i used to compile my servlet JAVA program, it gives me an error that javax.... files not found. How come i can overcome this difficulty ? from, vikram .
Tony Alicea
Desperado
Sheriff
Joined: Jan 30, 2000
Posts: 3219
posted
0
If the "2.0" in "JSDK2.0" is the Servlet version supported, then it's two versions behind. I prefer the Tomcat Reference Implementation Server from Apache (with help from Sun): Release Build 3.1 of Tomcat from the Apache Software Foundation is now available. Tomcat is the combined JSP 1.1 and Servlets 2.2 reference implementation being developed under the Apache process. Tomcat is available at the Apache web site in both binary and source versions: http://jakarta.apache.org/downloads/binindex.html Maybe someone can explain to me the reason for existence or justification of the Servlet Development Kit from Sun? I don't see it, but who knows... Unless one is only initerested in Servlets 2.1 (and JSP 1.0?)... I guess it's possible.
Tony Alicea Senior Java Web Application Developer, SCPJ2, SCWCD
Frank Carver
Sheriff
Joined: Jan 07, 1999
Posts: 6913
posted
0
Tony wrote: Maybe someone can explain to me the reason for existence or justification of the Servlet Development Kit from Sun The reason is both historical and practical. The historical reason is that the JSDK series were both, for several years, the only way to get the servlet API and a very simple reference server. Although Tomcat is up and running now, that is a very recent occurrence, and neither Sun, nor the wider developer community are willing to dispose of a known working way to get servlets until Tomcat has proven itself. The practical reason is that there are a lot of servers, servlet containers and servlet engines still out there which have been built to use preceding versions of the servlet API. If your web host runs Apache Jserv, for example, it only supports version 2.0 of the servlet API, so you need a version 2.0 jar to compile your servlets against, otherwise they are unlikely to work when deployed. Netscape Enterprise Server up to about version 3.6, only supports version 1.0 of the servlet API. It's an irritating situation, but to be sure a servlet will run on the widest choice of servers, it currently needs to be built and tested to the lowest-common-denominator of the 1.0, 2.0, 2.1 and 2.2 servlet APIs.
Hi..Vikram, Coming back to your problem,it's apackage problem and not of classpath one. remove javax folder and place it in say C:\examples\..\javax whereas you are compiling in C:\examples\HelloServlet.java Hope this will solve your problem. good luck nm
"Knowledge is Power"****************<A HREF="http://www.geocities.com/nityananda_mukherjee" TARGET=_blank rel="nofollow">THREAD/SCJP RESOURCES</A>
Tony Alicea
Desperado
Sheriff
Joined: Jan 30, 2000
Posts: 3219
posted
0
Thanks Frank. I knew there had to be a good reason and I am new to Servlets. On the other hand, Servlets 2.1 are not good enough for what we want to do at work in the near future (the forwarding of POSTs via RequestDispatcher). It seems that only Servlets 2.2 supports it and IBM's WebSphere is at Servlets 2.1 and JSP 1.0. We'll have to wait . Or do you know of a 2.1 implementation that supports forwarding of POSTs?
Frank Carver
Sheriff
Joined: Jan 07, 1999
Posts: 6913
posted
0
In previous Servlet APIs you had to do it manually - build the HTTP request from the supplied data, send it to a remote URL, retrieve the results and pass them through to your output stream. A bit clumsy, and error prone especially with Readers/Writers, but it can be done.