You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Sebastian (JIRA)" <ji...@apache.org> on 2007/12/07 11:59:35 UTC

[jira] Created: (WW-2362) "HTML form buttons HOWTO" tutorial in Cookbook does no longer work

"HTML form buttons HOWTO" tutorial in Cookbook does no longer work
------------------------------------------------------------------

                 Key: WW-2362
                 URL: https://issues.apache.org/struts/browse/WW-2362
             Project: Struts 2
          Issue Type: Bug
          Components: Documentation
    Affects Versions: 2.0.11
            Reporter: Sebastian
            Assignee: Ted Husted


In the "HTML form buttons HOWTO" tutorial, it is said that "When a button is pressed, a parameter is set in the framework with the name and value that are specified as the name and value attributes of your HTML button. The framework converts this automatically to boolean value if an appropriate property of the Action is found."

In Struts 2.0.11, this is not the case.
The framework only converts to "true"  if the parameter is set to the String "true".

So the only way to get the example of the tutorial work is to define the input tags like this

<input type="submit" name="buttonOnePressed" value="true"> 
<input type="submit" name="buttonTwoPressed" value="true">

This renders the example useless, as the value attribute defined the button text.
 

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


[jira] Assigned: (WW-2362) "HTML form buttons HOWTO" tutorial in Cookbook does no longer work

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

Musachy Barroso reassigned WW-2362:
-----------------------------------

    Assignee: Dave Newton

Assigning to Dave as this is part of the cookbook code review

> "HTML form buttons HOWTO" tutorial in Cookbook does no longer work
> ------------------------------------------------------------------
>
>                 Key: WW-2362
>                 URL: https://issues.apache.org/struts/browse/WW-2362
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 2.0.11
>            Reporter: Sebastian
>            Assignee: Dave Newton
>             Fix For: 2.1.4
>
>
> In the "HTML form buttons HOWTO" tutorial, it is said that "When a button is pressed, a parameter is set in the framework with the name and value that are specified as the name and value attributes of your HTML button. The framework converts this automatically to boolean value if an appropriate property of the Action is found."
> In Struts 2.0.11, this is not the case.
> The framework only converts to "true"  if the parameter is set to the String "true".
> So the only way to get the example of the tutorial work is to define the input tags like this
> <input type="submit" name="buttonOnePressed" value="true"> 
> <input type="submit" name="buttonTwoPressed" value="true">
> This renders the example useless, as the value attribute defined the button text.
>  

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


[jira] Commented: (WW-2362) "HTML form buttons HOWTO" tutorial in Cookbook does no longer work

Posted by "Steve Akins (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43216#action_43216 ] 

Steve Akins commented on WW-2362:
---------------------------------

Agree.

I posted some comments here http://www.mail-archive.com/user@struts.apache.org/msg72596.html



> "HTML form buttons HOWTO" tutorial in Cookbook does no longer work
> ------------------------------------------------------------------
>
>                 Key: WW-2362
>                 URL: https://issues.apache.org/struts/browse/WW-2362
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 2.0.11
>            Reporter: Sebastian
>             Fix For: Future
>
>
> In the "HTML form buttons HOWTO" tutorial, it is said that "When a button is pressed, a parameter is set in the framework with the name and value that are specified as the name and value attributes of your HTML button. The framework converts this automatically to boolean value if an appropriate property of the Action is found."
> In Struts 2.0.11, this is not the case.
> The framework only converts to "true"  if the parameter is set to the String "true".
> So the only way to get the example of the tutorial work is to define the input tags like this
> <input type="submit" name="buttonOnePressed" value="true"> 
> <input type="submit" name="buttonTwoPressed" value="true">
> This renders the example useless, as the value attribute defined the button text.
>  

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


[jira] Commented: (WW-2362) "HTML form buttons HOWTO" tutorial in Cookbook does no longer work

Posted by "Steve Akins (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43209#action_43209 ] 

Steve Akins commented on WW-2362:
---------------------------------


Can't think of how to fix it but I hope this helps.

Here's a trace of where it does the conversion (xwork 2.0.4, ognl 2.6.11, struts 2.0.11) .

