You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2012/10/03 11:00:07 UTC

[jira] [Comment Edited] (WICKET-4493) Unwrapped IllegalArgumentException in WicketURLDecoder

    [ https://issues.apache.org/jira/browse/WICKET-4493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13468429#comment-13468429 ] 

Martin Grigorov edited comment on WICKET-4493 at 10/3/12 7:58 PM:
------------------------------------------------------------------

Hi Johan,

Here is the code in Wicket related to your question:

if (IExceptionSettings.SHOW_EXCEPTION_PAGE.equals(unexpectedExceptionDisplay))
			{
				Page currentPage = extractCurrentPage();
				return createPageRequestHandler(new PageProvider(new ExceptionErrorPage(e,
					currentPage)));
			}
			else if (IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE.equals(unexpectedExceptionDisplay))
			{
				return createPageRequestHandler(new PageProvider(
					application.getApplicationSettings().getInternalErrorPage()));
			}
			else
			{
				// IExceptionSettings.SHOW_NO_EXCEPTION_PAGE
				return new ErrorCodeRequestHandler(500);
			}

About my comment that the reported issue is not a problem in 1.5+ - the code in 1.5/6.x is improved since 1.4.x. See class org.apache.wicket.request.UrlDecoder.
                
      was (Author: mgrigorov):
    Hi Johan,

Here is the code in Wicket related to your question:

                        if (IExceptionSettings.SHOW_EXCEPTION_PAGE.equals(unexpectedExceptionDisplay))
			{
				Page currentPage = extractCurrentPage();
				return createPageRequestHandler(new PageProvider(new ExceptionErrorPage(e,
					currentPage)));
			}
			else if (IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE.equals(unexpectedExceptionDisplay))
			{
				return createPageRequestHandler(new PageProvider(
					application.getApplicationSettings().getInternalErrorPage()));
			}
			else
			{
				// IExceptionSettings.SHOW_NO_EXCEPTION_PAGE
				return new ErrorCodeRequestHandler(500);
			}

About my comment that the reported issue is not a problem in 1.5+ - the code in 1.5/6.x is improved since 1.4.x. See class org.apache.wicket.request.UrlDecoder.
                  
> Unwrapped IllegalArgumentException in WicketURLDecoder
> ------------------------------------------------------
>
>                 Key: WICKET-4493
>                 URL: https://issues.apache.org/jira/browse/WICKET-4493
>             Project: Wicket
>          Issue Type: Task
>          Components: wicket
>    Affects Versions: 1.4.19
>            Reporter: James McIntosh
>            Priority: Minor
>
> In the class: org.apache.wicket.protocol.http.WicketURLDecoder there are two IllegalArgumentException which should be wrapped in WicketRuntimeException
> Wrapping them would be good for consistency and help manage runtime exceptions.
> These are the two exceptions, lines 164 and 179:
> throw new IllegalArgumentException("URLDecoder: Incomplete trailing escape (%) pattern");
> throw new IllegalArgumentException("URLDecoder: Illegal hex characters in escape (%) pattern - " + e.getMessage());
> e.g.
> throw new WicketRuntimeException(new IllegalArgumentException("URLDecoder: Incomplete trailing escape (%) pattern"));
> throw new WicketRuntimeException(new IllegalArgumentException("URLDecoder: Illegal hex characters in escape (%) pattern - " + e.getMessage()));
> Other similar runtime exceptions found:
> org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest
> Lines 106, 114
> throw new IllegalArgumentException("argument maxSize must be not null");
> throw new IllegalStateException("ServletRequest does not contain multipart content. One possible solution is to explicitly call Form.setMultipart(true), Wicket tries its best to auto-detect multipart forms but there are certain situation where it cannot.");

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira