cancel
Showing results for 
Search instead for 
Did you mean: 

Adding JSP as compiled classes

Former Member
0 Kudos

Hi all,

Using Netweaver developer studio with MAM 2.5 I want to export the JSP files as compiled classes. This is an option in the final screen of the export.

Without clicking this on the export works fine, but with this option clicked the browser cannot find the page...

Has anyone any ideas as to why this does not work?

Thanks,

Ronan

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

I´m facing the same problem.. Any Idea??

Former Member
0 Kudos

hello,

some of the problems related to this subject are covered

in this blog.

/people/sap.user72/blog/2005/12/08/compiling-and-packaging-mi-projects-using-ant

regards

jo

Former Member
0 Kudos

HI All,

not sure if the blog helps but typically the following problem comes up in this case:

You web xml is configuring you application, say it maps url on servlets or JSP (which are a sort of uncompiled servlets).

For example if using MAM the standard web.xml contains the following entry:

<servlet>

<servlet-name>MAMStart</servlet-name>

<jsp-file>/mam_start.jsp</jsp-file>

</servlet>

which maps calls to the MAMStart serlvet to a jsp file.

If you now compile the JSP, the JSP file does not exist anymore in the delivery WAR file, but you get the compiled servlet instead. In MAM this is the class "mam_0005fstart". So what you need to do is to adjust this mapping, so that tomcat can find the correct implementation of the MAMStart servlet.

<servlet>

<servlet-name>MAMStart</servlet-name>

<servlet-class>mam_0005fstart</servlet-class>

</servlet>

As you see you do not map the servlet name to a jsp file, but to a servlet_class, which is the result of compiling the original JSP file.

The naming is not exaclty clear to me (say where does the 0005 come from, I guess the underlines get translated or masked somehow) but you receive always hte same result name from compiling the same jsp.

If you do not know the exact name of the compiled JSP just compile the JSP and search for the result class file.

Bottomline: You need to ensure that the configuration fits to the new situation of not having JSPs anymore but compiled JSPs, which are servlets (normal Java classes implementing a special interface...).

Hope that helps,

Tom

Former Member
0 Kudos

hello thomas,

>The naming is not exaclty clear to me (say where does

>the 0005 come from, I guess the underlines get

>translated or masked somehow) but you receive always hte

>same result name from compiling the same jsp.

i have the same question before as well... the numerics

0002e, 0005f, 0002f that are inserted/appended into the

classname of the translated jsp are actually the hex value

or characters '.','_' and '/' respectively. Tomcat uses

these characters by changing the '.' with '_' in the package

name e.g. com.sap to com_sap. so if your jsp jsps or package

names have these characters, tomcat will use their hex values

to distinguish between the original and the modified names.

hope this clears your doubt...

regards

jo

Former Member
0 Kudos

Hi Jo,

I am getting an error while running build.xml file with ANT. I have followed the similar way that you published in your blog. I have added some more lines to class path which my jsp files are using in form include tags.

My tomcat version is TOMCAT 5

JDK : 1.4.2_08

IDE: NWDS7.0

Here is the error trace :

<i><i><b>jspCompile:

[jasperc] 2007-06-01 02:12:00 - error-the file '\error_page.jsp' generated the following parse exception: org.apache.jasper.compiler.CompileException: C:\Documents and Settings\Satish\Desktop\test\XMAM30_ECLIPSE\temp\error_page.jsp(2,0) Bad file argument to include

[jasperc] 2007-06-01 02:12:00 - error-the file '\legend.jsp' generated the following parse exception: org.apache.jasper.compiler.CompileException: C:\Documents and Settings\Satish\Desktop\test\XMAM30_ECLIPSE\temp\legend.jsp(2,4) Bad file argument to include

[jasperc] 2007-06-01 02:12:00 - error-the file '\mam_home.jsp' generated the following parse exception: org.apache.jasper.compiler.CompileException: C:\Documents and Settings\Satish\Desktop\test\XMAM30_ECLIPSE\temp\mam_home.jsp(2,4) Bad file argument to include

[jspc] BUILD FAILED: file:C:/Documents and Settings/Satish/Desktop/test/XMAM30_ECLIPSE/cfg/build.xml:96: Java returned: 9</b></i></i>

<u>Is there any other way to get the compiled jsp files rather than by using ANT & build.xml file.</u>

Please tell me to resolve this

Regards,

Murthy

Answers (1)

Answers (1)

Former Member
0 Kudos

hello ronan,

are your jsp files properly compiled?

are you using include directives in your jsps?

regards

jo