|
|
|
The suggested fix does solve this problem, but it creates a new one when trying to add a new user. When saving a new user, I now get the following error:
javax.faces.FacesException: javax.crypto.BadPaddingException: Given final block not properly padded at org.apache.myfaces.shared_impl.util.StateUtils.symmetric(StateUtils.java:373) at org.apache.myfaces.shared_impl.util.StateUtils.symmetric(StateUtils.java:411) at org.apache.myfaces.shared_impl.util.StateUtils.decrypt(StateUtils.java:291) at org.apache.myfaces.shared_impl.util.StateUtils.reconstruct(StateUtils.java:240) at org.apache.myfaces.renderkit.html.HtmlResponseStateManager.getSavedState(HtmlResponseStateManager.java:184) at org.apache.myfaces.renderkit.html.HtmlResponseStateManager.getState(HtmlResponseStateManager.java:136) at org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(JspStateManagerImpl.java:289) at org.ajax4jsf.framework.ajax.AjaxStateManager.restoreView(AjaxStateManager.java:76) at |
|||||||||||||||||||||||||||||||||||||||||||||||||||
1. Change all <h:inputField ... to <t:saveState
2. Roles need special treatment:
<c:otherwise>
<t:saveState value="#{userForm.userRoles}" />
<t:saveState value="#{userForm.user.roles}" />
<t:saveState value="#{userForm.user.enabled}" />
<t:saveState value="#{userForm.user.accountExpired}" />
<t:saveState value="#{userForm.user.accountLocked}" />
<t:saveState value="#{userForm.user.credentialsExpired}" />
<h:panelGroup>
<t:htmlTag value="strong">#{text['user.roles']}:</t:htmlTag>
<c:forEach var="role" items="#{userForm.userRoles}"
varStatus="status">
${role}<c:if test="${!status.last}">,</c:if>
</c:forEach>
</h:panelGroup>
<h:outputText />
<h:outputText />
</c:otherwise>
Now in that case in userForm.save():
getRequest().getParameterValues("userForm:userRoles") == null in:
setUserRoles(getRequest().getParameterValues("userForm:userRoles"));
But it doesnt matter since users roles are stored:
<t:saveState value="#{userForm.user.roles}" />