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/25 05:20:44 UTC

[jira] Created: (WICKET-1957) Odd number of page parameters - should not throw IllegalStateException

Odd number of page parameters - should not throw IllegalStateException
----------------------------------------------------------------------

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


The default URL strategy in wicket throws IllegalStateException, when there is odd number of parameters ?
See AbstractRequestTargetUrlCodingStrategy: line 169 in RC1

We have a problem with this way handling, because our users rewrite URLs manually
(we cannot prevent users from doing this).

Our pages are stateless and they don't use any parameters - BUT there are throwing exceptions
and showing InternalErrorPage-s. It is presented like a serious problem like DB, or like service failed
but there is no problem actually - only parameters, that are not used.

I think, that page parameters should not result in INTERNAL ERROR,
because there are many cases, where this is not relevant.
There should be an alternative way - some custom handling or ignoring parameters in such a situation.

The same problem is with MixedParamUrlCodingStrategy:
(See MixedParamUrlCodingStrategy: line 181)  in RC1
------------------------------------------------------------------------------------
Adding additional parameter results in exception a internal-error page.
IMHO, additional parameters should be ignored and not result in error.

I would suggest add the latest odd parameter to page parameters, but with empty value "".


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


[jira] Commented: (WICKET-1957) Odd number of page parameters - should not throw IllegalStateException

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

Stefan Simik commented on WICKET-1957:
--------------------------------------

Yes, Ryan - exactly the same we did in our application http://www.domenovac.sk.
We tried many solutions (for example ignore quietly incorrect parameters, ...), but the final and best solution we found  was to throw an 404 http error.

As you said, we can override error page (supported by servlet specifications in web.xml)  ->  it is no problem to show our custom 404 page.

I also suggest to throw 404 error, when incorrect parameters.

Patch provided.


> Odd number of page parameters - should not throw IllegalStateException
> ----------------------------------------------------------------------
>
>                 Key: WICKET-1957
>                 URL: https://issues.apache.org/jira/browse/WICKET-1957
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.4-RC1
>            Reporter: Stefan Simik
>            Assignee: Igor Vaynberg
>         Attachments: ExtendedBookmarkablePageRequestTargetUrlCodingStrategy.java
>
>
> The default URL strategy in wicket throws IllegalStateException, when there is odd number of parameters ?
> See AbstractRequestTargetUrlCodingStrategy: line 169 in RC1
> We have a problem with this way handling, because our users rewrite URLs manually
> (we cannot prevent users from doing this).
> Our pages are stateless and they don't use any parameters - BUT there are throwing exceptions
> and showing InternalErrorPage-s. It is presented like a serious problem like DB, or like service failed
> but there is no problem actually - only parameters, that are not used.
> I think, that page parameters should not result in INTERNAL ERROR,
> because there are many cases, where this is not relevant.
> There should be an alternative way - some custom handling or ignoring parameters in such a situation.
> The same problem is with MixedParamUrlCodingStrategy:
> (See MixedParamUrlCodingStrategy: line 181)  in RC1
> ------------------------------------------------------------------------------------
> Adding additional parameter results in exception a internal-error page.
> IMHO, additional parameters should be ignored and not result in error.
> I would suggest add the latest odd parameter to page parameters, but with empty value "".

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


[jira] Resolved: (WICKET-1957) Odd number of page parameters - should not throw IllegalStateException

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

Igor Vaynberg resolved WICKET-1957.
-----------------------------------

    Resolution: Won't Fix
      Assignee: Igor Vaynberg

the problem here is that these strategies expect param-name/param-value pairs. so if you enter for example /a/b/c what is c? do we create a parameter called "c" with a "null" value? or do we create a parameter with "null" name and value "c"? these strategie are made to work with parameter PAIRS. if you want something that just lets you access an arbitrary string of parameters use IndexedParamUrlCodingStrategy

