Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is an alternative to Jetty? I'm looking for a simple javax.servlet container [closed]

Tags:

java

servlets

What is an alternative to Jetty? I'm looking for a simple javax.servlet container. Jetty is too complex for the task I'm working with. And its documentation is very poor.

PS. I created my own web framework: takes.org

like image 994
yegor256 Avatar asked May 10 '11 21:05

yegor256


People also ask

Is Jetty same as Tomcat?

Tomcat is an Apache project, while Jetty is managed by the Eclipse Foundation. In terms of licensing, Tomcat enjoys the Apache 2.0 open source license, while Jetty is dual licensed through both the Apache 2.0 License and the Eclipse Public License 1.0.

Is Jetty servlet container?

Jetty provides a web server and servlet container, additionally providing support for HTTP/2, WebSocket, OSGi, JMX, JNDI, JAAS and many other integrations. These components are open source and are freely available for commercial use and distribution.

What is a Jetty servlet?

Jetty is an open source Java web server, as well as a servlet container, that provides an application with the features required to launch and run an application servlet or API.

What is a Jetty container?

Jetty is a pure Java-based HTTP (Web) server and Java Servlet container. While Web Servers are usually associated with serving documents to people, Jetty is now often used for machine to machine communications, usually within larger software frameworks.


3 Answers

Try Grizzly, which is the standalone part of Jersey (JAX-RS implementation).

like image 111
sksamuel Avatar answered Oct 06 '22 16:10

sksamuel


Possible Alternatives

  • Resin
  • Tiny Java Web Server
  • Winstone (a bit outdated)
  • or if you want JAX-RS support, then Jersey is the reference implementation

Simple, But Not Too Simple

That being said, except if you are really constrained, why wouldn't a minimalist config of Tomcat or even GlassFish work for you?

If complexity is an issue, then maybe you should start with Tomcat first and then see how Jetty (or others) could be used and how it would fit your goals later. Tomcat is not that heavyweight, and at least you'll have plenty of documentation and examples to look at.


Update: As you mention in the comment that you need JAX-RS support, Jersey is indeed a good option. Have a look at Vogella's article on REST with Java using Jersey for a good ramp-up.

like image 8
haylem Avatar answered Oct 06 '22 16:10

haylem


Do you know about embedding jetty? This is instead of deploying your app in jetty, embedding jetty in your app.

I used before and it's quite easy. Here's some documentation:

http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty

like image 3
polypiel Avatar answered Oct 06 '22 16:10

polypiel