Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
20 RecordTimeServletjava import javax.ejb.*; import java.rmi.*; import javax.rmi.PortableRemoteObject; import java.io.*; import java.util.*; import java.text.*; import import import import import import import import import com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.Core.*; com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.FormPrimitives.*; com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.Layout.*; com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.ContentElements.*; com.wiley.compBooks.EJwithUML.TimeCardWorkflow.*; com.wiley.compBooks.EJwithUML.Dtos.*; com.wiley.compBooks.EJwithUML.TimecardProducers.*; com.wiley.compBooks.EJwithUML.Base.EjbUtil.*; com.wiley.compBooks.EJwithUML.Base.ApplicationExceptions.*; /** * The RecordTimeServlet uses the TimecardWorkflow and * HtmlProduction packages to create the formatted HTML * for the time entry form and to capture the entered hours. */ public class RecordTimeServlet extends BasicTimecardServlet { private static final DateFormat. | 20 RecordTimeServletjava import javax.ejb. import java.rmi. import javax.rmi.PortableRemoteObject import java.io. import java.util. import java.text. import com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.Core. import com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.FormPrimitives. import com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.Layout. import com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.ContentElements. import com.wiley.compBooks.EJwithUML.TimeCardWorkflow. import com.wiley.compBooks.EJwithUML.Dtos. import com.wiley.compBooks.EJwithUML.TimecardProducers. import com.wiley.compBooks.EJwithUML.Base.EjbUtil. import com.wiley.compBooks.EJwithUML.Base.ApplicationExceptions. The RecordTimeServlet uses the TimecardWorkflow and HtmlProduction packages to create the formatted HTML for the time entry form and to capture the entered hours. public class RecordTimeServlet extends BasicTimecardServlet private static final DateFormat longFormat new SimpleDateFormat MMM dd yyyy private static final DateFormat shortFormat new SimpleDateFormat MMM dd private static final DateFormat keyFormat new SimpleDateFormat MMM.dd.Yyyy private static final DateFormat dayOfWeekFormat new SimpleDateFormat EE public void doGet HttpServletRequest request HttpServletResponse response throws ServletException lOException doPost request response Overrides method from HttpServlet. doPost is called by the servlet engine. public void doPost HttpServletRequest request HttpServletResponse response throws ServletException lOException System.out.println RecordTimeServlet doPost try PagePrimitive page null RecordTimeServletjava 21 extract username from session HttpSession session request.getSession false String username String session.getAttribute TimecardKey.USERNAME.getKeyText extract parameters String client request.getParameter TimecardKey.CLIENT.getKeyText String project request.getParameter TimecardKey.PROJECT.getKeyText String code request.getParameter TimecardKey.CODE.getKeyText Get .