> Odd number of page parameters - should not throw IllegalStateException
> ----------------------------------------------------------------------
>
>                 Key: WICKET-1957
>                 URL: https://issues.apache.org/jira/browse/WICKET-1957
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.4-RC1
>            Reporter: Stefan Simik
>            Assignee: Igor Vaynberg
>         Attachments: ExtendedBookmarkablePageRequestTargetUrlCodingStrategy.java
>
>
> The default URL strategy in wicket throws IllegalStateException, when there is odd number of parameters ?
> See AbstractRequestTargetUrlCodingStrategy: line 169 in RC1
> We have a problem with this way handling, because our users rewrite URLs manually
> (we cannot prevent users from doing this).
> Our pages are stateless and they don't use any parameters - BUT there are throwing exceptions
> and showing InternalErrorPage-s. It is presented like a serious problem like DB, or like service failed
> but there is no problem actually - only parameters, that are not used.
> I think, that page parameters should not result in INTERNAL ERROR,
> because there are many cases, where this is not relevant.
> There should be an alternative way - some custom handling or ignoring parameters in such a situation.
> The same problem is with MixedParamUrlCodingStrategy:
> (See MixedParamUrlCodingStrategy: line 181)  in RC1
> ------------------------------------------------------------------------------------
> Adding additional parameter results in exception a internal-error page.
> IMHO, additional parameters should be ignored and not result in error.
> I would suggest add the latest odd parameter to page parameters, but with empty value "".

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


[jira] Commented: (WICKET-1957) Odd number of page parameters - should not throw IllegalStateException

Posted by "Vjacheslav Kanivetc (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12650892#action_12650892 ] 

Vjacheslav Kanivetc commented on WICKET-1957:
---------------------------------------------

Yes, this is a very annoying behavior in 1.3 series of wicket as well, especially when we wish to allow people to modify url, for example, for username and password-protected rss with some extra parameters, the way like BookmarkablePageRequestTargetUrlCodingStrategy encodes the input, user is unable to enter for example /username/password/somemask, he needs to enter pairs of key-value.

Much better would be to simply pass resulting PageParameters to the handler that is going to accept the input

> Odd number of page parameters - should not throw IllegalStateException
> ----------------------------------------------------------------------
>
>                 Key: WICKET-1957
>                 URL: https://issues.apache.org/jira/browse/WICKET-1957
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.4-RC1
>            Reporter: Stefan Simik
>
> The default URL strategy in wicket throws IllegalStateException, when there is odd number of parameters ?
> See AbstractRequestTargetUrlCodingStrategy: line 169 in RC1
> We have a problem with this way handling, because our users rewrite URLs manually
> (we cannot prevent users from doing this).
> Our pages are stateless and they don't use any parameters - BUT there are throwing exceptions
> and showing InternalErrorPage-s. It is presented like a serious problem like DB, or like service failed
> but there is no problem actually - only parameters, that are not used.
> I think, that page parameters should not result in INTERNAL ERROR,
> because there are many cases, where this is not relevant.
> There should be an alternative way - some custom handling or ignoring parameters in such a situation.
> The same problem is with MixedParamUrlCodingStrategy:
> (See MixedParamUrlCodingStrategy: line 181)  in RC1
> ------------------------------------------------------------------------------------
> Adding additional parameter results in exception a internal-error page.
> IMHO, additional parameters should be ignored and not result in error.
> I would suggest add the latest odd parameter to page parameters, but with empty value "".

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


[jira] Updated: (WICKET-1957) Odd number of page parameters - should not throw IllegalStateException

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

Stefan Simik updated WICKET-1957:
---------------------------------

    Attachment: ExtendedBookmarkablePageRequestTargetUrlCodingStrategy.java

Simple patch for this issue, that we temporarily used, until the problem will be fixed in wicket.
Demonstrates my suggested solution,.


> Odd number of page parameters - should not throw IllegalStateException
> ----------------------------------------------------------------------
>
>                 Key: WICKET-1957
>                 URL: https://issues.apache.org/jira/browse/WICKET-1957
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.4-RC1
>            Reporter: Stefan Simik
>         Attachments: ExtendedBookmarkablePageRequestTargetUrlCodingStrategy.java
>
>
> The default URL strategy in wicket throws IllegalStateException, when there is odd number of parameters ?
> See AbstractRequestTargetUrlCodingStrategy: line 169 in RC1
> We have a problem with this way handling, because our users rewrite URLs manually
> (we cannot prevent users from doing this).
> Our pages are stateless and they don't use any parameters - BUT there are throwing exceptions
> and showing InternalErrorPage-s. It is presented like a serious problem like DB, or like service failed
> but there is no problem actually - only parameters, that are not used.
> I think, that page parameters should not result in INTERNAL ERROR,
> because there are many cases, where this is not relevant.
> There should be an alternative way - some custom handling or ignoring parameters in such a situation.
> The same problem is with MixedParamUrlCodingStrategy:
> (See MixedParamUrlCodingStrategy: line 181)  in RC1
> ------------------------------------------------------------------------------------
> Adding additional parameter results in exception a internal-error page.
> IMHO, additional parameters should be ignored and not result in error.
> I would suggest add the latest odd parameter to page parameters, but with empty value "".

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


