Exposing resources from jar files in web applications (Tomcat7)

前端 未结 1 388
余生分开走
余生分开走 2020-11-27 15:07

Some time ago I read an article what is expected to be in Servlet API 3.0. I remember I read that you can save some .jsp files in a /WEB-INF/lib/somelib.jar/META-INF/web

相关标签:
1条回答
  • 2020-11-27 15:35

    There is a feature in servlet 3.0 that allows you to package resources (images, jsp, etc.) in a JAR file. What you do is in your jar file, you create META-INF/resources and dump anything you want in there including directories for structuring your resources. What happens is that META-INF/resources will be mapped to the docroot of your web application.

    When there is a clash of resource between your app and the JAR file, your apps resource will be returned. See this

    Tomcat 7 supports Servlet 3 so it should support this feature

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