jsp standalone

S

steph

Hi,

I'd like to use jsp as templating mechanisme to generate HTML files in a
standalone application.

What is the best way ? Which api could I use ?

I know I need a jsp compiler to compile .jsp files and a jsp runtime to execute
the compiled class. I try to use catalina implémentation with no success.

Help.

Thanks.
 
W

William Brogden

Hi,

I'd like to use jsp as templating mechanisme to generate HTML files in a
standalone application.

What is the best way ? Which api could I use ?

I know I need a jsp compiler to compile .jsp files and a jsp runtime to
execute the compiled class. I try to use catalina implémentation with no
success.

JSP require the environment created by a servlet container such as Tomcat.
Why don't you just run Tomcat and write a little program to open a URL,
read the result, and write it to a file?
Bill
 
S

steph

Le 08/11/2004 14:27, William Brogden a écrit :
JSP require the environment created by a servlet container such as Tomcat.
Why don't you just run Tomcat and write a little program to open a URL,
read the result, and write it to a file?
Bill

With an embeded tomcat and httpclient for example ? why not.
But I thought that's a bit huge to run a webserver for my "little" problem of
templating.

More widely, is there any simple api to have a templating mechanisme in a
standalone application ?
 
B

Brusque

steph said:
With an embeded tomcat and httpclient for example ? why not.
But I thought that's a bit huge to run a webserver for my "little" problem of
templating.

More widely, is there any simple api to have a templating mechanisme in a
standalone application ?

Have a look at Velocity http://jakarta.apache.org/velocity/

It's more generic, not soley web/servlet based like jsp
 
A

Alex Kay

steph said:
Hi,

I'd like to use jsp as templating mechanisme to generate HTML files in a
standalone application.

What is the best way ? Which api could I use ?

I know I need a jsp compiler to compile .jsp files and a jsp runtime to execute
the compiled class. I try to use catalina implémentation with no success.

Help.

Thanks

I'm sure there are other ways but off the top of my head:-

1.You can run Jetty (a small but nice servlet/jsp container) in embedded
mode thus keeping with your standalone theme,

2. Many servlet/jsp servers have a command line utility to compile JSPs you
can then call the server from a utility pass some HTTP messages to it and
capture the HTML (this wouldn't be hard),

3. maybe write you're own simple template function and not have full-blown
jsp.

Cheers
Alex Kay
 
B

Bryce

Hi,

I'd like to use jsp as templating mechanisme to generate HTML files in a
standalone application.

What is the best way ? Which api could I use ?

I know I need a jsp compiler to compile .jsp files and a jsp runtime to execute
the compiled class. I try to use catalina implémentation with no success.

I'm not sure what you are trying to do, but JSP's get compiled NOT to
HTML, but to java servlets.

If you are looking for a good way to generate HTML files from a
template, you might want to look at Velocity (unless I'm not
understanding you).

http://jakarta.apache.org/velocity/
 
S

steph

Le 08/11/2004 20:54, Bryce a écrit :
I'm not sure what you are trying to do,
but JSP's get compiled NOT to HTML, but to java servlets.

no, realy!
I know my english is poor but "I'd like to use jsp as templating mechanisme to
generate HTML files in a standalone application." was my primary idea.
Feel free to correct my sentence.
If you are looking for a good way to generate HTML files from a
template, you might want to look at Velocity (unless I'm not
understanding you).

http://jakarta.apache.org/velocity/

That's perhaps the good way.
But I'm intersted in compiling and running a jsp in my own application.
 
Joined
Dec 12, 2010
Messages
1
Reaction score
0
Try casper scriplet engine

You can try casper scriplet engine can be used standalone or with web app.
Try = code.google.com/p/casper/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top