jsp standalone

Discussion in 'Java' started by steph, Nov 8, 2004.

  1. steph

    steph Guest

    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.
    --
    stephane
    retirez les lettres majuscules et le 666 de l'adresse pour l'utiliser.
     
    steph, Nov 8, 2004
    #1
    1. Advertising

  2. On Mon, 08 Nov 2004 10:06:27 +0100, steph
    <> wrote:

    > 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
     
    William Brogden, Nov 8, 2004
    #2
    1. Advertising

  3. steph

    steph Guest

    Le 08/11/2004 14:27, William Brogden a &eacute;crit :

    > On Mon, 08 Nov 2004 10:06:27 +0100, steph
    > <> wrote:
    >
    >> 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


    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 ?

    --
    stephane
    retirez les lettres majuscules et le 666 de l'adresse pour l'utiliser.
     
    steph, Nov 8, 2004
    #3
  4. steph

    Brusque Guest

    "steph" <> wrote in message
    news:418f87eb$0$2537$...
    >
    > 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
     
    Brusque, Nov 8, 2004
    #4
  5. steph

    Alex Kay Guest

    "steph" <> wrote in message
    news:418f3723$0$5160$...
    > 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
     
    Alex Kay, Nov 8, 2004
    #5
  6. steph

    Bryce Guest

    On Mon, 08 Nov 2004 10:06:27 +0100, steph
    <> wrote:

    >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/


    --
    now with more cowbell
     
    Bryce, Nov 8, 2004
    #6
  7. steph

    steph Guest

    Le 08/11/2004 20:54, Bryce a &eacute;crit :

    > On Mon, 08 Nov 2004 10:06:27 +0100, steph
    > <> wrote:
    >
    >
    >>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.


    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.

    >
    > --
    > now with more cowbell


    --
    stephane
    retirez les lettres majuscules et le 666 de l'adresse pour l'utiliser.
     
    steph, Nov 9, 2004
    #7
  8. steph

    vivek13186

    Joined:
    Dec 12, 2010
    Messages:
    1
    Try casper scriplet engine

    You can try casper scriplet engine can be used standalone or with web app.
    Try = code.google.com/p/casper/
     
    vivek13186, Dec 12, 2010
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex
    Replies:
    5
    Views:
    711
    Angus Lepper
    Dec 12, 2003
  2. Dipesh Mehta

    Standalone Perl Executable ? ? ?

    Dipesh Mehta, Sep 30, 2003, in forum: Perl
    Replies:
    3
    Views:
    4,610
  3. Raju
    Replies:
    1
    Views:
    1,829
    Rajesh.V
    Oct 29, 2003
  4. Eych
    Replies:
    3
    Views:
    398
    S. Justin Gengo
    Nov 21, 2003
  5. Replies:
    0
    Views:
    4,419
Loading...

Share This Page