geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject cvs commit: incubator-geronimo/modules/console-web/src/java/org/apache/geronimo/console/web/taglib MBeanAttributesTag.java
Date Thu, 20 Nov 2003 07:43:51 GMT
janb        2003/11/19 23:43:51

  Modified:    modules/console-web/src/java/org/apache/geronimo/console/web/taglib
                        MBeanAttributesTag.java
  Log:
  Don't attempt to call getAttribute unless there is a getter for it (ie it is Readable).
There is not always going to be a getter for every setter.
  
  Revision  Changes    Path
  1.5       +18 -17    incubator-geronimo/modules/console-web/src/java/org/apache/geronimo/console/web/taglib/MBeanAttributesTag.java
  
  Index: MBeanAttributesTag.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/console-web/src/java/org/apache/geronimo/console/web/taglib/MBeanAttributesTag.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MBeanAttributesTag.java	22 Oct 2003 18:06:23 -0000	1.4
  +++ MBeanAttributesTag.java	20 Nov 2003 07:43:51 -0000	1.5
  @@ -242,24 +242,25 @@
                   attributeName = attributes[i].getName();
                   //value = attributes[i].toString();
   
  -                Object attrObj = server.getAttribute(name, attributeName);
  -                if ( attrObj == null ) {
  -                    continue;
  -                }
  -                value = attrObj.toString();
  +                if (attributes[i].isReadable()) {
  +                    Object attrObj = server.getAttribute(name, attributeName);
  +                    if ( attrObj == null ) {
  +                        continue;
  +                    }
  +                    value = attrObj.toString();
   
  -                if (i % 2 == 0) {
  -                    trClass = "one";
  -                } else if (i % 2 == 1) {
  -                    trClass = "two";
  -                }
  -                out.println("\t<tr class=\"" + trClass + "\">");
  -                out.println("\t\t<td class=\"name\">" + attributeName + "</td>");
  -                out.println("\t\t<td class=\"center\">=</td>");
  -                out.println("\t\t<td class=\"value\">" +
  +                    if (i % 2 == 0) {
  +                        trClass = "one";
  +                    } else if (i % 2 == 1) {
  +                        trClass = "two";
  +                    }
  +                    out.println("\t<tr class=\"" + trClass + "\">");
  +                    out.println("\t\t<td class=\"name\">" + attributeName + "</td>");
  +                    out.println("\t\t<td class=\"center\">=</td>");
  +                    out.println("\t\t<td class=\"value\">" +
                           URLDecoder.decode(value, "UTF-8") + "</td>");
  -                out.println("\t</tr>");
  -
  +                    out.println("\t</tr>");
  +                }
               }
           } catch (Exception e) {
               e.printStackTrace();
  @@ -273,4 +274,4 @@
           Collections.sort(list, comp);
           return list;
       }
  -}
  \ No newline at end of file
  +}
  
  
  

Mime
View raw message