You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Jeromy Evans (JIRA)" <ji...@apache.org> on 2008/07/18 02:37:06 UTC

[jira] Created: (WW-2723) Provide debug information about which methods where matched/invoked by OGNL

Provide debug information about which methods where matched/invoked by OGNL
---------------------------------------------------------------------------

                 Key: WW-2723
                 URL: https://issues.apache.org/struts/browse/WW-2723
             Project: Struts 2
          Issue Type: Improvement
          Components: Expression Language
    Affects Versions: 2.1.2, 2.0.11.2
            Reporter: Jeromy Evans
            Priority: Minor
             Fix For: Future


It would be helpful if developers could enable debug messages where Struts2 displays the methods that were invoked when getting or setting a property.

eg. rather than "user.firstName", see that it invoked action.getUser() then User.getFirstName()

This will help debugging mismatched property names (eg. isUser(), getUser, getuser()) and especially help developers understand that, for example, getUser() must be invoked prior to setFirstName().

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2723) Provide debug information about which methods where matched/invoked by OGNL

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44406#action_44406 ] 

Musachy Barroso commented on WW-2723:
-------------------------------------

Also, the parameters are always String arrays, so when there is an exception, printing the values in the array would be better than the cryptic [Ljava.lang.String;@12dcb8c thing.

> Provide debug information about which methods where matched/invoked by OGNL
> ---------------------------------------------------------------------------
>
>                 Key: WW-2723
>                 URL: https://issues.apache.org/struts/browse/WW-2723
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Expression Language
>    Affects Versions: 2.0.11.2, 2.1.2
>            Reporter: Jeromy Evans
>            Priority: Minor
>             Fix For: Future
>
>
> It would be helpful if developers could enable debug messages where Struts2 displays the methods that were invoked when getting or setting a property.
> eg. rather than "user.firstName", see that it invoked action.getUser() then User.getFirstName()
> This will help debugging mismatched property names (eg. isUser(), getUser, getuser()) and especially help developers understand that, for example, getUser() must be invoked prior to setFirstName().

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2723) Provide debug information about which methods where matched/invoked by OGNL

Posted by "Wes Wannemacher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44410#action_44410 ] 

Wes Wannemacher commented on WW-2723:
-------------------------------------

James, No harm no foul, I'm not completely against doing what Jeromy suggests, I just wanted to point out that it can be done w/o Struts2 modifications. 

> Provide debug information about which methods where matched/invoked by OGNL
> ---------------------------------------------------------------------------
>
>                 Key: WW-2723
>                 URL: https://issues.apache.org/struts/browse/WW-2723
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Expression Language
>    Affects Versions: 2.0.11.2, 2.1.2
>            Reporter: Jeromy Evans
>            Priority: Minor
>             Fix For: Future
>
>
> It would be helpful if developers could enable debug messages where Struts2 displays the methods that were invoked when getting or setting a property.
> eg. rather than "user.firstName", see that it invoked action.getUser() then User.getFirstName()
> This will help debugging mismatched property names (eg. isUser(), getUser, getuser()) and especially help developers understand that, for example, getUser() must be invoked prior to setFirstName().

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (WW-2723) Provide debug information about which methods where matched/invoked by OGNL

Posted by "Wes Wannemacher (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2723?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wes Wannemacher closed WW-2723.
-------------------------------

    Resolution: Fixed

I'm going to mark this as closed per Musachy's comments. If someone feels that the logging isn't enough and wants more, feel free to reopen.

> Provide debug information about which methods where matched/invoked by OGNL
> ---------------------------------------------------------------------------
>
>                 Key: WW-2723
>                 URL: https://issues.apache.org/struts/browse/WW-2723
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Expression Language
>    Affects Versions: 2.0.11.2, 2.1.2
>            Reporter: Jeromy Evans
>            Priority: Minor
>             Fix For: Future
>
>
> It would be helpful if developers could enable debug messages where Struts2 displays the methods that were invoked when getting or setting a property.
> eg. rather than "user.firstName", see that it invoked action.getUser() then User.getFirstName()
> This will help debugging mismatched property names (eg. isUser(), getUser, getuser()) and especially help developers understand that, for example, getUser() must be invoked prior to setFirstName().

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2723) Provide debug information about which methods where matched/invoked by OGNL

