public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { request.setCharacterEncoding("utf-8");
///////////////////////////////////////////////
// [Close] button press judgment /////////////////////////////////////////////// String type = request.getParameter("submitClose2"); if (type! = null) {// Originally, it is a comparison with the "close" character string, but since it is garbled, it is a null comparison. return mapping.findForward("close"); }
///////////////////////////////////////////////
// [Apply] button press judgment /////////////////////////////////////////////// type = request.getParameter("submitshinsei"); if (type! = null) {// Originally, it is a comparison with the "application" character string, but since it is garbled, it is a null comparison. return setKoutuhi(mapping, form, request, response); }
///////////////////////////////////////////////
// [Initial processing] /////////////////////////////////////////////// return init(mapping, form, request, response);
}
/**
@param mapping
@param form
@param request
@param response
@return ActionForward */ private ActionForward init(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
KshinseiForm ksForm = (KshinseiForm)form; //ksForm = new KshinseiForm();
//交通費新規申請画面の日付のプルダウン作成
List
request.getSession().setAttribute("selYmdList", selYmdList);
// Transition destination is own screen (defined in struts-config.xml) return mapping.findForward("success"); }
//交通費新規申請画面の日付のプルダウン作成メソッド
private List
private ActionForward setKoutuhi(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
//formにあるJSPより取得したデータをKshinseiForm型にする KshinseiForm ksForm = (KshinseiForm)form;
//JSPより取得したデータをSQLでインサートするほうへ移す DKoutuhiInfoData insertData = new DKoutuhiInfoData(); insertData.setShainId("111003"); insertData.setKinmuDay(ksForm.getSinSelYmd()); insertData.setGyoumuNo(ksForm.getSinGyoumuNo()); insertData.setVisit(ksForm.getSinVisit()); insertData.setDepartArea(ksForm.getSinDepartArea()); insertData.setArrivalArea(ksForm.getSinArrivalArea()); insertData.setVehicle(ksForm.getSinVehicle()); insertData.setKinngaku(ksForm.getSinKinngaku()); insertData.setEtc(ksForm.getSinEtc()); insertData.setJoutai ("application"); insertData.setDelKbn("0"); insertData.setEntryId("111003"); insertData.setUpdateId("111003");
// Data INSERT class MKoutuhiInfo info = new MKoutuhiInfo();
// Send data to INSERT class list data info.setKoutuhiInfo(insertData);
// Transition destination is own screen (defined in struts-config.xml) return mapping.findForward("kmeisai");
}
Recommended Posts