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

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

    [ https://issues.apache.org/jira/browse/WW-4683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15464704#comment-15464704 ] 

Lukasz Lenart edited comment on WW-4683 at 9/5/16 10:34 AM:
------------------------------------------------------------

It's a definition of result {{account}}, not {{SUCCESS}} which you return from the action. You must have something like

{code:java}
@Result(name="success",location = "/clearing/account.jsp")
{code}


was (Author: lukaszlenart):
It's a definition of result {[account}}, not {{SUCCESS}} which you return from the action. You must have something like

{code:java}
@Result(name="success",location = "/clearing/account.jsp")
{code}

> 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.31, 2.5.3
>
>
> 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.
> {code:java}
>  @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);
>     }
> {code}



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