Java Servlet not affected after changes made. [Solved]
While you create a servlet/Java program and execute it using tomcat server, its works fine and display output, but when you change your code compile it and refresh your web-page it does not display any changes that you have made. There are three methods to fix this problem.
Open server.xml in notepad or notepad++ or any other text editor.
At the end of this file add this tag <Context path="/myapps"
reloadable="true" debug="0"/> . "Before closing </Host>".
In this example "/myapps" is my application folder name inside webapps folder where i am saving my servlet code and you can modify this with your own application folder.
After adding this tag save this file and restart tomcat server and execute your servlet code and this will display you each changes that you will made each time without restarting tomcat server or deploying application from tomcat application manager.
Watch a video tutorial here...
- Restart Tomcat server
- Deploy your application from tomcat application manager
- Configure Server.xml file
First two methods are time consuming and difficult because we makes change in our code again and again and if we use first two methods we must restart tomcat or deploy our application each time we made change in our servlet code. Third method is easy and we need to configure server.xml file only once time.
In this post i will explain to you how you can configure server.xml file with <context> tag. Server.xml file is located in C:\tomcat\conf directory.
Open server.xml in notepad or notepad++ or any other text editor.
At the end of this file add this tag <Context path="/myapps"
reloadable="true" debug="0"/> . "Before closing </Host>".
In this example "/myapps" is my application folder name inside webapps folder where i am saving my servlet code and you can modify this with your own application folder.
After adding this tag save this file and restart tomcat server and execute your servlet code and this will display you each changes that you will made each time without restarting tomcat server or deploying application from tomcat application manager.
Watch a video tutorial here...
Comments
Post a Comment