/*
* Servletpertamaku.java
*
* Created on December 10, 2008, 10:12 AM
*/
package jeniservlet;
import java.io.*;
import java.net.*;
import javax.servlet.*;
import javax.servlet.http.*;
/**
*
* @author Komdat
* @version
*/
public class Servletpertamaku extends HttpServlet {
/** 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;charset=UTF-8");
PrintWriter out = response.getWriter();
out.println("");
out.println("");
out.println("
out.println("");
out.println("");
out.println("
Servlet Servletpertamaku at " + request.getContextPath () + "
");out.println("");
out.println("");
out.close();
}
//
/** Handles the HTTP
GET
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
POST
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";
}
//
}
Tidak ada komentar:
Posting Komentar