Asme Just Asme Just - 1 year ago 125
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.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download