在Tomcat开发模式下重新加载JSTL Tag文件 [英] Reloading JSTL Tag files in Tomcat development mode

查看:84
本文介绍了在Tomcat开发模式下重新加载JSTL Tag文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚继承的应用程序定义了.tag文件-即,用JSP编写的JSTL标记和其他JSTL标记. Tomcat是否有可能以与JSP的开发"模式相同的方式获取对.tag文件的更改并重新编译/重新加载它们而无需重新启动?

The application I just inherited defines .tag files - ie JSTL tags written in JSP and other JSTL tags. Is it possible for Tomcat to pick up on changes to .tag files and recompile/reload them without a restart, in the same manner of "development" mode for JSPs?

编辑我应该注意到,上下文在Tomcat中被标记为可重载",并且我已经成功地热部署了类文件和jsps.只是没有选择.tag文件.

Edit I should have noted that the context is marked as "reloadable" in Tomcat, and I'm successfully hot-deploying class files and jsps. It's just not picking up on .tag files.

推荐答案

JSP的开发"模式也适用于标记文件...除非标记文件打包在jar文件中(例如,在/META-INF/tags/中) /WEB-INF/lib中的jar文件).

"development" mode for JSPs applies for the tag files too ... unless the tag files are being packaged in a jar file (e.g. in /META-INF/tags/ of a jar file in /WEB-INF/lib).

如果标记文件像JSP一样部署(例如,在/WEB-INF/tags/中),则在开发"模式为true的情况下,将对其进行检查以进行修改并在每次访问时重新加载它们.您不必显式设置它,因为它在tomcat 5.5/6中默认为true.

If the tag files are being deployed like the JSPs (e.g. in /WEB-INF/tags/) they will be checked for modification and reloaded on each access if "development" mode is true. You shouldn't have to set it explicitly as it's true by default in tomcat 5.5/6.

如果您检查$CATALINA_BASE/conf/web.xml并且开发"未明确设置为false,但是仍然存在重新加载.tag文件的问题(假设这些文件不是用jar包装的),则可以尝试关闭标签池(对于碧玉,JspServlet):

If you check $CATALINA_BASE/conf/web.xml and "development" isn't explicitly set to false but you're still getting issues with reload of .tag files (assuming these aren't jar-packaged) you could try turning off tag pools (for the jasper, JspServlet):

<init-param>
    <param-name>enablePooling</param-name>
    <param-value>false</param-value>
</init-param>

...但这确实不是必须的.

... but this really shouldn't be necessary.

这篇关于在Tomcat开发模式下重新加载JSTL Tag文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