JSf tags not showing

This is the question I saw here, but the solution did not solve my problem. I am dealing with jsf 2.0 again and I have 2 pages: login.xhtml and index.xhtml, I also use SpringSecurity for auth purposes. index.xhtml does ok, but the login does not work (the page source shows that the jsf tags are not parsed). I already disabled SpringSecurity to check if it has something with my problem, but no luck ... I really don't know what is wrong with my code (2 days in a row, trying to figure it out), so any help is SO appreciated. Here is my code:

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
</context-param>

<!-- Spring Security -->
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>

<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Spring Security -->

<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<session-config>
    <session-timeout>
        30
    </session-timeout>
</session-config>
<welcome-file-list>
    <welcome-file>JSF2Example/index.xhtml</welcome-file>
</welcome-file-list>

login.xhtml part

<h:head>
    <title>Ejemplo JSF 2 AJAX</title>
</h:head>
<h:body>
       <h:form id="login">
        <h:panelGrid columns="2">
            <h:outputLabel for="Usuario" value="Usuario:"/>
            <h:inputText id="Usuario" value="#{loginBean.userName}" required="true"/>
            <h:outputLabel for="Password" value="Contraseña:"/>
            <h:inputSecret id="Password" value="#{loginBean.password}"        required="true"/>
        </h:panelGrid>
        <h:commandButton value="Ingresar" actionListener="#{loginBean.doLogin}"/>
        <h:messages/>
    </h:form>
</h:body>

Any ideas? Thank you so much!

+3
source share
1 answer

, jsf

:

  • URL- url-pattern FacesServlet, .

  • xmlns JSF <html>, .

+4

Source: https://habr.com/ru/post/1744009/


All Articles