• 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

what wrong ? :-(

 
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Nazmul Huda Sarkar
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 2378
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Nazmul Huda Sarkar
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 236
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic