• Post Reply Bookmark Topic Watch Topic
  • New Topic

Alert box in JSP!  RSS feed

 
Neeraj Macker
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have an old application in javascript. i am converting it into JSP. how can i have alert boxes in JSP?
 
Jeffrey Spaulding
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Same as before. Your client instruments are still HTML & JS

J.
 
Neeraj Macker
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jeffrey Spaulding:
Same as before. Your client instruments are still HTML & JS

J.


can u please explain your point with an example. i have found out that it is impossible to call javascript from JSP but the opposite is possible, although not very efficiently.
 
Jeffrey Spaulding
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your JSP code's job is to create valid HTMl (and JavaScript in your case)

You simply generate the necessary code on the fly.

If you would use in JavaScript you simply generate
the necessary text for your alert on the fly.

Take a look at this discussion for further reference.


J.

[ July 01, 2005: Message edited by: Jeffrey Spaulding ]
[ July 01, 2005: Message edited by: Jeffrey Spaulding ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP is executed on the server. It's output can include Javascript.
The Javascript code get's interpreted on the client machine in the browser.

The two can not 'call' each other.

If you want a popup, write it in Javascript as this is client side functionality.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!