Posted by "James Holmes (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44409#action_44409 ] 

James Holmes commented on WW-2723:
----------------------------------

+1 to Jeromy and Musachy's ideas.

Sorry, -1 to requiring Spring to achieve this Wes.

> Provide debug information about which methods where matched/invoked by OGNL
> ---------------------------------------------------------------------------
>
>                 Key: WW-2723
>                 URL: https://issues.apache.org/struts/browse/WW-2723
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Expression Language
>    Affects Versions: 2.0.11.2, 2.1.2
>            Reporter: Jeromy Evans
>            Priority: Minor
>             Fix For: Future
>
>
> It would be helpful if developers could enable debug messages where Struts2 displays the methods that were invoked when getting or setting a property.
> eg. rather than "user.firstName", see that it invoked action.getUser() then User.getFirstName()
> This will help debugging mismatched property names (eg. isUser(), getUser, getuser()) and especially help developers understand that, for example, getUser() must be invoked prior to setFirstName().

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2723) Provide debug information about which methods where matched/invoked by OGNL

Posted by "Wes Wannemacher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44407#action_44407 ] 

Wes Wannemacher commented on WW-2723:
-------------------------------------

I agree with Musachy that dumping the ref rather than array values is ugly and unhelpful, but I wonder how valuable it would be to add this to the core? Since we support spring, why not just define pointcuts and advice on an action if/when it becomes necessary to debug? Looking at Spring's config, it seems that it would be easy to add pointcut/advice, build a logger and then when you have what you want, you could take it back out.

I know that not all projects use Spring, but if it it truly necessary to find out which action methods are being called, it might not be too much to ask to add spring, and update the config.

-Wes

> Provide debug information about which methods where matched/invoked by OGNL
> ---------------------------------------------------------------------------
>
>                 Key: WW-2723
>                 URL: https://issues.apache.org/struts/browse/WW-2723
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Expression Language
>    Affects Versions: 2.0.11.2, 2.1.2
>            Reporter: Jeromy Evans
>            Priority: Minor
>             Fix For: Future
>
>
> It would be helpful if developers could enable debug messages where Struts2 displays the methods that were invoked when getting or setting a property.
> eg. rather than "user.firstName", see that it invoked action.getUser() then User.getFirstName()
> This will help debugging mismatched property names (eg. isUser(), getUser, getuser()) and especially help developers understand that, for example, getUser() must be invoked prior to setFirstName().

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2723) Provide debug information about which methods where matched/invoked by OGNL

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44412#action_44412 ] 

Musachy Barroso commented on WW-2723:
-------------------------------------

I think this is fixed in 2.1, if the action has a setAge of type int, and I submit age=aaaaa, this is logged:

java.lang.NumberFormatException: For input string: "aaa"
......
ognl.MethodFailedException: Method "setAge" failed for object org.apache.struts2.showcase.UITagExample@10d963 [java.lang.NoSuchMethodException: setName([Ljava.lang.String;)]


It was probably part of the fix for logging errors when values are not found on the stack (I think Matt did that one)

> Provide debug information about which methods where matched/invoked by OGNL
> ---------------------------------------------------------------------------
>
>                 Key: WW-2723
>                 URL: https://issues.apache.org/struts/browse/WW-2723
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Expression Language
>    Affects Versions: 2.0.11.2, 2.1.2
>            Reporter: Jeromy Evans
>            Priority: Minor
>             Fix For: Future
>
>
> It would be helpful if developers could enable debug messages where Struts2 displays the methods that were invoked when getting or setting a property.
> eg. rather than "user.firstName", see that it invoked action.getUser() then User.getFirstName()
> This will help debugging mismatched property names (eg. isUser(), getUser, getuser()) and especially help developers understand that, for example, getUser() must be invoked prior to setFirstName().

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.