Hi all,

I'm working on making sure an application I've written works on Tomcat,
Resin and a few others, and I've come across a very interesting problem.

The application is working with tag libraries, and runs on Apache/Tomcat
4.1.12, and Resin 2.1.6.

My tag library is "IfSet".

In the _jspService() that Tomcat generates I get the following code snippet:

+++++
com.mycompany.tags.IfSet _jspx_th_dm_ifSet_0 = new
com.mycompany.tags.IfSet();
_jspx_th_dm_ifSet_0.setPageContext(pageContext);
_jspx_th_dm_ifSet_0.setParent(null);
_jspx_th_dm_ifSet_0.setName("myname");
java.lang.String value = null;

try {
        int _jspx_eval_dm_ifSet_0 = _jspx_th_dm_ifSet_0.doStartTag();
      value = (java.lang.String) pageContext.findAttribute("key1");
      if (_jspx_eval_dm_ifSet_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
        try {
                if (_jspx_eval_dm_ifSet_0 !=
javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
                              out = pageContext.pushBody();
  _jspx_th_dm_ifSet_0.setBodyContent((javax.servlet.jsp.tagext.BodyContent)
out);
                              _jspx_th_dm_ifSet_0.doInitBody();
++++++++++++

But resin produces this code snippet:

+++++++++++
com.caucho.jsp.QBodyContent _jsp_endTagHack0 = null;
      if (_jsp_tag0 == null) {
        _jsp_tag0 = new com.mycompany.tags.IfSet();
        _jsp_tag0.setPageContext(pageContext);
        _jsp_tag0.setParent((javax.servlet.jsp.tagext.Tag) null);
        _jsp_tag0.setName("myname");
      }

      int _jspEval1 = _jsp_tag0.doStartTag();
      if (_jspEval1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
        if (_jspEval1 ==
javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_BUFFERED) {
          out = pageContext.pushBody();
          _jsp_endTagHack0 = (com.caucho.jsp.QBodyContent) out;
          _jsp_tag0.setBodyContent(_jsp_endTagHack0);
        }
        value = (java.lang.String)pageContext.findAttribute("key1");

++++++++

All I'm doing in my html is calling <%pageContext.findAttribute("key1")%>,
and I'm getting an error that "value" isn't declared. For some reason Tomcat
will declare is using "java.lang.String value = null;" while Resin will not.
Also, Tomcat is initializing the tag library right away, with the statement 

com.mycompany.tags.IfSet _jspx_th_dm_ifSet_0 = new
com.mycompany.tags.IfSet();

but Resin instead uses 

com.mycompany.tags.IfSet _jsp_tag0 = null;

Is there some part of the spec Tomcat is implementing properly/differently?
Is it how I'm using my tag library?

Any help would be great, since this is in the servlet code generated, and
it's a bit hard to work backwards to figure out what my Tomcat is doing and
why.

Thanks!

-HK

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

Reply via email to