XWorkBasicConverter.doConvertToBoolean(Object) line: 221	
XWorkBasicConverter.convertValue(Map, Object, Member, String, Object, Class) line: 88	
XWorkBasicConverter.convertValue(Map, Object, Member, String, Object, Class) line: 116	
AnnotationXWorkConverter(XWorkConverter).convertValue(Map, Object, Member, String, Object, Class) line: 321	
OgnlRuntime.getConvertedType(OgnlContext, Object, Member, String, Object, Class) line: 687	
OgnlRuntime.getConvertedTypes(OgnlContext, Object, Member, String, Class[], Object[], Object[]) line: 703	
OgnlRuntime.getConvertedMethodAndArgs(OgnlContext, Object, String, List, Object[], Object[]) line: 726	
OgnlRuntime.getAppropriateMethod(OgnlContext, Object, Object, String, String, List, Object[], Object[]) line: 783	
OgnlRuntime.callAppropriateMethod(OgnlContext, Object, Object, String, String, List, Object[]) line: 794	
OgnlRuntime.setMethodValue(OgnlContext, Object, String, Object, boolean) line: 964	
OgnlValueStack$ObjectAccessor(ObjectPropertyAccessor).setPossibleProperty(Map, Object, String, Object) line: 75	
OgnlValueStack$ObjectAccessor(ObjectPropertyAccessor).setProperty(Map, Object, Object, Object) line: 131	
OgnlValueStack$ObjectAccessor.setProperty(Map, Object, Object, Object) line: 68	
OgnlRuntime.setProperty(OgnlContext, Object, Object, Object) line: 1656	
CompoundRootAccessor.setProperty(Map, Object, Object, Object) line: 44	
OgnlRuntime.setProperty(OgnlContext, Object, Object, Object) line: 1656	
ASTProperty.setValueBody(OgnlContext, Object, Object) line: 101	
ASTProperty(SimpleNode).evaluateSetValueBody(OgnlContext, Object, Object) line: 177	
ASTProperty(SimpleNode).setValue(OgnlContext, Object, Object) line: 246	
Ognl.setValue(Object, Map, Object, Object) line: 476	
OgnlUtil.setValue(String, Map, Object, Object) line: 186	
OgnlValueStack.setValue(String, Object, boolean) line: 158	
OgnlValueStack.setValue(String, Object) line: 146	
ParametersInterceptor.setParameters(Object, ValueStack, Map) line: 193	



> "HTML form buttons HOWTO" tutorial in Cookbook does no longer work
> ------------------------------------------------------------------
>
>                 Key: WW-2362
>                 URL: https://issues.apache.org/struts/browse/WW-2362
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 2.0.11
>            Reporter: Sebastian
>             Fix For: Future
>
>
> In the "HTML form buttons HOWTO" tutorial, it is said that "When a button is pressed, a parameter is set in the framework with the name and value that are specified as the name and value attributes of your HTML button. The framework converts this automatically to boolean value if an appropriate property of the Action is found."
> In Struts 2.0.11, this is not the case.
> The framework only converts to "true"  if the parameter is set to the String "true".
> So the only way to get the example of the tutorial work is to define the input tags like this
> <input type="submit" name="buttonOnePressed" value="true"> 
> <input type="submit" name="buttonTwoPressed" value="true">
> This renders the example useless, as the value attribute defined the button text.
>  

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


[jira] Issue Comment Edited: (WW-2362) "HTML form buttons HOWTO" tutorial in Cookbook does no longer work

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

smittel edited comment on WW-2362 at 2/14/08 2:37 AM:
--------------------------------------------------------

I also agree with Al, I had good success using the "method" solution to determine which button was pressed.

      was (Author: smittel):
    I also agree with Al, I had good success using the "method" solution to determine wich button was pressed.
  
> "HTML form buttons HOWTO" tutorial in Cookbook does no longer work
> ------------------------------------------------------------------
>
>                 Key: WW-2362
>                 URL: https://issues.apache.org/struts/browse/WW-2362
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 2.0.11
>            Reporter: Sebastian
>             Fix For: Future
>
>
> In the "HTML form buttons HOWTO" tutorial, it is said that "When a button is pressed, a parameter is set in the framework with the name and value that are specified as the name and value attributes of your HTML button. The framework converts this automatically to boolean value if an appropriate property of the Action is found."
> In Struts 2.0.11, this is not the case.
> The framework only converts to "true"  if the parameter is set to the String "true".
> So the only way to get the example of the tutorial work is to define the input tags like this
> <input type="submit" name="buttonOnePressed" value="true"> 
> <input type="submit" name="buttonTwoPressed" value="true">
> This renders the example useless, as the value attribute defined the button text.
>  

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


