servlet-spec
  1. servlet-spec
  2. SERVLET_SPEC-50

Configure <error-page> programmatically in Servlet 3.0

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      Web.xml can be programmatically created using Servlet 3.0. But features like <error-page> , < session-timeout> still needs to be configured in a web.xml.Can you provide a way to programmatically create these as well? Especially, error-page configuration.

        Activity

        Hide
        Rajiv Mordani added a comment -

        While we did provide programmatic APIs for adding servlets, filters and listeners, we have not exposed a full API for processing every element in the descriptor via APIs. Note that the programmatic APIs are not a complete replacement for the descriptor. It still makes sense to specify certain aspects via descriptors - just like in the case of annotations.

        Show
        Rajiv Mordani added a comment - While we did provide programmatic APIs for adding servlets, filters and listeners, we have not exposed a full API for processing every element in the descriptor via APIs. Note that the programmatic APIs are not a complete replacement for the descriptor. It still makes sense to specify certain aspects via descriptors - just like in the case of annotations.
        Hide
        arjan tijms added a comment -

        Ideally, every element (with some exceptions) would be settable in 3 ways, namely via:

        • The traditional descriptor
        • An annotation
        • A high level programmatic API

        Note that JSF 2.2 introduced a method that's between the descriptor and the programmatic API: a call-back in which the descriptor is exposed as a DOM tree and can be programmatically manipulated. See http://jdevelopment.nl/jsf-22/#533 You could call this a low level programmatic API.

        It might make sense to adopt the JSF 2.2 method for web.xml.

        Show
        arjan tijms added a comment - Ideally, every element (with some exceptions) would be settable in 3 ways, namely via: The traditional descriptor An annotation A high level programmatic API Note that JSF 2.2 introduced a method that's between the descriptor and the programmatic API: a call-back in which the descriptor is exposed as a DOM tree and can be programmatically manipulated. See http://jdevelopment.nl/jsf-22/#533 You could call this a low level programmatic API. It might make sense to adopt the JSF 2.2 method for web.xml.

          People

          • Assignee:
            Shing Wai Chan
            Reporter:
            shijas
          • Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: