Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

In JSP I have a list. It contains String type of elements. I want to access this list in JavaScript. How can I do it?

JSPCode

    <%! List l;%>
    <% 
       l=(List)request.getAttribute("listResource");
    %>  

JavaScriptCode

  function verify_Resources()
  {
      var resourceId=document.getElementById("res").value;
      var rid=<%=l%>
  }

I want check wether the Selected id is in the List or not.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
193 views
Welcome To Ask or Share your Answers For Others

1 Answer

You need to serialize the list to JSON.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...