File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring 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!