Jim Gmeiner wrote:My problem now is I want the results showing up in original jsp (index.jsp) as opposed to the jsp that I currently 'forwarding' it to (searchResults.jsp)
You can easily forward to any JSP you want including the same JSP. Be aware that this will be a completely new request and a new invocation of the JSP. From the point of view of everything involved, it's no different from invoking any other JSP.
This code is completely egregious for a number of reasons:
<td> <% out.print(items.get(i).getItemNumber()); %> </td>
1. Java code in a JSP is ridiculous and irresponsible in 2012.
2. Even when scriptlets were in vogue, using out.println() i this manner is completely inside out. But as scriptlets shouldn't be used at all, that's moot.
I know from reading other posts that Java code in the jsp is frowned up, but I have been told that is how I have to do it (reasons unknown).
You have been badly misinformed. And if this other party told you to do it as above then this is someone whose advice
you should avoid like the plague.
Step 1: Refactor the JSP to use the JSTL and EL instead of scriptlets. There is
no valid excuse, none at all, for using scriptlets in a JSP that was not written prior to 2002.
Step 2: Be sure that your page controller is setting up everything needed for the page. Keep the complexity in the controller, not in the JSP.
After that, we'll see how much closer you are to your goal and take it from there. You current path is taking you in the wrong direction.