| Author |
what wrong ? :-(
|
Nazmul Huda Sarkar
Ranch Hand
Joined: Feb 01, 2002
Posts: 317
|
|
I placed my servlet in the C:\Tomcat4.0\webapps\NZServlet\web-inf\classes directory...after compiling...it load successfully in the browser... BUT..if I edit it, compile and try to refresh the browser...new servlet failed to load...just show the previous one...I have to restrat my tomcat again to load the servlet.... is there any solution ?
|
Nazmul<br />SCJP,SCWCD,IBM OOAD with UML
|
 |
Stephen Batsas
Ranch Hand
Joined: Jan 22, 2002
Posts: 117
|
|
Nazmul, I think you path is wrong. Should be: c:\Tomcat4\webapps\ROOT\WEB-INF\classes\.... Servlets should be saved in package name - whatever yours is: eg NZServlet Regards Stephen Batsas SCPJ2
|
 |
Manjunath Subramanian
Ranch Hand
Joined: Jul 18, 2001
Posts: 236
|
|
add reloadable="true" as an attribute/value in the context tag in server.xml for your context. Like this.. <Context path="/session" docBase="c:\MyServlets\session" debug="0" reloadable="true"> </Context> Hope this helps, Manjunath
|
 |
Madhav Lakkapragada
Ranch Hand
Joined: Jun 03, 2000
Posts: 5040
|
|
uuuuummmm...I have a different approach! Try reloading the page with < shift_key > + Reload button of your browser. Then you might want to add a "System.out.print" stmt in your Servlet methods so you know that the method was executed. This will tell you that your request is being processed by the server rather than your browser cache. I think you path is wrong. Should be: c:\Tomcat4\webapps\ROOT\WEB-INF\classes\.... Not necessarily. You can add a servlet to your own webapp. In this case "NZServlet" would be treated as the web-app. I would agree with you if you had picked on the "web-inf" in the original path, but then he said he could access it so I assume it is a typo here. You clearly have added your servlet in to your web.xml file too. Where was this suggested, I din't pick this from the original post. It is NOT necessary that you should add each servlet into the "web.xml" for you to access it through a browser. My Tomcat 4.0 does refresh without restarting but with a delay, by which I mean that if I refresh about 5-10 times it picks the new one up. Try to reload with < shift_key > + "Reload" buttons. This, in most cases, will attempt to call the server and not load from the page cache. My two cents......... - satya
|
Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
|
 |
Nazmul Huda Sarkar
Ranch Hand
Joined: Feb 01, 2002
Posts: 317
|
|
Hello Stephen Why should I use root or even the installation folder as my developing folder...I think this is not a good practice... I dont try the other suggestions yet...let me check...hope some of these will help me... Regards Nazmul
|
 |
Ashik Uzzaman
Ranch Hand
Joined: Jul 05, 2001
Posts: 2370
|
|
Nazmul, i know resin auto reloads the changed servlet class files and Tomcat also do that. When i used in standalone pc at my home, tomcat auto relaods the changed class files without any problem. But when i used in my previous office's 20 pc network, it did not relaod automatically ....i had to restart tomcat. Possbile an entry in server.xml file should be the right solution...
|
Ashik Uzzaman
Senior Member of Technical Staff, Salesforce.com, San Francisco, CA, USA.
|
 |
Nazmul Huda Sarkar
Ranch Hand
Joined: Feb 01, 2002
Posts: 317
|
|
If my development path is C:\Tomcat4.0\webapps\NZServlet\web-inf\classes then what should be the Context path in server.xml ??? Hello satya, I'm using Internet Explorer 5 ...where is the reload button in IE ??? I think u mean the Refresh button....no effect shift+refresh .... Hey Ashik...I placed the servelt in the C:\Tomcat4.0/webapps/example/web-inf/classes folder and in LAN or Standalone no problem reloading... :-( but problem facing when it is in C:\Tomcat4.0/webapps/ROOT/web-inf/classes or C:\Tomcat4.0\webapps\NZServlet\web-inf\classes folder [ March 10, 2002: Message edited by: Md. Nazmul Huda Sarkar ]
|
 |
Axel Janssen
Ranch Hand
Joined: Jan 08, 2001
Posts: 2164
|
|
Originally posted by Md. Nazmul Huda Sarkar: If my development path is C:\Tomcat4.0\webapps\NZServlet\web-inf\classes then what should be the Context path in server.xml ??? [ March 10, 2002: Message edited by: Md. Nazmul Huda Sarkar ]
Context path is: NZServlet. (b.t.w.: it should be WEB-INF!!) very common is a structure like this: context-path: Context-path --WEB-INF ---classes ----SomeClasses.class ---web.xml --jsp ---someJsp.jsp --html ---someHtml.html --css ---someCss.css Axel
|
 |
Nazmul Huda Sarkar
Ranch Hand
Joined: Feb 01, 2002
Posts: 317
|
|
I have put this in my C:\Tomcat4.0\conf\server.xml file stil facing problem of reloading... :-( <!-- NZServlet Context --> <!-- <Context path="/NZServlet" docBase="NZServlet" debug="0" reloadable="true"/> -->
|
 |
Manjunath Subramanian
Ranch Hand
Joined: Jul 18, 2001
Posts: 236
|
|
If you have written it exactly like how you have shown above then i am not surprised that it doesn't work...!! Remove the comments <!-- & --> around the <context> tag and then try.. Manjunath
|
 |
Nazmul Huda Sarkar
Ranch Hand
Joined: Feb 01, 2002
Posts: 317
|
|
It works...... Thanks Manjunath... Perhapes the problem was the comment tag...I'm new in xml... Still a bit delay to load..but I dont mind Thanks all
|
 |
 |
|
|
subject: what wrong ? :-(
|
|
|