aspose file tools*
The moose likes Servlets and the fly likes JSP and javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP and javascript" Watch "JSP and javascript" New topic
Author

JSP and javascript

Rashmi Gowda
Greenhorn

Joined: Dec 04, 2000
Posts: 5
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

Joined: Mar 22, 2000
Posts: 12805
    
    5
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

Joined: Mar 15, 2002
Posts: 48
Is JSP a LANGUAGE???
Are you sure?
Jesse Beaumont
Ranch Hand

Joined: May 30, 2002
Posts: 43
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


---<br />Time flies like an arrow,<br />Fruit flies like a banana
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP and javascript