Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

confusion about compilaton,translation and runtime errors

 
neetika sharma
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having a bit confusion about the exact type of error being displayed by this problem situation ....

public void doGet(HttpServletRequest req, HttpServletResponse res){ try
{
RequestDispatcher rd = this.getServletContext().getRequestDispatcher("Login.jsp"); // 1
rd.forward(req, res);
}
catch(Exception e)
{
e.printStackTrace();
}
}

Which type of error we will get here by //1 error as we have to give absolute path of Login.jsp??
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What error did you get when you tried it?
 
Micheal John
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you are using requestdispatcher of ServletContext, it required relative path ("/" should be mandatory)
 
neetika sharma
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To, Ulf Dittmer

I havent tried it.There are so many questions in which options displays all kinds of errors...So that time I feel tough to decide for a particular type of error...as in the above example.So I need to kno any specific way to go for the decisionin exam..

and Micheal John..I kno that the code ll definitly give problem but I am not clear about the type of error:-(:-(
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think its a runtime error because no complains at compilations time and as its servlet so no translation required
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic