Jasper2's JspC

2003-08-14 Thread Dmitry Beransky
Hi,

I'm having partial luck manually invoking JspC and compiling JSP pages on 
demand.  I get as far as precomiling to .java, but for the world of me 
can't figure out how to get the java class compiled to bytecode.  Looking 
at the source code for org.apache.jasper.compiler.Compiler, it appears that 
I should be getting a .class as well, but I'm not.

Can anyone offer any pointers or sample source code I could look at 
(reminder, this is for Japser2)?

Thanks
Dmitry
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Jasper2's JspC

2003-08-14 Thread Subir Sengupta
Use the -compile argument.

-Original Message-
From: Dmitry Beransky [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 13, 2003 9:55 AM
To: [EMAIL PROTECTED]
Subject: Jasper2's JspC


Hi,

I'm having partial luck manually invoking JspC and compiling JSP pages on 
demand.  I get as far as precomiling to .java, but for the world of me 
can't figure out how to get the java class compiled to bytecode.  Looking 
at the source code for org.apache.jasper.compiler.Compiler, it appears that 
I should be getting a .class as well, but I'm not.

Can anyone offer any pointers or sample source code I could look at 
(reminder, this is for Japser2)?


Thanks
Dmitry


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Jasper2's JspC

2003-08-14 Thread Subir Sengupta
Try using jspc with the -compile flag and see what happens.  Your code is
probably not setting something (I don't know what), which is causing it to
not compile.

As an aside, I don't use the -compile flag to compile.  I use the jspc
script to create the .java files and then I use Jikes to compile.  It's much
much faster than javac.

Subir

-Original Message-
From: Dmitry Beransky [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 13, 2003 11:50 AM
To: Tomcat Users List
Subject: RE: Jasper2's JspC


At 10:42 AM 8/13/2003, Subir Sengupta wrote:
Use the -compile argument.

At 10:42 AM 8/13/2003, Steph Richardson wrote:
Otherwise, JspC will not create .class files for you, but the java 
files
that JspC creates can just be compiled with javac, using
Tomcat's classpath

Here's the thing.  Setting -compile flag forces JspC to call 
Compiler.compile().  I'm already making this call (I'm actually bypassing 
JspC, setting all the options and contexts myself and calling 
Compiler.compile() directly).  Compiler.compile() makes a call to 
generateClass() which in turn invokes Ant's javac task to compile the 
file.  The task completes with no errors or exceptions; I'm stepping 
through the execution in a debugger and I can see that 'success' flag is 
set to true upon the javac's completion.  Yet there is no .class file to be 
found anywhere.


Dmitry

-Original Message-
I'm having partial luck manually invoking JspC and compiling JSP pages 
on demand.  I get as far as precomiling to .java, but for the world of 
me can't figure out how to get the java class compiled to bytecode.  
Looking at the source code for org.apache.jasper.compiler.Compiler, it 
appears that I should be getting a .class as well, but I'm not.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Jasper2's JspC

2003-08-14 Thread Dmitry Beransky
At 10:42 AM 8/13/2003, Subir Sengupta wrote:
Use the -compile argument.

At 10:42 AM 8/13/2003, Steph Richardson wrote:
Otherwise, JspC will not create .class files for you, but the java files 
that JspC creates can just be compiled with javac, using
Tomcat's classpath
Here's the thing.  Setting -compile flag forces JspC to call 
Compiler.compile().  I'm already making this call (I'm actually bypassing 
JspC, setting all the options and contexts myself and calling 
Compiler.compile() directly).  Compiler.compile() makes a call to 
generateClass() which in turn invokes Ant's javac task to compile the 
file.  The task completes with no errors or exceptions; I'm stepping 
through the execution in a debugger and I can see that 'success' flag is 
set to true upon the javac's completion.  Yet there is no .class file to be 
found anywhere.

Dmitry

-Original Message-
I'm having partial luck manually invoking JspC and compiling JSP pages on
demand.  I get as far as precomiling to .java, but for the world of me
can't figure out how to get the java class compiled to bytecode.  Looking
at the source code for org.apache.jasper.compiler.Compiler, it appears that
I should be getting a .class as well, but I'm not.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Jasper2's JspC

2003-08-14 Thread Dmitry Beransky
At 01:16 PM 8/13/2003, Subir Sengupta wrote:
Try using jspc with the -compile flag and see what happens.  Your code is
probably not setting something (I don't know what), which is causing it to
not compile.
You're right.  I found a conflict in option settings between the output 
directory and the jsp file name.  The sample jsp I'm trying to compile is 
located in /layouts/default.jsp, the webapp root api is set to 
c:/projects/cms/web and the output directory is set to c:/temp.  When 
the jsp file gets precompiled with these settings, the resulting .java file 
gets dumped into c:/temp/default_jsp.java, but when the compiler is 
getting invoked, it's looking for the file in c:/temp/layouts/.  I'm 
going to comb through JavaC code to see what exactly it is that I'm missing.

Thanks
Dmitry 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Jasper2's JspC

2003-08-14 Thread Steph Richardson
There was a recent thread on doing this with Ant, search for subject
Jasper, JSPC, Ant and Precompiling JSP's

Otherwise, JspC will not create .class files for you, but the java files that JspC 
creates can just be compiled with javac, using
Tomcat's classpath
TOMCAT_HOME/common/lib/*.jar
TOMCAT_HOME/shared/lib/*.jar
as well as any web-app specific classpaths ( probably WEB-INF/lib/*.jar )


Steph

 -Original Message-
 From: Dmitry Beransky [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, August 13, 2003 12:55 PM
 To: [EMAIL PROTECTED]
 Subject: Jasper2's JspC


 Hi,

 I'm having partial luck manually invoking JspC and compiling JSP pages on
 demand.  I get as far as precomiling to .java, but for the world of me
 can't figure out how to get the java class compiled to bytecode.  Looking
 at the source code for org.apache.jasper.compiler.Compiler, it appears that
 I should be getting a .class as well, but I'm not.

 Can anyone offer any pointers or sample source code I could look at
 (reminder, this is for Japser2)?


 Thanks
 Dmitry


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]