DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13064>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13064

NullPointerException in Option tag

           Summary: NullPointerException in Option tag
           Product: Struts
           Version: 1.0.2 Final
          Platform: Sun
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Custom Tags
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


<html:option key="key" value="value"/>
  throws NullPointerException if tag has no body ( bodyContent is null )

  Workaround:
  <html:option key="key" value="value"></html:option>

 this problem exists on resin app server(possible resin bug, I am not sure).
 but single "if" statement can help :

public int doAfterBody() throws JspException {
      if(bodyContent != null){     
        String text = bodyContent.getString();
        if (text != null) {
            text = text.trim();
            if (text.length() > 0)
                this.text = text;
        }
       }  
        return (SKIP_BODY);

    }

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

Reply via email to