Re: Tapestry with Jetty behind https frontend

2014-02-20 Thread Kristian Marinkovic
hi all, going through the posts i realized there is an easier solution missing. What i do is to contribute a HttpServletRequestHandler that checks for the X-Forwarded-Proto header and - in case its set - wraps the HttpServletRequest with overrides to isSecure(), getScheme() and getServerPort(). A

Re: Tapestry with Jetty behind https frontend

2014-02-19 Thread Ilya Obshadko
On Thu, Feb 20, 2014 at 9:58 AM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: By the way, is there any reason preventing Tapestry team from incorporating >> X-Forwarded-* headers support into Tapestry itself? This kind of >> configuration is pretty standard nowadays. >> > > Feel free

Re: Tapestry with Jetty behind https frontend

2014-02-19 Thread Thiago H de Paula Figueiredo
On Wed, 19 Feb 2014 18:31:44 -0300, Ilya Obshadko wrote: By the way, is there any reason preventing Tapestry team from incorporating X-Forwarded-* headers support into Tapestry itself? This kind of configuration is pretty standard nowadays. Feel free to post a JIRA about that. -- Thiago

Re: Tapestry with Jetty behind https frontend

2014-02-19 Thread Ilya Obshadko
On Tue, Feb 18, 2014 at 10:34 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > I've posted it several hours ago. Did it reach the mailing list? >> > > It did, but I only received it after I posted my message. :P Your solution > is very elegant, by the way. > > Thank you! By the w

Re: Tapestry with Jetty behind https frontend

2014-02-18 Thread Manoj Ananthapadmanabhan
I used jetty's ForwardedRequestCustomizer for setting the request properties correctly http://download.eclipse.org/jetty/stable-9/apidocs/org/eclipse/jetty/server/ForwardedRequestCustomizer.html On Mon, Feb 17, 2014 at 12:29 AM, Ilya Obshadko wrote: > Probably this has been asked already, but I

Re: Tapestry with Jetty behind https frontend

2014-02-18 Thread Thiago H de Paula Figueiredo
On Mon, 17 Feb 2014 23:42:52 -0300, Ilya Obshadko wrote: I've posted it several hours ago. Did it reach the mailing list? It did, but I only received it after I posted my message. :P Your solution is very elegant, by the way. -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate

Re: Tapestry with Jetty behind https frontend

2014-02-18 Thread Lance Java
Note: this can also be achieved with @Autobuild and decorate. I often use this to work around circular dependencies with service overrides. public BaseUrlSource decorateBaseUrlSource(@Autobuild ForwardedBaseURLSourceImpl newBaseUrlSource) { return newBaseUrlSource; } http://tapestry.apache.org

Re: Tapestry with Jetty behind https frontend

2014-02-17 Thread Ilya Obshadko
I've posted it several hours ago. Did it reach the mailing list? I can create a Gist, if you'd like. On Tue, Feb 18, 2014 at 1:18 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Mon, 17 Feb 2014 19:52:32 -0300, Ilya Obshadko > wrote: > > I've researched a little bit more and

Re: Tapestry with Jetty behind https frontend

2014-02-17 Thread Thiago H de Paula Figueiredo
On Mon, 17 Feb 2014 19:52:32 -0300, Ilya Obshadko wrote: I've researched a little bit more and found BaseURLSource service which is responsible for URL construction. But overriding BaseURLSource doesn't work because of circular dependency during initialization, while trying to alter BaseUR

Re: Tapestry with Jetty behind https frontend

2014-02-17 Thread Ilya Obshadko
Forgot to mention: in this case, you don't need any custom Jetty connectors. Having true in your connector configuration is sufficient. On Tue, Feb 18, 2014 at 10:50 AM, Ilya Obshadko wrote: > I've finally managed to find a correct solution. It's relatively easy once > you put everything togeth

Re: Tapestry with Jetty behind https frontend

2014-02-17 Thread Ilya Obshadko
I've finally managed to find a correct solution. It's relatively easy once you put everything together. In AppModule.bind(): binder.bind ( BaseURLSource.class, ForwardedBaseURLSourceImpl.class).withId ( "ForwardedBaseURLSource" ); Contribute service override to BaseURLSource: @Con

Re: Tapestry with Jetty behind https frontend

2014-02-17 Thread Daniel Jue
I don't have the full solution here in front of me, but I know I've done this in the past with the Tapestry Spring Security integration, and I'm sure the Tynamo Shiro integration for T5 also does this. You could snoop around the code in there until someone here gets you an answer that meets your n

Re: Tapestry with Jetty behind https frontend

2014-02-17 Thread Ilya Obshadko
I've researched a little bit more and found BaseURLSource service which is responsible for URL construction. But overriding BaseURLSource doesn't work because of circular dependency during initialization, while trying to alter BaseURLSource using advisors simply doesn't work at all (advisor never

Re: Tapestry with Jetty behind https frontend

2014-02-17 Thread Ilya Obshadko
I have already implemented it using method advice, so that Request.isSecure () returns true when frontend sets appropriate header. However things turn strange at this point. All links rendered by PageLink component now look like: http://servername:443/context/page Note plain http instead of http

Re: Tapestry with Jetty behind https frontend

2014-02-17 Thread Thiago H de Paula Figueiredo
On Mon, 17 Feb 2014 17:31:53 -0300, Ilya Obshadko wrote: I understand how to do that with service advisors, but decoration remains unclear. How do I override a single method from the interface using decoration? Could you provide a brief example? See http://tapestry.apache.org/tapestry-ioc-d

Re: Tapestry with Jetty behind https frontend

2014-02-17 Thread Ilya Obshadko
I understand how to do that with service advisors, but decoration remains unclear. How do I override a single method from the interface using decoration? Could you provide a brief example? Thanks! On Mon, Feb 17, 2014 at 9:21 PM, Lance Java wrote: > Request is a tapestry managed service so you

Re: Tapestry with Jetty behind https frontend

2014-02-17 Thread Lance Java
Request is a tapestry managed service so you can provide a custom implementation of isSecure() by decorating or overriding it in your AppModule. On 17 Feb 2014 08:30, "Ilya Obshadko" wrote: > Probably this has been asked already, but I couldn't manage to find a > solution that works. > > I have

Tapestry with Jetty behind https frontend

2014-02-17 Thread Ilya Obshadko
Probably this has been asked already, but I couldn't manage to find a solution that works. I have an https frontend and Jetty 8 server with Tapestry application behind. I've carefully read http://wiki.eclipse.org/Jetty/Howto/Configure_mod_proxy After setting up Jetty extension from https://bitbuc