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)?

有帮助吗?

解决方案

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>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top