You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "tm_jee (JIRA)" <ji...@apache.org> on 2006/11/01 17:25:57 UTC

[jira] Created: (WW-1486) showcase throws exception when validation error occurred

showcase throws exception when validation error occurred
--------------------------------------------------------

                 Key: WW-1486
                 URL: http://issues.apache.org/struts/browse/WW-1486
             Project: Struts 2
          Issue Type: Bug
          Components: Examples
    Affects Versions: 2.0.1
            Reporter: tm_jee
         Assigned To: tm_jee
             Fix For: 2.0.2


In showcase, whenever there's a validation error, we get the following stack trace

2006-11-02 00:12:14,671 ERROR (org.apache.struts2.components.ActionComponent:246) - Could not execute action: //date
No result defined for action org.apache.struts2.showcase.DateAction and result input - action - file:/home/tm_jee/development/struts2/apps/showcase/src/main/webapp/WEB-INF/classes/struts.xml:64:77
        at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:347)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:250)
        at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:115)
        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)


This is due to when there's an error "input" is returned but, DateAction does not have an "input" result. DateAction just prepares date in various format and should not be subjected to validation error. 

What could be done is to have DateAction execution method to be "browse" instead

         <action name="date" class="org.apache.struts2.showcase.DateAction" method="browse">
            <result name="success">/date.jsp</result>
        </action>

and changed DateExecution method from "execute" to "browse"
    public String browse() throws Exception {
          ....
    }

"browse" by default will be ignored by "workflow" and "validation" interceptor.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (WW-1486) showcase throws exception when validation error occurred

Posted by "tm_jee (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/struts/browse/WW-1486?page=all ]

tm_jee resolved WW-1486.
------------------------

    Resolution: Fixed

fixed.

Sending        src/main/java/org/apache/struts2/showcase/DateAction.java
Sending        src/main/resources/struts.xml
Transmitting file data ..
Committed revision 469969.

> showcase throws exception when validation error occurred
> --------------------------------------------------------
>
>                 Key: WW-1486
>                 URL: http://issues.apache.org/struts/browse/WW-1486
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Examples
>    Affects Versions: 2.0.1
>            Reporter: tm_jee
>         Assigned To: tm_jee
>             Fix For: 2.0.2
>
>
> In showcase, whenever there's a validation error, we get the following stack trace
> 2006-11-02 00:12:14,671 ERROR (org.apache.struts2.components.ActionComponent:246) - Could not execute action: //date
> No result defined for action org.apache.struts2.showcase.DateAction and result input - action - file:/home/tm_jee/development/struts2/apps/showcase/src/main/webapp/WEB-INF/classes/struts.xml:64:77
>         at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:347)
>         at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:250)
>         at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:115)
>         at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
> This is due to when there's an error "input" is returned but, DateAction does not have an "input" result. DateAction just prepares date in various format and should not be subjected to validation error. 
> What could be done is to have DateAction execution method to be "browse" instead
>          <action name="date" class="org.apache.struts2.showcase.DateAction" method="browse">
>             <result name="success">/date.jsp</result>
>         </action>
> and changed DateExecution method from "execute" to "browse"
>     public String browse() throws Exception {
>           ....
>     }
> "browse" by default will be ignored by "workflow" and "validation" interceptor.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira