<< Back to previous view

[SERVLET_SPEC-50] Configure <error-page> programmatically in Servlet 3.0 Created: 01/Nov/12  Updated: 01/Mar/13

Status: Open
Project: servlet-spec
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: shijas Assignee: Shing Wai Chan
Resolution: Unresolved Votes: 3
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: FUTURE_RELEASE
Participants: arjan tijms, Rajiv Mordani, shijas and Shing Wai Chan

 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.



 Comments   
Comment by Rajiv Mordani [ 09/Jan/13 07:55 AM ]

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.

Comment by arjan tijms [ 09/Feb/13 09:15 PM ]

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.

Generated at Sat Apr 19 17:13:56 UTC 2014 using JIRA 4.0.2#472.