import java.io.*;
import java.net.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
/**
*
* @author James Rechy
* @version
*/
public class James extends HttpServlet {
/**
* Initializes the servlet.
*/
public void init(ServletConfig config) throws ServletException {
config.getServletContext().log("Iniciado MiServlet a las" +new Date());
super.init(config);
}
/** Destroys the servlet.
*/
public void destroy() {
}
/** Processes requests for both HTTP
GET
and POST
methods.* @param request servlet request
* @param response servlet response
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("< html>");
out.println("< head>");
out.println("< title>Ejemplo de un servlet en la web < /title>");
out.println("< br>< /br>");
out.println("< hr>< i>< b>WELLCOME TO JAVA AND SERVLETS 2008< /b>< /i>< /hr>");
out.println("< br>< /br>");
out.println("< h1>< font color=BLUE>HELLO,GRETTINGS FROM YOUR FRIEND JAMES RECHY, PROBANDO UN SERVLET DE JAVA< /font>< /h1>");
out.println("Usuario:< INPUT type=text name=usuario>");
out.println("< /head>");
out.println("< body background=SKYBLUE");
out.println("< /body>");
out.println("< /html>");
out.close();
}
/**
* Handles the HTTP < code> GET < /code> method.
* @param request servlet request
* @param response servlet response
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP < code> POST < /code> method.
* @param request servlet request
* @param response servlet response
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/** Returns a short description of the servlet.
*/
public String getServletInfo() {
return "Short description";
}
}