Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tomcat 5 Issue

Status
Not open for further replies.

mingus

Programmer
May 8, 2001
59
0
0
US
Hi!

I am trying to get Tomcat 5 to work with JSP tags
I have the a page that does this:

<mytags:tag1>
<mytags:tag2/>
</mytags>

It works in Tomcat 4. It doesn't in Tomcat 5. It I take out the nested tag, tag2, and put in text the things work. Tag1 is a conditional which does SKIP_BODY if the condition is not meet, else does EVAL_BODY_INCLUDE This is an issue with all such tags in Tomcat 5.

The message is in compling the JSP page which gives an error like this (swap in real names for tag1 & tag2):

c_jsp.java:98: _jspx_meth_core_setCookie_0(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext) in org.apache.jsp.c_jsp cannot be applied to (com.lemans.tags.conditional.IfRequestEqualsTag,javax.servlet.jsp.PageContext)

Appears to similar if not the same to:


But it claims the fixed it.

Any ideals?

mingus
 
Can you post the relevant code from the c_jsp.java (about 10 lines before line 98) which can be found in the TOMCAT_HOME/work/ directory ...

--------------------------------------------------
Free Database Connection Pooling Software
 
Here is routine that gets created. Error happens have the out.print (I marked with ERROR HAPPENS HERE)

