File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes pass a parameter from a struts ActionForm to a javascript fn Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "pass a parameter from a struts ActionForm to a javascript fn" Watch "pass a parameter from a struts ActionForm to a javascript fn" New topic
Author

pass a parameter from a struts ActionForm to a javascript fn

Gayatri Ganesh
Ranch Hand

Joined: Dec 23, 2003
Posts: 143
Hi Everyone,

Is there a way to pass a parameter from the struts action or use the struts ActionForm variable to a javascript fn on the jsp which should open a new pop -up browser window with that parameter ?

Thanks,
Gayatri
John Smith
Ranch Hand

Joined: Sep 02, 2004
Posts: 61
if you just do a bean:write inside your script tags you'll get the value of the variable as those tags are parsed before the page is loaded thus before the javascript can ever possibly be executed
Kim Kantola
Ranch Hand

Joined: May 17, 2001
Posts: 274
Hey, I have a similar question, but instead of passing a parameter, can you pass an actual object?

For example, I have an object, and I want to pass it to a javascript function which will then call a popup.

Can only strings be passed, or can an object be passed to a javascript function?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: pass a parameter from a struts ActionForm to a javascript fn
 
Similar Threads
How to forward radio button input from one jsp to another?
Problem with redirect after validation
Passing GET parameters to .do pages
how to transfer the data from the form bean to the DTO in struts
Getting ActionForm values from Java class