I have implemented jsf form based authentication like the following:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
<div>My Application</div>
</h:head>
<h:body>
<form name="loginForm" method="POST" action="j_security_check">
<table>
<tr>
<td align="right"><strong>User name</strong></td>
<td><input type="text" name="j_username"/></td>
</tr>
<tr>
<td align="right"><strong>Password</strong></td>
<td><input type="password" size="25" name="j_password"/></td>
</tr>
<tr>
<td/><td/>
</tr>
<tr>
<td/>
<td><input type="submit" value="Submit"/></td>
</tr>
</table>
</form>
</h:body>
</html>
and it works fine. But when I'm tring to make labels to not be hard-coded but get loaded from resource bundle like this:
instead of this:
<td align="right"><strong>Password</strong></td>
having this:
<td align="right"><strong>#{uiBundle['password']}</strong></td>
it doesn't load the expected label. Note, it work's fine for all my other pages. I have registered the resource bundle in faces-config like the following:
<resource-bundle>
<base-name>bundles.UiBundle</base-name>
<var>uiBundle</var>
</resource-bundle>
Also, I tried to load it loaccaly by adding:
<f:loadBundle basename="bundles.UiBundle" var="uiBundle"/>
but it also didn't help. I wonder why it doesn't work for login page and what is the way for having label translations in login page.
Thanks in advance.