[jira] Commented: (WICKET-1957) Odd number of page parameters - should not throw IllegalStateException

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

Stefan Simik commented on WICKET-1957:
--------------------------------------

I accept, that this strategy expepts name/value pairs. It's ok, but the most annoying behavior, is HANDLING odd number of parameters.
The last odd parameter should be ignored or better have empty value (empty string) but NOT THROW INTERNAL ERROR in application.

There is no real problem in our web application, but from user point of view - he sees APPLICATION CRASHING = INTERNAL ERRROR .
That's the real problem.

I think, that handling of odd number of parameters should be handled another way (it's up to you - core developers), but not throwing internal-error,
because there is no real error - but additional parameter, that can be ignored/set with empty value.

> Odd number of page parameters - should not throw IllegalStateException
> ----------------------------------------------------------------------
>
>                 Key: WICKET-1957
>                 URL: https://issues.apache.org/jira/browse/WICKET-1957
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.4-RC1
>            Reporter: Stefan Simik
>            Assignee: Igor Vaynberg
>         Attachments: ExtendedBookmarkablePageRequestTargetUrlCodingStrategy.java
>
>
> The default URL strategy in wicket throws IllegalStateException, when there is odd number of parameters ?
> See AbstractRequestTargetUrlCodingStrategy: line 169 in RC1
> We have a problem with this way handling, because our users rewrite URLs manually
> (we cannot prevent users from doing this).
> Our pages are stateless and they don't use any parameters - BUT there are throwing exceptions
> and showing InternalErrorPage-s. It is presented like a serious problem like DB, or like service failed
> but there is no problem actually - only parameters, that are not used.
> I think, that page parameters should not result in INTERNAL ERROR,
> because there are many cases, where this is not relevant.
> There should be an alternative way - some custom handling or ignoring parameters in such a situation.
> The same problem is with MixedParamUrlCodingStrategy:
> (See MixedParamUrlCodingStrategy: line 181)  in RC1
> ------------------------------------------------------------------------------------
> Adding additional parameter results in exception a internal-error page.
> IMHO, additional parameters should be ignored and not result in error.
> I would suggest add the latest odd parameter to page parameters, but with empty value "".

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


[jira] Updated: (WICKET-1957) Odd number of page parameters - should not throw IllegalStateException

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

Stefan Simik updated WICKET-1957:
---------------------------------

    Attachment: Patch to throw 404 error.zip

Patch to throw 404 error in URL coding strategies, when parameters are incorrect.

2 strategies patched:   
     1. mixed, 
     2. default (bookmarkable)

> Odd number of page parameters - should not throw IllegalStateException
> ----------------------------------------------------------------------
>
>                 Key: WICKET-1957
>                 URL: https://issues.apache.org/jira/browse/WICKET-1957
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.4-RC1
>            Reporter: Stefan Simik
>            Assignee: Igor Vaynberg
>         Attachments: ExtendedBookmarkablePageRequestTargetUrlCodingStrategy.java, Patch to throw 404 error.zip
>
>
> The default URL strategy in wicket throws IllegalStateException, when there is odd number of parameters ?
> See AbstractRequestTargetUrlCodingStrategy: line 169 in RC1
> We have a problem with this way handling, because our users rewrite URLs manually
> (we cannot prevent users from doing this).
> Our pages are stateless and they don't use any parameters - BUT there are throwing exceptions
> and showing InternalErrorPage-s. It is presented like a serious problem like DB, or like service failed
> but there is no problem actually - only parameters, that are not used.
> I think, that page parameters should not result in INTERNAL ERROR,
> because there are many cases, where this is not relevant.
> There should be an alternative way - some custom handling or ignoring parameters in such a situation.
> The same problem is with MixedParamUrlCodingStrategy:
> (See MixedParamUrlCodingStrategy: line 181)  in RC1
> ------------------------------------------------------------------------------------
> Adding additional parameter results in exception a internal-error page.
> IMHO, additional parameters should be ignored and not result in error.
> I would suggest add the latest odd parameter to page parameters, but with empty value "".

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


[jira] Commented: (WICKET-1957) Odd number of page parameters - should not throw IllegalStateException

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651403#action_12651403 ] 

Igor Vaynberg commented on WICKET-1957:
---------------------------------------

all this is a result of the user manually trying to tweak the url - which should cause an error. perhaps your internal error page should mention this so the user knows they messed up the url. showing an error page does not mean your application crashed, it simply means it could not process the input - in this case the url. if you expect your users to tweak the url often use the right tool for the job, like i already suggested, the indexed coding strategy.

> Odd number of page parameters - should not throw IllegalStateException
> ----------------------------------------------------------------------
>
>                 Key: WICKET-1957
>                 URL: https://issues.apache.org/jira/browse/WICKET-1957
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.4-RC1
>            Reporter: Stefan Simik
>            Assignee: Igor Vaynberg
>         Attachments: ExtendedBookmarkablePageRequestTargetUrlCodingStrategy.java
>
>
> The default URL strategy in wicket throws IllegalStateException, when there is odd number of parameters ?
> See AbstractRequestTargetUrlCodingStrategy: line 169 in RC1
> We have a problem with this way handling, because our users rewrite URLs manually
> (we cannot prevent users from doing this).
> Our pages are stateless and they don't use any parameters - BUT there are throwing exceptions
> and showing InternalErrorPage-s. It is presented like a serious problem like DB, or like service failed
> but there is no problem actually - only parameters, that are not used.
> I think, that page parameters should not result in INTERNAL ERROR,
> because there are many cases, where this is not relevant.
> There should be an alternative way - some custom handling or ignoring parameters in such a situation.
> The same problem is with MixedParamUrlCodingStrategy:
> (See MixedParamUrlCodingStrategy: line 181)  in RC1
> ------------------------------------------------------------------------------------
> Adding additional parameter results in exception a internal-error page.
> IMHO, additional parameters should be ignored and not result in error.
> I would suggest add the latest odd parameter to page parameters, but with empty value "".

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


[jira] Commented: (WICKET-1957) Odd number of page parameters - should not throw IllegalStateException

Posted by "Ryan Donahue (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12653945#action_12653945 ] 

Ryan Donahue commented on WICKET-1957:
--------------------------------------

We have run into this for our site utipu.com where Yahoo Slurp tries to guess URLs in the following manner:
1) Slurp encounters the following valid URL, http://www.utipu.com/some/valid/url
2) Then Slurp requests this URL http://www.utipu.com/some/valid

