Thread: [Ejtools-cvs] CVS: applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib C
Brought to you by:
letiemble
From: Laurent E. <let...@us...> - 2002-05-15 20:56:14
|
Update of /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib In directory usw-pr-cvs1:/tmp/cvs-serv10285/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib Modified Files: ConnectTag.java MBeanAttributeAccessTag.java MBeanAttributeClassTag.java MBeanAttributeEditorTag.java MBeanAttributeValueTag.java MBeanParameterClassTag.java Log Message: Add some JavaDocs Index: ConnectTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib/ConnectTag.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ConnectTag.java 25 Apr 2002 20:23:34 -0000 1.2 --- ConnectTag.java 15 May 2002 20:56:11 -0000 1.3 *************** *** 1,51 **** package net.sourceforge.ejtools.jmxbrowser.web.taglib; ! import java.io.*; ! import javax.servlet.http.*; ! import javax.servlet.jsp.*; ! import javax.servlet.jsp.tagext.*; ! import net.sourceforge.ejtools.jmxbrowser.web.*; /** ! * Description of the Class * ! * @author letiembl ! * @created 1 mars 2002 */ public class ConnectTag extends TagSupport { ! /** The key of the session-scope bean we look for. */ private String name = Constants.TREE; ! /** The page to which we should forward for the user to log on. */ private String page = "/connect.do"; /** ! * Setter for the name attribute * ! * @param name The new value for name attribute */ ! public void setName(String name) { ! this.name = name; } /** ! * Setter for the page attribute * ! * @param page The new value for page attribute */ ! public void setPage(String page) { ! this.page = page; } /** ! * Getter for the name attribute * ! * @return The value of name attribute */ public String getName() --- 1,85 ---- + /* + * EJTools, the Enterprise Java Tools + * + * Distributable under LGPL license. + * See terms of license at www.gnu.org. + */ package net.sourceforge.ejtools.jmxbrowser.web.taglib; ! import javax.servlet.http.HttpSession; ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! import net.sourceforge.ejtools.jmxbrowser.web.Constants; /** ! * Description of the Class * ! * @author letiemble ! * @created 1 mars 2002 ! * @todo Javadoc to complete */ public class ConnectTag extends TagSupport { ! /** The key of the application-scope bean we look for. */ private String name = Constants.TREE; ! /** The page to which we should forward for the user to log on. */ private String page = "/connect.do"; /** ! * Description of the Method * ! * @return Description of the Returned Value ! * @exception JspException Description of Exception */ ! public int doEndTag() throws JspException { ! boolean valid = false; ! ! HttpSession session = pageContext.getSession(); ! System.out.println("ConnectTag session " + session.getId()); ! ! if ((session != null) && (session.getAttribute(name) != null)) ! { ! valid = true; ! } ! ! // Forward control based on the results ! if (valid) ! { ! return (EVAL_PAGE); ! } ! else ! { ! try ! { ! pageContext.forward(page); ! } ! catch (Exception e) ! { ! throw new JspException(e.toString()); ! } ! return (SKIP_PAGE); ! } } /** ! * Description of the Method * ! * @return Description of the Returned Value ! * @exception JspException Description of Exception */ ! public int doStartTag() throws JspException { ! return (SKIP_BODY); } /** ! * Getter for the name attribute * ! * @return The value of name attribute */ public String getName() *************** *** 56,62 **** /** ! * Getter for the page attribute * ! * @return The value of page attribute */ public String getPage() --- 90,96 ---- /** ! * Getter for the page attribute * ! * @return The value of page attribute */ public String getPage() *************** *** 66,121 **** ! /** ! * Description of the Method ! * ! * @return Description of the Returned Value ! * @exception JspException Description of Exception ! */ ! public int doStartTag() throws JspException { ! return (SKIP_BODY); } /** ! * Description of the Method * ! * @return Description of the Returned Value ! * @exception JspException Description of Exception */ ! public int doEndTag() throws JspException { ! boolean valid = false; ! ! HttpSession session = pageContext.getSession(); ! System.out.println("ConnectTag session " + session.getId()); ! ! if ((session != null) && (session.getAttribute(name) != null)) ! valid = true; ! ! // Forward control based on the results ! if (valid) ! return (EVAL_PAGE); ! else ! { ! try ! { ! pageContext.forward(page); ! } ! catch (Exception e) ! { ! throw new JspException(e.toString()); ! } ! return (SKIP_PAGE); ! } } ! /** Description of the Method */ ! public void release() { ! super.release(); ! this.name = Constants.TREE; ! this.page = "/connect.do"; } } --- 100,131 ---- ! /** Description of the Method */ ! public void release() { ! super.release(); ! this.name = Constants.TREE; ! this.page = "/connect.do"; } /** ! * Setter for the name attribute * ! * @param name The new value for name attribute */ ! public void setName(String name) { ! this.name = name; } ! /** ! * Setter for the page attribute ! * ! * @param page The new value for page attribute ! */ ! public void setPage(String page) { ! this.page = page; } } Index: MBeanAttributeAccessTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib/MBeanAttributeAccessTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MBeanAttributeAccessTag.java 25 Apr 2002 20:20:44 -0000 1.1 --- MBeanAttributeAccessTag.java 15 May 2002 20:56:11 -0000 1.2 *************** *** 1,8 **** package net.sourceforge.ejtools.jmxbrowser.web.taglib; ! import javax.management.*; import javax.servlet.jsp.JspException; - import javax.servlet.jsp.PageContext; import javax.servlet.jsp.tagext.TagSupport; import org.apache.struts.util.MessageResources; import org.apache.struts.util.RequestUtils; --- 1,14 ---- + /* + * EJTools, the Enterprise Java Tools + * + * Distributable under LGPL license. + * See terms of license at www.gnu.org. + */ package net.sourceforge.ejtools.jmxbrowser.web.taglib; ! import javax.management.MBeanAttributeInfo; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.TagSupport; + import org.apache.struts.util.MessageResources; import org.apache.struts.util.RequestUtils; *************** *** 10,80 **** /** ! * Description of the Class * ! * @author letiembl ! * @created 25 avril 2002 */ public class MBeanAttributeAccessTag extends TagSupport { ! /** Description of the Field */ ! private static MessageResources messages = MessageResources.getMessageResources("MBeanAttributeInfoAccess"); ! /** Name of the bean that contains the data we will be rendering. */ ! protected String name = null; /** Should we ignore missing beans and simply output nothing? */ protected boolean ignore = false; ! /**Filter the rendered output for characters that are sensitive in HTML? */ ! protected boolean filter = true; /** The scope to be searched to retrieve the specified bean. */ protected String scope = null; /** ! * Setter for the name attribute * ! * @param name The new value for name attribute */ ! public void setName(String name) { - this.name = name; - } ! /** ! * Setter for the ignore attribute ! * ! * @param ignore The new value for ignore attribute ! */ ! public void setIgnore(boolean ignore) ! { ! this.ignore = ignore; } /** ! * Setter for the filter attribute * ! * @param filter The new value for filter attribute */ ! public void setFilter(boolean filter) { ! this.filter = filter; } /** ! * Setter for the scope attribute * ! * @param scope The new value for scope attribute */ ! public void setScope(String scope) { ! this.scope = scope; } /** ! * Getter for the name attribute * ! * @return The value of name attribute */ public String getName() --- 16,100 ---- /** ! * Description of the Class * ! * @author letiemble ! * @created 25 avril 2002 ! * @todo Javadoc to complete */ public class MBeanAttributeAccessTag extends TagSupport { ! /** Filter the rendered output for characters that are sensitive in HTML? */ ! protected boolean filter = true; /** Should we ignore missing beans and simply output nothing? */ protected boolean ignore = false; ! /** Name of the bean that contains the data we will be rendering. */ ! protected String name = null; /** The scope to be searched to retrieve the specified bean. */ protected String scope = null; + /** Description of the Field */ + private static MessageResources messages = MessageResources.getMessageResources("MBeanAttributeInfoAccess"); /** ! * Description of the Method * ! * @return Description of the Returned Value ! * @exception JspException Description of Exception */ ! public int doStartTag() throws JspException { + // Look up the requested bean (if necessary) + MBeanAttributeInfo info = (MBeanAttributeInfo) RequestUtils.lookup(pageContext, name, scope); + if (ignore) + { + if (info == null) + { + return (SKIP_BODY); + } + // Nothing to output + } ! String output = computeAccess(info); ! if (filter) ! { ! ResponseUtils.write(pageContext, ResponseUtils.filter(output)); ! } ! else ! { ! ResponseUtils.write(pageContext, output); ! } ! ! // Continue processing this page ! return (SKIP_BODY); } /** ! * Getter for the filter attribute * ! * @return The value of filter attribute */ ! public boolean getFilter() { ! return (this.filter); } /** ! * Getter for the ignore attribute * ! * @return The value of ignore attribute */ ! public boolean getIgnore() { ! return (this.ignore); } /** ! * Getter for the name attribute * ! * @return The value of name attribute */ public String getName() *************** *** 85,167 **** /** ! * Getter for the ignore attribute * ! * @return The value of ignore attribute */ ! public boolean getIgnore() { ! return (this.ignore); } /** ! * Getter for the filter attribute * ! * @return The value of filter attribute */ ! public boolean getFilter() { ! return (this.filter); } /** ! * Getter for the scope attribute * ! * @return The value of scope attribute */ ! public String getScope() { ! return (this.scope); } /** ! * Description of the Method * ! * @return Description of the Returned Value ! * @exception JspException Description of Exception */ ! public int doStartTag() throws JspException { ! ! // Look up the requested bean (if necessary) ! MBeanAttributeInfo info = (MBeanAttributeInfo) RequestUtils.lookup(pageContext, name, scope); ! if (ignore) ! { ! if (info == null) ! return (SKIP_BODY); ! // Nothing to output ! } ! ! String output = computeAccess(info); ! if (filter) ! ResponseUtils.write(pageContext, ResponseUtils.filter(output)); ! else ! ResponseUtils.write(pageContext, output); ! ! // Continue processing this page ! return (SKIP_BODY); } ! /** Release all allocated resources. */ ! public void release() { ! ! super.release(); ! filter = true; ! ignore = false; ! name = null; ! scope = null; ! } /** ! * Description of the Method * ! * @param info Description of Parameter ! * @return Description of the Returned Value */ protected String computeAccess(MBeanAttributeInfo info) --- 105,180 ---- /** ! * Getter for the scope attribute * ! * @return The value of scope attribute */ ! public String getScope() { ! return (this.scope); ! } ! ! ! /** Release all allocated resources. */ ! public void release() ! { ! ! super.release(); ! filter = true; ! ignore = false; ! name = null; ! scope = null; ! } /** ! * Setter for the filter attribute * ! * @param filter The new value for filter attribute */ ! public void setFilter(boolean filter) { ! this.filter = filter; } /** ! * Setter for the ignore attribute * ! * @param ignore The new value for ignore attribute */ ! public void setIgnore(boolean ignore) { ! this.ignore = ignore; } /** ! * Setter for the name attribute * ! * @param name The new value for name attribute */ ! public void setName(String name) { ! this.name = name; } ! /** ! * Setter for the scope attribute ! * ! * @param scope The new value for scope attribute ! */ ! public void setScope(String scope) { ! this.scope = scope; } /** ! * Description of the Method * ! * @param info Description of Parameter ! * @return Description of the Returned Value */ protected String computeAccess(MBeanAttributeInfo info) Index: MBeanAttributeClassTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib/MBeanAttributeClassTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MBeanAttributeClassTag.java 25 Apr 2002 20:20:44 -0000 1.1 --- MBeanAttributeClassTag.java 15 May 2002 20:56:11 -0000 1.2 *************** *** 1,27 **** package net.sourceforge.ejtools.jmxbrowser.web.taglib; ! import javax.management.*; import javax.servlet.jsp.JspException; - import javax.servlet.jsp.PageContext; import javax.servlet.jsp.tagext.TagSupport; import net.sourceforge.ejtools.util.ClassTools; ! import org.apache.struts.util.MessageResources; import org.apache.struts.util.RequestUtils; import org.apache.struts.util.ResponseUtils; /** ! * Description of the Class * ! * @author letiembl ! * @created 25 avril 2002 */ public class MBeanAttributeClassTag extends TagSupport { - /** Name of the bean that contains the data we will be rendering. */ - protected String name = null; - /** Should we ignore missing beans and simply output nothing? */ - protected boolean ignore = false; /** Filter the rendered output for characters that are sensitive in HTML? */ protected boolean filter = true; /** The scope to be searched to retrieve the specified bean. */ protected String scope = null; --- 1,34 ---- + /* + * EJTools, the Enterprise Java Tools + * + * Distributable under LGPL license. + * See terms of license at www.gnu.org. + */ package net.sourceforge.ejtools.jmxbrowser.web.taglib; ! import javax.management.MBeanAttributeInfo; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.TagSupport; + import net.sourceforge.ejtools.util.ClassTools; ! import org.apache.struts.util.RequestUtils; import org.apache.struts.util.ResponseUtils; /** ! * Description of the Class * ! * @author letiemble ! * @created 25 avril 2002 ! * @todo Javadoc to complete */ public class MBeanAttributeClassTag extends TagSupport { /** Filter the rendered output for characters that are sensitive in HTML? */ protected boolean filter = true; + /** Should we ignore missing beans and simply output nothing? */ + protected boolean ignore = false; + /** Name of the bean that contains the data we will be rendering. */ + protected String name = null; /** The scope to be searched to retrieve the specified bean. */ protected String scope = null; *************** *** 29,79 **** /** ! * Setter for the name attribute * ! * @param name The new value for name attribute */ ! public void setName(String name) { ! this.name = name; ! } ! /** ! * Setter for the ignore attribute ! * ! * @param ignore The new value for ignore attribute ! */ ! public void setIgnore(boolean ignore) ! { ! this.ignore = ignore; } /** ! * Setter for the filter attribute * ! * @param filter The new value for filter attribute */ ! public void setFilter(boolean filter) { ! this.filter = filter; } /** ! * Setter for the scope attribute * ! * @param scope The new value for scope attribute */ ! public void setScope(String scope) { ! this.scope = scope; } /** ! * Getter for the name attribute * ! * @return The value of name attribute */ public String getName() --- 36,98 ---- /** ! * Description of the Method * ! * @return Description of the Returned Value ! * @exception JspException Description of Exception */ ! public int doStartTag() throws JspException { ! // Look up the requested bean (if necessary) ! MBeanAttributeInfo info = (MBeanAttributeInfo) RequestUtils.lookup(pageContext, name, scope); ! if (ignore) ! { ! if (info == null) ! { ! return (SKIP_BODY); ! } ! // Nothing to output ! } + String output = ClassTools.classDisplay(info.getType()); + if (filter) + { + ResponseUtils.write(pageContext, ResponseUtils.filter(output)); + } + else + { + ResponseUtils.write(pageContext, output); + } ! // Continue processing this page ! return (SKIP_BODY); } /** ! * Getter for the filter attribute * ! * @return The value of filter attribute */ ! public boolean getFilter() { ! return (this.filter); } /** ! * Getter for the ignore attribute * ! * @return The value of ignore attribute */ ! public boolean getIgnore() { ! return (this.ignore); } /** ! * Getter for the name attribute * ! * @return The value of name attribute */ public String getName() *************** *** 84,155 **** /** ! * Getter for the ignore attribute * ! * @return The value of ignore attribute */ ! public boolean getIgnore() { ! return (this.ignore); } /** ! * Getter for the filter attribute * ! * @return The value of filter attribute */ ! public boolean getFilter() { ! return (this.filter); } /** ! * Getter for the scope attribute * ! * @return The value of scope attribute */ ! public String getScope() { ! return (this.scope); } /** ! * Description of the Method * ! * @return Description of the Returned Value ! * @exception JspException Description of Exception */ ! public int doStartTag() throws JspException { ! // Look up the requested bean (if necessary) ! MBeanAttributeInfo info = (MBeanAttributeInfo) RequestUtils.lookup(pageContext, name, scope); ! if (ignore) ! { ! if (info == null) ! return (SKIP_BODY); ! // Nothing to output ! } ! ! String output = ClassTools.classDisplay(info.getType()); ! if (filter) ! ResponseUtils.write(pageContext, ResponseUtils.filter(output)); ! else ! ResponseUtils.write(pageContext, output); ! ! // Continue processing this page ! return (SKIP_BODY); } ! /** Release all allocated resources. */ ! public void release() { ! super.release(); ! filter = true; ! ignore = false; ! name = null; ! scope = null; } } --- 103,168 ---- /** ! * Getter for the scope attribute * ! * @return The value of scope attribute */ ! public String getScope() { ! return (this.scope); ! } ! ! ! /** Release all allocated resources. */ ! public void release() ! { ! super.release(); ! filter = true; ! ignore = false; ! name = null; ! scope = null; } /** ! * Setter for the filter attribute * ! * @param filter The new value for filter attribute */ ! public void setFilter(boolean filter) { ! this.filter = filter; } /** ! * Setter for the ignore attribute * ! * @param ignore The new value for ignore attribute */ ! public void setIgnore(boolean ignore) { ! this.ignore = ignore; } /** ! * Setter for the name attribute * ! * @param name The new value for name attribute */ ! public void setName(String name) { ! this.name = name; } ! /** ! * Setter for the scope attribute ! * ! * @param scope The new value for scope attribute ! */ ! public void setScope(String scope) { ! this.scope = scope; } } Index: MBeanAttributeEditorTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib/MBeanAttributeEditorTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MBeanAttributeEditorTag.java 25 Apr 2002 20:20:44 -0000 1.1 --- MBeanAttributeEditorTag.java 15 May 2002 20:56:11 -0000 1.2 *************** *** 1,94 **** package net.sourceforge.ejtools.jmxbrowser.web.taglib; ! import java.beans.*; ! import javax.management.*; import javax.servlet.jsp.JspException; - import javax.servlet.jsp.PageContext; import javax.servlet.jsp.tagext.TagSupport; ! import net.sourceforge.ejtools.jmx.*; import net.sourceforge.ejtools.util.ClassTools; ! import org.apache.struts.util.MessageResources; import org.apache.struts.util.RequestUtils; import org.apache.struts.util.ResponseUtils; /** ! * Description of the Class * ! * @author letiembl ! * @created 25 avril 2002 */ public class MBeanAttributeEditorTag extends TagSupport { - /** Name of the bean that contains the data we will be rendering. */ - protected String name = null; - /** Should we ignore missing beans and simply output nothing? */ - protected boolean ignore = false; /** Filter the rendered output for characters that are sensitive in HTML? */ protected boolean filter = true; ! /** The scope to be searched to retrieve the specified bean. */ ! protected String scope = null; /** Name of the property to be accessed on the specified bean. */ protected String property = null; /** ! * Setter for the name attribute * ! * @param name The new value for name attribute */ ! public void setName(String name) { ! this.name = name; ! } ! /** ! * Setter for the property attribute ! * ! * @param property The new value for property attribute ! */ ! public void setProperty(String property) ! { ! this.property = property; } /** ! * Setter for the ignore attribute * ! * @param ignore The new value for ignore attribute */ ! public void setIgnore(boolean ignore) { ! this.ignore = ignore; } /** ! * Setter for the filter attribute * ! * @param filter The new value for filter attribute */ ! public void setFilter(boolean filter) { ! this.filter = filter; } /** ! * Setter for the scope attribute * ! * @param scope The new value for scope attribute */ ! public void setScope(String scope) { ! this.scope = scope; } /** ! * Getter for the property attribute * ! * @return The value of property attribute */ public String getProperty() --- 1,139 ---- + /* + * EJTools, the Enterprise Java Tools + * + * Distributable under LGPL license. + * See terms of license at www.gnu.org. + */ package net.sourceforge.ejtools.jmxbrowser.web.taglib; ! import java.beans.PropertyEditor; ! import java.beans.PropertyEditorManager; ! ! import javax.management.MBeanAttributeInfo; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.TagSupport; ! ! import net.sourceforge.ejtools.jmx.MBeanAccessor; import net.sourceforge.ejtools.util.ClassTools; ! import org.apache.struts.util.RequestUtils; import org.apache.struts.util.ResponseUtils; /** ! * Description of the Class * ! * @author letiemble ! * @created 25 avril 2002 ! * @todo Javadoc to complete */ public class MBeanAttributeEditorTag extends TagSupport { /** Filter the rendered output for characters that are sensitive in HTML? */ protected boolean filter = true; ! /** Should we ignore missing beans and simply output nothing? */ ! protected boolean ignore = false; ! /** Name of the bean that contains the data we will be rendering. */ ! protected String name = null; /** Name of the property to be accessed on the specified bean. */ protected String property = null; + /** The scope to be searched to retrieve the specified bean. */ + protected String scope = null; /** ! * Description of the Method * ! * @return Description of the Returned Value ! * @exception JspException Description of Exception */ ! public int doStartTag() throws JspException { ! // Look up the requested bean (if necessary) ! MBeanAccessor bean = (MBeanAccessor) RequestUtils.lookup(pageContext, name, scope); ! if (ignore) ! { ! if (bean == null) ! { ! return (SKIP_BODY); ! } ! // Nothing to output ! } + MBeanAttributeInfo info = (MBeanAttributeInfo) RequestUtils.lookup(pageContext, property, scope); ! PropertyEditor propertyeditor = null; ! Class c = ClassTools.getClass(info.getType()); ! ! if (c == null) ! { ! addUnsupportedProperty(info); ! } ! else ! { ! if (c.isArray()) ! { ! Class componentType = c.getComponentType(); ! propertyeditor = PropertyEditorManager.findEditor(componentType); ! ! if (propertyeditor == null) ! { ! propertyeditor = PropertyEditorManager.findEditor(String.class); ! } ! addArrayProperty(bean, propertyeditor, info); ! } ! else ! { ! propertyeditor = PropertyEditorManager.findEditor(c); ! ! if (propertyeditor == null) ! { ! propertyeditor = PropertyEditorManager.findEditor(String.class); ! } ! addProperty(bean, propertyeditor, info); ! } ! } ! ! // Continue processing this page ! return (SKIP_BODY); } /** ! * Getter for the filter attribute * ! * @return The value of filter attribute */ ! public boolean getFilter() { ! return (this.filter); } /** ! * Getter for the ignore attribute * ! * @return The value of ignore attribute */ ! public boolean getIgnore() { ! return (this.ignore); } /** ! * Getter for the name attribute * ! * @return The value of name attribute */ ! public String getName() { ! return (this.name); } /** ! * Getter for the property attribute * ! * @return The value of property attribute */ public String getProperty() *************** *** 99,219 **** /** ! * Getter for the name attribute * ! * @return The value of name attribute */ ! public String getName() { ! return (this.name); } /** ! * Getter for the ignore attribute * ! * @return The value of ignore attribute */ ! public boolean getIgnore() { ! return (this.ignore); } /** ! * Getter for the filter attribute * ! * @return The value of filter attribute */ ! public boolean getFilter() { ! return (this.filter); } /** ! * Getter for the scope attribute * ! * @return The value of scope attribute */ ! public String getScope() { ! return (this.scope); } /** ! * Description of the Method * ! * @return Description of the Returned Value ! * @exception JspException Description of Exception */ ! public int doStartTag() throws JspException { ! // Look up the requested bean (if necessary) ! MBeanAccessor bean = (MBeanAccessor) RequestUtils.lookup(pageContext, name, scope); ! if (ignore) ! { ! if (bean == null) ! return (SKIP_BODY); ! // Nothing to output ! } ! ! MBeanAttributeInfo info = (MBeanAttributeInfo) RequestUtils.lookup(pageContext, property, scope); ! ! PropertyEditor propertyeditor = null; ! Class c = ClassTools.getClass(info.getType()); ! ! if (c == null) ! { ! addUnsupportedProperty(info); ! } ! else ! { ! if (c.isArray()) ! { ! Class componentType = c.getComponentType(); ! propertyeditor = PropertyEditorManager.findEditor(componentType); ! ! if (propertyeditor == null) ! { ! propertyeditor = PropertyEditorManager.findEditor(String.class); ! } ! addArrayProperty(bean, propertyeditor, info); ! } ! else ! { ! propertyeditor = PropertyEditorManager.findEditor(c); ! ! if (propertyeditor == null) ! { ! propertyeditor = PropertyEditorManager.findEditor(String.class); ! } ! addProperty(bean, propertyeditor, info); ! } ! } ! ! // Continue processing this page ! return (SKIP_BODY); } ! /** Release all allocated resources. */ ! public void release() { ! super.release(); ! filter = true; ! ignore = false; ! name = null; ! scope = null; } /** ! * Adds a feature to the ArrayProperty attribute of the MBeanAttributeEditorTag object * ! * @param propertyeditor The feature to be added to the ArrayProperty attribute ! * @param attributeInfo The feature to be added to the ArrayProperty attribute ! * @param object The feature to be added to the ArrayProperty attribute ! * @exception JspException Description of Exception */ protected void addArrayProperty(MBeanAccessor object, PropertyEditor propertyeditor, MBeanAttributeInfo attributeInfo) throws JspException --- 144,234 ---- /** ! * Getter for the scope attribute * ! * @return The value of scope attribute */ ! public String getScope() { ! return (this.scope); ! } ! ! ! /** Release all allocated resources. */ ! public void release() ! { ! super.release(); ! filter = true; ! ignore = false; ! name = null; ! scope = null; } /** ! * Setter for the filter attribute * ! * @param filter The new value for filter attribute */ ! public void setFilter(boolean filter) { ! this.filter = filter; } /** ! * Setter for the ignore attribute * ! * @param ignore The new value for ignore attribute */ ! public void setIgnore(boolean ignore) { ! this.ignore = ignore; } /** ! * Setter for the name attribute * ! * @param name The new value for name attribute */ ! public void setName(String name) { ! this.name = name; } /** ! * Setter for the property attribute * ! * @param property The new value for property attribute */ ! public void setProperty(String property) { ! this.property = property; } ! /** ! * Setter for the scope attribute ! * ! * @param scope The new value for scope attribute ! */ ! public void setScope(String scope) { ! this.scope = scope; } /** ! * Adds a feature to the ArrayProperty attribute of the ! * MBeanAttributeEditorTag object * ! * @param propertyeditor The feature to be added to the ArrayProperty ! * attribute ! * @param attributeInfo The feature to be added to the ArrayProperty ! * attribute ! * @param object The feature to be added to the ArrayProperty ! * attribute ! * @exception JspException Description of Exception */ protected void addArrayProperty(MBeanAccessor object, PropertyEditor propertyeditor, MBeanAttributeInfo attributeInfo) throws JspException *************** *** 250,256 **** --- 265,275 ---- if (filter) + { ResponseUtils.write(pageContext, ResponseUtils.filter(output)); + } else + { ResponseUtils.write(pageContext, output); + } } catch (Exception _ex) *************** *** 262,271 **** /** ! * Adds a feature to the UnsupportedProperty attribute of the MBeanAttributeEditorTag object * ! * @param propertyeditor The feature to be added to the Property attribute ! * @param attributeInfo The feature to be added to the Property attribute ! * @param object The feature to be added to the Property attribute ! * @exception JspException Description of Exception */ protected void addProperty(MBeanAccessor object, PropertyEditor propertyeditor, MBeanAttributeInfo attributeInfo) throws JspException --- 281,291 ---- /** ! * Adds a feature to the UnsupportedProperty attribute of the ! * MBeanAttributeEditorTag object * ! * @param propertyeditor The feature to be added to the Property attribute ! * @param attributeInfo The feature to be added to the Property attribute ! * @param object The feature to be added to the Property attribute ! * @exception JspException Description of Exception */ protected void addProperty(MBeanAccessor object, PropertyEditor propertyeditor, MBeanAttributeInfo attributeInfo) throws JspException *************** *** 295,309 **** if (filter) ResponseUtils.write(pageContext, ResponseUtils.filter(output)); else ResponseUtils.write(pageContext, output); } /** ! * Adds a feature to the UnsupportedProperty attribute of the MBeanAttributeEditorTag object * ! * @param attributeInfo The feature to be added to the UnsupportedProperty attribute ! * @exception JspException Description of Exception */ protected void addUnsupportedProperty(MBeanAttributeInfo attributeInfo) throws JspException --- 315,335 ---- if (filter) + { ResponseUtils.write(pageContext, ResponseUtils.filter(output)); + } else + { ResponseUtils.write(pageContext, output); + } } /** ! * Adds a feature to the UnsupportedProperty attribute of the ! * MBeanAttributeEditorTag object * ! * @param attributeInfo The feature to be added to the ! * UnsupportedProperty attribute ! * @exception JspException Description of Exception */ protected void addUnsupportedProperty(MBeanAttributeInfo attributeInfo) throws JspException *************** *** 313,319 **** --- 339,349 ---- if (filter) + { ResponseUtils.write(pageContext, ResponseUtils.filter(output)); + } else + { ResponseUtils.write(pageContext, output); + } } Index: MBeanAttributeValueTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib/MBeanAttributeValueTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MBeanAttributeValueTag.java 25 Apr 2002 20:20:44 -0000 1.1 --- MBeanAttributeValueTag.java 15 May 2002 20:56:11 -0000 1.2 *************** *** 1,188 **** package net.sourceforge.ejtools.jmxbrowser.web.taglib; ! import javax.management.*; import javax.servlet.jsp.JspException; - import javax.servlet.jsp.PageContext; import javax.servlet.jsp.tagext.TagSupport; ! import net.sourceforge.ejtools.jmx.*; import org.apache.struts.util.RequestUtils; import org.apache.struts.util.ResponseUtils; /** ! * Description of the Class * ! * @author letiembl ! * @created 25 avril 2002 */ public class MBeanAttributeValueTag extends TagSupport { - /** Name of the bean that contains the data we will be rendering. */ - protected String name = null; - /** Should we ignore missing beans and simply output nothing? */ - protected boolean ignore = false; /** Filter the rendered output for characters that are sensitive in HTML? */ protected boolean filter = true; ! /** The scope to be searched to retrieve the specified bean. */ ! protected String scope = null; /** Name of the property to be accessed on the specified bean. */ protected String property = null; /** ! * Setter for the name attribute * ! * @param name The new value for name attribute */ ! public void setName(String name) { ! this.name = name; } /** ! * Setter for the ignore attribute * ! * @param ignore The new value for ignore attribute */ ! public void setIgnore(boolean ignore) { ! this.ignore = ignore; } /** ! * Setter for the filter attribute * ! * @param filter The new value for filter attribute */ ! public void setFilter(boolean filter) { ! this.filter = filter; } /** ! * Setter for the scope attribute * ! * @param scope The new value for scope attribute */ ! public void setScope(String scope) { ! this.scope = scope; } /** ! * Setter for the property attribute * ! * @param property The new value for property attribute */ ! public void setProperty(String property) { ! this.property = property; } /** ! * Getter for the name attribute * ! * @return The value of name attribute */ ! public String getName() { ! return (this.name); } ! /** ! * Getter for the ignore attribute ! * ! * @return The value of ignore attribute ! */ ! public boolean getIgnore() { ! return (this.ignore); } /** ! * Getter for the filter attribute * ! * @return The value of filter attribute */ ! public boolean getFilter() { ! return (this.filter); } /** ! * Getter for the scope attribute * ! * @return The value of scope attribute */ ! public String getScope() { ! return (this.scope); } /** ! * Getter for the property attribute * ! * @return The value of property attribute */ ! public String getProperty() { ! return (this.property); } /** ! * Description of the Method * ! * @return Description of the Returned Value ! * @exception JspException Description of Exception */ ! public int doStartTag() throws JspException { ! // Look up the requested bean (if necessary) ! MBeanAccessor bean = (MBeanAccessor) RequestUtils.lookup(pageContext, name, scope); ! if (ignore) ! { ! if (bean == null) ! return (SKIP_BODY); ! // Nothing to output ! } ! ! MBeanAttributeInfo info = (MBeanAttributeInfo) RequestUtils.lookup(pageContext, property, scope); ! String output = ""; ! ! if (info.isIs() || info.isReadable()) ! { ! System.out.println("Getting value for attribute " + info.getName()); ! output = "" + bean.getAttribute(bean.getObjectName(), info.getName()); ! } ! ! if (filter) ! ResponseUtils.write(pageContext, ResponseUtils.filter(output)); ! else ! ResponseUtils.write(pageContext, output); ! ! // Continue processing this page ! return (SKIP_BODY); } ! /** Release all allocated resources. */ ! public void release() { ! ! super.release(); ! filter = true; ! ignore = false; ! name = null; ! scope = null; ! } --- 1,202 ---- + /* + * EJTools, the Enterprise Java Tools + * + * Distributable under LGPL license. + * See terms of license at www.gnu.org. + */ package net.sourceforge.ejtools.jmxbrowser.web.taglib; ! import javax.management.MBeanAttributeInfo; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.TagSupport; ! ! import net.sourceforge.ejtools.jmx.MBeanAccessor; ! import org.apache.struts.util.RequestUtils; import org.apache.struts.util.ResponseUtils; /** ! * Description of the Class * ! * @author letiemble ! * @created 25 avril 2002 ! * @todo Javadoc to complete */ public class MBeanAttributeValueTag extends TagSupport { /** Filter the rendered output for characters that are sensitive in HTML? */ protected boolean filter = true; ! /** Should we ignore missing beans and simply output nothing? */ ! protected boolean ignore = false; ! /** Name of the bean that contains the data we will be rendering. */ ! protected String name = null; /** Name of the property to be accessed on the specified bean. */ protected String property = null; + /** The scope to be searched to retrieve the specified bean. */ + protected String scope = null; /** ! * Description of the Method * ! * @return Description of the Returned Value ! * @exception JspException Description of Exception */ ! public int doStartTag() throws JspException { ! // Look up the requested bean (if necessary) ! MBeanAccessor bean = (MBeanAccessor) RequestUtils.lookup(pageContext, name, scope); ! if (ignore) ! { ! if (bean == null) ! { ! return (SKIP_BODY); ! } ! // Nothing to output ! } ! ! MBeanAttributeInfo info = (MBeanAttributeInfo) RequestUtils.lookup(pageContext, property, scope); ! String output = ""; ! ! if (info.isIs() || info.isReadable()) ! { ! System.out.println("Getting value for attribute " + info.getName()); ! output = "" + bean.getAttribute(bean.getObjectName(), info.getName()); ! } ! ! if (filter) ! { ! ResponseUtils.write(pageContext, ResponseUtils.filter(output)); ! } ! else ! { ! ResponseUtils.write(pageContext, output); ! } ! ! // Continue processing this page ! return (SKIP_BODY); } /** ! * Getter for the filter attribute * ! * @return The value of filter attribute */ ! public boolean getFilter() { ! return (this.filter); } /** ! * Getter for the ignore attribute * ! * @return The value of ignore attribute */ ! public boolean getIgnore() { ! return (this.ignore); } /** ! * Getter for the name attribute * ! * @return The value of name attribute */ ! public String getName() { ! return (this.name); } /** ! * Getter for the property attribute * ! * @return The value of property attribute */ ! public String getProperty() { ! return (this.property); } /** ! * Getter for the scope attribute * ! * @return The value of scope attribute */ ! public String getScope() { ! return (this.scope); } ! /** Release all allocated resources. */ ! public void release() { ! ! super.release(); ! filter = true; ! ignore = false; ! name = null; ! scope = null; ! } /** ! * Setter for the filter attribute * ! * @param filter The new value for filter attribute */ ! public void setFilter(boolean filter) { ! this.filter = filter; } /** ! * Setter for the ignore attribute * ! * @param ignore The new value for ignore attribute */ ! public void setIgnore(boolean ignore) { ! this.ignore = ignore; } /** ! * Setter for the name attribute * ! * @param name The new value for name attribute */ ! public void setName(String name) { ! this.name = name; } /** ! * Setter for the property attribute * ! * @param property The new value for property attribute */ ! public void setProperty(String property) { ! this.property = property; } ! /** ! * Setter for the scope attribute ! * ! * @param scope The new value for scope attribute ! */ ! public void setScope(String scope) { ! this.scope = scope; } Index: MBeanParameterClassTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib/MBeanParameterClassTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MBeanParameterClassTag.java 25 Apr 2002 20:20:44 -0000 1.1 --- MBeanParameterClassTag.java 15 May 2002 20:56:11 -0000 1.2 *************** *** 1,36 **** package net.sourceforge.ejtools.jmxbrowser.web.taglib; ! import javax.management.*; import javax.servlet.jsp.JspException; - import javax.servlet.jsp.PageContext; import javax.servlet.jsp.tagext.TagSupport; import net.sourceforge.ejtools.util.ClassTools; ! import org.apache.struts.util.MessageResources; import org.apache.struts.util.RequestUtils; import org.apache.struts.util.ResponseUtils; /** ! * Description of the Class * ! * @author letiembl ! * @created 25 avril 2002 */ public class MBeanParameterClassTag extends TagSupport { ! /** Filter the rendered output for characters that are sensitive in HTML? */ protected boolean filter = true; ! /** Should we ignore missing beans and simply output nothing? */ protected boolean ignore = false; ! /** Name of the bean that contains the data we will be rendering. */ protected String name = null; ! /** The scope to be searched to retrieve the specified bean. */ protected String scope = null; /** ! * Description of the Method * ! * @return Description of the Returned Value ! * @exception JspException Description of Exception */ public int doStartTag() throws JspException --- 1,43 ---- + /* + * EJTools, the Enterprise Java Tools + * + * Distributable under LGPL license. + * See terms of license at www.gnu.org. + */ package net.sourceforge.ejtools.jmxbrowser.web.taglib; ! import javax.management.MBeanParameterInfo; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.TagSupport; + import net.sourceforge.ejtools.util.ClassTools; ! import org.apache.struts.util.RequestUtils; import org.apache.struts.util.ResponseUtils; /** ! * Description of the Class * ! * @author letiemble ! * @created 25 avril 2002 ! * @todo Javadoc to complete */ public class MBeanParameterClassTag extends TagSupport { ! /** Filter the rendered output for characters that are sensitive in HTML? */ protected boolean filter = true; ! /** Should we ignore missing beans and simply output nothing? */ protected boolean ignore = false; ! /** Name of the bean that contains the data we will be rendering. */ protected String name = null; ! /** The scope to be searched to retrieve the specified bean. */ protected String scope = null; /** ! * Description of the Method * ! * @return Description of the Returned Value ! * @exception JspException Description of Exception */ public int doStartTag() throws JspException *************** *** 63,69 **** /** ! * Getter for the filter attribute * ! * @return The value of filter attribute */ public boolean getFilter() --- 70,76 ---- /** ! * Getter for the filter attribute * ! * @return The value of filter attribute */ public boolean getFilter() *************** *** 74,80 **** /** ! * Getter for the ignore attribute * ! * @return The value of ignore attribute */ public boolean getIgnore() --- 81,87 ---- /** ! * Getter for the ignore attribute * ! * @return The value of ignore attribute */ public boolean getIgnore() *************** *** 85,91 **** /** ! * Getter for the name attribute * ! * @return The value of name attribute */ public String getName() --- 92,98 ---- /** ! * Getter for the name attribute * ! * @return The value of name attribute */ public String getName() *************** *** 96,102 **** /** ! * Getter for the scope attribute * ! * @return The value of scope attribute */ public String getScope() --- 103,109 ---- /** ! * Getter for the scope attribute * ! * @return The value of scope attribute */ public String getScope() *************** *** 106,110 **** ! /** Release all allocated resources. */ public void release() { --- 113,117 ---- ! /** Release all allocated resources. */ public void release() { *************** *** 118,124 **** /** ! * Setter for the filter attribute * ! * @param filter The new value for filter attribute */ public void setFilter(boolean filter) --- 125,131 ---- /** ! * Setter for the filter attribute * ! * @param filter The new value for filter attribute */ public void setFilter(boolean filter) *************** *** 129,135 **** /** ! * Setter for the ignore attribute * ! * @param ignore The new value for ignore attribute */ public void setIgnore(boolean ignore) --- 136,142 ---- /** ! * Setter for the ignore attribute * ! * @param ignore The new value for ignore attribute */ public void setIgnore(boolean ignore) *************** *** 140,146 **** /** ! * Setter for the name attribute * ! * @param name The new value for name attribute */ public void setName(String name) --- 147,153 ---- /** ! * Setter for the name attribute * ! * @param name The new value for name attribute */ public void setName(String name) *************** *** 151,157 **** /** ! * Setter for the scope attribute * ! * @param scope The new value for scope attribute */ public void setScope(String scope) --- 158,164 ---- /** ! * Setter for the scope attribute * ! * @param scope The new value for scope attribute */ public void setScope(String scope) |