File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes URGENT:Error when using Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "URGENT:Error when using "forward" method of RequestDispatcher" Watch "URGENT:Error when using "forward" method of RequestDispatcher" New topic

URGENT:Error when using "forward" method of RequestDispatcher

Raj Sikka
Ranch Hand

Joined: Apr 11, 2003
Posts: 34
Hi ,
I am getting "ServletException" while using forward method of RequestDispatcher.
Can anyone suggest the solution for this.
i am using following piece of code.
It gave ServletException at "rd.forward(--)".
RequestDispatcher rd =
what are all possible ways to get ServletException.
And what is the workaround for this problem?
Pls help.
Thanks in advance ,
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
A ServletException usually comes with a descriptive string, which you should find in the stack trace. Can you tell us what it is?

Ron Newman - SCJP 1.2 (100%, 7 August 2002)
Raj Sikka
Ranch Hand

Joined: Apr 11, 2003
Posts: 34
Hi ,Thanks for your prompt response.
here is the stack trace that i obtained.
at weblogic.servlet.internal.RequestDispatcherImpl.forward(
at nif.wnf.util.ErrorPage.displayErrorPage(
at svm.eug.servlet.EUGControllerServlet.EUGConnectivityModified(
at svm.eug.servlet.EUGControllerServlet.service(
at javax.servlet.http.HttpServlet.service(
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(
at weblogic.servlet.internal.TailFilter.doFilter(
at weblogic.servlet.internal.FilterChainImpl.doFilter(
at nif.wnf.filter.SessionFilter.doFilter(
at weblogic.servlet.internal.FilterChainImpl.doFilter(
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(
at weblogic.servlet.internal.ServletRequestImpl.execute(
at weblogic.kernel.ExecuteThread.execute(
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
there's nothing below there, giving a "root cause" ?
Is it possible that the page you forwarded to is actually generating the exception?
[ July 23, 2003: Message edited by: Ron Newman ]
Raj Sikka
Ranch Hand

Joined: Apr 11, 2003
Posts: 34
That was the only stack trace that i got.
One more thing is ..
"xyz.jsp" is compiled successfully.
I wrote one "out.println()" statement at the first line of that jsp. i couldnt see that line also while executing.
it simply says "ServletException" and it points the line "rd.forward("xyz.jsp")".
what is the problem in forwarding to that jsp ?
pls help,
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
Does this error still happen if you replace the contents of "xyz.jsp" by something simple, like this?
<body><p>Hello, world!</p></body>
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5371
is your xyz.jsp is in the same folder where your servlet is residing ??
with this request.getRequestDispatcher("xyz.jsp");
code, server will try to locate xyz.jsp in the directory where servlet is available.
If you have folder structure like..
then you should use following code:

"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
I agree. Here's the link:
subject: URGENT:Error when using "forward" method of RequestDispatcher
Similar Threads
forward() Method Problem
forward method in jsp
Forwarding request to same servlet
html:errors tag not working
getting servlet name from request?