[GitHub] [wicket] martin-g opened a new pull request #440: WICKET-6807 Improve the check for the submitting component

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [wicket] martin-g opened a new pull request #440: WICKET-6807 Improve the check for the submitting component

GitBox

martin-g opened a new pull request #440:
URL: https://github.com/apache/wicket/pull/440


   First check for the special 'name.x' parameter
   If there is no such then check that there is exactly one 'name' parameter
   Always use only the GET/POST parameters as the form's method


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [wicket] martin-g commented on a change in pull request #440: WICKET-6807 Improve the check for the submitting component

GitBox

martin-g commented on a change in pull request #440:
URL: https://github.com/apache/wicket/pull/440#discussion_r466298364



##########
File path: wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java
##########
@@ -1711,7 +1725,7 @@ public final void writeHiddenFields()
  {
  // if it's a get, did put the parameters in the action attribute,
  // and have to write the url parameters as hidden fields
- if (encodeUrlInHiddenFields())
+ if (METHOD_POST.equalsIgnoreCase(getMethod()))

Review comment:
       Sven Meier comment from https://issues.apache.org/jira/browse/WICKET-6807?focusedCommentId=17172167&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17172167:
   
   That is not correct!
   
   Parameters **must** be written as hidden fields, when the Form is 'get' (because the browser would strip them from the form's action). For a 'post' Form the parameters **can** be either in hidden fields **or** in the form's action, both would work.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [wicket] martin-g commented on a change in pull request #440: WICKET-6807 Improve the check for the submitting component

GitBox
In reply to this post by GitBox

martin-g commented on a change in pull request #440:
URL: https://github.com/apache/wicket/pull/440#discussion_r466298364



##########
File path: wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java
##########
@@ -1711,7 +1725,7 @@ public final void writeHiddenFields()
  {
  // if it's a get, did put the parameters in the action attribute,
  // and have to write the url parameters as hidden fields
- if (encodeUrlInHiddenFields())
+ if (METHOD_POST.equalsIgnoreCase(getMethod()))

Review comment:
       Sven Meier's comment from https://issues.apache.org/jira/browse/WICKET-6807?focusedCommentId=17172167&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17172167:
   
   That is not correct!
   
   Parameters **must** be written as hidden fields, when the Form is 'get' (because the browser would strip them from the form's action). For a 'post' Form the parameters **can** be either in hidden fields **or** in the form's action, both would work.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [wicket] martin-g commented on a change in pull request #440: WICKET-6807 Improve the check for the submitting component

GitBox
In reply to this post by GitBox

martin-g commented on a change in pull request #440:
URL: https://github.com/apache/wicket/pull/440#discussion_r466298812



##########
File path: wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java
##########
@@ -1711,7 +1725,7 @@ public final void writeHiddenFields()
  {
  // if it's a get, did put the parameters in the action attribute,
  // and have to write the url parameters as hidden fields
- if (encodeUrlInHiddenFields())
+ if (METHOD_POST.equalsIgnoreCase(getMethod()))

Review comment:
       In that case let's always write them as hidden fields.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [wicket] martin-g commented on a change in pull request #440: WICKET-6807 Improve the check for the submitting component

GitBox
In reply to this post by GitBox

martin-g commented on a change in pull request #440:
URL: https://github.com/apache/wicket/pull/440#discussion_r466333061



##########
File path: wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java
##########
@@ -1711,7 +1725,7 @@ public final void writeHiddenFields()
  {
  // if it's a get, did put the parameters in the action attribute,
  // and have to write the url parameters as hidden fields
- if (encodeUrlInHiddenFields())
+ if (METHOD_POST.equalsIgnoreCase(getMethod()))

Review comment:
       I've updated it.
   I want to check what else could be simplified by using always hidden fields. I don't see a reason to write extra query parameters in the form action url instead of using hidden fields everywhere.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [wicket] svenmeier commented on pull request #440: WICKET-6807 Improve the check for the submitting component

GitBox
In reply to this post by GitBox

svenmeier commented on pull request #440:
URL: https://github.com/apache/wicket/pull/440#issuecomment-669913170


   Always writing parameters into hidden fields will mix them into the post parameters. This makes it impossible to differentiate them with form fields - something WICKET-6807 actually wanted to improve on.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [wicket] martin-g closed pull request #440: WICKET-6807 Improve the check for the submitting component

GitBox
In reply to this post by GitBox

martin-g closed pull request #440:
URL: https://github.com/apache/wicket/pull/440


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]