首页 新闻 会员 周边 捐助

jsp 获取不到 request.setAttribute的值 struts1 急急急!!!!!

0
悬赏园豆:20 [已关闭问题] 关闭于 2017-08-16 17:32

jsp

struts

spring

异常

@SuppressWarnings("unused")
public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) {
    javax.servlet.http.HttpSession session = request.getSession(false);
    if (session == null)
        session = request.getSession(true);
    String validate = (String) request.getAttribute("GLOBE_VALIDATE");
    String invs = Pattern.compile("[^0-9,,]").matcher(request.getParameter("selinv")).replaceAll("");
    String invid[] = invs.split(",");
    Invoiceinfo invoiceinfo=null;
    Invoiceinfo invoiceinfotwo=null;
    ActionForward forward = null;
    String message = null;
    boolean messageFlag = false;
        invoiceinfo = invoiceinfohcDao.findById(String.valueOf(invid[0]));
        invoiceinfotwo=invoiceinfohcDao.findById(String.valueOf(invid[1]));
             //发票购销方税号一致,名称一致
            if((invoiceinfo.getGfmc()).equals(invoiceinfotwo.getGfmc()) && (invoiceinfo.getXfmc()).equals(invoiceinfotwo.getXfmc())
                    && (invoiceinfo.getEnterpriseid()).equals(invoiceinfotwo.getEnterpriseid()) && (invoiceinfo.getDistributiontaxnumber()).equals(invoiceinfotwo.getEnterpriseid())){
                try {
                    if (invoiceinfo.getBz()!=null && invoiceinfo.getBz().equals(invoiceinfotwo.getBz())) {//发票备注流水号一致
                        invoiceinfohcDao.updateHcById(String.valueOf(invoiceinfo.getId()));
                        invoiceinfohcDao.updateBySN(invoiceinfo.getBz());
                        /*request.setAttribute("message", "解决红冲异常成功!!");
                        forward = mapping.findForward("default");*/
                        messageFlag = false;
                        message = (new StringBuilder("解决红冲异常成功!!")).toString();
                        
                    }else{
                        invoiceinfohcDao.updateHcById(String.valueOf(invoiceinfo.getId()));
                        /*request.setAttribute("message", "解决红冲异常成功!!");
                        forward = mapping.findForward("default");*/
                        messageFlag = false;
                        message = (new StringBuilder("解决红冲异常成功,未发现流水号,流水号信息未更新!!")).toString();
                    }
                } catch (Exception e) {
                    /*request.setAttribute("message",e.getMessage());
                    forward = mapping.findForward("default");*/
                    messageFlag = false;
                    message = (new StringBuilder("解决红冲异常失败!系统异常!")).append(
                            e.getMessage()).toString();
                }
            }else{
                /*request.setAttribute("message","解决红冲异常失败!发票异常!!");
                forward = mapping.findForward("default");*/
                messageFlag = false;
                message = (new StringBuilder("解决红冲异常失败!发票异常!!")).toString();
            /*    ActionMessages messages = new ActionMessages();
                messages.add("org.apache.struts.action.GLOBAL_MESSAGE",
                        new ActionMessage("解决红冲异常失败!发票异常!!"));
                saveMessages(request, messages);*/
            }
            request.setAttribute("informessageMsg", message);
            System.out.println(message);
    return mapping.findForward("success");
}

private InvoiceinfohcDAO invoiceinfohcDao;
private JdbcTemplate jdbcTemplate;
}
Vip灬cnblog的主页 Vip灬cnblog | 初学一级 | 园豆:133
提问于:2017-08-16 17:32
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册