views:

971

answers:

2

I am editing the jsp files which are residing directly inside tomcat/webapps/myapp/web-inf. But to see the changes i have to restart the server these. As far as i know, jsp changes don't require you to restart the server. The only configuration i found which was related to automatic reloading is reloadable = "true"

Set to true if you want Catalina to monitor classes in /WEB-INF/classes/ and /WEB-INF/lib for changes, and automatically reload the web application if a change is detected.

I used this attribute in the context.xml, but still the problem persist. What could be the other possible reason of not detecting changes in jsp file without restarting?

@Bozho: This is the excerpt from web.xml. Do i need to change something?

 <servlet>
        <servlet-name>jsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>fork</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>xpoweredBy</param-name>
            <param-value>false</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
    </servlet>
+1  A: 

In the tomcat docs, see the development setting. It must be set to true in order to have jsps reloaded.

development - Is Jasper used in development mode? If true, the frequency at which JSPs are checked for modification may be specified via the modificationTestInterval parameter.true or false, default true.

This is in your CATALINA_HOME/conf/web.xml

Additionally, if you need to refresh a jsp in a production environment without restart, you can go to CATALINA_HOME/work/Catalina/localhost/contentName/org/apache/jsp and delete the your_jsp.java and your_jsp.class files. They will be recreated the next time they are accessed.

Edit: after providing your configuration, and comment about not refreshing the content, I have another though: clear your browser cache, or open the page from another browser.

Bozho
editing the question to add the excerpt from web.xml
Rakesh Juyal
interesting thins is i have deleted all files from `CATALINA_HOME/work/Catalina/localhost/contentName/org/apache/jsp` and on accessing the page, new .java and .class files are created for the jsp. But still the changes are not getting reflected. :(
Rakesh Juyal
A: 

Would like to bump this thread, as they say, because I am seeing the same problem.

When I delete the .class or the .java or both .class and .java I am not seeing them recreated and I am not seeing the changes reflected on that page

kbkb