Some implementations of pageContext do not allow null values in the page
context (and other contexts as well).
There is a remove method that is supposed to be used for those situations.
Here is a fixed doStart method for DefineTag.

public int doStartTag() throws JspException {

        // Retrieve the required property value
        Object value = this.value;
        if (value == null)
            value = RequestUtils.lookup(pageContext, name, property,
scope);

        // Expose this value as a scripting variable
        int inScope = PageContext.PAGE_SCOPE;
        if ("request".equals(toScope))
            inScope = PageContext.REQUEST_SCOPE;
        else if ("session".equals(toScope))
            inScope = PageContext.SESSION_SCOPE;
        else if ("application".equals(toScope))
            inScope = PageContext.APPLICATION_SCOPE;
     if( value==null )
          pageContext.removeAttribute(id, inScope);
     else
          pageContext.setAttribute(id, value, inScope);
        return (SKIP_BODY);

    }

Bill Wallace

(585) 214-8872
Fax: (585) 295-4718
Element K
'the knowledge catalyst'
www.elementk.com


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to