embedded-jetty

I-Jetty or Jetty

拈花ヽ惹草 提交于 2019-12-03 20:17:01
I have a web application to be hosted on android device. I am currently using the emulator available with android sdk. My application will serve both static as well as dynamic data. I am currently using jetty version 6.1.22. I wanted to ask what will be a better option to be used. 1. Jetty webserver with stripped off code. 2. I-Jetty. My application uses following features- ResourceHandler to serve static resources. A Generic servlet to serve synchronous data requests. An extension to CometServlet to serve asynchronous data requests. I am looking forward to following criteria for comparison.

How to deploy a Scala project from Eclipse?

爱⌒轻易说出口 提交于 2019-12-03 17:04:49
问题 I have a Scala project in Eclipse that I need to package up so I can deploy it to a server. It's based on Jetty but it runs as a standalone application. It contains Scala classes, Java classes and a number of 3rd party jars. I assumed there would be some kind of deployment option in the Scala Eclipse plugin but I've drawn a blank. What is the simplest way to package the Scala project into a runnable file so it can be deployed? Any help greatly appreciated. Cheers. 回答1: Sbt supports web

How to run jetty server for java junit testing

百般思念 提交于 2019-12-03 15:52:04
问题 I am trying to write an integration test to spin up jetty server locally and then use client to communicate with the rest URI and call the business logic downstream. However, when I start my jetty server it does not relinquish the control, so my client is not executed. So I used threading to start my jetty in a different thread, however, the thread finishes before my client call, it says connection refused. Any approach I can take? @Test public void testPerform() { final JettyServer

Embedded Jetty doesn't recognise Spring MVC Security

孤者浪人 提交于 2019-12-03 14:53:18
问题 I am developing a Spring application that starts an embedded Jetty Server. It then "deploys" a Spring MVC web app to this Jetty server. All is working well with multiple controllers, but I fail to add Spring Security to the web app. I use programmatic and annotation-based configuration and the Jetty server is configured like this: Server server = new Server(8080); server.setStopAtShutdown(true); AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();

Publish JAX-WS endpoint with embedded Jetty 7

a 夏天 提交于 2019-12-03 12:51:08
问题 Can anybody help with this? I want to use an embedded Jetty 7 as Endpoint. This is what I tried: public class MiniTestJetty { @WebService(targetNamespace = "http") public static class Calculator { @Resource WebServiceContext context; public int add(int a, int b) { return a + b; } } public static void main(String[] args) throws Exception { int port = 8080; Server server = new Server(port); Calculator calculator = new Calculator(); Endpoint.publish("http://localhost:" + port + "/calc",

How to implement FileUpload in embedded Jetty?

匆匆过客 提交于 2019-12-03 10:19:35
问题 I am writing a android app including a webserver. Therefore I use the Embedded Jetty (8.0.1). The next step I want to do is implementing a file upload. The HTML looks like that and I think correct: <form action=\"fileupload\" method=\"post\" enctype=\"multipart/form-data\"> <table> <tbody> <tr> <td><input type=\"file\" name=\"userfile1\" /></td> </tr> <tr> <td> <input type=\"submit\" value=\"Submit\" /><input type=\"reset\" value=\"Reset\" /> </td> </tr> </tbody> </table> </form> When I use

How to set up SSL on an embedded Jetty?

 ̄綄美尐妖づ 提交于 2019-12-03 08:45:26
I've got jetty 7.x embedded. Basically just creating a SelectChannelConnector to listen on port 80 and WebAppContext to deploy a single WAR directory. I need to add SSL now (all the keystore stuff is done), and I would have guessed to just add an SslSelectChannelConnector, but all the methods are deprecated without any javadocs to explain why, and what to do instead. And the Jetty/SSL docs only show some XML without describing what to do with it. Can anyone get me the entry point here to setting up SSL an an embedded instance of Jetty? I don't think this will be complicated, I just don't know

In the Jetty server how can I obtain the client certificate used when client authentication is required?

≯℡__Kan透↙ 提交于 2019-12-03 07:58:34
问题 It is very easy to set up an embedded Jetty server that requests client authentication: One just needs to add the statement SslContextFactory.setNeedClientAuth(true); to the ssl context when configuring the server. Any client that has its certificate in the server's truststore will be able to establish a TLS connection to the server. However I need to know which client of all the possible trusted clients is currently making a request; in other words I need to know the client certificate used

Add resources to Jetty programmatically

佐手、 提交于 2019-12-03 07:18:07
I have a main class that configures and fires up Jetty. (That's standard practice from Wicket for testing a webapp, but it's really not wicket-specific.) final Server server = new Server(); //skipped socketconnector initialization final WebAppContext bb = new WebAppContext(); bb.setServer(server); bb.setContextPath("/"); bb.setWar("src/main/webapp"); server.addHandler(bb); server.start(); As you can see, src/main/webapp is used as webapp root. However, I have some resources that are in target/classes and that are copied to the webapp later. So I would like to add virtual directories to jetty.

How to deploy a Scala project from Eclipse?

倖福魔咒の 提交于 2019-12-03 07:01:43
I have a Scala project in Eclipse that I need to package up so I can deploy it to a server. It's based on Jetty but it runs as a standalone application. It contains Scala classes, Java classes and a number of 3rd party jars. I assumed there would be some kind of deployment option in the Scala Eclipse plugin but I've drawn a blank. What is the simplest way to package the Scala project into a runnable file so it can be deployed? Any help greatly appreciated. Cheers. Sbt supports web application deployments . You can of course use Ant, Maven or another build tools to package your WAR for Jetty