struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maurizio Cucchiara (Closed) (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (WW-3695) XWorkConverter catch XWorkException so that the client application can't get the detail original error message
Date Mon, 31 Oct 2011 10:21:32 GMT

     [ https://issues.apache.org/jira/browse/WW-3695?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Maurizio Cucchiara closed WW-3695.
----------------------------------

    Resolution: Not A Problem
      Assignee: Maurizio Cucchiara

First add the input result to your action configuration:
{code}
@Result(name = "input", location = "/WEB-INF/pages/test/test_input.ftl", type = "freemarker")
{code}
Then print your field errors with the specific xml tag:
{code}
<@s.fielderror/>
{code}

Please, next time ask this kind of question to the [user ML|http://struts.apache.org/mail.html].
                
> XWorkConverter catch XWorkException so that the client application can't get the detail
original error message
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3695
>                 URL: https://issues.apache.org/jira/browse/WW-3695
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Other
>    Affects Versions: 2.2.1.1
>            Reporter: shenjc
>            Assignee: Maurizio Cucchiara
>
> in com.opensymphony.xwork2.conversion.impl.XWorkConverter line 331 to 341
> {code}
> try {
>     if (LOG.isDebugEnabled())
>         LOG.debug("falling back to default type converter [" + defaultTypeConverter +
"]");
>     return defaultTypeConverter.convertValue(context, target, member, property, value,
toClass);
> } catch (Exception e) {
>     if (LOG.isDebugEnabled())
>         LOG.debug("unable to convert value using type converter [#0]", e, defaultTypeConverter.getClass().getName());
>     handleConversionException(context, property, value, target);
>     return TypeConverter.NO_CONVERSION_POSSIBLE;
> }
> {code}
> here try catch code "defaultTypeConverter.convertValue" so that it can not throw exception
to outside.
> in some case,for example:
> when I transmit a param a bigInteger to Integer in a action.
> the program will run pass and ignore this exception,the outside program can't catch it
,so that can't find what cause the error.
> and it only print in log file:
> {noformat}
> com.opensymphony.xwork2.util.logging.commons.CommonsLogger.debug(72) | unable to convert
value using type converter [com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter]
> Overflow or underflow casting: "3322333330" into class java.lang.Long - [unknown location]
> {noformat}
> and we need to find this  error message in large debug log message;
>  
> I think, throw this exception and not catch it here,and change log level from debug to
error when print this message will better,isn't it ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message