tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Read JSR 045 SMAP Files Produced by Jasper
Date Tue, 15 Mar 2011 15:59:08 GMT
Hash: SHA1

Mark and Eric,

On 3/15/2011 5:14 AM, Mark Thomas wrote:
> On 14/03/2011 20:53, Eric Sheridan wrote:
>> 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?
> Not that I can think of, but that could be a valuable feature for Jasper
> if you were interested in writing a patch. See [1] for more background.
> There would be several benefits to being able parse SMAP info.

This sounds like something that could be done with a bit of hacking. I
didn't find anything Googling around, either. I did find something
called jclasslib that can be used for inspecting Java .class files but
it's most built as a bytecode browser and decompiler: much more that we
really need.

This information is evidently available via JVMDI, so the JVM must be
loading it somehow. Maybe poking around in OpenJDK would yield some
fruitful results.

The syntax for the Source Maps is pretty simple: the tough part will be
reading it from a Class file because of all the cruft you have to sift
through just to get to the part you want.

I could pretty easily write some code to extract the SMAP extension from
the .class file. It's not hard to ignore a lot of the .class content.

- -chris
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message