officeClosing.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 officeClosing 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>Office Closing Announcement</TITLE></HEAD>");
  13. out.print("<BODY>");
  14. out.print("<CENTER>");
  15. String reason = request.getParameter("reason");
  16. String date = request.getParameter("date");
  17. if ((reason.equals("")) || (date.equals("")))
  18. out.print("<BR>You need to fill out the form in its entirety<BR>");
  19. else {
  20. out.print("<FONT SIZE='4' COLOR='navy'>");
  21. out.print("A message has been sent to all employees that the office<BR>");
  22. out.print("is closing on " + date + " for the following reason<BR>");
  23. out.print(reason);
  24. out.print("</FONT><BR>");
  25. }
  26. out.print("<BR><A HREF='./welcome.html'>Back To Home Page</A><BR>");
  27. out.print("</CENTER>");
  28. out.print("<BR><BR><BR><HR>Copyright Staplerz 2001</HR>");
  29. out.print("</BODY></HTML>");
  30. }
  31. }