views:

92

answers:

1

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

A: 

You just need to instruct the browser to NOT cache the page. You can do this with the following set of meta tags inside the HTML <head> element of the JSP pages in question:

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">

Make sure that you clear the browser cache before testing.

BalusC
I have tried using this but this doesnt seem to work.I am using safari
Sam