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