0

I have a problem with PrimeFaces 5 and bootstrap theme. I am using wildfly server , ejb 3.2, JSF 2.2 + PrimeFaces 5 with bootstrap theme. I am trying to do simple login page.

My login page:

<h:head>
    <title>Login Form</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <h:outputStylesheet library="primefaces-bootstrap" />
</h:head>

<h:body>
<h:form id="login" onsubmit="action='j_security_check';" prependId="false">
    <h:panelGrid columns="2">
        <p:outputLabel for="j_username" value="Username" />
        <p:inputText id="j_username" />
        <p:outputLabel for="j_password" value="Password" />
        <p:password id="j_password" />
        <p:commandButton id="submit" value="Login" ajax="false"/>
    </h:panelGrid>
</h:form>
</h:body>
</html>

Unfortunately, there is no display on my web browser. Can you tell me what is the reason?

Login page

Tiny
  • 27,221
  • 105
  • 339
  • 599
KamilJ
  • 249
  • 3
  • 5
  • 14
  • @Tiny A situation where prependId=false is useful is in the login form, if you are using JAAS/Spring Security, because the ids of the inputtexts have to be exactly "j_username" and "j_password". So you shouldn't put the form id before them, and using prependId=false is a good choice to acheive this. – KamilJ Feb 22 '15 at 13:50
  • @Tiny So in my case is good? – KamilJ Feb 22 '15 at 17:44

1 Answers1

0

I have changed url pattern in web.xml file:

from:

   <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*xhtml</url-pattern>
    </servlet-mapping>

to:

<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<welcome-file-list>
    <welcome-file>/faces/login.xhtml</welcome-file>
</welcome-file-list>

Now it works.

Marco Sulla
  • 15,299
  • 14
  • 65
  • 100
KamilJ
  • 249
  • 3
  • 5
  • 14