[jira] Updated: (WW-2362) "HTML form buttons HOWTO" tutorial in Cookbook does no longer work

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

Ted Husted updated WW-2362:
---------------------------

    Assignee:     (was: Ted Husted)

> "HTML form buttons HOWTO" tutorial in Cookbook does no longer work
> ------------------------------------------------------------------
>
>                 Key: WW-2362
>                 URL: https://issues.apache.org/struts/browse/WW-2362
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 2.0.11
>            Reporter: Sebastian
>
> In the "HTML form buttons HOWTO" tutorial, it is said that "When a button is pressed, a parameter is set in the framework with the name and value that are specified as the name and value attributes of your HTML button. The framework converts this automatically to boolean value if an appropriate property of the Action is found."
> In Struts 2.0.11, this is not the case.
> The framework only converts to "true"  if the parameter is set to the String "true".
> So the only way to get the example of the tutorial work is to define the input tags like this
> <input type="submit" name="buttonOnePressed" value="true"> 
> <input type="submit" name="buttonTwoPressed" value="true">
> This renders the example useless, as the value attribute defined the button text.
>  

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


[jira] Updated: (WW-2362) "HTML form buttons HOWTO" tutorial in Cookbook does no longer work

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

Wes Wannemacher updated WW-2362:
--------------------------------

    Fix Version/s:     (was: 2.1.4)
                   2.1.5

> "HTML form buttons HOWTO" tutorial in Cookbook does no longer work
> ------------------------------------------------------------------
>
>                 Key: WW-2362
>                 URL: https://issues.apache.org/struts/browse/WW-2362
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 2.0.11
>            Reporter: Sebastian
>            Assignee: Dave Newton
>             Fix For: 2.1.5
>
>
> In the "HTML form buttons HOWTO" tutorial, it is said that "When a button is pressed, a parameter is set in the framework with the name and value that are specified as the name and value attributes of your HTML button. The framework converts this automatically to boolean value if an appropriate property of the Action is found."
> In Struts 2.0.11, this is not the case.
> The framework only converts to "true"  if the parameter is set to the String "true".
> So the only way to get the example of the tutorial work is to define the input tags like this
> <input type="submit" name="buttonOnePressed" value="true"> 
> <input type="submit" name="buttonTwoPressed" value="true">
> This renders the example useless, as the value attribute defined the button text.
>  

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


[jira] Resolved: (WW-2362) "HTML form buttons HOWTO" tutorial in Cookbook does no longer work

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

Musachy Barroso resolved WW-2362.
---------------------------------

    Resolution: Fixed

doc was updated

> "HTML form buttons HOWTO" tutorial in Cookbook does no longer work
> ------------------------------------------------------------------
>
>                 Key: WW-2362
>                 URL: https://issues.apache.org/struts/browse/WW-2362
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 2.0.11
>            Reporter: Sebastian
>            Assignee: Dave Newton
>             Fix For: 2.1.7
>
>
> In the "HTML form buttons HOWTO" tutorial, it is said that "When a button is pressed, a parameter is set in the framework with the name and value that are specified as the name and value attributes of your HTML button. The framework converts this automatically to boolean value if an appropriate property of the Action is found."
> In Struts 2.0.11, this is not the case.
> The framework only converts to "true"  if the parameter is set to the String "true".
> So the only way to get the example of the tutorial work is to define the input tags like this
> <input type="submit" name="buttonOnePressed" value="true"> 
> <input type="submit" name="buttonTwoPressed" value="true">
> This renders the example useless, as the value attribute defined the button text.
>  

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


[jira] Updated: (WW-2362) "HTML form buttons HOWTO" tutorial in Cookbook does no longer work

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

James Holmes updated WW-2362:
-----------------------------

    Fix Version/s:     (was: Future)
                   2.1.3

We just need to update the docs to close this one out.

