can i add JavaScript in servlet ?

G

Gaurav

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
 
K

kaeli

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.

--
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top