package interval;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

/*
Jednoduchy servlet, ktory vypise svoje skutocne "meno" a IP adresu navstevnika.
*/

public class CustomURLServlet extends HttpServlet {

   public void doGet(HttpServletRequest request, HttpServletResponse response)
                     throws ServletException, IOException {
      response.setContentType("text/html;charset=windows-1250");
      PrintWriter out = response.getWriter();
      out.println("<HTML><HEAD><TITLE>Definícia vlastného URL - web.xml</TITLE></HEAD>\n" +
                  "<BODY>\n" + 
                  "Hello my real name is <strong>" + this.getClass().getName() + "</strong><br>" +
                  "and you are from <strong>" + request.getRemoteAddr() + "</strong>" +
                  "</BODY></HTML>");
   }
}