[73-MappingDiscovery] and getNamedDispatcher()


Edward Burns
 

Hello Experts,

Our TCK developer discovered a corner case in the 73-MappingDiscovery
spec and impl: what to do about the case of getNamedDispatcher()?

I propose we do the same approach in this case as we do for the "9.3.1
Included Request Parameters" and "9.4.2 Forwarded Request Parameters"
sections: declare we must not produce a HttpServletMapping instance if
the "servlet was obtained by using the getNamedDispatcherMethod". This
will be specified in the javadoc for
HttpServletRequest.getHttpServletMapping() by adding a paragraph after
the first paragraph that states:

If the servlet corresponding to this request was obtained using the
getNamedDispatcherMethod method, this method must return null.

ACTION: Since we are now after Pubilc Review, I would like to request a
quick response on this. Please reply by COB GMTs0500 Friday 16 June
2017. No response indicates you accept this proposal.

Thanks,

Ed

--
| edward.burns@... | office: +1 407 458 0017


Stuart Douglas
 

Another alternative would be to add a MappingMatch of NAMED, use
getServletName() to return the name, and have pattern and matchValue
return null (or the empty string).

I think this could be more useful, however it is a larger change which
may be an issue this late in the process.

Stuart

On Wed, Jun 14, 2017 at 11:41 PM, Edward Burns <edward.burns@...> wrote:
Hello Experts,

Our TCK developer discovered a corner case in the 73-MappingDiscovery
spec and impl: what to do about the case of getNamedDispatcher()?

I propose we do the same approach in this case as we do for the "9.3.1
Included Request Parameters" and "9.4.2 Forwarded Request Parameters"
sections: declare we must not produce a HttpServletMapping instance if
the "servlet was obtained by using the getNamedDispatcherMethod". This
will be specified in the javadoc for
HttpServletRequest.getHttpServletMapping() by adding a paragraph after
the first paragraph that states:

If the servlet corresponding to this request was obtained using the
getNamedDispatcherMethod method, this method must return null.

ACTION: Since we are now after Pubilc Review, I would like to request a
quick response on this. Please reply by COB GMTs0500 Friday 16 June
2017. No response indicates you accept this proposal.

Thanks,

Ed

--
| edward.burns@... | office: +1 407 458 0017



Edward Burns
 

On Thu, 15 Jun 2017 02:55:07 +0200, "Stuart Douglas" <sdouglas@...> said:
SD> Another alternative would be to add a MappingMatch of NAMED, use
SD> getServletName() to return the name, and have pattern and matchValue
SD> return null (or the empty string).

SD> I think this could be more useful, however it is a larger change which
SD> may be an issue this late in the process.

Yes, it is too late. I stick by my existing proposal.

Ed
--
| edward.burns@... | office: +1 407 458 0017


Greg Wilkins
 


Ed,

I think that when using a Dispatcher obtained from getNamedDispatcher, then nothing about the request is actually changed.  The servletPath and pathInfo remain the same, it is just that a different servlet has been explicitly named to handle the request.

So in that case, I think that getHttpServletMapping return value should also not change. Ie it should reflect the mapping that was used to set the servletPath and pathInfo.

In short I think that getHttpServletMapping should only change in coordination with changes to getServletPath, getPathInfo, getRequestURI.    Change one, you change them all.  Leave some unchanged, then we leave all unchanged.

So my counter proposal is:

>   If the servlet corresponding to this request was obtained using the
>   getNamedDispatcherMethod method, this method returns the mapping last applied to 
>   this request to set the values of getServletPath and getPathInfo


regards


On 15 June 2017 at 19:22, Edward Burns <edward.burns@...> wrote:
>>>>> On Thu, 15 Jun 2017 02:55:07 +0200, "Stuart Douglas" <sdouglas@...> said:

SD> Another alternative would be to add a MappingMatch of NAMED, use
SD> getServletName() to return the name, and have pattern and matchValue
SD> return null (or the empty string).

SD> I think this could be more useful, however it is a larger change which
SD> may be an issue this late in the process.

Yes, it is too late.  I stick by my existing proposal.

Ed
--
| edward.burns@... | office: +1 407 458 0017






--
Greg Wilkins <gregw@...> CTO http://webtide.com