Forums Register Login

Servlets 2.4 Specification Questions

+Pie Number of slices to send: Send
 

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
+Pie Number of slices to send: Send
 

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:

Tell me how it all turns out. Here is a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 868 times.
Similar Threads
Doubt with web.xml
RequestDispatcher null? is this possible outcome.
Defining ErrorDocument in Websphere 5.0.1
How to handle an Exception thrown in a Scriptlet in a .Tag File
HttpServletResponse.sendError
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 22:34:19.