Why are my JSP changes are not reflected without restarting Tomcat?

前端 未结 12 1338
忘掉有多难
忘掉有多难 2020-12-02 18:48

I am editing JSP files which are residing directly inside tomcat/webapps/myapp/WEB-INF, but to see the changes, I have to restart the server. As far as I know,

相关标签:
12条回答
  • 2020-12-02 19:15

    Synchronize server & client time

    you can check your server time and client system time. For me a few days ago after changing the server time correctly worked. It reflected the changes of the .jsp files.

    0 讨论(0)
  • 2020-12-02 19:16

    You will need to go to the server project in Eclipse and edit the web.xml file and set 'development' to true.

    0 讨论(0)
  • 2020-12-02 19:19

    I am using TomEE 1.7.2 on Windows 7 with Eclipse. The solution that worked for me was simply changing the web.xml file for the TomEE server at localhost-config (in my IDE) so that the development init param is true:

    <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>
        <init-param>
            <param-name>development</param-name>
            <param-value>true</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
    </servlet>
    
    0 讨论(0)
  • 2020-12-02 19:25

    An even more late answer ...

    Setting "antiResourceLocking" to "true" in the context file may prevent JSP to be reloaded by the Tomcat (Bugzilla 37668).

    This is documented on the Tomcat doc, at the "antiResourceLocking" parameter explanation

    0 讨论(0)
  • 2020-12-02 19:28

    I too faced this problem while doing jsp changes in myeclipse, those are not reflecting in the application while running. I hope these checks will help you.

    1. Double click on Tomcat Server from MyEclipse.
    2. click the Publishing menu from the Overview window.
    3. Select the Radio button "Automatically publish when resources change"
    4. enter the publishing interval time as 1 second.

    I hope this will help you.

    0 讨论(0)
  • 2020-12-02 19:30

    A late answer, anyone else might find this useful though.

    Check the permissions on the Tomcat folder, I have tried a lot of other solutions and it did not work out.

    Finally I gave my 'user account' 'Full control' permission to the Tomcat folder and Tomcat picked up the changes whenever I made a change in JSP. I am assuming you are using Windows. The rationale behind this was: whenever you make a change in JSP, it has to be compiled and deployed (written) to the webapps folder. If there is no 'write' permission on that folder, it will silently fail. This was happening in my case. So if reloadable = true and development = true in the context.xml do not work, try this permission fix.

    I am using Tomcat 7 on Windows 7.

    0 讨论(0)
提交回复
热议问题