Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top