How to get the javabean js property?

Category: Eclipse
2011-07-15 04:24:29

Sponsored Links
I now have a list in the form of property, how to get this in JavaScript circulation list value it?
write right, right?

var list= [];
for(i= 0; i <= <%=BeanList.size(); %>){
list[i] = BeanList.get(i);

Sponsored Links

2011-07-15 04:36:05
looked really wrong, so be it changed
var a = <%=BeanList.size()%>
            var list= [];
            for(i= 0; i <= a; i++){
                list[i] = <%=BeanList.get(i)%>;
2011-07-15 04:54:11

If you want a list, you first list stored in a range in the js, you can add quotes to get jstl tag list.
2011-07-15 05:12:01
on the page you can use a hidden variable <input type = "hidden" id = "xxx" value = "<% .. javabean ..%> ; "....
then use js to get on the line, if javabean set, then put the string back into the collection, and then parse the string js get on the line
2011-07-15 05:18:15
var list= [];
            for(i= 0; i <= <%=BeanList.size()%>; i++){
                list[i] = <%=BeanList.get(i)%>;

You do not have to write out yet
2011-07-15 05:27:02

2011-07-15 05:45:35
BeanList this place will complain it? BeanList is a form of property,

public class TESTForm  {
    private List BeanList;}
2011-07-15 05:57:01
JS can not use the server-side a target. This is too common sense.
If you want to use, then look DWR it, this too can call the server-side objects.
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.