wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes confusion about compilaton,translation and runtime errors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "confusion about compilaton,translation and runtime errors" Watch "confusion about compilaton,translation and runtime errors" New topic
Author

confusion about compilaton,translation and runtime errors

neetika sharma
Ranch Hand

Joined: May 19, 2006
Posts: 89
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
Marshal

Joined: Mar 22, 2005
Posts: 42372
    
  64
What error did you get when you tried it?


Ping & DNS - my free Android networking tools app
Micheal John
Ranch Hand

Joined: Nov 01, 2006
Posts: 344
Since you are using requestdispatcher of ServletContext, it required relative path ("/" should be mandatory)


Micheal John
SCJP 1.4 (86%), SCWCD 1.4 (86%), SCBCD 1.3 (85%), SCDJWS (Just Started...) - Satisfaction Lies in Our EFFORT, Not in the ATTAINMENT
neetika sharma
Ranch Hand

Joined: May 19, 2006
Posts: 89
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

Joined: Mar 18, 2004
Posts: 572
I think its a runtime error because no complains at compilations time and as its servlet so no translation required
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: confusion about compilaton,translation and runtime errors