users@servlet-spec.java.net

[servlet-spec users] [jsr369-experts] Re: [73-getMapping] PROPOSAL

From: Edward Burns <edward.burns_at_oracle.com>
Date: Wed, 8 Feb 2017 12:58:49 -0800

MT> Much clearer. Many thanks. +1 from me.

EB> Aside from the below mentioned changes to the sketch provided by Arjan,
EB> I have a question. Does it make sense to allow the caller to discover
EB> if the mapping was invoked via a Servlet vs. a Filter? If so, how about
EB> adding a method to Mapping boolean isServlet()?

MT> How would that work? If you call a method on the HttpServletRequest then
MT> the request will have been mapped to exactly one servlet and to 0 to
MT> many filters. How do you determine which mapping to return? Do you
MT> return them all?

>>>>> On Tue, 15 Sep 2015 08:11:56 -0700, Edward Burns <edward.burns_at_oracle.com> said:

EB> Let's just leave that out, then.

I have updated the proposal and implemented it on top of GlassFish
trunk, but it is not yet committed.

I addressed the Filter and Listener issue as follows:

HttpServletRequest.getMapping():

  If called from a Servlet, return the Mapping by which this
  HttpServletRequest was invoked, otherwise return a Mapping equivalent
  to the one specified for the default implementation. Each invocation
  of this method must return a fresh instance of Mapping. The
  implementation must retain no reference to the returned
  Mapping. Servlet 4.0 compliant implementations must override this
  method.

  Implementation Requirements:

    The default implementation returns a Mapping that returns the empty
    string for the match value and pattern and MappingMatch.UNKNOWN for
    the match type.

The full API can be browsed at

https://maven.java.net/service/local/repositories/snapshots/archive/javax/servlet/javax.servlet-api/4.0.0-b03-SERVLET_SPEC-73-SNAPSHOT/javax.servlet-api-4.0.0-b03-SERVLET_SPEC-73-20170208.204929-1-javadoc.jar/!/javax/servlet/http/HttpServletRequest.html#getMapping--

ACTION: Please reply by close of business GMT-0800 Friday 10 February or
I'll run with the above proposal.

Thanks,

Ed

-- 
| edward.burns_at_oracle.com | office: +1 407 458 0017
| 19 business days until planned start of JSF 2.3 Final Approval Ballot
|  9 business days until DevNexus 2017
| 34 business days until JavaLand 2017