• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Servlets 2.4 Specification Questions

 
Ranch Hand
Posts: 634
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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:

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic