This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have no idea what a GridView is -- it's certainly not a JSP concept.
Here's how I would do it:
The page controller would call a business-layer class to fetch the information.
In the business-layer class, I'd get the data from the database and copy it from the resultset into a Java collection and close the resultset as soon as possible. If appropriate I'd use a java.util.List of beans that represent the items to be displayed. Or it could be as simple as Object
The list (or array) would be returned to the controller, which would set it as a scoped variable in request scope.
The controller would forward to the JSP.
In the JSP, the <c:forEach> tag, perhaps nested if necessary, would iterate over the List or array to create the HTML table markup to display the data.
And when i try to retrieve the "data" in jsp Page by the request.getAttribute("data"); method its showing nothing.
And i tried to display data whether data is coming to the Arrylist or not and written out.println(data);
It showed an infinity nos of some Arrylist[uiwy]j (something .. something ) in the browser ..