Example usage for javax.servlet.http HttpServlet subclass-usage

List of usage examples for javax.servlet.http HttpServlet subclass-usage

Introduction

In this page you can find the example usage for javax.servlet.http HttpServlet subclass-usage.

Usage

From source file MyServlet.java

public class MyServlet extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, java.io.IOException {

        RequestDispatcher dispatcher = null;
        String param = request.getParameter("go");

From source file MyServlet.java

public class MyServlet extends HttpServlet {

    public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
        res.setContentType("text/plain");
        PrintWriter out = res.getWriter();

From source file MyServlet.java

public class MyServlet extends HttpServlet {

    Vector sites = new Vector();
    Random random = new Random();

    public void init() throws ServletException {

From source file MyServlet.java

public class MyServlet extends HttpServlet {

    static int classCount = 0; // shared by all instances
    int count = 0; // separate for each servlet
    static Hashtable instances = new Hashtable(); // also shared

From source file SiteSelector.java

public class SiteSelector extends HttpServlet {

    Vector<String> sites = new Vector<String>();

    Random random = new Random();

From source file MyServlet.java

public class MyServlet extends HttpServlet {
    public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException {
        ServletOutputStream out = res.getOutputStream();
        res.setContentType("text/html");
        out.println("<html><head><title>Basic Form Processor Output</title></head>");
        out.println("<body>");

From source file MyServlet.java

public class MyServlet extends HttpServlet {

    public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
        res.setContentType("text/html");
        PrintWriter out = res.getWriter();

From source file MyServlet.java

public class MyServlet extends HttpServlet {

    public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
        res.setContentType("text/plain; charset=Shift_JIS");
        PrintWriter out = res.getWriter();
        res.setHeader("Content-Language", "ja");

From source file MyServlet.java

public class MyServlet extends HttpServlet {

    String msg = "";

    public void init(ServletConfig config) {
        msg = "Hello from Java servlets!";

From source file MyServlet.java

public class MyServlet extends HttpServlet {

    public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
        res.setContentType("text/plain");
        PrintWriter out = res.getWriter();
        res.setHeader("Content-Language", "es");