0

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?

Community
  • 1
  • 1
taylordurden
  • 357
  • 2
  • 5
  • 17
  • see http://stackoverflow.com/questions/8067904/jsf-2-resources-with-cdn or http://stackoverflow.com/questions/13667052/how-can-i-use-houtputscript-with-a-remote-file – Arun P Johny Nov 26 '13 at 00:58
  • Thanks for the quick reply. Do you know if you can use `` and `` without using `ui:composition`? I tried both ways and couldn't get it to work. – taylordurden Nov 26 '13 at 02:06
  • Please ignore Arun. He has no utter idea what problem you're currently facing and by following his ignorant advice you would only confuse yourself more. – BalusC Nov 26 '13 at 10:55
  • The modified URL in the generated ` – BalusC Nov 26 '13 at 10:56
  • Correction, I'm using JSF 2.1. Libraries: Java EE, TopLink, Oracle XML Parser V2, CDI. faces-config.xml is empty (except for the boiler plate stuff). Here's most of what's in my web.xml: – taylordurden Nov 26 '13 at 17:48
  • javax.faces.PROJECT_STAGE Development Faces Servlet javax.faces.webapp.FacesServlet 1 Faces Servlet /faces/* – taylordurden Nov 26 '13 at 17:49

0 Answers0