You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "DavidLiu (JIRA)" <ji...@apache.org> on 2016/09/01 04:27:20 UTC

[jira] [Created] (WW-4683) some of actions did not work.

DavidLiu created WW-4683:
----------------------------

             Summary: some of actions did not work.
                 Key: WW-4683
                 URL: https://issues.apache.org/jira/browse/WW-4683
             Project: Struts 2
          Issue Type: Bug
          Components: Core Results
    Affects Versions: 2.3.24
         Environment: struts2.3.24.3,weblogic12c, jdk8,centos7  
            Reporter: DavidLiu
             Fix For: 2.3.24


If I change struts.devMode =false ,the struts2 occur error. the error info as below.
error message : No result defined for action guangdu.admin.action.BorrowerAccountManager and result success

If I change struts.devMode =true ,the struts2 work well.

 @Action("/borrowerAccount/depositSaving")
    public String depositSaving(){
        try{
            if(amount<=0){
                throw new IllegalArgumentException("金额不能小于0");
            }

            String orderNo=_sequence.generateBackgroundSequence();
            UserAgentInfo userAgentInfo=new UserAgentInfo(request.getRemoteAddr(),"web",request.getSession().getAttribute("username").toString(),"admin");
            String html=orderService.generatorDeposit(orderNo,enterpriseId,-1,amount,request.getRequestURL().toString().replace("depositSaving", "manager"),userAgentInfo);

            generateHtml(html);

            return SUCCESS;
        }
        catch (Exception exp){
            return showMessageAction(SUCCESS,exp);
        }
        catch (Error error){
            return showMessageAction(SUCCESS,error);
        }
    }

private void generateHtml(String html) throws IOException {
        HttpServletResponse res = ServletActionContext.getResponse();
        res.setContentType("html/text;charset=utf-8");
        PrintWriter out = res.getWriter();

        out.write(html);
    }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)