I have a jsp which will be submitted in to a first servlet which forwards the request to a second servlet.
I tried this on my home and in my office it gives two different results.
in my office when i call req.getRequestURL() in my second servlet it will give me the http://localhost:8080/processparam where i obtained the request dispather as req.getRequestDispatcher("processparam") in my first servlet.but same code when i run in my home instead of this it displays http://localhost:8080/test the url which will be invoked when i submit the JSP page for my first servlet test why is this happening it is the same code. what could be the reason.
in my test.java file i will get the requestdispatcher and forward the request. once i get this URL http://localhost:8080/test on browser after submitting the JSP file in my office when i change url to http://localhost:8080/test/1/2/3 it works fine but same thing in my home system it throws stack overflow exception if i comment requestdispatcher code it works fine
I am REALLY CONFUSED WITH THIS FROM 3 DAYS can any body help me in solving this issue
Here is your problem. You are getting a dispatcher using a path relative to the current request. Which means that "/contextparam/processparam" will be called, which goes back to your first servlet again. And this loops until the stack explodes. You should use a path relative to the context instead :
I tried putting the extra elements for <web-app ...> from the specified location now it is giving other exception. can any body give me a correct web.xml code with web-app...> and doc type elements it will be very help full
Thanks [ April 09, 2008: Message edited by: raja ram ]