I dont think <html:text> was designed to take a body - in the tld file for the <html:hidden> tag the body parameter is set to empty and they both extend the same parent class (BaseFieldTag).
 
BaseFieldTag is a child of BaseHandlerTag which extends BodyTagSupport and BaseFieldTag returns EVAL_BODY_TAG from its doStartTag() method - but I think this looks like a mistake because its not been written to process the body - I think it should really return SKIP_BODY.
 
My advice - dont put anything in the body.
 
Niall
 
-----Original Message-----
From: Nick Chalko [mailto:[EMAIL PROTECTED]]
Sent: 27 June 2001 19:53
To: [EMAIL PROTECTED]
Subject: null pointer error

My jsp page with  the following tag
<html:text property="username" size="20" maxlength="20" value="test"> inside
</html:txt>
 
generates the following java code (from VAJ 3.5.3)
         do {
                        // end
                        out.print(_jspx_html_data[4]);
                        // begin [file="C:\\login.jsp";from=(16,0);to=(16,69)]
                            /* ----  html:text ---- */
                            org.apache.struts.taglib.html.TextTag _jspx_th_html_text_1 = new org.apache.struts.taglib.html.TextTag();
                            _jspx_th_html_text_1.setPageContext(pageContext);
                            _jspx_th_html_text_1.setParent(_jspx_th_html_form_2);
                            JspRuntimeLibrary.introspecthelper(_jspx_th_html_text_1, "maxlength","20",null,null, false);
                            JspRuntimeLibrary.introspecthelper(_jspx_th_html_text_1, "property","username",null,null, false);
                            JspRuntimeLibrary.introspecthelper(_jspx_th_html_text_1, "size","20",null,null, false);
                            JspRuntimeLibrary.introspecthelper(_jspx_th_html_text_1, "value","test",null,null, false);
                            try {
                              int _jspx_eval_html_text_1 = _jspx_th_html_text_1.doStartTag();
                              if (_jspx_eval_html_text_1 == Tag.EVAL_BODY_INCLUDE)
                              throw new JspTagException("Since tag handler class org.apache.struts.taglib.html.TextTag implements BodyTag, it can't return Tag.EVAL_BODY_INCLUDE");
                          if (_jspx_eval_html_text_1 != Tag.SKIP_BODY) {
                              try {
                              if (_jspx_eval_html_text_1 != Tag.EVAL_BODY_INCLUDE) {
// the next nile sets out to null
                              out = pageContext.pushBody();
                              _jspx_th_html_text_1.setBodyContent((BodyContent) out);
                          }
                          _jspx_th_html_text_1.doInitBody();
                          do {
                          // end
                          out.print(_jspx_html_data[5]);
                          // begin [file="C:\\login.jsp";from=(25,0);to=(25,0)]
                          } while (_jspx_th_html_text_1.doAfterBody() == BodyTag.EVAL_BODY_TAG);
                      } finally {
                          if (_jspx_eval_html_text_1 != Tag.EVAL_BODY_INCLUDE)
                              out = pageContext.popBody();
                      }
                  }
                  if (_jspx_th_html_text_1.doEndTag() == Tag.SKIP_PAGE)
                      return;
              } finally {
                  _jspx_th_html_text_1.release();
              }
 
 
The proplem is  pageContext.pushBody() returns null which then fails the next time something is written to out.
Any ideas. 
 
R,
Nick

Reply via email to