tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Howard Lewis Ship <hls...@gmail.com>
Subject Re: Patch: TAP51858 (Branch 5.3)
Date Tue, 22 May 2012 15:43:36 GMT
Thanks for these patches, I look forward to applying them.  Two notes:

1) Patches MUST come through JIRA, not the mailing list.  This is
requirement at Apache, and supports legal protections for the
committers.

2) Patches with tests are even better!

On Tue, May 22, 2012 at 4:27 AM, Michael Wyraz
<michael.wyraz@evermind.de> wrote:
> From 38db152c669ccbf88703adf35d90f12d3f22a2f4 Tue, 22 May 2012 13:26:22
> +0200
> From: Michael Wyraz <michael.wyraz@evermind.de>
> Date: Tue, 22 May 2012 13:21:40 +0200
> Subject: [PATCH] TAP5-1858     Cookie service should allow to set path,
> domain AND maxAge
>
> diff --git
> a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/CookiesImpl.java
> b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/CookiesImpl.java
> index 3c88006..0a89b02 100644
> ---
> a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/CookiesImpl.java
> +++
> b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/CookiesImpl.java
> @@ -121,6 +121,32 @@
>
>         cookieSink.addCookie(cookie);
>     }
> +
> +    public void writeCookieValue(String name, String value, String path,
> String domain, int maxAge)
> +    {
> +        Cookie cookie = new Cookie(name, value);
> +        if (path==null) cookie.setPath(request.getContextPath() + "/");
> +        else cookie.setPath(path);
> +        if (domain!=null) cookie.setDomain(domain);
> +        if (maxAge!=0) cookie.setMaxAge(maxAge);
> +        else cookie.setMaxAge(defaultMaxAge);
> +        cookie.setSecure(request.isSecure());
> +
> +        cookieSink.addCookie(cookie);
> +    }
> +
> +    public void writeCookieValue(String name, String value, String path,
> String domain, int maxAge)
> +    {
> +        Cookie cookie = new Cookie(name, value);
> +        if (path==null) cookie.setPath(request.getContextPath() + "/");
> +        else cookie.setPath(path);
> +        if (domain!=null) cookie.setDomain(domain);
> +        if (maxAge!=0) cookie.setMaxAge(maxAge);
> +        else cookie.setMaxAge(defaultMaxAge);
> +        cookie.setSecure(request.isSecure());
> +
> +        cookieSink.addCookie(cookie);
> +    }
>
>     public void removeCookieValue(String name)
>     {
> diff --git
> a/tapestry-core/src/main/java/org/apache/tapestry5/services/Cookies.java
> b/tapestry-core/src/main/java/org/apache/tapestry5/services/Cookies.java
> index 4bcd653..a081a6d 100644
> --- a/tapestry-core/src/main/java/org/apache/tapestry5/services/Cookies.java
> +++ b/tapestry-core/src/main/java/org/apache/tapestry5/services/Cookies.java
> @@ -67,6 +67,11 @@
>     void writeCookieValue(String name, String value, String path, String
> domain);
>
>     /**
> +     * As with {@link #writeCookieValue(String, String, String)} but an
> explicit domain,path and maximum age may be set.
> +     */
> +    void writeCookieValue(String name, String value, String path, String
> domain, int maxAge);
> +
> +    /**
>      * Removes a previously written cookie, by writing a new cookie with a
> maxAge of 0.
>      */
>     void removeCookieValue(String name);
>
> --
> Mit freundlichen Grüßen / Regards
>
> Michael Wyraz
>
> evermind GmbH
> Schorlemmerstraße 1
> 04155 Leipzig
>
> Tel.:       +49 (0)341-25 39 66 - 0
> Fax:        +49 (0)341-25 39 66 - 1
> Funk:       +49 (0)177-73 00 00 3
> E-Mail:     michael.wyraz@evermind.de
>
> HRB: 21586
> Amtsgericht Leipzig
>
> Geschäftsführer:
> Christoph Klemm
> Thomas Grünert
> Michael Wyraz
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Mime
View raw message