4

It's possible to include javascript via outputScript tag from jsp which generate is? (contentType=application/javascript)

Or maybe there is another way to achieve localized javascript in facelets (best practice)?

Lostboy
  • 458
  • 3
  • 16
  • my question is about how to do this by outputScript tag in myfaces, given: jsf which generates javascript like in replies from http://stackoverflow.com/questions/14575128/passing-localized-javascript-messages-from-ressource-bundles-using-jsf goal: output it by myfaces outputScript tag – Lostboy Nov 23 '13 at 12:49

1 Answers1

3

The <h:outputScript> doesn't support JSP/Facelets files, but only real plain .js files.

Your best bet is using "plain vanilla" <script> element.

<script src="#{request.contextPath}/resources/script.jsp"></script>
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • thanks, it's possible to include it inside head from some composition define tag? – Lostboy Nov 23 '13 at 12:55
  • Certainly. Just put a `` in the desired location of `` of master template and then declare the above script inside `` of template client. – BalusC Nov 23 '13 at 12:57