I'm using JSF 2.0. I have
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script language="text/javascript" >
in my source, but when I deploy it, I'm getting:
<SCRIPT type=text/javascript
src="appmonitorgreeting_xhtml_files/jquery-latest.min.js"></SCRIPT>
This suggessts that you can just add the URL the normal way, but for some reason JSF is stripping out my url and just using the file name. Here's the full head in case it helps:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head>
<meta charset="utf-8" content=""/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content=""/>
<meta name="author" content=""/>
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7"/>
<h:outputStylesheet library="css" name="appmonitor.css"/>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script language="text/javascript" >
function show(area) {
var obj = document.getElementById(area)
obj.style.display = (obj.style.display == 'inline') ? 'none' : 'inline'
};
jQuery(document).ready(function() {
alert("see it does work");
});
</script>
</h:head>
How do I make it use http://code.jquery.com/jquery-latest.min.js as the src?
<ui:insert name="resources" />and<ui:define name="resources">without usingui:composition? I tried both ways and couldn't get it to work.<script src>isn't the default behavior (the uppercased<SCRIPT>element for sure also not as that's invalid XHTML). So you must have somewhere a custom resource handler or some weird servlet filter or such. Please list the libraries used in your application and the resource handlers listed in faces-config.xml and the servlet filters listed in web.xml.