How to copy java Array into javascript Array? -


i have .jsp page in used on click javascript function further validation , other processing stuff. i've created array in jsp scriptlets , how pass javascript function gets called when submit button hit? tried this:

var jsarray = <%=linearray%>; 

but didn't work out.
in fact function wasn't getting called after put above scriptlet. how copy java array javascript array?

try this:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>  var jsarray = [    <c:foreach var="item" items="${linearray}">    <c:out value="${item}"/>,   </c:foreach> ]; 

this generate javascript array variable jsarray , put java linearray values it. if that's need do.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -