You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by TWönlìnè <tw...@gmail.com> on 2010/03/24 09:58:19 UTC

Compiling JSP with SMAP

I'm using apache-tomcat-6.0.20 with JASPER 2....

I need to compile a web project (Eclipse WAR application) which is JSP to
JAVA source files.

I'm successfully generating JAVA files from JSP files (Used JASPER 2), but
now i need to get mapping from JSP lines to JAVA lines.
I tried using SMAP feature which available in JASPER 2, but i can't
configure it correctly.

There are two questions i need to ask,

1) Will generating SMAP files will help me to map JSP lines to generated
JAVA lines?

2) How to do this?

JASPER how to doc says - The servlet which implements Jasper is configured
using init parameters in your global $CATALINA_BASE/conf/web.xml.

I edited that web.xml with following code - (used dumpSmap & suppressSmap)

<servlet>
        <servlet-name>jsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>suppressSmap</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>dumpSmap</param-name>
            <param-value>true</param-value>
        </init-param>
    </servlet>

But no luck!!!!

Any help!!!!!

-- 
_A_N_I_M_E_-_O_T_A_K_U_

Re: Compiling JSP with SMAP

Posted by Konstantin Kolinko <kn...@gmail.com>.
2010/3/24 TWönlìnè <tw...@gmail.com>:
> @Mercy, Thanks....
>
> I managed to create SMAP files,
> using this code in my BUILD.XML - which compiles JSPs
>
> (...)
>
> Now it is creating .SMAP files.
>

SMAPs are appended to the *.class files. That is why you do not see
them as separate files when running Tomcat.

Format of the SMAP is specified by JSR 045,
http://jcp.org/en/jsr/detail?id=045

Best regards,
Konstantin Kolinko

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


Re: Compiling JSP with SMAP

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

All,

Strange... I found this sitting in my "Unsent" folder. Here it is, a
little late.

On 3/24/2010 8:40 AM, TWönlìnè wrote:
> Now a new problem arise,
> How to read a .SMAP file,
> I know its map from JSP to JAVA but how the numbers are associated, (can
> someone explain....) is there an easier way to do this?

SMAP is defined in JSR 45 (first Google result when searching for "smap
file" tells you this).

http://www.jcp.org/en/jsr/summary?id=45

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkuzYcMACgkQ9CaO5/Lv0PAyBACfUp++zuXAfGfrTzk9nW27FVc2
OhsAoKGe8AF6g9eRvA/ADI/bIgyCIzbK
=4mSN
-----END PGP SIGNATURE-----

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


Re: Compiling JSP with SMAP

Posted by TWönlìnè <tw...@gmail.com>.
@Mercy, Thanks....

I managed to create SMAP files,
using this code in my BUILD.XML - which compiles JSPs

<taskdef classname="org.apache.jasper.JspC" name="jasper2" >
        <classpath refid="tomcat.classpath" />
    </taskdef>

<target name="jasper.jspc">
        <echo message="Starting JASPER/JSPC compiler..." />
        <jasper2
                 validateXml="false"
                 failonerror="false"
                 package="${module.name}"
                 smapSuppressed="false"
                 smapDumped="true"
                 compilertargetvm="1.6"
                 compilersourcevm="1.6"
                 classdebuginfo="true"
                 listErrors="true"
                 verbose="9"
                 uriroot="${web.dir}"
                 webXmlFragment="${tool.work.dir}/generated_web.xml"
                 outputDir="${tool.web.scr.dir}" />
    </target>

Now it is creating .SMAP files.

Now a new problem arise,
How to read a .SMAP file,
I know its map from JSP to JAVA but how the numbers are associated, (can
someone explain....)
is there an easier way to do this?

Re: Compiling JSP with SMAP

Posted by Mercy <te...@gmail.com>.
Hi TWönlìnè,

    Did you a project named "Server" with a sub folder  whose name is 
like "Tomcat v6.0 Server at localhost-config"?

    If you had, please set these values into web.xml in.


Kind regards,
Mercy

TWönlìnè wrote:
> I'm using apache-tomcat-6.0.20 with JASPER 2....
>
> I need to compile a web project (Eclipse WAR application) which is JSP to
> JAVA source files.
>
> I'm successfully generating JAVA files from JSP files (Used JASPER 2), but
> now i need to get mapping from JSP lines to JAVA lines.
> I tried using SMAP feature which available in JASPER 2, but i can't
> configure it correctly.
>
> There are two questions i need to ask,
>
> 1) Will generating SMAP files will help me to map JSP lines to generated
> JAVA lines?
>
> 2) How to do this?
>
> JASPER how to doc says - The servlet which implements Jasper is configured
> using init parameters in your global $CATALINA_BASE/conf/web.xml.
>
> I edited that web.xml with following code - (used dumpSmap & suppressSmap)
>
> <servlet>
>         <servlet-name>jsp</servlet-name>
>         <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
>         <init-param>
>             <param-name>suppressSmap</param-name>
>             <param-value>false</param-value>
>         </init-param>
>         <init-param>
>             <param-name>dumpSmap</param-name>
>             <param-value>true</param-value>
>         </init-param>
>     </servlet>
>
> But no luck!!!!
>
> Any help!!!!!
>
>   


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