dcsimg
Just want to compile a single JSP page
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Timo_Ratilainen
Posted On:   Thursday, November 14, 2002 08:06 AM

I need to see the servlet (.java) code of a simple JSP code like this: <% out.println("Testing."); %> I installed Ant 1.5 and Tomcat 4.1.12. build.xml file for Ant is like this: simple JSP compile destdir="." verbose="9" classpath="C: empTomcat-4.1.12commonlib"> that common/lib includes jasper-runtime.jar and jasper-compiler.jar. and when trying to compile: C: emp est>ant Buildfile: build.xml compile: [jspc] Compiling 1 source fileC: emp est    More>>

I need to see the servlet (.java) code of a simple JSP code like this:

			



<% out.println("Testing."); %>






I installed Ant 1.5 and Tomcat 4.1.12.



build.xml file for Ant is like this:

			


simple JSP compile




destdir="."
verbose="9"
classpath="C: empTomcat-4.1.12commonlib">






that common/lib includes jasper-runtime.jar and jasper-compiler.jar.



and when trying to compile:

			
C: emp est>ant
Buildfile: build.xml

compile:
[jspc] Compiling 1 source fileC: emp est
[jasperc] java.lang.NoClassDefFoundError: org/apache/jasper/JspC
[jasperc] Exception in thread "main"

BUILD FAILED
file:C:/temp/test/build.xml:10: Java returned: 1

Total time: 3 seconds
C: emp est>



Any ideas?



Is there any other way to compile single or few JSP pages, so that I would see the servlet code? I'm using JBuilder6 and as far as I know its not possible to see servlet code in JBuilder.




TR    <<Less

Re: Just want to compile a single JSP page

Posted By:   Jeff_Hubbach  
Posted On:   Thursday, November 14, 2002 10:24 AM

Try setting your classpath as follows:

classpath="[tomcat-root]/common/lib/jasper-compiler.jar:[tomcat-root]/common/lib/jasper-runtime.jar:[tomcat-root]/common/lib/servlet.jar:[ant-root]/lib/ant.jar"


You're probably going to have to switch / with .

Re: Just want to compile a single JSP page

Posted By:   Bozidar_Dangubic  
Posted On:   Thursday, November 14, 2002 08:47 AM

your app or web server compile JSPs. you cannot use ant to compile JSP since JSP is not a java file and you cannot compile it as you would compile a normal java file using javac or jikes or whatever compiler you are using. in addition, each web/app server does something a little bit different when compiling JSP into servlets so your servlet code generated from JSPs will slightly vary from one server to next. I am not aware of any compilers for JSPs that you can use in your ant scripts. your best bet is to just start your web/app server and access the JSP and then look at the generated code. A bit tedious but doable through ant.
About | Sitemap | Contact