Hi,

I have this question:
I am intercepting a JSF Bean 's action method (to apply method-based security) with Spring.

In it I do this (test code, hance the hard coding of a few vars) in Spring's invoke() method of the interceptor:

...
getFacesContext().addMessage("usersForm:errors", new FacesMessage ("Security Error!")); // add msg to comp with clint ID "errors" in form "usersForm"
Iterator it3 = getFacesContext().getMessages("usersForm:errors");
while(it3.hasNext()){ logger.info("This is a msg of errors: " + ((FacesMessage)it3.next()).getSummary());}
                                
UIMessages errComp = (UIMessages)rootview.findComponent ("usersForm:errors");
if(errComp == null)logger.info("errComp is null!");
errComp.decode(getFacesContext());                                              
                // apply values to this comp
getFacesContext().getViewRoot().processUpdates(getFacesContext ()); // force recursive (?) master refresh
...
return null; (to force JSF to stay on teh same page - this works fine. (if I call "return inv.proceed();" it just continues of course))
Observations:
- "This is a msg of errors: " actually prints out the error msg again, in my Eclipse console, so the error msg WAS effectively added to the component.
- "errComp is null" is never printed.
- As the msg wasn't shown in the page, I added the 2nd paragraph, hoping to force an updated rendering this way.

--> What is strange: the actual error message, is NEVER shown.

& In the page ,I have:
...
 <t:messages id="errors" globalOnly="true" styleClass="error" />
 </h:form>
...

Any ideas as to what I'm doing wrong/how to force this component being rendered after all?

Thx guys,
Wolf

Reply via email to