infinite loop

Hi

I am building a web application in JSP where the user need to login

the user input will be sent to loginServlet to be validated

I tried to make the user go to the page he logged in from

first I get the url using

String url = request.getHeader("referer");

then send him back using

RequestDispatcher view = request.getRequestDispatcher(url);

view.forward(request,response);

if the user logged in one the first try it works fine, but if he made a mistake and tried again it will get an error for infinite loop because the url string will refere to the loginServlet

how can I avoid this?

thnx

Message was edited by:

Lich_King

[736 byte] By [Lich_Kinga] at [2007-11-26 15:56:27]
# 1
Don't use referer :-)Maybe have a hidden field on the page which specifies which field you go back to?You can populate it from referer the first time, but on subsequent tries populate it from the request parameter.
evnafetsa at 2007-7-8 22:17:17 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...