You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Henrik von Schlanbusch <he...@enovate.no> on 2012/06/28 08:52:24 UTC

Same page secured and unsecured

Hi

Is it possible to have the same page secured and not secured?
I have a page now that need to be accessed via https. 
Consequently I have annotated it with @Secure. But
now I also need to access the same page via http. If 
I try to use the page from http, my ActionLinks do not work,
but they do when accessing the page via https. Is it possible
to serve the pages in both ways by configuring tapestry
in some way?

Best regards
Henrik von Schlanbusch


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


Re: Same page secured and unsecured

Posted by Paul Stanton <pa...@mapshed.com.au>.
Thanks Lenny that is exactly it and the solution works great.

Agree with the bug poster and would vote for the issue if it weren't 
closed already.

p.

On 28/10/2013 6:05 PM, Lenny Primak wrote:
> I think you are running into this issue:
> https://issues.apache.org/jira/browse/TAP5-2080
> Seems due to political issues it will not be fixed,
> But the workaround in the issue should work for you.
> I feel your pain because I had to implement a similar workaround as well.
>
>> On Oct 28, 2013, at 2:35 AM, Paul Stanton <pa...@mapshed.com.au> wrote:
>>
>> Sorry for the thread revival, however I am coming up against the same problem.
>>
>> I have a page needs to be served via https for some customers and http for others.
>>
>> If I request the page via https without the @Secure annotation, all ajax event urls are incorrectly altered to:
>> http://domain:443/app/page:event
>> - both the protocol and port are incorrect in this case.
>>
>> If I request the page via https with the @Secure annotation, ajax event urls are correctly altered to:
>> https://domain/app/page:event
>>
>> Another problem is, when requesting the page via http with the @Secure annotation redirect incorrectly to https:
>> https://domain:80/app/page <https://maps.vodafone.com.au:80/VHAMap-stage/publiccoverage/public-vf>
>> - not sure why port 80 is added, it is not needed in our config.
>>
>>
>> So my question is, how can I achieve the behaviour of @Secure dynamically and only if the request is made over https?
>>
>> Thanks, Paul.
>>
>>> On 28/06/2012 10:20 PM, Thiago H de Paula Figueiredo wrote:
>>>> On Thu, 28 Jun 2012 03:52:24 -0300, Henrik von Schlanbusch <he...@enovate.no> wrote:
>>>>
>>>> Hi
>>> Hi!
>>>
>>>> Is it possible to have the same page secured and not secured?
>>>> I have a page now that need to be accessed via https.
>>>> Consequently I have annotated it with @Secure.
>>> You misuderstood @Secure. You don't need it in a page so it can be accessed though HTTPS. @Secure guarantees that the page is only requested through HTTPS, redirecting if needed. From the @Secure JavaDoc: "A marker annotation that indicates that the page in question may only be accessed via HTTPS."
>>>
>>> Just remove @Secure and it will work with HTTP and HTTPS.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


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


Re: Same page secured and unsecured

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
I think you are running into this issue: 
https://issues.apache.org/jira/browse/TAP5-2080
Seems due to political issues it will not be fixed,
But the workaround in the issue should work for you. 
I feel your pain because I had to implement a similar workaround as well.  

> On Oct 28, 2013, at 2:35 AM, Paul Stanton <pa...@mapshed.com.au> wrote:
> 
> Sorry for the thread revival, however I am coming up against the same problem.
> 
> I have a page needs to be served via https for some customers and http for others.
> 
> If I request the page via https without the @Secure annotation, all ajax event urls are incorrectly altered to:
> http://domain:443/app/page:event
> - both the protocol and port are incorrect in this case.
> 
> If I request the page via https with the @Secure annotation, ajax event urls are correctly altered to:
> https://domain/app/page:event
> 
> Another problem is, when requesting the page via http with the @Secure annotation redirect incorrectly to https:
> https://domain:80/app/page <https://maps.vodafone.com.au:80/VHAMap-stage/publiccoverage/public-vf>
> - not sure why port 80 is added, it is not needed in our config.
> 
> 
> So my question is, how can I achieve the behaviour of @Secure dynamically and only if the request is made over https?
> 
> Thanks, Paul.
> 
>> On 28/06/2012 10:20 PM, Thiago H de Paula Figueiredo wrote:
>>> On Thu, 28 Jun 2012 03:52:24 -0300, Henrik von Schlanbusch <he...@enovate.no> wrote:
>>> 
>>> Hi
>> 
>> Hi!
>> 
>>> Is it possible to have the same page secured and not secured?
>>> I have a page now that need to be accessed via https.
>>> Consequently I have annotated it with @Secure.
>> 
>> You misuderstood @Secure. You don't need it in a page so it can be accessed though HTTPS. @Secure guarantees that the page is only requested through HTTPS, redirecting if needed. From the @Secure JavaDoc: "A marker annotation that indicates that the page in question may only be accessed via HTTPS."
>> 
>> Just remove @Secure and it will work with HTTP and HTTPS.
> 

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


Re: Same page secured and unsecured

Posted by Paul Stanton <pa...@mapshed.com.au>.
Sorry for the thread revival, however I am coming up against the same 
problem.

I have a page needs to be served via https for some customers and http 
for others.

If I request the page via https without the @Secure annotation, all ajax 
event urls are incorrectly altered to:
http://domain:443/app/page:event
- both the protocol and port are incorrect in this case.

If I request the page via https with the @Secure annotation, ajax event 
urls are correctly altered to:
https://domain/app/page:event

Another problem is, when requesting the page via http with the @Secure 
annotation redirect incorrectly to https:
https://domain:80/app/page 
<https://maps.vodafone.com.au:80/VHAMap-stage/publiccoverage/public-vf>
- not sure why port 80 is added, it is not needed in our config.


So my question is, how can I achieve the behaviour of @Secure 
dynamically and only if the request is made over https?

Thanks, Paul.

On 28/06/2012 10:20 PM, Thiago H de Paula Figueiredo wrote:
> On Thu, 28 Jun 2012 03:52:24 -0300, Henrik von Schlanbusch 
> <he...@enovate.no> wrote:
>
>> Hi
>
> Hi!
>
>> Is it possible to have the same page secured and not secured?
>> I have a page now that need to be accessed via https.
>> Consequently I have annotated it with @Secure.
>
> You misuderstood @Secure. You don't need it in a page so it can be 
> accessed though HTTPS. @Secure guarantees that the page is only 
> requested through HTTPS, redirecting if needed. From the @Secure 
> JavaDoc: "A marker annotation that indicates that the page in question 
> may only be accessed via HTTPS."
>
> Just remove @Secure and it will work with HTTP and HTTPS.
>


Re: Same page secured and unsecured

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Thu, 28 Jun 2012 03:52:24 -0300, Henrik von Schlanbusch  
<he...@enovate.no> wrote:

> Hi

Hi!

> Is it possible to have the same page secured and not secured?
> I have a page now that need to be accessed via https.
> Consequently I have annotated it with @Secure.

You misuderstood @Secure. You don't need it in a page so it can be  
accessed though HTTPS. @Secure guarantees that the page is only requested  
through HTTPS, redirecting if needed. From the @Secure JavaDoc: "A marker  
annotation that indicates that the page in question may only be accessed  
via HTTPS."

Just remove @Secure and it will work with HTTP and HTTPS.

-- 
Thiago H. de Paula Figueiredo

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