Jsp page getting called from cache rather than getting loaded from server

Posted by sam4u-optimistic86 on Stack Overflow See other posts from Stack Overflow or by sam4u-optimistic86
Published on 2010-03-11T05:03:15Z Indexed on 2010/03/11 5:08 UTC
Read the original article Hit count: 400

Filed under:

I am calling a jsp based on 2 parameters which is passed from jsp 1 in this way.Below i pass 2 parameters into 2.jsp and based on these 2 parameters data is displayed in 2.jsp.I have a loop in which i have a number of hrefs like the one i have described below.Each of these href passes a different set of value to 2.jsp.

out.println("<a href=\"2.jsp?prId=" + prog.getId() + count + "\">" + prog.getName() + "</a>");

I retrieve these 2 parameters in 2.jsp using the following lines

count_id = request.getParameter( "country_id" );
prog_id  = Integer.parseInt(request.getParameter( "program_id" ));

Based on these 2 parameters i show the corresponding data in 2.jsp

Now i have a back button in 2.jsp and i call 1.jsp in 2.jsp using the following code

<a href="1.jsp"><img src="/image/back.gif" border="0"></a>

The problem is when i use the back button and go back to 1.jsp and select another href like the one i have described above i get the data related to the previous href selected.

I guess the problem is when i request the page is loaded from cache rather than from the server. Please advice

© Stack Overflow or respective owner

Related posts about jsp