netsoss / embedded-jetty Goto Github PK
View Code? Open in Web Editor NEWProvides a simple way of building an embedded Jetty that allows for xml-free applications
License: MIT License
Provides a simple way of building an embedded Jetty that allows for xml-free applications
License: MIT License
I have created a small JAX-RS2 project using Jersey2 and the NetsOSS embedded-jetty builder.
I want to add functionality to stop Jetty via HTTP POST, as described here: org.eclipse.jetty.server.handler.ShutdownHandler. I can not see that there is an appropriate method in the builder to perform this.
The following method could be added to the EmbeddedJettyBuilder to achieve this:
public EmbeddedJettyBuilder addHandlerAtRoot(HandlerBuilder<Handler> handlerHandlerBuilder) {
handlers.add(handlerHandlerBuilder);
return this;
}
In my bootstrap code I can call:
builder.addHandlerAtRoot(new HandlerBuilder<Handler>(new ShutdownHandler("foo")));
I have downloaded a local copy of the snapshot and added the code snippet mentioned abode to verify that this actually works.
It may be that I have overlooked something and that this is already possible in the existing code.
addServlet
returns a special builder for servlets (ServletHolderBuilder
), but addFilter
just returns the ServletContextHandlerBuilder
.
Workaround:
FilterHolder filterHolder = new FilterHolder(ServletContainer.class);
filterHolder.setInitParameter("javax.ws.rs.Application", Jsr311Application.class.getCanonicalName());
context.
addFilterHolder(filterHolder, "/*", EnumSet.of(REQUEST)).
It's currently not possible to configure the Connector properties.
Guava is a dependency, that should not be necessary.
It should be necessary to have dependencies to e.g. environment.properties. Remove all references to this.
String usePath = contextPath + subPath;
makes a funny path when subPath is null.
Add JSP(X) support with examples in embedded-jetty-sample
Currently it is necessary to recompile to get fresh resources, that should be fixed.
I got a problem with Jetty not serving the entire file (bootstrap.css in my case), it would stop sending after most of the file had been sent, missing 1108 bytes.
Upgrading to 9.0.5.v20130815 fixed the issue.
EmbeddedJettyBuilder does not support HTTPS endpoints. Add support for this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.