Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 647
  • Last Modified:

jsp redirect automaticlly

Hello, experts,

I'm using the redirect funation, response.sendRedirect(aurl). I want to implement a function, when user input some incorrect info. , the user will get some message. like, no record found, you will be redirect to pageA in a few minutes.

<%
out.println("no record found, you will be redirect to pageA in a few minutes);
response.sendRedirect(pageAurl).

%>

Do I need set a time for this?

Thanks for your reply

0
lilyyan
Asked:
lilyyan
  • 4
  • 3
2 Solutions
 
objectsCommented:
Use a meta refresh
0
 
objectsCommented:
<meta http-equiv="refresh" content="180;url=<%= pageAurl %>/">

http://webdesign.about.com/cs/metatags/a/aa080300a.htm
0
 
lilyyanAuthor Commented:
Hi, thanks for your reply. That's a good idea.

Well, my program is a jsp file.

If user is a new user, the program will tell that this user need to do sign on.

If user's password is wrong, the progarm will tell that the password is incorrect, and the user will be redirected to the login page.

so in the jsp file, I want the program can first display the error message:password incrorrect ,
then go to the login page. (i guess i still need use redirection function, but i don't know how to set the time)






0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
lilyyanAuthor Commented:
will the following code work?

if password wrong
<%
out.println("no record found, you will be redirect to pageA );
response.sendRedirect(pageAurl).
%>
0
 
objectsCommented:
No, you need to use the meta tag as I posted above, and specify the login page as the refresh page.
ie. after n seconds the page will refresh to the login page
0
 
manuel_mCommented:
As objects mentioned you should set the meta tag...

<meta http-equiv="refresh" content="5;url=http://webdesign.about.com/">

this will refresh to the site after 5 seconds.

I think this is what you are searching for. don't rate my comment ;) rate objects'

greetz
manuel
0
 
lilyyanAuthor Commented:
thanks all for your replies : )
0
 
objectsCommented:
no worries :)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now