You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Stefan Simik (JIRA)" <ji...@apache.org> on 2008/11/21 22:33:44 UTC

[jira] Created: (WICKET-1951) MixedParamUrlCodingStrategy should not throw exception, if there is more parameters, than expected

MixedParamUrlCodingStrategy should not throw exception, if there is more parameters, than expected
--------------------------------------------------------------------------------------------------

                 Key: WICKET-1951
                 URL: https://issues.apache.org/jira/browse/WICKET-1951
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.4-RC1
            Reporter: Stefan Simik


MixedParamUrlCodingStrategy should not throw exception, if there is more parameters, than expected.

The problem is in MixedParamUrlCodingStrategy.java, line: 181

Example: 
We have url, that displays info domain yahoo.com :    "http://server/domain/yahoo.com",    or about google.com:          "http://server/domain/google.com"

Page is mounted using MixedParamUrlCodingStrategy:
mount(new MixedParamUrlCodingStrategy("domain", DomainInfoPage.class, new String[]{ DomainInfoPage.PARAMETER_DOMAIN_NAME }));

When user types URL, that has more parameters, then we specified in mount  for example "http://server/domain/google.com/asdf"   --->>> GETS AN ERROR  !!!
But there is no reason for such an error, because only first parameter is required, additional can be ignored - without any errors.

Use case is, that our users often rewrite URL directly and such typo results in error, and we have no possibility to handle this
and show the page - all the needed information is in URL, so there is no reason to throw exception, when there is more information.



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


[jira] Resolved: (WICKET-1951) MixedParamUrlCodingStrategy should not throw exception, if there is more parameters, than expected

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1951?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-1951.
-----------------------------------

    Resolution: Won't Fix
      Assignee: Igor Vaynberg

the method decodeParameters(String urlFragment, Map urlParameters) which throws this error is protected, feel free to override it to work without throwing the exception.

> MixedParamUrlCodingStrategy should not throw exception, if there is more parameters, than expected
> --------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-1951
>                 URL: https://issues.apache.org/jira/browse/WICKET-1951
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-RC1
>            Reporter: Stefan Simik
>            Assignee: Igor Vaynberg
>
> MixedParamUrlCodingStrategy should not throw exception, if there is more parameters, than expected.
> The problem is in MixedParamUrlCodingStrategy.java, line: 181
> Example: 
> We have url, that displays info domain yahoo.com :    "http://server/domain/yahoo.com",    or about google.com:          "http://server/domain/google.com"
> Page is mounted using MixedParamUrlCodingStrategy:
> mount(new MixedParamUrlCodingStrategy("domain", DomainInfoPage.class, new String[]{ DomainInfoPage.PARAMETER_DOMAIN_NAME }));
> When user types URL, that has more parameters, then we specified in mount  for example "http://server/domain/google.com/asdf"   --->>> GETS AN ERROR  !!!
> But there is no reason for such an error, because only first parameter is required, additional can be ignored - without any errors.
> Use case is, that our users often rewrite URL directly and such typo results in error, and we have no possibility to handle this
> and show the page - all the needed information is in URL, so there is no reason to throw exception, when there is more information.

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


[jira] Commented: (WICKET-1951) MixedParamUrlCodingStrategy should not throw exception, if there is more parameters, than expected

Posted by "Stefan Hojer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12710931#action_12710931 ] 

Stefan Hojer commented on WICKET-1951:
--------------------------------------

Wont it make sense to react using a http 404 error if there are more parameters than allowed? In this case the user actually requests a resource that the server does not know about. So the correct response should be 404 Not Found. However the current implementation results in a 503 Internal Server Error.

Ok this method is protected, but the 503 just seems wrong as there is really no internal error here. It is just an error in the user input.

> MixedParamUrlCodingStrategy should not throw exception, if there is more parameters, than expected
> --------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-1951
>                 URL: https://issues.apache.org/jira/browse/WICKET-1951
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-RC1
>            Reporter: Stefan Simik
>            Assignee: Igor Vaynberg
>
> MixedParamUrlCodingStrategy should not throw exception, if there is more parameters, than expected.
> The problem is in MixedParamUrlCodingStrategy.java, line: 181
> Example: 
> We have url, that displays info domain yahoo.com :    "http://server/domain/yahoo.com",    or about google.com:          "http://server/domain/google.com"
> Page is mounted using MixedParamUrlCodingStrategy:
> mount(new MixedParamUrlCodingStrategy("domain", DomainInfoPage.class, new String[]{ DomainInfoPage.PARAMETER_DOMAIN_NAME }));
> When user types URL, that has more parameters, then we specified in mount  for example "http://server/domain/google.com/asdf"   --->>> GETS AN ERROR  !!!
> But there is no reason for such an error, because only first parameter is required, additional can be ignored - without any errors.
> Use case is, that our users often rewrite URL directly and such typo results in error, and we have no possibility to handle this
> and show the page - all the needed information is in URL, so there is no reason to throw exception, when there is more information.

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