Questions tagged [embedded-jetty]

Jetty is a widely used web container (server) written in Java and produced by Eclipse.

Jetty is a widely used web container written in Java. Jetty has a slogan, "Don't deploy your application in Jetty, deploy Jetty in your application."

What this means is that as an alternative to bundling your application as a standard WAR to be deployed in Jetty, Jetty is designed to be a software component that can be instantiated and used in a Java program just like any POJO. Put another way, running Jetty in embedded mode means putting an HTTP module into your application, rather than putting your application into an HTTP server.

You can find extra information for Jetty at Codehaus.

1375 questions
9
votes
3 answers

No multipartconfig for servlet error from Jetty using scalatra

I am trying to unit test an upload call but I get this error for the following code: @MultipartConfig(maxFileSize = 3145728) class WebServlet extends ScalatraServlet with FileUploadSupport { override def isSizeConstraintException(e: Exception) = e…
James Black
  • 41,583
  • 10
  • 86
  • 166
9
votes
4 answers

Jetty 9.0 embedded and RestEasy 3.0 keeps throwing NoSuchMethodError

Today I had the idea to build a very simple web application, which would be powered by a REST backend. Since I wanted a very lightweight server I started looking at Jetty. And since I wanted to try another JAX-RS implementation than Jersey I looked…
Wouter
  • 1,290
  • 2
  • 16
  • 24
9
votes
2 answers

How to add Access-Control-Allow-Origin to jetty server

I've got a jetty server to run my web services. Recently I developed a program to consume the web service and ran into Access-Control-Allow-Origin issue. How can I add the Access-Control-Allow-Origin: * to a jetty embedded server. below is the…
Imesh Chandrasiri
  • 5,558
  • 15
  • 60
  • 103
9
votes
2 answers

Map jetty ResourceHandler to a URL

Is it possible using embedded Jetty to serve static files from directory X but mapped to URL Y? I have static files stored under directory "web", but I want the URL be something like http://host/myapp. I have already successfully ran a server…
Little Bobby Tables
  • 5,261
  • 2
  • 39
  • 49
9
votes
2 answers

Embedded Jetty with annotated servlet patterns?

The following working code demonstrates including two servlets into an embedded instance of jetty. Server server = new Server(8080); ServletContextHandler context = new…
Jay
  • 19,649
  • 38
  • 121
  • 184
9
votes
6 answers

404 Not Found Error in a simple Jetty/Maven Hello World webapp

I have followed the instructions to create a "Standard WebApp with Jetty and Maven" precisely as described on the eclipse wiki: http://wiki.eclipse.org/Jetty/Tutorial/Jetty_and_Maven_HelloWorld#Developing_a_Standard_WebApp_with_Jetty_and_Maven…
kburns
  • 782
  • 2
  • 8
  • 22
8
votes
1 answer

How to start Lift in embedded Jetty?

I have a server, which shall serve some web content as a part of it's duties. It was working using embedded Jetty, and I want to add some Lift's beauty to it (templates, actors, etc). The problem is all lift examples use Jetty as a container. Is…
Rogach
  • 26,050
  • 21
  • 93
  • 172
8
votes
0 answers

Jetty ConnectHandler with Upstream Proxy

I am using Jetty's ConnectHandler to proxy SSL via CONNECT. Now I'd like to configure the ConnectHandler to forward requests to another proxy which will handle the CONNECT for me. Is there a way to configure the ConnectHandler to do this? I checked…
Jochen
  • 1,853
  • 3
  • 20
  • 28
8
votes
4 answers

Keycloak logout does not end session

I am using Keycloak 3.4 in a Java Application using Spring Framework and Jetty 8.1 with Keycloak Jetty-81-Adapter 3.4. According to the Keycloak documentation I should be able to use the HttpServletRequest in a Java EE application to logout from…
Cloud
  • 458
  • 1
  • 13
  • 34
8
votes
4 answers

Webapplication in Embedded Jetty getting Error 404 Not found

I want to deploy a Java Netbeans Webapp with an embedded Jetty Server; the server itself works, but I always get the following error: I searched through mounds of examples on the web, configured & reconfigured my web.xml; although my configuration…
IntelliData
  • 441
  • 6
  • 29
8
votes
1 answer

Resteasy and Google Guice: how to use multiple @ApplicationPath and resource with @Injection?

I created a project to test the dependency injection offered by Google Guice in my Jax-rs resources, using Resteasy. My intentions are: Use multiple @ApplicationPath for the versions of my API. In each class annotated with @ApplicationPath I load a…
Dherik
  • 17,757
  • 11
  • 115
  • 164
8
votes
3 answers

Remove Html Extension On Jetty

I would like to be able to go to https://localhost:8080/users/pages/profile (without the Server failing) instead of https://localhost:8080/users/pages/profile.html So I tried ServletContextHandler pagesContext = new…
user4786688
8
votes
4 answers

why is it necessary to return a Response object instead of String object to an http request in java?

I defined my REST method to return a String data type as a response to an http request. This is it: @Path("/users/{name}/") @GET @Produces("application/json") public String getAllUserMemberships(@PathParam("name") String name) throws…
Young Emil
  • 2,220
  • 2
  • 26
  • 37
8
votes
6 answers

Is it possible to create Desktop Application using Java backend & Web Technologies UI

I would like to create a desktop application in Java & web technologies. The main reason for selecting Java is that it is free, open source, and hence our investment would be minimal and we would save lots of investment with respect to licensing…
Mihir P
  • 81
  • 1
  • 3
8
votes
1 answer

Programmatically set Jetty configuration to increase allowed URL length

We're using embedded Jetty 9.3.1.v20150714 and ran into the problem in which our long query URL, combined with the other headers, were longer than those allowed. The solution seems straightforward: increase the requestHeaderSize in…
Garret Wilson
  • 18,219
  • 30
  • 144
  • 272