You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by dw...@apache.org on 2001/10/16 19:05:36 UTC

cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/logic MessagesPresentTag.java

dwinterfeldt    01/10/16 10:05:36

  Modified:    src/share/org/apache/struts/taglib/logic
                        MessagesPresentTag.java
  Log:
  Added a check that if the name field has Action.ERROR_KEY for a value it will use RequestUtil.getActionErrors to retrieve the object.
  
  Revision  Changes    Path
  1.2       +6 -1      jakarta-struts/src/share/org/apache/struts/taglib/logic/MessagesPresentTag.java
  
  Index: MessagesPresentTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/logic/MessagesPresentTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MessagesPresentTag.java	2001/10/16 15:52:12	1.1
  +++ MessagesPresentTag.java	2001/10/16 17:05:36	1.2
  @@ -130,7 +130,12 @@
           boolean bMessages = false;
   
           try {
  -            am = RequestUtils.getActionMessages(pageContext, name);
  +            // Definitely know it should be an error so 
  +            // use method to retrieve errors.
  +            if (Action.ERROR_KEY.equals(name))
  +               am = RequestUtils.getActionErrors(pageContext, name);
  +            else 
  +               am = RequestUtils.getActionMessages(pageContext, name);
           } catch(JspException e) {
               RequestUtils.saveException(pageContext, e);
               throw e;