can i add JavaScript in servlet ?

Discussion in 'Java' started by Gaurav, Apr 28, 2005.

  1. Gaurav

    Gaurav Guest

    hi...


    I am standing in a servlet and from there I should make a confirm box
    depending on which the request should be forwarded.

    Now the problem is that, the confirm box can only be made in Jscript,
    and since my control is in Servlets hand, how do I call a Jscript from
    my servlet ?

    I am following MVC Model 2 architecture.

    regrds
     
    Gaurav, Apr 28, 2005
    #1
    1. Advertising

  2. Gaurav

    kaeli Guest

    In article <>,
    enlightened us with...
    > hi...
    >
    >
    > I am standing in a servlet and from there I should make a confirm box
    > depending on which the request should be forwarded.
    >
    > Now the problem is that, the confirm box can only be made in Jscript,
    > and since my control is in Servlets hand, how do I call a Jscript from
    > my servlet ?


    You don't "call" jscript from a servlet. Javascript is executed on the
    client, long after your servlet is done outputting.
    You have to write the javascript to the outputstream along with the html.

    Or have the html include a js file (src). One of the two.

    --
    --
    ~kaeli~
    If at first you don't succeed, skydiving is not for you.
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
     
    kaeli, Apr 28, 2005
    #2
    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. Andy Fish
    Replies:
    4
    Views:
    2,431
    Andy Fish
    Dec 17, 2003
  2. Sean Clarke
    Replies:
    1
    Views:
    1,918
    Sudsy
    Jan 7, 2004
  3. circuit_breaker
    Replies:
    2
    Views:
    2,045
    Jack Jia
    Apr 4, 2004
  4. chamikara
    Replies:
    1
    Views:
    49,908
  5. Replies:
    4
    Views:
    706
    santax
    Apr 20, 2007
Loading...

Share This Page