<%!	String[] selElts=new String[100]; %>

			<a href="myPage.jsp" onclick="selElts  = tree2.getAllChecked()">Get list of checked</a>

the values to array "selElts" are returned from a javascript function. now, how could the print the array values in the same jsp page (or)
how to retrieve from next JSP page(myPage.jsp)

the values to array "selElts" are returned from a javascript function

The selElts you define in javascript is not the java array. They are not the same. What you have written doesn't work. You can not call javascript method to give values to java variables.


If you want to send something from one page to the other, you either submit the form and get the values with request.getParameter("")
or set the request Attributes and redirect.

If this doesn't make sense, study harder and learn about servlets and jsp

commented: Good suggeston +13
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.