The consequence for us is that when the Internal Error page is served with a 200 status to Slurp, Slurp assumes it is a valid URL and continues to request this URL everytime it crawls the site.

I agree with Igor that tweaking the URL incorrectly should cause an error.  However, I think it should respond with a 404 since the request URL is really "Not Found."  Replying with a "Page Not Found" should be sufficient, especially since Wicket allows us to override the "Page Not Found" page.

> Odd number of page parameters - should not throw IllegalStateException
> ----------------------------------------------------------------------
>
>                 Key: WICKET-1957
>                 URL: https://issues.apache.org/jira/browse/WICKET-1957
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.4-RC1
>            Reporter: Stefan Simik
>            Assignee: Igor Vaynberg
>         Attachments: ExtendedBookmarkablePageRequestTargetUrlCodingStrategy.java
>
>
> The default URL strategy in wicket throws IllegalStateException, when there is odd number of parameters ?
> See AbstractRequestTargetUrlCodingStrategy: line 169 in RC1
> We have a problem with this way handling, because our users rewrite URLs manually
> (we cannot prevent users from doing this).
> Our pages are stateless and they don't use any parameters - BUT there are throwing exceptions
> and showing InternalErrorPage-s. It is presented like a serious problem like DB, or like service failed
> but there is no problem actually - only parameters, that are not used.
> I think, that page parameters should not result in INTERNAL ERROR,
> because there are many cases, where this is not relevant.
> There should be an alternative way - some custom handling or ignoring parameters in such a situation.
> The same problem is with MixedParamUrlCodingStrategy:
> (See MixedParamUrlCodingStrategy: line 181)  in RC1
> ------------------------------------------------------------------------------------
> Adding additional parameter results in exception a internal-error page.
> IMHO, additional parameters should be ignored and not result in error.
> I would suggest add the latest odd parameter to page parameters, but with empty value "".

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