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=8484>.
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=8484

bean:define throws if both value AND content are set, but not if none are set

           Summary: bean:define throws if both value AND content are set,
                    but not if none are set
           Product: Struts
           Version: Nightly Build
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Custom Tags
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


The code (and documentation) for the "bean:define" tag says that you can't set
the "value" attribute and have body content, or you'll get a JspException.

However, if NEITHER the "value" attribute or the body content is set, it gets a
NPE in the following block of code in DefineTag.doEndTag().  What's worse is
that  this stack trace information is lost when the exception is finally
reported (it says it happened in "ForwardTag").  The only information I get is
that I got an NPE.  The only way to find these mistakes is to debug the
application in the debugger, and single-stepping once the Forward is done.

       if (value == null) {
            value = bodyContent.getString();
            if (value != null) {
                value = ((String) value).trim();
            }
        }

Any tag that has constraints like this should be checked to ensure that at least
one of the values are set.

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

Reply via email to