Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

While I am still making changes to a servlet code, how can I make a servlet reload every time I test it?

0
Posted

While I am still making changes to a servlet code, how can I make a servlet reload every time I test it?

0

Location: http://www.jguru.com/faq/view.jsp?EID=24607 Created: Mar 15, 2000 Modified: 2003-01-11 07:02:36.296 Author: John Zukowski (http://www.jguru.com/guru/viewbio.jsp?EID=7) Question originally posed by Rodolfo Ruiz (http://www.jguru.com/guru/viewbio.jsp?EID=2326 It depends on the web server you are using to test your servlet. For instance, with Tomcat, you would replace the WAR file and the server notices the change and loads the new servlet on the next request, without having to restart the server. [Short answer: for Tomcat, add reloadable=”true” to the tag for that web application. Note that there is a bug in Tomcat where replacing the WAR file doesn’t work; you also have to delete the unpacked directory under TOMCAT/webapps/foo (for TOMCAT/webapps/foo.war). If you are not using WAR file deployment, simply replacing the servlet classfile should work, as long as the class file is stored in webapp/WEB-INF/classes, or replacing the JAR file in webapp/WEB-INF/lib/foo.jar.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123