You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Illya Kysil <ik...@gmail.com> on 2011/06/12 16:12:31 UTC

Re: Read JSR 045 SMAP Files Produced by Jasper

Eric Sheridan <esheri3 <at> gmail.com> writes:

> 
> List,
> 
> I am developing an application that programmatically leverages the
> Apache Jasper JspC facilities to translate JSP source files into their
> Java (Servlet) equivalents. For this application, I need to be able to
> translate a Java line number back to the original JSP line number. I
> have JspC producing SMAP files which should contain most/all the
> information I need. However, I am having trouble finding any existing
> open source libraries that have the ability to parse JSR 045 SMAP files.
> I was hoping to come across an open source library that offered API such as:
> 
> SmapParser parser = new SmapParser(inputStream);
> Smap smap = parser.parse();
> int jspLineNumber = smap.getJspLineNumber(javaLineNumber);
> 
> Does any such code exist? If so, would you mind pointing me to
> it? If not, any alternative solutions to looking up the original JSP
> line number given that I am working with Apache Jasper?

I've just uploaded a code which does source map parsing and resolves the line
numbers across stratum. This code was created back in 2004 as part of
JspCompiler module for NetBeans 3.6.

See class Resolver and methods main and resolve.

See https://github.com/ikysil/sourcemap for the code repository.





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org