jsr369-experts@servlet-spec.java.net

[jsr369-experts] Re: [73-getMapping] PROPOSAL

From: Mark Thomas <markt_at_apache.org>
Date: Fri, 11 Sep 2015 20:49:51 +0100

On 11/09/2015 17:35, Edward Burns wrote:
> https://java.net/jira/browse/SERVLET_SPEC-73
>
>>>>>> On Thu, 10 Sep 2015 13:18:32 +0100, Mark Thomas <markt_at_apache.org> said:
>
> MT> Much clearer. Many thanks. +1 from me.
>
> Aside from the below mentioned changes to the sketch provided by Arjan,
> I have a question. Does it make sense to allow the caller to discover
> if the mapping was invoked via a Servlet vs. a Filter? If so, how about
> adding a method to Mapping boolean isServlet()?

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

Mark


>
> The proposal is at
> <https://maven.java.net/service/local/repositories/snapshots/archive/javax/servlet/javax.servlet-api/4.0.0-b01-SERVLET_SPEC-73-SNAPSHOT/javax.servlet-api-4.0.0-b01-SERVLET_SPEC-73-20150911.162919-1-javadoc.jar/!/javax/servlet/http/HttpServletRequest.html>.
>
>
> SECTION: Modified Files
>
> A src/main/java/javax/servlet/http/Mapping.java
>
> - The new type.
> M src/main/java/javax/servlet/http/HttpServletRequest.java
> A src/main/java/javax/servlet/http/MappingMatch.java
>
> - Renamed this from Arjan's MappingType. The fact that it's an enum
> says that it's a type already.
>
> - Added spec language.
>
> - Added UNKNOWN and IMPLICIT MappingType values.
>
> - Dropped isImplicit in favor of enum value.
>
> Please review.
>
> Thanks,
>
> Ed
>
>