tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 22833] New: - Generated SMAP looks wrong
Date Sat, 30 Aug 2003 14:12:34 GMT
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=22833>.
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=22833

Generated SMAP looks wrong

           Summary: Generated SMAP looks wrong
           Product: Tomcat 5
           Version: 5.0.9
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Jasper2
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: marcus.nylander@telia.com


In some cases the genereted SMAP seems wrong. If one looks at the JSR-45 and 
compare it with the example below the SMAP seems wrong.

The Example is the same as in JSR-45. 

File: Hello.jsp

<HTML>
<HEAD>
<TITLE>Hello Example</TITLE>
</HEAD>
<BODY>
<%@ include file="greeting.jsp" %>
</BODY>
</HTML> 

File 2: greeting.jsp

Hello There!<P>
Goodbye on <%= new java.util.Date() %>


The output SMAP becomes:

Hello_jsp.java
JSP
*S JSP
*F
+ 0 /Hello.jsp
Hello.jsp
+ 1 /greeting.jsp
greeting.jsp
*L
1,2:45   
3:47,2
4,2:49
1#1:51,2
2:52,2      <= seems wrong.. Should't it be 2#1:52,2
6#0,3:54    
*E

In all examples in JSR-45 they always use the file-id in the line info, 
shouldn't Jasper do the same? Like the following
1#0,2:45   
3#0:47,2
4#0,2:49
1#1:51,2
2#1:52,2      
6#0,3:54


It also looks like SMAP for JSP-declarations does not work. If I add a 
<%!
	void test() {
		System.out.print("Hello there..");
	}
%>

first to Hello.jsp. The first SMAP-line mapping the declaration becomes 2,4:1 
when should be 2,4:9 looking at the generated jsp.




First example of generated JSP:

package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

public final class Hello_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.Vector _jspx_dependants;

  static {
    _jspx_dependants = new java.util.Vector(1);
    _jspx_dependants.add("/greeting.jsp");
  }

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

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

    JspFactory _jspxFactory = null;
    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");
      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("<HTML>\r\n");
      out.write("<HEAD>\r\n");
      out.write("<TITLE>Hello Example");
      out.write("</TITLE>\r\n");
      out.write("</HEAD>\r\n");
      out.write("<BODY>\r\n");
      out.write("Hello There!");
      out.write("<P>\r\nGoodbye on ");
      out.write(String.valueOf( new java.util.Date() ));
      out.write("\r\n");
      out.write("</BODY>\r\n");
      out.write("</HTML>  ");
    } catch (Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (pageContext != null) pageContext.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
    }
  }
}

Mime
View raw message