You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Argo Vilberg <wi...@gmail.com> on 2008/08/07 17:46:15 UTC

T5 pagelink and http - >https redirect

hi,


I have one page with http protocol and pagelink in it.
Pagelink points https @secure page.

But problem is that pagelink generate https://localhost/digi/newpage link,
and not with alias localhost:8443.

http page is in port 8080, but pagelink do not understand that https port is
8443.

I also tried do add
    public void contributeAlias(Configuration<AliasContribution>
configuration)
       {
               BaseURLSource source = new BaseURLSource()
               {
                      public String getBaseURL(boolean secure)
                    {
                        String protocol = secure ? "https" : "http";

                        int port = secure ? 8080 : 8443;

                        return String.format("%s://localhost:%d", protocol,
port);
                    }
            };

configuration.add(AliasContribution.create(BaseURLSource.class,source));

       }


in AppModule.java

But this does not help.

Any ideas?

Argo

Re: T5 pagelink and http - >https redirect

Posted by Howard Lewis Ship <hl...@gmail.com>.
Please add a bug in JIRA.

On Fri, Aug 8, 2008 at 3:17 PM, Lutz Hühnken
<lh...@googlemail.com> wrote:
> I fell into that same trap once. Although it does it good job in
> teaching a lesson about not just copying & pasting code from a web
> page, it would really be nice if someone could correct the incorrect
> code samples on
>
> http://tapestry.apache.org/tapestry5/guide/secure.html
>
> Samples (plural) because it seems the snippets above the one with the
> mixed up ports also don't work anymore, I think it has to be
> configuration.add instead of configuration.put.
>
> Lutz
>
>
>
> On Fri, Aug 8, 2008 at 4:34 AM, tapestry5 <bi...@gmail.com> wrote:
>>
>> It should not be
>>
>> String protocol = secure ? "https" : "http";
>> int port = secure ? 8080 : 8443;
>>
>> but
>>
>> String protocol = secure ? "https" : "http";
>> int port = secure ? 8443 : 8080;
>>
>>
>>
>>
>> Argo Vilberg wrote:
>>>
>>> hi,
>>>
>>>
>>> I have one page with http protocol and pagelink in it.
>>> Pagelink points https @secure page.
>>>
>>> But problem is that pagelink generate https://localhost/digi/newpage link,
>>> and not with alias localhost:8443.
>>>
>>> http page is in port 8080, but pagelink do not understand that https port
>>> is
>>> 8443.
>>>
>>> I also tried do add
>>>     public void contributeAlias(Configuration<AliasContribution>
>>> configuration)
>>>        {
>>>                BaseURLSource source = new BaseURLSource()
>>>                {
>>>                       public String getBaseURL(boolean secure)
>>>                     {
>>>                         String protocol = secure ? "https" : "http";
>>>
>>>                         int port = secure ? 8080 : 8443;
>>>
>>>                         return String.format("%s://localhost:%d",
>>> protocol,
>>> port);
>>>                     }
>>>             };
>>>
>>> configuration.add(AliasContribution.create(BaseURLSource.class,source));
>>>
>>>        }
>>>
>>>
>>> in AppModule.java
>>>
>>> But this does not help.
>>>
>>> Any ideas?
>>>
>>> Argo
>>>
>>>
>>
>> --
>> View this message in context: http://www.nabble.com/T5-pagelink-and-http---%3Ehttps-redirect-tp18873545p18884134.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


Re: T5 pagelink and http - >https redirect

Posted by Lutz Hühnken <lh...@googlemail.com>.
I fell into that same trap once. Although it does it good job in
teaching a lesson about not just copying & pasting code from a web
page, it would really be nice if someone could correct the incorrect
code samples on

http://tapestry.apache.org/tapestry5/guide/secure.html

Samples (plural) because it seems the snippets above the one with the
mixed up ports also don't work anymore, I think it has to be
configuration.add instead of configuration.put.

Lutz



On Fri, Aug 8, 2008 at 4:34 AM, tapestry5 <bi...@gmail.com> wrote:
>
> It should not be
>
> String protocol = secure ? "https" : "http";
> int port = secure ? 8080 : 8443;
>
> but
>
> String protocol = secure ? "https" : "http";
> int port = secure ? 8443 : 8080;
>
>
>
>
> Argo Vilberg wrote:
>>
>> hi,
>>
>>
>> I have one page with http protocol and pagelink in it.
>> Pagelink points https @secure page.
>>
>> But problem is that pagelink generate https://localhost/digi/newpage link,
>> and not with alias localhost:8443.
>>
>> http page is in port 8080, but pagelink do not understand that https port
>> is
>> 8443.
>>
>> I also tried do add
>>     public void contributeAlias(Configuration<AliasContribution>
>> configuration)
>>        {
>>                BaseURLSource source = new BaseURLSource()
>>                {
>>                       public String getBaseURL(boolean secure)
>>                     {
>>                         String protocol = secure ? "https" : "http";
>>
>>                         int port = secure ? 8080 : 8443;
>>
>>                         return String.format("%s://localhost:%d",
>> protocol,
>> port);
>>                     }
>>             };
>>
>> configuration.add(AliasContribution.create(BaseURLSource.class,source));
>>
>>        }
>>
>>
>> in AppModule.java
>>
>> But this does not help.
>>
>> Any ideas?
>>
>> Argo
>>
>>
>
> --
> View this message in context: http://www.nabble.com/T5-pagelink-and-http---%3Ehttps-redirect-tp18873545p18884134.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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: T5 pagelink and http - >https redirect

Posted by tapestry5 <bi...@gmail.com>.
It should not be 

String protocol = secure ? "https" : "http";
int port = secure ? 8080 : 8443;

but 

String protocol = secure ? "https" : "http";
int port = secure ? 8443 : 8080;




Argo Vilberg wrote:
> 
> hi,
> 
> 
> I have one page with http protocol and pagelink in it.
> Pagelink points https @secure page.
> 
> But problem is that pagelink generate https://localhost/digi/newpage link,
> and not with alias localhost:8443.
> 
> http page is in port 8080, but pagelink do not understand that https port
> is
> 8443.
> 
> I also tried do add
>     public void contributeAlias(Configuration<AliasContribution>
> configuration)
>        {
>                BaseURLSource source = new BaseURLSource()
>                {
>                       public String getBaseURL(boolean secure)
>                     {
>                         String protocol = secure ? "https" : "http";
> 
>                         int port = secure ? 8080 : 8443;
> 
>                         return String.format("%s://localhost:%d",
> protocol,
> port);
>                     }
>             };
> 
> configuration.add(AliasContribution.create(BaseURLSource.class,source));
> 
>        }
> 
> 
> in AppModule.java
> 
> But this does not help.
> 
> Any ideas?
> 
> Argo
> 
> 

-- 
View this message in context: http://www.nabble.com/T5-pagelink-and-http---%3Ehttps-redirect-tp18873545p18884134.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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