0

I have this in my web.xml:

<login-config>
        <auth-method>FORM</auth-method>
        <form-login-config>
            <form-login-page>/login_page.xhtml</form-login-page>
        </form-login-config>
</login-config>

login_page.xhtml has some jsf code that is not rendering when jboss redirect to him.

How can i use jsf instead html pages inside <form-login-page> ?

Aurélio Antonio
  • 166
  • 1
  • 3
  • 13

2 Answers2

1

The JSF works are done by the FacesServlet.

You need to make sure that the URL matches the <url-pattern> of the FacesServlet. Given your problem, it seems that you don't have it mapped on the simple URL pattern of *.xhtml, but on something else, like *.jsf, *.faces or /faces/*. You should then change the URL in such way that it matches exactly that URL pattern.

Imagine that it's *.jsf, then you need to change it as such:

<form-login-page>/login_page.jsf</form-login-page>

However, easier is to just map the FacesServlet on *.xhtml. This way you never need to fiddle with virtual URLs.

<url-pattern>*.xhtml</url-pattern>

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
0

easy just use form-error-page tag:

<login-config>
    <auth-method>FORM</auth-method>
    <form-login-config>
        <form-login-page>/faces/yourlogin.jsp</form-login-page>
        <form-error-page>/faces/yourloginError.jsp</form-error-page>
    </form-login-config>
</login-config>
grepit
  • 21,260
  • 6
  • 105
  • 81