> "HTML form buttons HOWTO" tutorial in Cookbook does no longer work
> ------------------------------------------------------------------
>
>                 Key: WW-2362
>                 URL: https://issues.apache.org/struts/browse/WW-2362
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 2.0.11
>            Reporter: Sebastian
>             Fix For: 2.1.3
>
>
> In the "HTML form buttons HOWTO" tutorial, it is said that "When a button is pressed, a parameter is set in the framework with the name and value that are specified as the name and value attributes of your HTML button. The framework converts this automatically to boolean value if an appropriate property of the Action is found."
> In Struts 2.0.11, this is not the case.
> The framework only converts to "true"  if the parameter is set to the String "true".
> So the only way to get the example of the tutorial work is to define the input tags like this
> <input type="submit" name="buttonOnePressed" value="true"> 
> <input type="submit" name="buttonTwoPressed" value="true">
> This renders the example useless, as the value attribute defined the button text.
>  

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


[jira] Updated: (WW-2362) "HTML form buttons HOWTO" tutorial in Cookbook does no longer work

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

Musachy Barroso updated WW-2362:
--------------------------------

    Fix Version/s:     (was: 2.1.3)
                   2.1.4

> "HTML form buttons HOWTO" tutorial in Cookbook does no longer work
> ------------------------------------------------------------------
>
>                 Key: WW-2362
>                 URL: https://issues.apache.org/struts/browse/WW-2362
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 2.0.11
>            Reporter: Sebastian
>            Assignee: Dave Newton
>             Fix For: 2.1.4
>
>
> In the "HTML form buttons HOWTO" tutorial, it is said that "When a button is pressed, a parameter is set in the framework with the name and value that are specified as the name and value attributes of your HTML button. The framework converts this automatically to boolean value if an appropriate property of the Action is found."
> In Struts 2.0.11, this is not the case.
> The framework only converts to "true"  if the parameter is set to the String "true".
> So the only way to get the example of the tutorial work is to define the input tags like this
> <input type="submit" name="buttonOnePressed" value="true"> 
> <input type="submit" name="buttonTwoPressed" value="true">
> This renders the example useless, as the value attribute defined the button text.
>  

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


[jira] Commented: (WW-2362) "HTML form buttons HOWTO" tutorial in Cookbook does no longer work

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

Sebastian commented on WW-2362:
-------------------------------

I also agree with Al, I had good success using the "method" solution to determine wich button was pressed.

> "HTML form buttons HOWTO" tutorial in Cookbook does no longer work
> ------------------------------------------------------------------
>
>                 Key: WW-2362
>                 URL: https://issues.apache.org/struts/browse/WW-2362
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 2.0.11
>            Reporter: Sebastian
>             Fix For: Future
>
>
> In the "HTML form buttons HOWTO" tutorial, it is said that "When a button is pressed, a parameter is set in the framework with the name and value that are specified as the name and value attributes of your HTML button. The framework converts this automatically to boolean value if an appropriate property of the Action is found."
> In Struts 2.0.11, this is not the case.
> The framework only converts to "true"  if the parameter is set to the String "true".
> So the only way to get the example of the tutorial work is to define the input tags like this
> <input type="submit" name="buttonOnePressed" value="true"> 
> <input type="submit" name="buttonTwoPressed" value="true">
> This renders the example useless, as the value attribute defined the button text.
>  

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


[jira] Commented: (WW-2362) "HTML form buttons HOWTO" tutorial in Cookbook does no longer work

Posted by "Al Sutton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43213#action_43213 ] 

Al Sutton commented on WW-2362:
-------------------------------

Isn't this a documentation error?

I don't think there is an workable solution which will fix this, I would suggest that we update the HOWTO and any othr documentation to use the method="..." solution of determining which button was pressed.

> "HTML form buttons HOWTO" tutorial in Cookbook does no longer work
> ------------------------------------------------------------------
>
>                 Key: WW-2362
>                 URL: https://issues.apache.org/struts/browse/WW-2362
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 2.0.11
>            Reporter: Sebastian
>             Fix For: Future
>
>
> In the "HTML form buttons HOWTO" tutorial, it is said that "When a button is pressed, a parameter is set in the framework with the name and value that are specified as the name and value attributes of your HTML button. The framework converts this automatically to boolean value if an appropriate property of the Action is found."
> In Struts 2.0.11, this is not the case.
> The framework only converts to "true"  if the parameter is set to the String "true".
> So the only way to get the example of the tutorial work is to define the input tags like this
> <input type="submit" name="buttonOnePressed" value="true"> 
> <input type="submit" name="buttonTwoPressed" value="true">
> This renders the example useless, as the value attribute defined the button text.
>  

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