Search code examples
javajspsitemesh

Merging JavaScript code into the <head> with sitemesh and jsp's


I'm using sitemesh to decorate my web pages. Can someone guide me on the best practice. The header.jsp and sidebar.jsp have JavaScript code dependencies and I would like to merge these into the head along with the main page which is being decorated.

Basically I want to decorate both the HTML and the <head>.


Solution

  • If the code in healder.jsp is between <head></head>, sitemesh will, by default, append it into the <head></head> of the main decorator.