Hi all Ranchers! I am working hard to find out this problem but alas! 1: a Compiled servlet class and its mapping web.xml has been placed in the directory of tomcat 4.0 as d:\tomcat\webapps\ROOT\WEB-INF\
2: but even after restarting the server the message is produced while accessing the server that "the specified "name of servlet" is not available. 3: When I placed these two files in the tomcat 4.0 directory d:\tomcat\classes\ It works fine, and its init() methods parameters are initialized. 4: When I placed these two files in JSDK 2.0 directory: d:\jsdk\webpages\WEB-INF\ the servlet is successfully accessed but the init() method parameters are not initialized to the specified values assigned through web.xml deployment descriptor. Please let me know what is wrong with this A Java Student Saif Ullah SCJP2
Mike Dunn
Greenhorn
Joined: Apr 24, 2002
Posts: 4
posted
0
1 and 2: If your servlet class is in the default package, then your class file goes under d:\tomcat\webapps\ROOT\WEB-INF\classes\ If your servlet is an a package, say com.javaranch, then it goes under d:\tomcat\webapps\ROOT\WEB-INF\classes\com\javaranch\ In both cases, the web.xml file always goes under d:\tomcat\webapps\ROOT\WEB-INF\ 3: Classes in d:\tomcat\classes\ are global to all applications, and so wouldn't be the place to put your class file. 4: Sorry, I'm not familiar with JSDK 2.0
Manohar Karamballi
Ranch Hand
Joined: Jul 17, 2001
Posts: 227
posted
0
hai this is just a wild guess.. 4. init parameters are initialized only when servlet is loaded into JVM. Ur servelt may be already present in memmory when u tried to acess and so init is not getting triggered. Hope this helps Rgds Manohar
Dbugmaker
Greenhorn
Joined: May 05, 2002
Posts: 1
posted
0
Well About this problem u just put ur classes in a new folder in webapps suppose c:\tomcat\webapps\newfolder\web-apps\classes put ur web.xml in newfolder and for loading init() on startup write <load-on-startup>1 </load-on-startup> in ur xml hope this will help CU