package interval;

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

/*
Servlet, ktory iba vypise obsah celo-aplikacneho parametra "kontakt"
*/

public class ContextParamServlet extends HttpServlet {

private String kontakt;

  public void init(ServletConfig config) throws ServletException {
	 super.init(config);
	 ServletContext context = config.getServletContext();
	 kontakt = context.getInitParameter("kontakt");
  }

  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>web.xml</TITLE></HEAD>\n" +
                    "<BODY>" +
                    "Kontakt:<br>" +
                    "<em><b>" + kontakt  + "</b></em>" +
                    "</BODY></HTML>");
  }
}