Question

may i know if i can change the name of WEB-INF folder in any tomcat webapp. If no, then why as there is context.xml file in tomcat conf folder which contain the path of watchedresource. I tried renaming it but it doesn't work. Can you please tell me what is the reason to provide <WatchedResource>newWebInf/web.xml</WatchedResource> this tag in context.xml file if renaming is just not working. Or is there any other way to rename WEB-INF folder.

PS: I dont have any requirment related to this. I am just trying out the things. Please don't answer why and where you want this.

Thanks a lot.

Was it helpful?

Solution

No, you can't rename the WEB-INF folder. It's hard specified in the Servlet API specification.

The point of <WatchedResource> component is to specify the webapp-relative path of a file which Tomcat must monitor for changes in order to auto-reload the entire webapp. This defaults indeed to WEB-INF/web.xml, but it can also be another file, such as index.jsp or something else. The whole point is not that you can rename the WEB-INF/web.xml, but that you can specify a different file to monitor for changes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top