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 2014/07/21 14:38:38 UTC

[jira] [Resolved] (WICKET-5648) CookieUtils - add #loadValues(), make #getCookie() public, properly initialize from the defaults

     [ https://issues.apache.org/jira/browse/WICKET-5648?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-5648.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 6.17.0
                   7.0.0-M3

I've improved most of the things you suggested with https://git-wip-us.apache.org/repos/asf?p=wicket.git;a=commitdiff;h=b5e29819;hp=e50f298107ea2d8526a201d44a7200240747e80b.

#save() and #load() methods with several values are indeed for Wicket internal needs. I also see that the may break if any of the stored values has FormComponent#VALUE_SEPARATOR in it but I see no easy way to protect the application from this. The method(s) are used in different packages so they cannot be non-public. Encoding of ";" also won't help because this will break if the application actually uses whatever we decide to use instead ...

> CookieUtils - add #loadValues(), make #getCookie() public, properly initialize from the defaults
> ------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-5648
>                 URL: https://issues.apache.org/jira/browse/WICKET-5648
>             Project: Wicket
>          Issue Type: Improvement
>            Reporter: Thibault Kruse
>            Assignee: Martin Grigorov
>            Priority: Minor
>             Fix For: 7.0.0-M3, 6.17.0
>
>
> Hi, not sure even whether CookieUtils is supposed to be used outside wicket. But if so, it has some API flaws.
> The CookieUtils class has 
> public final void save(String key, final String... values)
> but no *public* load method to load the saved multiple values. Clients can load the whole string and split themselves, but that's dirty. And using FormComponent.VALUE_SEPARATOR seems wicket-specific anyway (and is not safe against values with that separator), so maybe that method should be protected, not public.
> The code
> cookie.setSecure(false);
> in save() also seems dodgy, but seems to have no effect (defaultSettings still work).
> Finally it is a bit weird that there is no access to the underlying Cookie itself, with it's getDomain() etc methods. For Developers it might be nice to work with the cookie avoiding the boilerplate code, so maybe getCookie() could be made public instead of private



--
This message was sent by Atlassian JIRA
(v6.2#6252)