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 Is it possible to  pass a bean(struts) through javascript.??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Is it possible to  pass a bean(struts) through javascript.???" Watch "Is it possible to  pass a bean(struts) through javascript.???" New topic
Author

Is it possible to pass a bean(struts) through javascript.???

Vic Hood
Ranch Hand

Joined: Jan 05, 2011
Posts: 477

Hi friends,
I have an issue where im expected to pass the value required for a javascript function using the value obtained from a form bean . I would like to know whether its possible to do so .
I'm looking at something on these lines (or the equivalent) in my JSP
.

And the corresponding Javascript function as :



Please help on how i could pass the bean value to the Javascript
Thanks.


Learning and Learning!-- Java all the way!
Shankar Tanikella
Ranch Hand

Joined: Jan 30, 2011
Posts: 329



implies that you are submiting a form used in your JSP

anyways, the below code should work fine as is... what is the problem that you facing?

<td><html:button property="objid"
onclick="alert('<bean:write name="listDetails" property="objid"/>')" value="Edit" > </html:button></td>


Have Fun with Java
little,little.. little by little makes a lot..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is it possible to pass a bean(struts) through javascript.???