未捕获引用错误:Primefaces未在Spring Security+;Jsf2.2.4

未捕获引用错误:Primefaces未在Spring Security+;Jsf2.2.4,jsf,primefaces,spring-security,themes,jsf-2.2,Jsf,Primefaces,Spring Security,Themes,Jsf 2.2,我有一个项目,使用Hibernate注释和JSF2.2登录数据库,使用primefaces4.0。登录工作正常,但是“login.xhtml”视图中的组件看起来不像primefaces组件,看起来只是jsf组件 Spring security.xml <global-method-security pre-post-annotations="enabled" /> <http auto-config="true" access-denied-page="/A

我有一个项目,使用Hibernate注释和JSF2.2登录数据库,使用
primefaces
4.0。登录工作正常,但是“login.xhtml”视图中的组件看起来不像primefaces组件,看起来只是
jsf
组件

Spring security.xml

     <global-method-security pre-post-annotations="enabled" />
     <http auto-config="true" access-denied-page="/AccesoDenegado.xhtml" use-expressions="true" >

    <!-- Se definen los dos perfiles y se interceptan las paginas para realizar la autenticacion-->


        <intercept-url pattern="/page1**" access="hasRole ('ROLE_PROFE')" />
        <intercept-url pattern="/page2**" access="hasRole ('ROLE_ALUMNO')"  />
        <intercept-url pattern="/javax.faces.resource/**" access="permitAll"/>


         <!--Se define una pagina de login personalizada, no a que viene por defecto-->

         <form-login 
         login-processing-url="/j_spring_security_check"
         login-page="/login.xhtml" 
         authentication-failure-url="/login"
         />

          <!-- Cerrar Sesion-->

          <logout invalidate-session="true" delete-cookies="JSESSIONID" logout- success-url="/" logout-url="/logout" /> 


    </http>

   <!--Autenticación de uuarios de la BBDD-->
    <authentication-manager >
      <authentication-provider user-service-ref="myUserDetailsService" >
      </authentication-provider>
    </authentication-manager>
</beans:beans>
}

LoginBean

public class LoginBean {

   /*este metodo se llama cuendo el usuario pulsa "acceder"*/
    public String doLogin() throws IOException, ServletException
    {
        ExternalContext context = FacesContext.getCurrentInstance().getExternalContext();

        RequestDispatcher dispatcher = ((ServletRequest) context.getRequest())
                 .getRequestDispatcher("/j_spring_security_check");

        dispatcher.forward((ServletRequest) context.getRequest(),
                (ServletResponse) context.getResponse());

        FacesContext.getCurrentInstance().responseComplete();
        // It's OK to return null here because Faces is just going to exit.
        return null;
    }
}
Login.xhtml


![      

]
这些组件不是基本面。以下是屏幕截图:

浏览器内置JS控制台Google Chrome出现错误


我使用以下方法解决问题:


我在登录页面中正确添加了css页面

@BalusC问题是css库没有包含在登录页面中(上),所以我在我发布的链接中发现,在登录页面上包含css库的正确方法OK,这样我就可以将问题改为未捕获引用错误:Primefaces没有在Spring Security+Jsf2.2 Primefaces 4的自定义登录页面中定义,因为您说过在Spring Security登录页面中不需要包含css库,对吗?我的登录页面不是原来的Spring安全表单,是定制的,我把它翻译成西班牙语。因此,当我将css库包含在其中时,效果很好。您告诉我,如果它是一个标准的Spring安全登录页面,则不需要在页面上声明css库。因此,我想把我的问题改为:“未捕获的引用错误:Primefaces未在**自定义**登录页面和Spring Security+Jsf2.2 Primefaces 4中定义”,适用于那些在Spring Security和Primefaces中有自定义登录页面并且有相同问题的人。可能重复
public class LoginBean {

   /*este metodo se llama cuendo el usuario pulsa "acceder"*/
    public String doLogin() throws IOException, ServletException
    {
        ExternalContext context = FacesContext.getCurrentInstance().getExternalContext();

        RequestDispatcher dispatcher = ((ServletRequest) context.getRequest())
                 .getRequestDispatcher("/j_spring_security_check");

        dispatcher.forward((ServletRequest) context.getRequest(),
                (ServletResponse) context.getResponse());

        FacesContext.getCurrentInstance().responseComplete();
        // It's OK to return null here because Faces is just going to exit.
        return null;
    }
}
<p:messages globalOnly="true"/>



<!--Para q pueda soportar el Spring Security Check no hay q cambiar ID-->
<p:panel header="Autenticación" style="margin-bottom:20px">
    <h:panelGrid columns="3" cellpadding="5">

<p:outputLabel for="j_username" value="Usuario " />  
<p:inputText id="j_username" required="true" label="username" />  
<p:message for="j_username" display="text" style="color:red"/>

<p:outputLabel for="j_password" value="Contraseña" />  
<h:inputSecret id="j_password" label="password" required="true" />  
<p:message for="j_password" display="text" style="color:red"/>

<p:outputLabel for="_spring_security_remember_me" value="Recordarme" />
<p:selectBooleanCheckbox    id="_spring_security_remember_me" />        



    ![</h:panelGrid>      
    <p:commandButton type="submit" id="login" value="Acceder"  action="#{loginBean.doLogin}" />


    </p:panel>

   </h:form>
     <!-- Boton de Home -->

     <br/>

 <h:form>   
         <p:commandButton action="home?faces-redirect=true" value="Home" /> 

</h:form>
</h:body>
</html>]