private boolean _jspx_meth_core_ifRequestEquals_0(PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// core:ifRequestEquals
com.lemans.tags.conditional.IfRequestEqualsTag _jspx_th_core_ifRequestEquals_0 = (com.lemans.tags.conditional.IfRequestEqualsTag) _jspx_tagPool_core_ifRequestEquals_value_name.get(com.lemans.tags.conditional.IfRequestEqualsTag.class);
_jspx_th_core_ifRequestEquals_0.setPageContext(_jspx_page_context);
_jspx_th_core_ifRequestEquals_0.setParent(null);
_jspx_th_core_ifRequestEquals_0.setName("save");
_jspx_th_core_ifRequestEquals_0.setValue("no");
int _jspx_eval_core_ifRequestEquals_0 = _jspx_th_core_ifRequestEquals_0.doStartTag();
if (_jspx_eval_core_ifRequestEquals_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
out = _jspx_page_context.pushBody();
_jspx_th_core_ifRequestEquals_0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_core_ifRequestEquals_0.doInitBody();
}
do {
out.write('\n');
out.write(' ');

// ERROR HAPPENS HERE
if (_jspx_eval_core_ifRequestEquals_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
if (_jspx_meth_core_setCookie_0(_jspx_th_core_ifRequestEquals_0, _jspx_page_context))
return true;
out.write('\n');
int evalDoAfterBody = _jspx_th_core_ifRequestEquals_0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_core_ifRequestEquals_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
out = _jspx_page_context.popBody();
}
if (_jspx_th_core_ifRequestEquals_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
return true;
_jspx_tagPool_core_ifRequestEquals_value_name.reuse(_jspx_th_core_ifRequestEquals_0);
return false;
}

 
Can you also post the method signature of :
_jspx_meth_core_setCookie_0

and also the object type of :
_jspx_eval_core_ifRequestEquals_0

--------------------------------------------------
Free Database Connection Pooling Software
 
private boolean _jspx_meth_core_setCookie_0(javax.servlet.jsp.tagext.JspTag _jspx_th_core_ifRequestEquals_0, PageContext _jspx_page_context)

int _jspx_eval_core_ifRequestEquals_0 = _jspx_th_core_ifRequestEquals_0.doStartTag();
 
and what does :

_jspx_th_core_ifRequestEquals_0.doStartTag();

return ?

I think you can see where I'm going here, basically seeing if jasper has the method signatures incorrect (I think it has, but want to check the source).

--------------------------------------------------
Free Database Connection Pooling Software
 
Well I am not seeing that declared in the file... Here is the entire Java. Yea something isn't declared right. Trying to trace it myself but not finding it.

Thansk for any help.


import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;

public class c_jsp extends HttpJspBase {


private static java.util.Vector _jspx_includes;

private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_core_ifRequestEquals_value_name;
private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_core_setCookie_value_name_duration;

public c_jsp() {
_jspx_tagPool_core_ifRequestEquals_value_name = new org.apache.jasper.runtime.TagHandlerPool();
_jspx_tagPool_core_setCookie_value_name_duration = new org.apache.jasper.runtime.TagHandlerPool();
}

public java.util.List getIncludes() {
return _jspx_includes;
}

public void _jspDestroy() {
_jspx_tagPool_core_ifRequestEquals_value_name.release();
_jspx_tagPool_core_setCookie_value_name_duration.release();
}

public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {

JspFactory _jspxFactory = null;
javax.servlet.jsp.PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;


try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html;charset=ISO-8859-1");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;

out.write("\n\n");
if (_jspx_meth_core_ifRequestEquals_0(pageContext))
return;
out.write("\n\n");
} catch (Throwable t) {
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (pageContext != null) pageContext.handlePageException(t);
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
}
}

private boolean _jspx_meth_core_ifRequestEquals_0(javax.servlet.jsp.PageContext pageContext)
throws Throwable {
JspWriter out = pageContext.getOut();
/* ---- core:ifRequestEquals ---- */
com.lemans.tags.conditional.IfRequestEqualsTag _jspx_th_core_ifRequestEquals_0 = (com.lemans.tags.conditional.IfRequestEqualsTag) _jspx_tagPool_core_ifRequestEquals_value_name.get(com.lemans.tags.conditional.IfRequestEqualsTag.class);
_jspx_th_core_ifRequestEquals_0.setPageContext(pageContext);
_jspx_th_core_ifRequestEquals_0.setParent(null);
_jspx_th_core_ifRequestEquals_0.setName("save");
_jspx_th_core_ifRequestEquals_0.setValue("no");
int _jspx_eval_core_ifRequestEquals_0 = _jspx_th_core_ifRequestEquals_0.doStartTag();
if (_jspx_eval_core_ifRequestEquals_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_core_ifRequestEquals_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
javax.servlet.jsp.tagext.BodyContent _bc = pageContext.pushBody();
out = _bc;
_jspx_th_core_ifRequestEquals_0.setBodyContent(_bc);
_jspx_th_core_ifRequestEquals_0.doInitBody();
}
do {
out.write("\n\t");
if (_jspx_meth_core_setCookie_0(_jspx_th_core_ifRequestEquals_0, pageContext))
return true;
out.write("\n");
int evalDoAfterBody = _jspx_th_core_ifRequestEquals_0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_core_ifRequestEquals_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
out = pageContext.popBody();
}
if (_jspx_th_core_ifRequestEquals_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
return true;
_jspx_tagPool_core_ifRequestEquals_value_name.reuse(_jspx_th_core_ifRequestEquals_0);
return false;
}

private boolean _jspx_meth_core_setCookie_0(javax.servlet.jsp.tagext.Tag _jspx_th_core_ifRequestEquals_0, javax.servlet.jsp.PageContext pageContext)
throws Throwable {
JspWriter out = pageContext.getOut();
/* ---- core:setCookie ---- */
com.lemans.tags.general.SetCookieTag _jspx_th_core_setCookie_0 = (com.lemans.tags.general.SetCookieTag) _jspx_tagPool_core_setCookie_value_name_duration.get(com.lemans.tags.general.SetCookieTag.class);
_jspx_th_core_setCookie_0.setPageContext(pageContext);
_jspx_th_core_setCookie_0.setParent(_jspx_th_core_ifRequestEquals_0);
_jspx_th_core_setCookie_0.setName("site");
_jspx_th_core_setCookie_0.setValue("");
_jspx_th_core_setCookie_0.setDuration("0");
int _jspx_eval_core_setCookie_0 = _jspx_th_core_setCookie_0.doStartTag();
if (_jspx_th_core_setCookie_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
return true;
_jspx_tagPool_core_setCookie_value_name_duration.reuse(_jspx_th_core_setCookie_0);
return false;
}
}

 
Okay I was wrong, or my info was wrong.

It fails in Tomcat 4 as well.

The difference is between Windows and Linux (Fedora).
Same code. Same Tomcat version now. Different results.
 
Really ? Thats a bit scary, we are testing with fedora core 1, to replace a linux RH8 live build.

Are you sure that on the Win32 boxes, it works, but on fedora it fails ?

--------------------------------------------------
Free Database Connection Pooling Software
 
Never mind... The person who did the install did something a little brain dead. We have lots of JAR files we've created or bought so he moved them from Windows to Fedora. When doing so he also over wrote the installed ones for Tomcat.

For reasons I don't know if you use Window Tomcat JAR files on Fedora then nested tags under the above condition fails. Still wouldn't mind knowing why, but it's easy to fix - install right! Nothing else busted BTW which is what was odd.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top