File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Servlets 2.4 Specification Questions 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 "Servlets 2.4 Specification Questions" Watch "Servlets 2.4 Specification Questions" New topic
Author

Servlets 2.4 Specification Questions

Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

Servlet Specification 2.4

SRV.9.9.2 Error Pages

1.Error-page declarations using the exception-type element in the deployment
descriptor must be unique up to the class name of the exception-type. Similarly,
error-page declarations using the status-code element must be unique in the
deployment descriptor up to the status code
.


2.The error page mechanism described does not intervene when errors occur
when invoked using the RequestDispatcher or filter.doFilter method. In this
way, a fillter or servlet using the RequestDispatcher has the opportunity to handle
errors generated.
--------------------------------------------------------------------------------------------------

SRV.8.1.1 Query Strings in Request Dispatcher Paths

3.Parameters specifed in the query string used to create the RequestDispatcher
take precedence over other parameters of the same name passed to the included
servlet. The parameters associated with a RequestDispatcher are scoped to apply
only for the duration of the include or forward call.

--------------------------------------------------------------------------------------------------------

Q1.Please explain what does the text in bold means "Unique up to the class name,Unique up to the status code" in the first statement.

Q2. What does " error page mechanism described does not intervene when errors occur
when invoked using the RequestDispatcher or filter.doFilter method" means ?

Q3.Can anyone provide an example for the third statement


OCPJP 6.0 93%
OCPJWCD 5.0 98%
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3775

Q1.Please explain what does the text in bold means "Unique up to the class name,Unique up to the status code" in the first statement.

You can have multiple error-page declarations with unique class types in the hierarchy of the exceptions along with specific type of exception classes (the subclasses of those) which will be invoked for specific types which they meant to be.
Q2. What does " error page mechanism described does not intervene when errors occur
when invoked using the RequestDispatcher or filter.doFilter method" means ?

That means this Error Page mechanism does not invoked in these scenarios, you may handle the errors yourself in these cases.
Q3.Can anyone provide an example for the third statement

Well, it says when you create a RequestDispatcher (with parameters) for a request the parameter(s) came with the original request with the same name will be replaced by the new ones.

Eg:


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlets 2.4 Specification Questions
 
Similar Threads
HttpServletResponse.sendError
RequestDispatcher null? is this possible outcome.
Defining ErrorDocument in Websphere 5.0.1
Doubt with web.xml
How to handle an Exception thrown in a Scriptlet in a .Tag File