Fixed#5555 NPE if there is a filter with a servlet name mapping, but a request is received for a servlet without a name match.
Added more simple tests for servlet and filter mappings
Fixed#5555 NPE if there is a filter with a servlet name mapping, but a request is received for a servlet without a name match.
Added more simple tests for servlet and filter mappings
* Fixes#55498 ServletHolder cleanup
Various cleanups for #5498 including:
+ renaming multiple `_servlet` fields in inner classes to avoid confusion
+ better comments in prepare method to describe why it is needed
+ call prepare from Invoker servlet
+ The `_servlet` field is not set until after the servlet is initialized
+ Consistent wrapping of `SingleThreadedWrapper` now in `initServlet`
+ The `getServlet` method now looks the volatile `_servlet` to avoid locking if possible
+ The `handle` method now calls `getServletInstance` as servlet will have been initialized in `prepare`
+ Found and fixed race with making unavaiable servlet available again
+ fixed nanotime overflow
+ fixed several compiler warnings/suggestions
+ removed while true from unavailable servlet
+ Do not destroy servlets unless init has been called.
+ Added TODOs about calling predestroy on instances not created by the holder.
+ Do not destroy servlets unless init has been called.
+ Added TODOs about calling predestroy on instances not created by the holder.
+ improved dump and toString
Moved jetty-dir.css from jetty-util to jetty-server,
so that it can be found by ResourceHandler when using JPMS.
Updated DefaultServlet to call a ResourceHandler method
to retrieve the stylesheet.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Fixes#5378 Setting Holders during STARTING
Holders are now started/initialized if needed by a new utility method
* Fixes#5378 Setting Holders during STARTING
Holders are now started/initialized if needed by a new utility method
* Issue #5022 Filter Cache cleanup
Issue #5022 Filter Cache cleanup:
+ Fixed many compiler warnings
+ removed old LazyList leftovers
+ Don't create holder string for source unless required
+ Only have a single type of chain, so it can be wrapped regardless of cache
+ Reverse mappings lists to make filter chain creation easier
+ build chain directly rather than build a list then a chain
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* added comment to explain ordering
Signed-off-by: gregw <gregw@webtide.com>
* More cleanups
* fixed toString format
turn off debug in OSGI test
* Issue #5357 - Updating to https://eclipse.org/
- Removing redundant <url> refs in pom.xml
- Correcting bad indenting from merge
- Correcting mailing list references
- Correcting bugs.eclipse.org references
- Correcting text file references
- Correcting html references
- Correcting further references
- Correcting download.eclipse.org reference
- Adding test for demo-base /proxy/current/
- Ensuring jetty-client is included in javadoc-proxy.war/WEB-INF/lib
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Issue #5162 CDI embedded integration improvements
Clean up CDI integration and documentation to better support embedded usage.
+ made listener public
+ added utility class for SCIs
* Issue #5162 CDI embedded integration improvements
Clean up CDI integration and documentation to better support embedded usage.
+ moved EmbeddedWeldTest to jetty-embedded
* fix javadoc
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #5162 CDI embedded integration improvements
ventilated text
* fix test pom
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Fixed javadoc
* Fixed javadoc
* Issue #5162 CDI embedded integration improvements
Moved tests to jetty-cdi to avoid consequences to other tests in embedded
* trailing new line
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* updates from review
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Feedback from review
On the client:
* Origin.Address.host is passed through HostPort.normalizeHost(),
so that if it is IPv6 is bracketed.
Now the ipv6 address passed to an `HttClient` request is bracketed.
* HttpRequest was de-bracketing the host, but now it does not anymore.
On the server:
* Request.getLocalAddr(), getLocalName(), getRemoteAddr(),
getRemoteHost(), getServerName(), when dealing with an IPv6 address,
return it bracketed.
The reason to return bracketed IPv6 also from *Addr() methods is that
if it is used with InetAddress/InetSocketAddress it still works, but
often it is interpreted as a URI host so brackets are necessary.
* DoSFilter was blindly bracketing - now it does not.
Added a number of test cases, and fixed those that expected
non-bracketed IPv6.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Issue #5093 Static UrlEncoded
Updated UrlEncoded to static only class with no synchronization
* Fixed additional tests
* fixed formatting
Signed-off-by: gregw <gregw@webtide.com>
* Replaced relevant usages of synchronized with AutoLock.
* Made AutoLock serializable since classes that use it may be stored in the HttpSession.
* Added convenience methods to AutoLock to execute lambdas with the lock held.
* Introduced AutoLock.WithCondition to use a Lock and a Condition together.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Fixes#5057 Included root context path
Root context path in include should be empty string.
* Issue #5057
merged context path methods as result of review.
ServletContent.getContextPath now returns the encoded contextPath (if anybody is silly enough to have one).
In jetty-10, the Container.Listener is also dumped as a bean, whereas it is not in
jetty-9. The test was checking that nothing was dumped as a bean, so
changed the test to explicitly look for the special formatting for
listeners, filters and servlets.
* 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>
* 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>
Introduced:
* Request Request.headers(Consumer<HttpFields.Mutable>).
This allows applications to modify the headers, and chain calls.
It also delegates the precise semantic of put/add/remove/clear to HttpFields, so there is no API duplication.
* HttpRequest.header(HttpField) to efficiently add fields while normalizing the request (only used in implementation).
* HttpResponse.header(HttpField) to efficiently add fields while parsing the response (only used in implementation).
This pairs with HttpResponse.trailer(HttpField).
* HttpResponse.headers(Consumer<HttpFields.Mutable>) to modify the fields after they have been populated (only used in tests).
Removed:
* Request.[set,add,put,remove], replaced by headers(Consumer<HttpFields.Mutable>).
Deprecated:
* Request.header(String, String)
* Request.header(HttpHeader, String)
Both replaced by headers(Consumer<HttpFields.Mutable>) with clearer semantic for add/put/remove.
All the rest is code cleanup to remove the usage of the deprecated header() methods.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Use HandlerList instead of HandlerCollection
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Use HandlerList instead of HandlerCollection
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Restored IncludedGzipTest.
Fixed ServletContextHandler.relinkHandlers(), now excluding
the checks for GzipHandler.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Fixed XML files.
Restored ServletContextHandler.setGzipHandler() and
deprecated it in case it's used from user's XML files.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>