aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Internal Server Error page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Internal Server Error page" Watch "Internal Server Error page" New topic
Author

Internal Server Error page

Steven Colley
Ranch Hand

Joined: Feb 18, 2005
Posts: 290
Wich code inside the catch block is supposed to trigger the display of a container generated HTTP Internal Server Error page ?

"response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR)" or
"throw new ServletException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e);"

?

tks.


SCJP | SCWCD | SCBCD | SCWSD 5 | SCEA (I) 1.4 | SCEA 5 | IBM SOA 669
Steven Colley
Ranch Hand

Joined: Feb 18, 2005
Posts: 290
Would it be the first option(sendError) because it says "generated an error page" ?

Tks.
Saurabh Chaubey
Ranch Hand

Joined: Oct 16, 2005
Posts: 101
Hi Felipe,
I think the first option will give the desired output for error500.
Reagarding the second option there is no constructor for ServletException which takes int as the first argument. The valid costructors are as follows:

public javax.servlet.ServletException();
public javax.servlet.ServletException(java.lang.String);
public javax.servlet.ServletException(java.lang.String,java.lang.Throwable);

public javax.servlet.ServletException(java.lang.Throwable);

So, the first option is correct.

Regards,
Saurabh
Steven Colley
Ranch Hand

Joined: Feb 18, 2005
Posts: 290
Hum, you�re dead right Saurabh , there is no constructor like that.
I dind�t get that.

Anyway, if we had somethig like this: "throw new ServletException("String")", i�m also think that the correct answer would be the "sendError()"

Tks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Internal Server Error page
 
Similar Threads
default Internal Server Error page in apache http server
setStatus and sendError
method calling
Custom Error Page
[ANN] Applied Reasoning Mock Exam