[jboss-user] [JBoss Seam] - Seam mail does not restore FacesContext properly

dilator do-not-reply at jboss.com
Tue May 15 17:43:41 EDT 2007


I noticed that after rendering a Seam mail which failed (email address not entered), redirects - using Redirect.instance() - had the string 'null' stuck on the front of them.

It turns out to be two problems:

1) UIMessage does not call MailFacesContextImpl.stop() if an exception is thrown in UIMessage.renderChildren

Fix:


  |    @Override
  |    public void encodeChildren(FacesContext context) throws IOException
  |    {
  |        try {
  |            JSF.renderChildren(FacesContext.getCurrentInstance(), this);
  |        } catch (Exception e){
  |            MailFacesContextImpl.stop();
  |            throw new FacesException(e);
  |        }
  |    }
  | 

2) MailExternalContextImpl.getRequestContextPath can return null.  Further I don't understand the need for this to return anything other than the delegate's context path, as it doesn't appear to be used anywhere.

Anyhooo... the fix in (1) is all that is required to resume service as normal, mail can do what it likes as long as it gives me back my original FacesContext :)

Cheers - Ben

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4045961#4045961

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4045961



More information about the jboss-user mailing list