ExampleServlet2.java
import java.io.*;

import javax.servlet.*;
import javax.servlet.http.*;

/**
 * This Servlet prints the text: "Χαιρετίσματα σε όλους από το ExampleServlet2".
 
 @author Sofoklis Stouraitis
 
 */
public class ExampleServlet2 extends HttpServlet {

  /**
   * Handles HTTP GET requests.
   
   @param request
   *            the request object
   @param response
   *            the response object
   
   @throws IOException
   *             if an input or output error is detected when the servlet
   *             handles the GET request
   @throws ServletException
   *             if the request for the GET could not be handled
   */
  public void doGet(HttpServletRequest request, HttpServletResponse response)
      throws IOException, ServletException {

    response.setContentType("text/html; charset=ISO-8859-7");
    PrintWriter out = new PrintWriter(response.getWriter()true);

    try {
      out.println("<html>");
      out.println("<head>");
      out.println("<Meta Http-Equiv='Content-Type' Content='text/html; Charset=windows-1253'>");
      out.println("<title>Παράδειγμα μετάβασης σε Servlet μέσο link</title>");
      out.println("</head>");
      out.println("<body>");
      out.println("<h1>Χαιρετίσματα σε όλους από το ExampleServlet2</h1>");
      out.println("</body>");
      out.println("</html>");

    catch (Exception ex) {
      out.println("Exception: " + ex.getMessage());
      out.println("</body>");
      out.println("</html>");
    }
  }
}// End of class