Asme Just Asme Just - 8 months ago 68
Java Question

Automatic redirection to a servlet from a JSP page

Is there a way to auto redirect to a servlet from a JSP page?

I know it's possible to do this to another JSP like this:

<% response.addHeader("Refresh","4;./nexPage.jsp"); %>

This code will redirect to nexPage.jsp after 4 seconds.

But I want it to redirect to a given servlet instead.


Can you please check with this.

<meta http-equiv="refresh" content="5;URL=/servleturl">

This will redirect to the given servlet url after 5 seconds. place this tag between your head tag. But i think this is not SEO friendly.