문제

We would like to have an header with same image, same css. The only thing which is needed is the name of application which would be provided into the model in order to load a different logo.

Is it possible to put that jsp into a jar which would be deployed on shared folder of a Tomcat 5.5 ?

How to do that ?

Thank you.

도움이 되었습니까?

해결책

You have multiple related solutions:

The Servlet 3.0 specification allows the exposition of static resources placed in jar under "META-INF/resources" folder. Sadly, JSPs are not static resources and Tomcat 5.5 is a Servlet 2.4 container.

다른 팁

AFAIK, there is no standard way to share JSPs in the way you described using Tomcat 5.5. In fact, this feature is available in servlet 3.0 but Apache Tomcat version 5.5 implements the Servlet 2.4. However, I see some solutions:

  • using a taglib for your header
  • using template frameworks which simplify the reuse of JSP fragments (such as tiles)
  • precompiling your JSP into servlet and using the generated class (weird but could do it)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top