FileDocCategorySizeDatePackage
ParamTagSupport.javaAPI DocGlassfish v2 API3200Sat May 05 19:17:54 BST 2007org.apache.taglibs.standard.tag.common.sql

ParamTagSupport

public abstract class ParamTagSupport extends javax.servlet.jsp.tagext.BodyTagSupport

Tag handler for <Param> in JSTL, used to set parameter values for a SQL statement.

author
Hans Bergsten

Fields Summary
protected Object
value
Constructors Summary
Methods Summary
public intdoEndTag()

	SQLExecutionTag parent = (SQLExecutionTag) 
	    findAncestorWithClass(this, SQLExecutionTag.class);
	if (parent == null) {
	    throw new JspTagException(
                Resources.getMessage("SQL_PARAM_OUTSIDE_PARENT"));
	}

	Object paramValue = null;
	if (value != null) {
	    paramValue = value;
	}
	else if (bodyContent != null) {
	    paramValue = bodyContent.getString().trim();
	    if (((String) paramValue).trim().length() == 0) {
		paramValue = null;
	    }
	}

	parent.addSQLParameter(paramValue);
	return EVAL_PAGE;