Re: JSF Spring security

Splash Forums PrettyFaces Users JSF Spring security Re: JSF Spring security


Hi Lincoln,

I am using MyFaces 2.1. I think I need to be more specific here.

In my xhtml, I put

<h:inputText id=”j_username” value=”#{userLoginFormBean.username}” required=”true” requiredMessage=”#{msg}” styleClass=”mrk-block” />

In the rendered html,

<input id=”j_id226006277_3a835164:j_id2014540464_3a8351c1:j_id2019806575_72a3b75_1:j_username” name=”j_id226006277_3a835164:j_id2014540464_3a8351c1:j_id2019806575_72a3b75_1:j_username” type=”text” value=”” />

I noticed that the name attribute is prepended with some generated values. Spring Security is not able to get any value by doing request.getParameter(“j_username”) because the name of the parameter is “j_id226006277_3a835164:j_id2014540464_3a8351c1:j_id2019806575_72a3b75_1:j_username” .

After debugging into the code and testing with different senarios, I found out that the if the input field is placed inside a NamingContainer, it will always prepend the values to the id. The value of the prepended id is actually the id of the parental namingContainers.

This actually bothers me a lot.