Reputation: 21
I am using setHeader()
method to refresh a JSP page as shown below
response.setHeader("Refresh", "5; URL=passDebitCard.jsp");
Now I want to send parameters to this passDebitCard.jsp after refreshing for 5 seconds How can I do that?
Upvotes: 1
Views: 2788
Reputation: 8771
You can append GET
parameters to the URL like this :
response.setHeader("Refresh", "5; URL=passDebitCard.jsp?param1=test1¶m2=test2");
You should also put an absolute path to this URL as a good practice, like this :
response.setHeader("Refresh", "5; URL=" + request.contextPath + "/passDebitCard.jsp?param1=test1¶m2=test2");
so you won't have path problem even if the previous page is moved or different.
Upvotes: 1