You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by dg...@apache.org on 2003/09/22 03:39:19 UTC

cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html MessagesTag.java

dgraham     2003/09/21 18:39:19

  Modified:    src/share/org/apache/struts/taglib/html MessagesTag.java
  Log:
  doAfterBody() treats missing message keys the same as
  doStartTag().  If the message is null, it's removed from the
  PageContext, else it's set as usual.  This finishes the fix
  for PR# 23005.
  
  Revision  Changes    Path
  1.24      +12 -8     jakarta-struts/src/share/org/apache/struts/taglib/html/MessagesTag.java
  
  Index: MessagesTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/MessagesTag.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- MessagesTag.java	9 Sep 2003 03:55:35 -0000	1.23
  +++ MessagesTag.java	22 Sep 2003 01:39:19 -0000	1.24
  @@ -252,10 +252,10 @@
                   report.getKey(),
                   report.getValues());
   
  -        if (msg != null) {
  -            pageContext.setAttribute(id, msg);
  -        } else {
  +        if (msg == null) {
               pageContext.removeAttribute(id);
  +        } else {
  +            pageContext.setAttribute(id, msg);
           }
   
           if (header != null && header.length() > 0) {
  @@ -298,7 +298,11 @@
                       report.getKey(),
                       report.getValues());
   
  -           pageContext.setAttribute(id, msg);
  +           if (msg == null) {
  +               pageContext.removeAttribute(id);
  +           } else {
  +               pageContext.setAttribute(id, msg);
  +           }
   
              return (EVAL_BODY_TAG);
           } else {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org