wood burning stoves 2.0*
The moose likes Servlets and the fly likes servlet exception occurs at Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet exception occurs at "dispatcher.forward()"" Watch "servlet exception occurs at "dispatcher.forward()"" New topic
Author

servlet exception occurs at "dispatcher.forward()"

tushar panda
Ranch Hand

Joined: Feb 16, 2009
Posts: 133
my code is :
"welcome2.java"


whenever i am calling this servlet code from my jsp file :
"welcome1.jsp"


it is showing "servlet exception"



showing this a 100-200 times then a "stackoverflow error".

if i put a stacktrace , it is giving :




is there a method to get the root cause of the servlet exception , how can i know the exact cause of the exception.
it looks as if a infinite loop is at line 10 in the servlet .
please help me.


Do Right , Fear No Man
Ninad Kulkarni
Ranch Hand

Joined: Aug 31, 2007
Posts: 784

@ tushar
Also give details of directory structure application and web.xml


SCJP 5.0 - JavaRanch FAQ - Java Beginners FAQ - SCJP FAQ - SCJP Mock Tests - Tutorial - JavaSE7 - JavaEE6 -Generics FAQ - JLS - JVM Spec - Java FAQs - Smart Questions
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12683
    
    5
The significant point is:
showing this a 100-200 times then a "stackoverflow error".


You have created circular logic with your forwarding which just keeps calling recursively until the stack runs out of room.

Bill

Java Resources at www.wbrogden.com
veeresh soni
Greenhorn

Joined: Dec 10, 2009
Posts: 12
I think you should use another way to get dispacher


getServletContext().getRequestDispatcher("/servlet/myspace");


try this
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlet exception occurs at "dispatcher.forward()"
 
Similar Threads
ClassCastException in forwarded JSP
HTTP Status 500
PDF save in Browser?
tomcat cannot display jsp struts
Could not retrieve data using JSTL