00001 import java.io.PrintWriter; 00002 00003 import javax.servlet.ServletException; 00004 import javax.servlet.http.HttpServlet; 00005 import javax.servlet.http.HttpServletRequest; 00006 import javax.servlet.http.HttpServletResponse; 00007 00008 public class ServletPLP extends HttpServlet { 00009 00010 public static final String mainPath = "C:\\java\\webapps\\plp\\execucao\\"; 00011 public static final int Expressoes1 = 0; 00012 public static final int Expressoes2 = 1; 00013 public static final int Funcional1 = 2; 00014 public static final int Funcional2 = 3; 00015 public static final int Imperativa1 = 4; 00016 public static final int Imperativa2 = 5; 00017 public static final int OrientadaAObjetos1 = 6; 00018 public static final int OrientadaAObjetos2 = 7; 00019 00020 public void doGet(HttpServletRequest request, HttpServletResponse response) 00021 throws ServletException, java.io.IOException { 00022 PrintWriter out; 00023 StringBuffer resposta = new StringBuffer(); 00024 response.setContentType("text/html"); 00025 out = response.getWriter(); 00026 try { 00027 String file = ServletPLP.mainPath + "index"; 00028 resposta.append(Library.getFile(file+"1.html")); 00029 resposta.append(Library.getFile(file+"2.html")); 00030 } 00031 catch (Exception exception) { 00032 resposta = new StringBuffer(); 00033 resposta.append(exception.getMessage()); 00034 } 00035 finally { 00036 out.println(resposta.toString()); 00037 out.close(); 00038 } 00039 } 00040 }