[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-1752) Imbalanced calls to MailFacesContextImpl.start(), MailFacesContextImpl.stop() possible
Michal Ruzicka (JIRA)
jira-events at lists.jboss.org
Thu Aug 2 10:30:49 EDT 2007
[ http://jira.jboss.com/jira/browse/JBSEAM-1752?page=comments#action_12370872 ]
Michal Ruzicka commented on JBSEAM-1752:
----------------------------------------
Verified, fixes my issue.
Thanks
> Imbalanced calls to MailFacesContextImpl.start(), MailFacesContextImpl.stop() possible
> --------------------------------------------------------------------------------------
>
> Key: JBSEAM-1752
> URL: http://jira.jboss.com/jira/browse/JBSEAM-1752
> Project: JBoss Seam
> Issue Type: Bug
> Components: Mail
> Affects Versions: 2.0.0.BETA1
> Environment: Windows XP; JBoss 4.2.1.GA
> Reporter: Michal Ruzicka
> Assigned To: Pete Muir
>
> MailFacesContextImpl.stop() is NOT called if there is an exception thrown during execution of UIMessage.encodeChildren() (this may happen for example if an invalid e-mail address is passed to the <m:to> tag).
> This leaves the MailFacesContextImpl as the current FacesContext with all sorts of negative consequences on rendering of the view that was being rendered before the rendering of the <m:message> started.
> The included patch solved the problem for me.
> WARNING: The patch was created without any in-depth knowledge of Seam functioning so please review CAREFULLY.
> diff -Naur jboss-seam-2.0.0.BETA1.orig/src/mail/org/jboss/seam/mail/ui/UIMessage.java jboss-seam-2.0.0.BETA1/src/mail/org/jboss/seam/mail/ui/UIMessage.java
> --- jboss-seam-2.0.0.BETA1.orig/src/mail/org/jboss/seam/mail/ui/UIMessage.java 2007-06-27 08:37:14.000000000 +0200
> +++ jboss-seam-2.0.0.BETA1/src/mail/org/jboss/seam/mail/ui/UIMessage.java 2007-08-01 22:20:08.000000000 +0200
> @@ -84,8 +84,6 @@
> @Override
> public void encodeBegin(FacesContext context) throws IOException
> {
> - MailFacesContextImpl.start(getUrlBase()
> - + context.getExternalContext().getRequestContextPath());
> mimeMessage = null;
> try
> {
> @@ -137,10 +135,6 @@
> {
> throw new FacesException(e.getMessage(), e);
> }
> - finally
> - {
> - MailFacesContextImpl.stop();
> - }
> }
>
> @Override
> @@ -152,7 +146,15 @@
> @Override
> public void encodeChildren(FacesContext context) throws IOException
> {
> - JSF.renderChildren(FacesContext.getCurrentInstance(), this);
> + MailFacesContextImpl.start(getUrlBase()
> + + context.getExternalContext().getRequestContextPath());
> + try {
> + JSF.renderChildren(FacesContext.getCurrentInstance(), this);
> + }
> + finally
> + {
> + MailFacesContextImpl.stop();
> + }
> }
>
> public String getImportance()
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the seam-issues
mailing list