Caucho Forums  

This forum is permanently closed because of spam. For free community support, please visit Google Groups:


Go Back   Caucho Forums > Resin

Reply
 
Thread Tools Display Modes
  #1  
Old 03-17-2011, 08:24 AM
imaniyar imaniyar is offline
Junior Member
 
Join Date: Mar 2011
Posts: 1
Default Resin doesn't compile JSP properly while Tomcat does

I thought the following code was portable. However, Tomcat 6.0.20 does it right, while Caucho Resin Pro 4.0.15 seems to be compiling it wrong.

My JSP code is as follows:

Code:
<jsp:scriptlet>  
    String referrer = request.getHeader("referer");  
    if( referrer != null ){  
</jsp:scriptlet>  
  
    <p>  
        You may   
        <jsp:element name="a">  
            <jsp:attribute name="href">  
                <jsp:expression>response.encodeURL(referrer)</jsp:expression>  
            </jsp:attribute>  
            <jsp:body>click here</jsp:body>  
        </jsp:element>   
        to return to the page you came from.  
    </p>  
      
<jsp:scriptlet>  
    }  
</jsp:scriptlet>
Tomcat compiles it to the following in the class org.apache.jsp.WEB_002dINF.error_002dpages._404_js p:
_jspService

Code:
.  
.  
.  
String referrer = request.getHeader("referer");  
if( referrer != null ){  
                      
      out.write("\r\n");  
      out.write("\t\t\t\t\t\r\n");  
      out.write("\t\t\t\t\t\t<p>\r\n");  
      out.write("\t\t\t\t\t\t\tYou may \r\n");  
      out.write("\t\t\t\t\t\t\t");  
      out = _jspx_page_context.pushBody();  
      out.print(response.encodeURL(referrer));  
      String _jspx_temp2 = ((javax.servlet.jsp.tagext.BodyContent)out).getString();  
      out = _jspx_page_context.popBody();  
      out.write("<" + "a" + " href=\"" + _jspx_temp2 + "\"" + ">");  
      out.write("click here");  
      out.write("</" + "a" + ">");  
      out.write(" \r\n");  
      out.write("\t\t\t\t\t\t\tto return to the page you came from.\r\n");  
      out.write("\t\t\t\t\t\t</p>\r\n");  
      out.write("\t\t\t\t\t\t\r\n");  
      out.write("\t\t\t\t\t");  
  
}  
.  
.  
.
Resin compiles it to the following in the class _jsp._web_22dinf._error_22dpages._404_jsp:
_jspService
Code:
.  
.  
.  
String referrer = request.getHeader("referer");  
if( referrer != null ){  
                      
    out.write(_jsp_string51, 0, _jsp_string51.length);  
    out.print(_jsp_fragment_4(pageContext, null, null, _jsp_state, _jsp_pageManager));out.write(_jsp_string52, 0, _jsp_string52.length);  
      
}  
.  
.  
.
In String _jsp_fragment_4(

Code:
 String _jsp_fragment_4(  
    com.caucho.jsp.PageContextImpl pageContext,  
    javax.servlet.jsp.tagext.JspTag _jsp_parent_tag,  
    javax.servlet.jsp.tagext.JspFragment _jspBody,  
    TagState _jsp_state,  
    com.caucho.jsp.PageManager _jsp_pageManager)  
    throws Throwable  
  {  
    com.caucho.jsp.PageContextImpl _jsp_parentContext = pageContext;  
    JspWriter out = pageContext.pushBody();  
    javax.el.ELContext _jsp_env = pageContext.getELContext();  
    javax.servlet.http.HttpServletRequest request = (javax.servlet.http.HttpServletRequest) pageContext.getRequest();  
    javax.servlet.http.HttpServletResponse response = (javax.servlet.http.HttpServletResponse) pageContext.getResponse();  
    javax.servlet.http.HttpSession session = pageContext.getSession();  
    javax.servlet.ServletContext application = pageContext.getServletContext();  
    javax.servlet.ServletConfig config = pageContext.getServletConfig();  
    try {  
      out.print((response.encodeURL(referrer)));  
      return ((com.caucho.jsp.BodyContentImpl) out).getString();  
    } finally {  
      pageContext.popAndReleaseBody();  
    }  
  }
Due to the function _jsp_fragment_4 that the Coucho Resin jsp compiler produces, Coucho Resin ends up through a INTERNAL SERVER ERROR because it cannot compile the jsp file into a servlet.

Do you think Caucho Resin is at fault?
Reply With Quote
  #2  
Old 03-23-2011, 11:11 PM
reza reza is offline
Super Moderator
 
Join Date: Nov 2009
Location: Philadelphia, PA
Posts: 101
Send a message via Skype™ to reza
Default

imaniyar,

Please post the stack trace.

Thanks,
Reza
Reply With Quote
  #3  
Old 03-29-2011, 06:28 PM
alex alex is offline
Administrator
 
Join Date: Aug 2009
Posts: 218
Default

imaniyar, I reported this as a bug:
http://bugs.caucho.com/view.php?id=4463
Reply With Quote
  #4  
Old 10-18-2011, 09:41 AM
Trivian Trivian is offline
Junior Member
 
Join Date: Oct 2011
Posts: 1
Default

Much thanks for letting this know. I was currently stuck ] how to get over it

Last edited by Trivian; 06-18-2012 at 01:30 PM.
Reply With Quote
  #5  
Old 10-18-2011, 06:52 PM
alex alex is offline
Administrator
 
Join Date: Aug 2009
Posts: 218
Default

The bug record says it should be fixed in 4.0.17 and higher.
Alex
Reply With Quote
Reply

Tags
compilation, resin, tomcat

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:26 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.