About Question enthuware.jwpv6.2.798 :

Moderator: admin

Post Reply
himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

About Question enthuware.jwpv6.2.798 :

Post by himaiMinh »

For option 1, I can demo even though it is not the best way to handle exception :

Code: Select all

public class MyServlet extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
         try{
             throw new IOException();
         }
         catch (IOException e){
              request.getRequestDispatcher("errorPage.jsp").forward(request, response);
         }
    }
}

admin
Site Admin
Posts: 10046
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.798 :

Post by admin »

Correct. But this is not the only solution, which is what the option says, "cannot be done...unless the exception is caught in the servlet". That is why this option is incorrect.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 42 guests