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
14
votes
1 answer

Can not post form with many (over 256) values

I am using Spring Boot 1.2.2 with Thymeleaf. My Problem is I try to post a long list of Items (some labels, one checkbox) in a form, which cant be perform so many items of my list. (I tested small lists and it worked.) First I used jetty but got an…
svenhornberg
  • 14,376
  • 9
  • 40
  • 56
14
votes
2 answers

Jetty 8 set "session-timeout" without web.xml?

I'm trying to set the session-timeout value in an embedded Jetty 8 instance. With embedded Jetty, how can I programmatically set the session-timeout value that would otherwise be set in the web.xml as follows:
HolySamosa
  • 9,011
  • 14
  • 69
  • 102
14
votes
8 answers

How do you get embedded Jetty 9 to successfully resolve the JSTL URI?

I'm packaging a Web Application Archive (.war) so that it can be started via java -jar webapp.war in a shell by launching an embedded copy of Jetty 9 using this code in a main class: int port = Integer.parseInt(System.getProperty("port", "80")); //…
William Proffitt
  • 658
  • 2
  • 6
  • 15
14
votes
4 answers

Detecting when an embedded Jetty server is fully initialized

I have embedded Jetty in a java application and am calling the start() method on an instance of the Jetty server object (after setting a handler list which describes the location of the static and dynamic web content). Does the start() call block…
user154394
14
votes
2 answers

Add more than one resource directory to jetty

Looking to use multiple static directories with Jetty. When the server runs: http://localhost:8282/A http://localhost:8282/B http://localhost:8282/C A is placed in X/V/A B is placed in Q/Z/B C is placed in P/T/C The following failed: …
yoav.str
  • 1,547
  • 6
  • 33
  • 73
14
votes
5 answers

Shortest code to start embedded Jetty server

I'm writing some example code where an embedded Jetty server is started. The server must load exactly one servlet, send all requests to the servlet and listen on localhost:80 My code so far: static void startJetty() { try { …
PeterMmm
  • 24,152
  • 13
  • 73
  • 111
13
votes
4 answers

How do you set both port and thread pool using embedded jetty, v 9.1.0

I'm using jetty 9.1.0, embedded, and would like to set both port and ThreadPool. I see a constructor for each, but don't see how to use one of those, and then any way to set the other. doing this Server server = new Server(9090); or Server server…
Alper Akture
  • 2,445
  • 1
  • 30
  • 44
13
votes
1 answer

Java / Jetty: How to Add Filter to Embedded Jetty

I am working with embedded Jetty and I want to add a servlet filter to check for authentication before each request. I tried following this example but it looks like the signature has changed. org.eclipse.jetty
David Williams
  • 8,388
  • 23
  • 83
  • 171
12
votes
2 answers

how to set connection/request timeout for jetty server?

I'm running an embedded jetty server (jetty 6.1.24) inside my application like this: Handler handler=new AbstractHandler() { @Override public void handle(String target, HttpServletRequest request, …
Hung Duong
  • 121
  • 1
  • 1
  • 4
12
votes
1 answer

Embedding Jetty as a Servlet Container

I'm using Tomcat to serve my Java Servlets and it's kinda more for me. I just need to serve, Servlet Requests alone, no static content, neither JSP, etc. So I was looking for a Servlet container that can be embedded in my Application. I felt it if…
Manikandaraj Srinivasan
  • 3,557
  • 5
  • 35
  • 62
11
votes
1 answer

Embedded Jetty: Different ports for internally- and externally-visible endpoints?

I've got a REST app that uses embedded Jetty as the server. Most of the endpoints need to be publicly-visible (and have appropriate authentication built in), but a few are for internal-use only. I'd like to avoid the overhead of authentication on…
David B.
  • 5,700
  • 5
  • 31
  • 52
11
votes
4 answers

Java spark framework enable logging

I'm building a java application with Spark framework with embedded Jetty and handlebars template engine. But when i get an 500 Internal Error, the console didn't say anything. I have added to my pom.xml the dependencies here:…
SergiX44
  • 371
  • 2
  • 5
  • 15
11
votes
2 answers

Map Shiro's AuthenticationException with Jersey's ExceptionMapper

Preface First of all, my sincerest apologies for this question being extremely long, but I honestly have no idea on how to shorten it, since each part is kind of a special case. Admittedly, I may be blind on this since I am banging my head against…
Markus W Mahlberg
  • 19,711
  • 6
  • 65
  • 89
11
votes
5 answers

How to deploy a Scala project from Eclipse?

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…
lach
  • 386
  • 2
  • 10
11
votes
2 answers

Does embedded Jetty have the ability to set the init-params of a filter?

Suppose I'm running embedded jetty with the following code. I want to pass in some parameters to my filter. When I look at the Jetty API for adding a filter - there are no options to set init-params. My question is Does embedded Jetty have the…
hawkeye
  • 34,745
  • 30
  • 150
  • 304
1 2
3
91 92