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
6
votes
4 answers

Embedded Jetty Server - NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet

I've have the following code to use an embedded Jetty server alongside a simple servlet and .jsp webpage. However, after compiling and running the code: javac -cp lib/servlet-api.jar:lib/jetty-all.jar com/test/MyServlet.java javac -cp…
user2998046
6
votes
3 answers

Setting Jetty resourcebase to static file embedded in the same jar file

I am trying to access static resource (eg. first.html) packed inside the same .jar file (testJetty.jar), which also has a class which starts the jetty (v.8) server (MainTest.java). I am unable to set the resource base correctly. The structure of my…
contactabbas
  • 832
  • 2
  • 11
  • 18
6
votes
3 answers

Embedded Jetty 9

I dont understand how i can rewrite this code used with jetty 6 for jetty 9 : import org.mortbay.jetty.*; import org.mortbay.jetty.nio.SelectChannelConnector; import org.mortbay.jetty.webapp.WebAppContext; public class ApplLauncher { public…
user443426
6
votes
2 answers

Embedded Jetty and SOAP

I am trying to run an embedded Jetty and would like to expose a soap webservice. The project is loaded as a WAR generated by netbeans. The webservice is generated from a WSDL. What is the simplest way to add SOAP support to embedded Jetty
Esben Skov Pedersen
  • 4,437
  • 2
  • 32
  • 46
6
votes
1 answer

Embedded Jetty: In secure https server, ContextHandler redirects to http URI

I'm building a sandbox RESTful API using embedded Jetty. My Proof-of-Concept design: a simple embedded jetty server that (1) accepts connections on an SSL port and (2) uses a ContextHandlerCollection to invoke the proper Handler based on the URI…
KevinKirkpatrick
  • 1,436
  • 1
  • 10
  • 15
6
votes
1 answer

How to configure embedded jetty to access Jersey resources?

I'm trying to configure embedded jetty to talk to my Jersey resources but I can't figure out how to do it. I've tried a couple of different things but nothing seems to work. The jetty tutorials don't really handle how to do it with Jersey. Any code…
user2494770
6
votes
2 answers

How to get content from CompleteListener in Jetty Client Async API

In the example below from Jetty's docs, a simple method of performing an efficient, asynchronous HTTP request is described. However, it never specifies how you are actually supposed to retrieve the server's reply in this example, and I can't seem to…
Alex
  • 18,332
  • 10
  • 49
  • 53
6
votes
4 answers

Embedded Jetty Server Classpath Issue

I'm trying to deploy a web application on an embedded Jetty Server. My application runs fine locally in a windows environment with the code below but when i deploy it as a JAR File on a Linux Server, it looks like my web.xml File is not picked up.…
user676567
  • 1,119
  • 9
  • 20
  • 39
6
votes
0 answers

How to make web filter support async?

I am using RESTEasy async support. However it breaks my JSONPfilter. public class JSONPFilter implements Filter { private static final Logger logger = LoggerFactory.getLogger(JSONPFilter.class); @Override public void…
janetsmith
  • 8,562
  • 11
  • 58
  • 76
6
votes
2 answers

Adding a jar to jetty plugin for maven

I used to deploy my WAR on local tomcat server and had a jackson-core.jar in the lib folder of tomcat. Now, I've switched to maven and am using the jetty plugin. Everything works fine except that I get a 406 error - The server responded with 406…
birdy
  • 9,286
  • 24
  • 107
  • 171
6
votes
2 answers

How do I programmatically set gzip in Jetty?

I'm writing a web app using Noir and clojure, which uses Jetty. Jetty has two ways of using gzip, one for static, and one for dynamic, they are described in https://stackoverflow.com/a/9113129/104021. I want to turn on both static and dynamic…
Paul Biggar
  • 27,579
  • 21
  • 99
  • 152
5
votes
1 answer

Using embedded Jetty using JSP gives error "web-jsptaglibrary_1_2.dtd not found"

I am using embedded Jetty to launch a webapp and I use JSP pages as views. Using the maven-jetty-plugin works fine for testing, which makes me think I am missing some dependencies when bootstrapping the server (and which is the root cause of the…
Daniel
  • 744
  • 8
  • 24
5
votes
3 answers

Write an HTML page in the servlet response properly

I have a servlet deployed under http://ip:8080/simple The servlet is under package a.b.c I have an html page in a.b.resources named Test.html. The html has an img tag for an image. In the servlet I do: htmlFile =…
Cratylus
  • 52,998
  • 69
  • 209
  • 339
5
votes
1 answer

How to install jetty with eclipse on Mac

I am a newbie w.r.t. jetty and RESTful API's. I want to create REST services using Jetty and wants to use embedded jetty with eclipse. Can anyone suggest me any HowTo for installing Jetty/ Jetty plugins with Eclipse in Mac OS. Regards,
rinku
  • 415
  • 2
  • 19
  • 29
5
votes
4 answers

How to prevent caching of static files in embedded Jetty instance?

I want to prevent my CSSs from being cached on the browser side. How can I do it in embedded Jetty instance? If I were using xml configuration file, I would add lines like: cacheControl
Sergey
  • 2,906
  • 3
  • 27
  • 32