License GNU Free Documentation License
Lines 12
Keywords
Hello World (24) J2EE (1) servlet (2)
Included in this Library
Permissions
Group Owner: Siafoo
Viewable by Everyone
Editable by "Siafoo" Group Members
Hide
Siafoo is here to make coding less frustrating and to save you time. Join Siafoo Now or Learn More

A Java Servlet Hello World Atom Feed 0

In Brief This is the minimal J2EE Servlet
# 's
 1import java.io.*;
2import javax.servlet.*;
3
4public class HelloServlet extends GenericServlet {
5 public void service(ServletRequest request, ServletResponse response)
6 throws ServletException, IOException {
7 response.setContentType("text/html");
8 final PrintWriter pw = response.getWriter();
9 pw.println("Hello, World!");
10 pw.close();
11 }
12}

This is the minimal J2EE Servlet