• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet exception occurs at "dispatcher.forward()"

 
tushar panda
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Ninad Kulkarni
Ranch Hand
Posts: 802
Hibernate Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@ tushar
Also give details of directory structure application and web.xml
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
veeresh soni
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you should use another way to get dispacher


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


try this
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic