I need move all JS scripts from “head” tag to bottom of “body” tag to increase a speed of application. I know, that need use PhaseListener, but how to get page content from this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming that your actual question is: How do I render JavaScript references at the page bottom rather than at the HEAD area?
I recommend to use the h:outputScript tag which ensures that a script gets references only once and with that you can control the rendering position.
Doc:
http://docs.oracle.com/cd/E17802_01/j2ee/javaee/javaserverfaces/2.0/docs/pdldocs/facelets/h/outputScript.html
Example:
This will render the script reference at the bottom of page body, independent from where you placed the Facelet tag on your view.