aspose file tools*
The moose likes Servlets and the fly likes load servlet automatically when changed without restarting server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "load servlet automatically when changed without restarting server" Watch "load servlet automatically when changed without restarting server" New topic
Author

load servlet automatically when changed without restarting server

Mahesh Pinnamaneni
Ranch Hand

Joined: Jul 02, 2004
Posts: 100
hai buddies,
is there any solution for loading the servlet automaticaly when it is changed rather than restarting the server for every change done to the file.(this is very problematic when developing servlet, restarting server everytime).
thanks
regards,
Mahesh
Prathiba Kalirengan
Greenhorn

Joined: Aug 30, 2004
Posts: 12
Compile your servlet files to put the classes with the correct package structure in the path where the server has the class files.
javac -d <directory where the server stores its servlet classes> <source files>
just refresh the servlet...
I hope this is what you have asked for...


SCJP 1.4<br />SCJA BETA
Mahesh Pinnamaneni
Ranch Hand

Joined: Jul 02, 2004
Posts: 100
dear pratibha,
hope u have not got me. if we use servlets , we have to make entries in web.xml (i use tomcat webserver) file.when we start server the servlet is loaded by taking the info from web.xml file. when i change the same servlet and need to reflect the changes, we need to restart the server and access the servlet.(becoz like JSP pages tomcat server will not check automatically for latest versions of servlets.we can request the changed JSP page without restarting the server as the server automatically checks for new versions in case of JSP).
hope u got me now.
whatz the solution for this.
regards,
mahesh
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61661
    
  67

Moving to the Servlets forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Kerry Wilson
Ranch Hand

Joined: Oct 29, 2003
Posts: 254
You just have to set the context to be reloadable in the context configuration file. ( server.xml )


http://www.goodercode.com
SCJP 1.4
jbig zala
Greenhorn

Joined: Sep 20, 2004
Posts: 11
Dear Mahesh,
If u r using tomcat4 or above.
It will automatically detect your modified servlet. and Loads them again by server when any request for it.
Ya Old thread will remain there.


Learning Never Ends ...................
Chandra Sekhar
Ranch Hand

Joined: Sep 26, 2003
Posts: 90
Hi

Try this...

Modify ur server.xml like this

<Context path="/myapp" docBase="myapp" debug="7" reloadable="true">
<Loader className="org.apache.catalina.loader.WebappLoader" reloadable="true" checkInterval="5" debug="7"/>
</Context>

Chandrasekhar
SCJP


"Luck is when opportunity meets preparation"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: load servlet automatically when changed without restarting server