• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP and javascript

 
Rashmi Gowda
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I would like to know if there is a way for adding a javascript 'alert' button in JSP such that the alert button appears on the same JSP page.Right now iam able to get the alert message on a different page. similarly can i add/embed JSP code(i.e, scriptlets/beans) in Javascript??
Any other ideas/suggestions to do the same ?
Thanks,
Rashmi
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lets remember what Javascript is - a scripting language written into a HTML page and executed on the browser side.
Anything you can create in Javascript on a plain HTML page can also be created on a HTML page written by JSP - the trick is getting the syntax and quote marks escaped properly.
Also remember what JSP is - a language for creating servlets on the server side based on a mix of HTML, special tags, and Java code. Any Java code you "embed in Javascript" will be meaningless on the browser side.
Bill

------------------
author of:
 
Renata fonseca
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is JSP a LANGUAGE???
Are you sure?
 
Jesse Beaumont
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Technically, JSP is a language, depending on what your definition of language is. The fact that it is then interpreted into Java is of little concern, but the fact that it has to be interpreted surely indicates that an argument exists for it to be denoted a language in its own right. That detail is of little relevance to the above post.
I would, however, add to Bill's post, just to be explicit that JSPs are not restricted to producing HTML (though clearly that is the scope of this thread)
Jesse - with pedantic hat
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic