org.safehaus.jettyjam.https.HelloWorldServlet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jettyjam-https Show documentation
Show all versions of jettyjam-https Show documentation
A simple https servlet that runs in an embedded jetty instance from an
executable jar file without requiring the webapp to be exploded.
package org.safehaus.jettyjam.https;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* A simple servlet that prints out hello world.
*/
public class HelloWorldServlet extends HttpServlet {
public static final String MESSAGE = "Hello World";
@Override
protected void doGet( final HttpServletRequest req, final HttpServletResponse resp )
throws ServletException, IOException
{
resp.getOutputStream().print( MESSAGE );
resp.flushBuffer();
}
}