-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getHttpServletMapping for async dispatch #4741
Comments
See jakartaee/servlet#309 for some clarification (hopefully?) |
Added unit tests for expected behavior Signed-off-by: Greg Wilkins <gregw@webtide.com>
I think this is related to the work that I'm doing in #4777, where I've made HttpURI, HttpFields and MetaData immutable. When doing dispataches the entire fields and uri instances are replace and then reverted, rather than their component parts. I think a similar approach can be taken with pathInContext, servletPath, pathInfo and pathMapping. Rather than handling each individually, I think the request can carry an immutable |
@lachlan-roberts to get your brain into this space, can you write a little webapp that can be deployed on tomcat and undertow to verify if they follow the TCK with respect to [2] in jakartaee/servlet#309 |
Note also that the current implementation of |
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
…rvletName Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Greatly increased the scope of this PR by combining the servletPath and pathInfo into the ServletPathMapping class that implements the HttpServletPathMapping interface. This allows us to greatly simplify the matching of servlets and reduce the number of times we need to actually to the match per request. Signed-off-by: Greg Wilkins <gregw@webtide.com>
Fixed problems with previous commit more cleanup of attributes in dispatcher. Signed-off-by: Greg Wilkins <gregw@webtide.com>
More code cleanups Signed-off-by: Greg Wilkins <gregw@webtide.com>
Named dispatch cleanup Signed-off-by: Greg Wilkins <gregw@webtide.com>
misc cleanup Signed-off-by: Greg Wilkins <gregw@webtide.com>
Added tests for named dispatchers Do not use ServletPathMapping for named dispatch Signed-off-by: Greg Wilkins <gregw@webtide.com>
renamed confusing isDefault method on ServletMapping Signed-off-by: Greg Wilkins <gregw@webtide.com>
simplified setAttribute Signed-off-by: Greg Wilkins <gregw@webtide.com>
added javadoc about AsyncAttributes Signed-off-by: Greg Wilkins <gregw@webtide.com>
Fixed javadoc Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4741 - fixes to jetty implementation of HttpServletMapping Signed-off-by: Lachlan Roberts <lachlan@webtide.com> * Issue #4741 - don't lazily generate HttpServletMapping to preserve servletName Signed-off-by: Lachlan Roberts <lachlan@webtide.com> * Issue #4741 - tests should expect no leading / for matchValue Signed-off-by: Lachlan Roberts <lachlan@webtide.com> * resolving TODOs from review - removed pathSpec from Request - getServletMapping moved to ServletHandler Signed-off-by: Lachlan Roberts <lachlan@webtide.com> * Issue #4741 - only create HttpServletMapping for exact matches once Signed-off-by: Lachlan Roberts <lachlan@webtide.com> * use wrapped attributes for async dispatch Signed-off-by: Lachlan Roberts <lachlan@webtide.com> * Issue #4741 - Changes from review, revert async attribute wrapping Signed-off-by: Lachlan Roberts <lachlan@webtide.com> * Issue #4741 - Changes from review Signed-off-by: Lachlan Roberts <lachlan@webtide.com> * Issue #4741 Async ServletMapping Greatly increased the scope of this PR by combining the servletPath and pathInfo into the ServletPathMapping class that implements the HttpServletPathMapping interface. This allows us to greatly simplify the matching of servlets and reduce the number of times we need to actually to the match per request. Signed-off-by: Greg Wilkins <gregw@webtide.com> * Issue #4741 Async ServletMapping Fixed problems with previous commit more cleanup of attributes in dispatcher. Signed-off-by: Greg Wilkins <gregw@webtide.com> * Issue #4741 Async ServletMapping More code cleanups Signed-off-by: Greg Wilkins <gregw@webtide.com> * Issue #4741 Async ServletMapping Named dispatch cleanup Signed-off-by: Greg Wilkins <gregw@webtide.com> * Issue #4741 Async ServletMapping misc cleanup Signed-off-by: Greg Wilkins <gregw@webtide.com> * Issue #4741 Async HttpServletMapping Added tests for named dispatchers Do not use ServletPathMapping for named dispatch Signed-off-by: Greg Wilkins <gregw@webtide.com> * Issue #4741 Async HttpServletMapping renamed confusing isDefault method on ServletMapping Signed-off-by: Greg Wilkins <gregw@webtide.com> * Issue #4741 Async HttpServletMapping simplified setAttribute Signed-off-by: Greg Wilkins <gregw@webtide.com> * Issue #4741 Async HttpServletMapping added javadoc about AsyncAttributes Signed-off-by: Greg Wilkins <gregw@webtide.com> * Issue #4741 Async HttpServletMapping Fixed javadoc Signed-off-by: Greg Wilkins <gregw@webtide.com> Co-authored-by: Greg Wilkins <gregw@webtide.com>
This completes the refactoring started in #4851, using the HttpServletMapping field to avoid having the servletPath field in the Request and instead have a pathInContext field. Signed-off-by: Greg Wilkins <gregw@webtide.com>
reverted ResourceService changes Signed-off-by: Greg Wilkins <gregw@webtide.com>
fixed gzip handler Signed-off-by: Greg Wilkins <gregw@webtide.com>
Fixed several TODOs left in the code removed _contextPath field and used an attributes lookup for include replaced setContextPaths with setContext Signed-off-by: Greg Wilkins <gregw@webtide.com>
Used the same pattern from the contextPath changes for servletPath and pathInfo. Now the servletPathMapping is always set on the request and only if the dispatch is an include do the effected methods look deeper for the source values. Signed-off-by: Greg Wilkins <gregw@webtide.com>
Improved javadoc Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #4741 HttpServletMapping This completes the refactoring started in #4851, using the HttpServletMapping field to avoid having the servletPath field in the Request and instead have a pathInContext field. Signed-off-by: Greg Wilkins <gregw@webtide.com> * Issue #4741 HttpServletMapping reverted ResourceService changes Signed-off-by: Greg Wilkins <gregw@webtide.com> * Issue #4741 HttpServletMapping fixed gzip handler Signed-off-by: Greg Wilkins <gregw@webtide.com> * Issue #4741 HttpServletMapping Fixed several TODOs left in the code removed _contextPath field and used an attributes lookup for include replaced setContextPaths with setContext Signed-off-by: Greg Wilkins <gregw@webtide.com> * Issue #4741 HttpServletMapping Used the same pattern from the contextPath changes for servletPath and pathInfo. Now the servletPathMapping is always set on the request and only if the dispatch is an include do the effected methods look deeper for the source values. Signed-off-by: Greg Wilkins <gregw@webtide.com> * Issue #4741 HttpServletMapping Improved javadoc Signed-off-by: Greg Wilkins <gregw@webtide.com>
Unlike the path methods (contextPath, servletPath, pathInfo), the new 4.0 getHttpServletMapping() method does not change when an AsyncContext.dispatch() is done, making it more like include.
The text was updated successfully, but these errors were encountered: