[Ejtools-cvs] libraries/taglib/src/main/org/ejtools/servlet/http/jsp/tagext package.html,NONE,1.1 Ch
Brought to you by:
letiemble
Update of /cvsroot/ejtools/libraries/taglib/src/main/org/ejtools/servlet/http/jsp/tagext In directory sc8-pr-cvs1:/tmp/cvs-serv18305/taglib/src/main/org/ejtools/servlet/http/jsp/tagext Modified Files: CheckBoxObjectTag.java HiddenObjectTag.java ObjectClassTag.java RequestParameterTag.java Added Files: package.html Log Message: Add more javadocs. Add package.html files. --- NEW FILE: package.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!-- EJTools, the Enterprise Java Tools Distributable under LGPL license. See terms of license at www.gnu.org. $Revision: 1.1 $ --> <html> <head/> <body> Provides generic purpose JSP tags. </body> </html> Index: CheckBoxObjectTag.java =================================================================== RCS file: /cvsroot/ejtools/libraries/taglib/src/main/org/ejtools/servlet/http/jsp/tagext/CheckBoxObjectTag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CheckBoxObjectTag.java 15 Sep 2003 21:58:25 -0000 1.3 --- CheckBoxObjectTag.java 13 Dec 2003 21:24:50 -0000 1.4 *************** *** 14,43 **** /** ! * Description of the Class * * @author Laurent Etiemble * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="checkbox" body-content="empty" */ public class CheckBoxObjectTag extends TagSupport { ! /** Description of the Field */ protected String id = null; ! /** Description of the Field */ protected String name = null; ! /** Description of the Field */ protected String property = null; ! /** Description of the Field */ protected String scope = null; ! /** Description of the Field */ protected String value = "true"; /** ! * Description of the Method * ! * @return Description of the Returned Value ! * @exception JspException Description of Exception */ public int doStartTag() --- 14,50 ---- /** ! * Tag that generates an HTML checkbox input field ! * <p> ! * The field is created with :<ul> ! * <li>The <code>id</code> parameter : used as the name</li> ! * <li>The <code>name</code>,<code>property</code> and <code>scope</code> parameter : used to fetch an object. This object is then used as the value</li> ! * <li>The <code>value</code> parameter : used to check/uncheck the field</li> ! * </ul> ! * </p> * * @author Laurent Etiemble * @version $Revision$ ! * @jsp:tag name="checkbox" ! * body-content="empty" */ public class CheckBoxObjectTag extends TagSupport { ! /** Id property of the tag */ protected String id = null; ! /** Name property of the tag */ protected String name = null; ! /** Property property of the tag */ protected String property = null; ! /** Scope property of the tag */ protected String scope = null; ! /** Value property of the tag */ protected String value = "true"; /** ! * Executed when the start tag is encountered * ! * @return An int value to resume or not the processing ! * @exception JspException In case of problem */ public int doStartTag() *************** *** 49,67 **** if (property != null) { ! object = RequestUtils.lookup(pageContext, name, property, scope); } else { ! object = RequestUtils.lookup(pageContext, name, scope); } if (object == null) { ! throw new JspException("Unable to find bean " + name + " or its property " + property); } StringBuffer output = new StringBuffer(); output.append("<input type=\"checkbox\" name=\""); ! output.append(id); output.append("\""); if (Boolean.valueOf(object.toString()).booleanValue()) --- 56,75 ---- if (property != null) { ! object = RequestUtils.lookup(pageContext, this.name, this.property, this.scope); } else { ! object = RequestUtils.lookup(pageContext, this.name, this.scope); } if (object == null) { ! throw new JspException("Unable to find bean " + this.name + " or its property " + this.property); } + // Output the field StringBuffer output = new StringBuffer(); output.append("<input type=\"checkbox\" name=\""); ! output.append(this.id); output.append("\""); if (Boolean.valueOf(object.toString()).booleanValue()) *************** *** 70,74 **** } output.append(" value=\""); ! output.append(ResponseUtils.filter(value.toString())); output.append("\"/>"); --- 78,82 ---- } output.append(" value=\""); ! output.append(ResponseUtils.filter(this.value.toString())); output.append("\"/>"); *************** *** 81,136 **** /** ! * Gets the id attribute of the HiddenObjectTag object * * @return The id value ! * @jsp:attribute name="id" required="true" rtexprvalue="true" */ public String getId() { ! return (this.id); } /** ! * Getter for the name attribute * ! * @return The value of name attribute ! * @jsp:attribute name="name" required="true" rtexprvalue="true" */ public String getName() { ! return (this.name); } /** ! * Gets the property attribute of the HiddenObjectTag object * * @return The property value ! * @jsp:attribute name="property" required="false" rtexprvalue="true" */ public String getProperty() { ! return (this.property); } /** ! * Getter for the scope attribute * ! * @return The value of scope attribute ! * @jsp:attribute name="scope" required="false" rtexprvalue="true" */ public String getScope() { ! return (this.scope); } /** ! * Gets the value attribute of the CheckBoxObjectTag object * * @return The value value ! * @jsp:attribute name="value" required="false" rtexprvalue="true" */ public String getValue() --- 89,154 ---- /** ! * Gets the id value of this tag * * @return The id value ! * @jsp:attribute name="id" ! * required="true" ! * rtexprvalue="true" */ public String getId() { ! return this.id; } /** ! * Gets the name value of this tag * ! * @return The name value ! * @jsp:attribute name="name" ! * required="true" ! * rtexprvalue="true" */ public String getName() { ! return this.name; } /** ! * Gets the property value of this tag * * @return The property value ! * @jsp:attribute name="property" ! * required="false" ! * rtexprvalue="true" */ public String getProperty() { ! return this.property; } /** ! * Gets the scope value of this tag * ! * @return The scope value ! * @jsp:attribute name="scope" ! * required="false" ! * rtexprvalue="true" */ public String getScope() { ! return this.scope; } /** ! * Gets the value value of this tag * * @return The value value ! * @jsp:attribute name="value" ! * required="false" ! * rtexprvalue="true" */ public String getValue() *************** *** 144,157 **** { super.release(); ! id = null; ! name = null; ! property = null; ! scope = null; ! value = "true"; } /** ! * Sets the id attribute of the HiddenObjectTag object * * @param id The new id value --- 162,175 ---- { super.release(); ! this.id = null; ! this.name = null; ! this.property = null; ! this.scope = null; ! this.value = "true"; } /** ! * Sets the id value of this tag * * @param id The new id value *************** *** 164,170 **** /** ! * Setter for the name attribute * ! * @param name The new value for name attribute */ public void setName(String name) --- 182,188 ---- /** ! * Sets the name value of this tag * ! * @param name The new name value */ public void setName(String name) *************** *** 175,179 **** /** ! * Sets the property attribute of the HiddenObjectTag object * * @param property The new property value --- 193,197 ---- /** ! * Sets the property value of this tag * * @param property The new property value *************** *** 186,192 **** /** ! * Setter for the scope attribute * ! * @param scope The new value for scope attribute */ public void setScope(String scope) --- 204,210 ---- /** ! * Sets the scope value of this tag * ! * @param scope The new scope value */ public void setScope(String scope) *************** *** 197,201 **** /** ! * Sets the value attribute of the CheckBoxObjectTag object * * @param value The new value value --- 215,219 ---- /** ! * Sets the value value of this tag * * @param value The new value value *************** *** 205,209 **** this.value = value; } - } --- 223,226 ---- Index: HiddenObjectTag.java =================================================================== RCS file: /cvsroot/ejtools/libraries/taglib/src/main/org/ejtools/servlet/http/jsp/tagext/HiddenObjectTag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** HiddenObjectTag.java 15 Sep 2003 21:58:25 -0000 1.3 --- HiddenObjectTag.java 13 Dec 2003 21:24:50 -0000 1.4 *************** *** 14,41 **** /** ! * Description of the Class * * @author Laurent Etiemble * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="hidden" body-content="empty" */ public class HiddenObjectTag extends TagSupport { ! /** Description of the Field */ protected String id = null; ! /** Description of the Field */ protected String name = null; ! /** Description of the Field */ protected String property = null; ! /** Description of the Field */ protected String scope = null; /** ! * Description of the Method * ! * @return Description of the Returned Value ! * @exception JspException Description of Exception */ public int doStartTag() --- 14,47 ---- /** ! * Tag that generates an HTML hidden input field ! * <p> ! * The field is created with :<ul> ! * <li>The <code>id</code> parameter : used as the name</li> ! * <li>The <code>name</code>,<code>property</code> and <code>scope</code> parameter : used to fetch an object. This object is then used as the value</li> ! * </ul> ! * </p> * * @author Laurent Etiemble * @version $Revision$ ! * @jsp:tag name="hidden" ! * body-content="empty" */ public class HiddenObjectTag extends TagSupport { ! /** Id property of the tag */ protected String id = null; ! /** Name property of the tag */ protected String name = null; ! /** Property property of the tag */ protected String property = null; ! /** Scope property of the tag */ protected String scope = null; /** ! * Executed when the start tag is encountered * ! * @return An int value to resume or not the processing ! * @exception JspException In case of problem */ public int doStartTag() *************** *** 47,65 **** if (property != null) { ! object = RequestUtils.lookup(pageContext, name, property, scope); } else { ! object = RequestUtils.lookup(pageContext, name, scope); } if (object == null) { ! throw new JspException("Unable to find bean " + name + " or its property " + property); } StringBuffer output = new StringBuffer(); output.append("<input type=\"hidden\" name=\""); ! output.append(id); output.append("\" value=\""); output.append(ResponseUtils.filter(object.toString())); --- 53,72 ---- if (property != null) { ! object = RequestUtils.lookup(pageContext, this.name, this.property, this.scope); } else { ! object = RequestUtils.lookup(pageContext, this.name, this.scope); } if (object == null) { ! throw new JspException("Unable to find bean " + this.name + " or its property " + this.property); } + // Output the field StringBuffer output = new StringBuffer(); output.append("<input type=\"hidden\" name=\""); ! output.append(this.id); output.append("\" value=\""); output.append(ResponseUtils.filter(object.toString())); *************** *** 74,121 **** /** ! * Gets the id attribute of the HiddenObjectTag object * * @return The id value ! * @jsp:attribute name="id" required="true" rtexprvalue="true" */ public String getId() { ! return (this.id); } /** ! * Getter for the name attribute * ! * @return The value of name attribute ! * @jsp:attribute name="name" required="true" rtexprvalue="true" */ public String getName() { ! return (this.name); } /** ! * Gets the property attribute of the HiddenObjectTag object * * @return The property value ! * @jsp:attribute name="property" required="false" rtexprvalue="true" */ public String getProperty() { ! return (this.property); } /** ! * Getter for the scope attribute * ! * @return The value of scope attribute ! * @jsp:attribute name="scope" required="false" rtexprvalue="true" */ public String getScope() { ! return (this.scope); } --- 81,136 ---- /** ! * Gets the id value of this tag * * @return The id value ! * @jsp:attribute name="id" ! * required="true" ! * rtexprvalue="true" */ public String getId() { ! return this.id; } /** ! * Gets the name value of this tag * ! * @return The name value ! * @jsp:attribute name="name" ! * required="true" ! * rtexprvalue="true" */ public String getName() { ! return this.name; } /** ! * Gets the property value of this tag * * @return The property value ! * @jsp:attribute name="property" ! * required="false" ! * rtexprvalue="true" */ public String getProperty() { ! return this.property; } /** ! * Gets the scope value of this tag * ! * @return The scope value ! * @jsp:attribute name="scope" ! * required="false" ! * rtexprvalue="true" */ public String getScope() { ! return this.scope; } *************** *** 125,137 **** { super.release(); ! id = null; ! name = null; ! property = null; ! scope = null; } /** ! * Sets the id attribute of the HiddenObjectTag object * * @param id The new id value --- 140,152 ---- { super.release(); ! this.id = null; ! this.name = null; ! this.property = null; ! this.scope = null; } /** ! * Sets the id value of this tag * * @param id The new id value *************** *** 144,150 **** /** ! * Setter for the name attribute * ! * @param name The new value for name attribute */ public void setName(String name) --- 159,165 ---- /** ! * Sets the name value of this tag * ! * @param name The new name value */ public void setName(String name) *************** *** 155,159 **** /** ! * Sets the property attribute of the HiddenObjectTag object * * @param property The new property value --- 170,174 ---- /** ! * Sets the property value of this tag * * @param property The new property value *************** *** 166,172 **** /** ! * Setter for the scope attribute * ! * @param scope The new value for scope attribute */ public void setScope(String scope) --- 181,187 ---- /** ! * Sets the scope value of this tag * ! * @param scope The new scope value */ public void setScope(String scope) Index: ObjectClassTag.java =================================================================== RCS file: /cvsroot/ejtools/libraries/taglib/src/main/org/ejtools/servlet/http/jsp/tagext/ObjectClassTag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ObjectClassTag.java 15 Sep 2003 21:58:25 -0000 1.3 --- ObjectClassTag.java 13 Dec 2003 21:24:50 -0000 1.4 *************** *** 13,40 **** /** ! * Description of the Class * * @author Laurent Etiemble * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="className" body-content="empty" */ public class ObjectClassTag extends TagSupport { ! /** Description of the Field */ protected String id = null; ! /** Description of the Field */ protected String name = null; ! /** Description of the Field */ protected String property = null; ! /** Description of the Field */ protected String scope = null; /** ! * Description of the Method * ! * @return Description of the Returned Value ! * @exception JspException Description of Exception */ public int doStartTag() --- 13,46 ---- /** ! * Tag that put the object class in the page context ! * <p> ! * The object class is put in the context with :<ul> ! * <li>The <code>id</code> parameter : used as the identifier</li> ! * <li>The <code>name</code>,<code>property</code> and <code>scope</code> parameter : used to fetch an object. This object class it then computes</li> ! * </ul> ! * </p> * * @author Laurent Etiemble * @version $Revision$ ! * @jsp:tag name="className" ! * body-content="empty" */ public class ObjectClassTag extends TagSupport { ! /** Id property of the tag */ protected String id = null; ! /** Name property of the tag */ protected String name = null; ! /** Property property of the tag */ protected String property = null; ! /** Scope property of the tag */ protected String scope = null; /** ! * Executed when the start tag is encountered * ! * @return An int value to resume or not the processing ! * @exception JspException In case of problem */ public int doStartTag() *************** *** 46,63 **** if (property != null) { ! object = RequestUtils.lookup(pageContext, name, property, scope); } else { ! object = RequestUtils.lookup(pageContext, name, scope); } if (object == null) { ! throw new JspException("Unable to find bean " + name + " or its property " + property); } // Put the classname in the pagecontext ! pageContext.setAttribute(id, object.getClass().getName()); // Continue processing this page --- 52,69 ---- if (property != null) { ! object = RequestUtils.lookup(pageContext, this.name, this.property, this.scope); } else { ! object = RequestUtils.lookup(pageContext, this.name, this.scope); } if (object == null) { ! throw new JspException("Unable to find bean " + this.name + " or its property " + this.property); } // Put the classname in the pagecontext ! pageContext.setAttribute(this.id, object.getClass().getName()); // Continue processing this page *************** *** 67,114 **** /** ! * Gets the id attribute of the HiddenObjectTag object * * @return The id value ! * @jsp:attribute name="id" required="true" rtexprvalue="true" */ public String getId() { ! return (this.id); } /** ! * Getter for the name attribute * ! * @return The value of name attribute ! * @jsp:attribute name="name" required="true" rtexprvalue="true" */ public String getName() { ! return (this.name); } /** ! * Gets the property attribute of the HiddenObjectTag object * * @return The property value ! * @jsp:attribute name="property" required="false" rtexprvalue="true" */ public String getProperty() { ! return (this.property); } /** ! * Getter for the scope attribute * ! * @return The value of scope attribute ! * @jsp:attribute name="scope" required="false" rtexprvalue="true" */ public String getScope() { ! return (this.scope); } --- 73,128 ---- /** ! * Gets the id value of this tag * * @return The id value ! * @jsp:attribute name="id" ! * required="true" ! * rtexprvalue="true" */ public String getId() { ! return this.id; } /** ! * Gets the name value of this tag * ! * @return The name value ! * @jsp:attribute name="name" ! * required="true" ! * rtexprvalue="true" */ public String getName() { ! return this.name; } /** ! * Gets the property value of this tag * * @return The property value ! * @jsp:attribute name="property" ! * required="false" ! * rtexprvalue="true" */ public String getProperty() { ! return this.property; } /** ! * Gets the scope value of this tag * ! * @return The scope value ! * @jsp:attribute name="scope" ! * required="false" ! * rtexprvalue="true" */ public String getScope() { ! return this.scope; } *************** *** 118,130 **** { super.release(); ! id = null; ! name = null; ! property = null; ! scope = null; } /** ! * Sets the id attribute of the HiddenObjectTag object * * @param id The new id value --- 132,144 ---- { super.release(); ! this.id = null; ! this.name = null; ! this.property = null; ! this.scope = null; } /** ! * Sets the id value of this tag * * @param id The new id value *************** *** 137,143 **** /** ! * Setter for the name attribute * ! * @param name The new value for name attribute */ public void setName(String name) --- 151,157 ---- /** ! * Sets the name value of this tag * ! * @param name The new name value */ public void setName(String name) *************** *** 148,152 **** /** ! * Sets the property attribute of the HiddenObjectTag object * * @param property The new property value --- 162,166 ---- /** ! * Sets the property value of this tag * * @param property The new property value *************** *** 159,165 **** /** ! * Setter for the scope attribute * ! * @param scope The new value for scope attribute */ public void setScope(String scope) --- 173,179 ---- /** ! * Sets the scope value of this tag * ! * @param scope The new scope value */ public void setScope(String scope) Index: RequestParameterTag.java =================================================================== RCS file: /cvsroot/ejtools/libraries/taglib/src/main/org/ejtools/servlet/http/jsp/tagext/RequestParameterTag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RequestParameterTag.java 15 Sep 2003 21:58:25 -0000 1.3 --- RequestParameterTag.java 13 Dec 2003 21:24:50 -0000 1.4 *************** *** 13,40 **** /** ! * Description of the Class * * @author Laurent Etiemble * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="requestParameter" body-content="empty" */ public class RequestParameterTag extends TagSupport { ! /** Description of the Field */ protected String id = null; ! /** Description of the Field */ protected String name = null; ! /** Description of the Field */ protected String type = null; ! /** Description of the Field */ protected String value = null; /** ! * Description of the Method * ! * @return Description of the Returned Value ! * @exception JspException Description of Exception */ public int doStartTag() --- 13,48 ---- /** ! * Tag that put a request parameter in the page context ! * <p> ! * The request parameter is put in the context with :<ul> ! * <li>The <code>id</code> parameter : used as the identifier</li> ! * <li>The <code>name</code> parameter : used to fetch the request parameter</li> ! * <li>The <code>type</code> parameter : used to type the request parameter</li> ! * <li>The <code>value</code> parameter : used as a default value if the request parameter is not found</li> ! * </ul> ! * </p> * * @author Laurent Etiemble * @version $Revision$ ! * @jsp:tag name="requestParameter" ! * body-content="empty" */ public class RequestParameterTag extends TagSupport { ! /** Id property of the tag */ protected String id = null; ! /** Name property of the tag */ protected String name = null; ! /** Type property of the tag */ protected String type = null; ! /** Value property of the tag */ protected String value = null; /** ! * Executed when the start tag is encountered * ! * @return An int value to resume or not the processing ! * @exception JspException In case of problem */ public int doStartTag() *************** *** 43,61 **** String s = null; ! s = pageContext.getRequest().getParameter(name); ! if ((s == null) && (value == null)) { ! throw new JspException("Request parameter " + name + " not found and value is not provided"); } if (s == null) { ! s = value; } ! Object object = this.convert(s, type); // Put the value in the pagecontext ! pageContext.setAttribute(id, object); // Continue processing this page --- 51,69 ---- String s = null; ! s = pageContext.getRequest().getParameter(this.name); ! if ((s == null) && (this.value == null)) { ! throw new JspException("Request parameter " + this.name + " not found and value is not provided"); } if (s == null) { ! s = this.value; } ! Object object = this.convert(s, this.type); // Put the value in the pagecontext ! pageContext.setAttribute(this.id, object); // Continue processing this page *************** *** 65,112 **** /** ! * Gets the id attribute of the HiddenObjectTag object * * @return The id value ! * @jsp:attribute name="id" required="true" rtexprvalue="true" */ public String getId() { ! return (this.id); } /** ! * Getter for the name attribute * ! * @return The value of name attribute ! * @jsp:attribute name="name" required="true" rtexprvalue="true" */ public String getName() { ! return (this.name); } /** ! * Gets the property attribute of the HiddenObjectTag object * ! * @return The property value ! * @jsp:attribute name="type" required="false" rtexprvalue="true" */ public String getType() { ! return (this.type); } /** ! * Returns the value. * ! * @return String ! * @jsp:attribute name="value" required="false" rtexprvalue="true" */ public String getValue() { ! return value; } --- 73,128 ---- /** ! * Gets the id value of this tag * * @return The id value ! * @jsp:attribute name="id" ! * required="true" ! * rtexprvalue="true" */ public String getId() { ! return this.id; } /** ! * Gets the name value of this tag * ! * @return The name value ! * @jsp:attribute name="name" ! * required="true" ! * rtexprvalue="true" */ public String getName() { ! return this.name; } /** ! * Gets the type value of this tag * ! * @return The type value ! * @jsp:attribute name="type" ! * required="false" ! * rtexprvalue="true" */ public String getType() { ! return this.type; } /** ! * Gets the value value of this tag * ! * @return The value value ! * @jsp:attribute name="value" ! * required="false" ! * rtexprvalue="true" */ public String getValue() { ! return this.value; } *************** *** 116,127 **** { super.release(); ! id = null; ! name = null; ! type = null; } /** ! * Sets the id attribute of the HiddenObjectTag object * * @param id The new id value --- 132,144 ---- { super.release(); ! this.id = null; ! this.name = null; ! this.type = null; ! this.value = null; } /** ! * Sets the id value of this tag * * @param id The new id value *************** *** 134,140 **** /** ! * Setter for the name attribute * ! * @param name The new value for name attribute */ public void setName(String name) --- 151,157 ---- /** ! * Sets the name value of this tag * ! * @param name The new name value */ public void setName(String name) *************** *** 145,149 **** /** ! * Sets the property attribute of the HiddenObjectTag object * * @param type The new type value --- 162,166 ---- /** ! * Sets the type value of this tag * * @param type The new type value *************** *** 156,162 **** /** ! * Sets the value. * ! * @param value The value to set */ public void setValue(String value) --- 173,179 ---- /** ! * Sets the value value of this tag * ! * @param value The new value value */ public void setValue(String value) *************** *** 167,177 **** /** ! * Description of the Method * ! * @param s Description of the Parameter ! * @param type Description of the Parameter ! * @return Description of the Return Value */ ! private Object convert(String s, String type) { Class c = ClassTools.getClass(type); --- 184,194 ---- /** ! * Used to transform a string into a type object * ! * @param s The string representation of the object ! * @param type The type of the object ! * @return A type object */ ! protected Object convert(String s, String type) { Class c = ClassTools.getClass(type); |