You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Angelo C." <an...@gmail.com> on 2011/07/18 12:12:10 UTC

subdoamin when https else root, possible?

Hi,

I use @secure on some pages(login, setup, etc), with following BaseURL
service, it works well.

now, there is this new requirement, when in https mode, the domain should be
a subdomain:
safe.sample.com not a root domain, sample.com, this cause problems to
existing pages,
example, a non @secure page View become http://www.safe.sample.com/view,
instead of http://www.sample.com/view

solutions?

Angelo
 


public  static void contributeAlias(Configuration<AliasContribution>
configuration)
   {
       BaseURLSource source = new BaseURLSource()
       {
           public String getBaseURL(boolean secure)
           {
               String protocol = secure ? "https" : "http";
               int port = secure ? 8443 : 8080;
               return String.format("%s://www.%s", protocol, "sample.com");
           }
       };

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


--
View this message in context: http://tapestry.1045711.n5.nabble.com/subdoamin-when-https-else-root-possible-tp4598875p4598875.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


Re: subdoamin when https else root, possible?

Posted by Taha Hafeez <ta...@gmail.com>.
Hi Angelo

This might help
http://tapestry.1045711.n5.nabble.com/example-BaseURLSource-T5-td2427659.html

regards
Taha

On Mon, Jul 18, 2011 at 3:42 PM, Angelo C. <an...@gmail.com> wrote:
> Hi,
>
> I use @secure on some pages(login, setup, etc), with following BaseURL
> service, it works well.
>
> now, there is this new requirement, when in https mode, the domain should be
> a subdomain:
> safe.sample.com not a root domain, sample.com, this cause problems to
> existing pages,
> example, a non @secure page View become http://www.safe.sample.com/view,
> instead of http://www.sample.com/view
>
> solutions?
>
> Angelo
>
>
>
> public  static void contributeAlias(Configuration<AliasContribution>
> configuration)
>   {
>       BaseURLSource source = new BaseURLSource()
>       {
>           public String getBaseURL(boolean secure)
>           {
>               String protocol = secure ? "https" : "http";
>               int port = secure ? 8443 : 8080;
>               return String.format("%s://www.%s", protocol, "sample.com");
>           }
>       };
>
>       configuration.add(AliasContribution.create(BaseURLSource.class,
> source));
>   }
>
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/subdoamin-when-https-else-root-possible-tp4598875p4598875.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: subdoamin when https else root, possible?

Posted by "Angelo C." <an...@gmail.com>.
right, I was thinking maybe there is a simpler solution. then again, that
requirement looks good to me, when a viewer sees:

https://safe.sample.com instead of https://sample.com, that make him feel
better:)

--
View this message in context: http://tapestry.1045711.n5.nabble.com/subdoamin-when-https-else-root-possible-tp4598875p4599336.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


Re: subdoamin when https else root, possible?

Posted by Taha Hafeez <ta...@gmail.com>.
If I understand correctly, the problem in your case is that the links
generated are not absolute e.g. PageLink for MyPage.class generates
'/mypage', so when on a secure page, the secure domain will be used by
the browser. If you want the links to be consistent you have you
create your own links with Link.toAbsoluteURI() (:

On Mon, Jul 18, 2011 at 4:49 PM, Angelo C. <an...@gmail.com> wrote:
> not sure if that applicable in my case. let me explain a little more, with my
> BaseURLService:
>
> 1. In the  www.sample.com/view, login page's link is:
> https://www.safe.sample.com/login, that's what I want.
>
> 2. When you are in the login page, view page's link become:
> http://www.safe.sample.com/view, i want it to be http://www.sample.com/view
>
> ?
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/subdoamin-when-https-else-root-possible-tp4598875p4599062.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: subdoamin when https else root, possible?

Posted by "Angelo C." <an...@gmail.com>.
not sure if that applicable in my case. let me explain a little more, with my
BaseURLService:

1. In the  www.sample.com/view, login page's link is:
https://www.safe.sample.com/login, that's what I want.

2. When you are in the login page, view page's link become:
http://www.safe.sample.com/view, i want it to be http://www.sample.com/view

?

--
View this message in context: http://tapestry.1045711.n5.nabble.com/subdoamin-when-https-else-root-possible-tp4598875p4599062.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