This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JSP and the fly likes Doubt  in JavaScript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Doubt  in JavaScript" Watch "Doubt  in JavaScript" New topic
Author

Doubt in JavaScript

Dipti Mishra
Greenhorn

Joined: Jan 24, 2006
Posts: 22
Hi Folks,

Can anyone tell me how do we call a java script method in a JSP file.Can we use it directly call it? Can we retrieve a session variable in javascript? if yes, then please specify how? and if no then do tell me the reason.

Thanks in advance.

regards,
Dipti
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Javascript is interpreted in the browser (client side) whereas JSP is interpreted on the server.

The easiest way to understand the implications of this is to think:
"The JSP writes the HTML and Javascript which the browser will interpret."
and to use your browser's "View -> Source" option to look at the actual HTML/Javascript code which was the output from your JSPs execution.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

Read this article.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
wood burning stoves
 
subject: Doubt in JavaScript