This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP and javascript" Watch "JSP and javascript" New topic

JSP and javascript

vasudevan gopalan

Joined: Jul 09, 2000
Posts: 7
Is it possible to write JSP inside javascript ? If so tell me with an example?
chanoch wiggers
Ranch Hand

Joined: May 24, 2001
Posts: 245
I am not quite sure what you mean by this. Do you mean, can you create javascript dynamically using JSP scriptlets?
if so then yes. Here is an example I use. I have a function that preloads images but I want to determine the images to preload dynamically. I therefore add the list to the function call parameters using jsp. (real code not used, am paraphrasing here)
imagePreloader(<%=imageListToLoad%> )

chanoch<p><a href="" target="_blank" rel="nofollow">Author of Professional Apache Tomcat</a></p>
I agree. Here's the link:
subject: JSP and javascript
It's not a secret anymore!