I am using primefaces and bootstrap in a login and I get the following error:
Uncaught ReferenceError: $ is not defined at login.xhtml:252 (anonymous) @ login.xhtml:252 login.xhtml:260 Uncaught ReferenceError: PrimeFaces is not defined at login.xhtml:260 (anonymous) @ login.xhtml:260
I have tried to include the style sheet in the header, to include a different version of jquery ... nothing works for me!
Attached login code.xhtml:
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
<h:body style="text-align:center">
<p:growl id="mensajes" showDetail="true" life="2000" />
<h:form>
<p:panel header="Login" style="width:300px">
<h:panelGrid columns="2" cellpadding="5">
<h:outputLabel for="username" value="Usuario:" />
<p:inputText value="#{loginBean.nombreUsu}" id="username"
required="true" label="username" />
<h:outputLabel for="password" value="Clave:" />
<p:password value="#{loginBean.password}" id="password" required="true"
label="password" />
<f:facet name="footer">
<p:commandButton id="loginButton" value="Login"
actionListener="#{loginBean.submit}" update=":mensajes"
oncomplete="manejarLogin(xhr, status, args)" />
</f:facet>
</h:panelGrid>
</p:panel>
</h:form>
</h:body>
<script type="text/javascript">
//<![CDATA[
function manejarLogin(xhr, status, args) {
if (!args.validationFailed && args.estaLogeado) {
setTimeout(function() {
window.location = args.view;
}, 500);
}
}
//]]>
</script>
</html>
EDIT:
I just realized that some documents from primefaces load in state 302 ... this why it happens ???