How to add an element to html-head on an arbitrary Sub-JSP page

So, I have my main JSP page, which includes several sub-JSP pages hierarchically.

Some of these sub-JSP pages contain scripts and styles that should be included with them, but I want the styles and script tags to be at the beginning of the document.

Is this possible without using JavaScript?

+4
source share
1 answer

There may well be reasons not to send all your scripts (or css) at all.

However, in many cases this is the right approach. You just need to take care to avoid collisions.

Therefore, I would recommend putting your javascript in some .js files, your css in .css files, and loading at least all your css and the necessary js for all pages that require their content.

if you need a more modular approach, please be more specific so that we can see what suits your needs.

0
source

All Articles