timeOffRequest.java
上传用户:dinglihq
上传日期:2013-02-04
资源大小:99958k
文件大小:1k
源码类别:

Java编程

开发平台:

Java

  1. package com.servlets;
  2. import javax.servlet.*;
  3. import javax.servlet.http.*;
  4. import java.io.*;
  5. public class timeOffRequest extends HttpServlet
  6. {
  7. public void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
  8. {
  9. response.setContentType("text/html");
  10. ServletOutputStream out = response.getOutputStream();
  11. out.print("<HTML><HEAD><TITLE>Time Off Request Submitted</TITLE></HEAD>");
  12. out.print("<BODY>");
  13. out.print("<CENTER>");
  14. String empname = request.getParameter("empname");
  15. String month = request.getParameter("month");
  16. String year = request.getParameter("year");
  17. String hours = request.getParameter("hours");
  18. String name = request.getParameter("managersname");
  19. String email = request.getParameter("managersemail");
  20. if ((hours.equals("")) || (name.equals("")) || (email.equals("")) || (empname.equals("")))
  21. out.print("<BR>You need to fill out the form in its entirety<BR>");
  22. else {
  23. out.print("<FONT SIZE='4' COLOR='navy'>");
  24. out.print("Time Off Request for: " + empname + "<BR>");
  25. out.print("Time Off In Hours: " + hours + " in " + month + ", " + year + "<BR>");
  26. out.print("<BR><BR>This report has been submitted to " + name + " at " + email);
  27. out.print("</FONT><BR>");
  28. }
  29. out.print("<BR><A HREF='./welcome.html'>Back To Home Page</A><BR>");
  30. out.print("</CENTER>");
  31. out.print("<BR><BR><BR><HR>Copyright Staplerz 2001</HR>");
  32. out.print("</BODY></HTML>");
  33. }
  34. }