This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes pass bean property values to javascript function 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 » Java » JSP
Bookmark "pass bean property values to javascript function" Watch "pass bean property values to javascript function" New topic
Author

pass bean property values to javascript function

Chetan Ram
Greenhorn

Joined: Mar 10, 2011
Posts: 20
Hi,

I have a bean class Person which has properties like name, age




I want to pass bean property values to javascript function for further use.

I can use struts <logic:iterate> or <c:foreach> to iterate over the bean properties.

Thanks for any help.

Chinnu
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

I Assume that you do iteration then display/non-display the value into a td(table). then just get the text/string value in javascript!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

Niether of the Struts proprietary tag or <c:forEach> will "iterate" over properties. They are intended to iterate over collections.

What is it you are really trying to accomplish so we can guide you to the more appropriate methods?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Chetan Ram
Greenhorn

Joined: Mar 10, 2011
Posts: 20
Thanks for the reply.

we store bean objects in an arraylist. So in JSP, we get arraylist which contains beans.
I want to pass bean properties values to javascript.

Expected : I want to pass bean properties values to datagrid to display it in UI.

What I understand is that data needs to be passed to form the datagrid content to display.
I am trying to use dojo datagrid.
 
jQuery in Action, 2nd edition
 
subject: pass bean property values to javascript function
 
Similar Threads
Read/Write BLOB in byte[] with Hibernate in MySQL..
Class objects into ArrayList
Help with jsp beans
jsp:getProperty gives null
EL is null Friendly?