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/03 08:03:41 UTC

T5: pagelink

hi,


I want use pagelink with port 8443 and https protocol.

If i use:
    <t:pagelink page="Start" context="currentRole.roleId">
                        ${currentRole.roleName}
    </t:pagelink>

then tapestry generate
http://localhost/app/start/4


But i want
https://localhost:8443/app/start4


Argo

Re: T5: pagelink

Posted by Argo Vilberg <wi...@gmail.com>.
My problem is that, my first page is http and after that are pages https.

If i switch to https, then ID-Card authentication is occour in tomcat.
Thatsway i must use both protocol.

But how to change http,https and ports in appModule.java





2008/8/6 Daniel Jue <te...@gmail.com>

> You could also change the default HTTPS port in your app server
> configuration, and then your don't have to worry about modifying the
> URIs.  The default is of course 443.
>
> "The https:// protocol can be used in exactly the same way as the
> http:// protocol.
> The differences are that HTTPS uses a default port number of 443 (80
> for HTTP) and that
> HTTPS automatically performs SSL negotiation and thus always sends
> data in encrypted form,
> i.e. web servers accessed through https:// have to be "secure web
> servers"."
>
> For me, my development is always HTTP, and the deployed is always
> using HTTPS (for everything)
> So in the module that contributes these settings (for most people
> that's the AppModule), I look up a value stored in the local JNDI
> which tells me if I should use https or not
>
> public void contributeMetaDataLocator(MappedConfiguration<String,String>
> configuration)
> {
>  if(thisIsDeploymentServer())
>  {
>    configuration.put(TapestryConstants.SECURE_PAGE, "true");
>   }
> }
>
> On Tue, Aug 5, 2008 at 11:35 PM, tapestry5 <bi...@gmail.com> wrote:
> >
> > I have the same issue. I tried using it.
> > It won't open the landing page. Infact if i don't put @Secure and also
> donot
> > contribute it opens the landing page as https and further the links were
> > http.
> >
> > Even if i make it work but still contributeAlias is good for testing but
> not
> > for production.
> >
> > Is there any other way to get https and not http.
> >
> > As my page can be used for http and https. So if i put @Secure then it
> won't
> > work for any http call.
> >
> >
> >
> > 9902468 wrote:
> > >
> > > Hi,
> > >
> > > Use @Secure annotation and add this to your appmodule: (Also use
> whatever
> > > ports you wish.)
> > >
> > > public void contributeAlias(Configuration<AliasContribution>
> > > configuration)
> > >     {
> > >         BaseURLSource source = new BaseURLSource()
> > >         {
> > >             public String getBaseURL(boolean secure)
> > >             {
> > >                 String protocol = secure ? "https" : "http";
> > >
> > >                 int port = secure ? 443 : 80;
> > >
> > >                 if(port == 80 || port == 443){
> > >                     return String.format("%s://localhost", protocol);
> > >                 }
> > >
> > >                 return String.format("%s://localhost:%d", protocol,
> port);
> > >             }
> > >         };
> > >
> > >         configuration.add(AliasContribution.create(BaseURLSource.class,
> > > source));
> > >     }
> > >
> > >
> > >
> > > Argo Vilberg wrote:
> > >>
> > >> hi,
> > >>
> > >>
> > >> I want use pagelink with port 8443 and https protocol.
> > >>
> > >> If i use:
> > >>     <t:pagelink page="Start" context="currentRole.roleId">
> > >>                         ${currentRole.roleName}
> > >>     </t:pagelink>
> > >>
> > >> then tapestry generate
> > >> http://localhost/app/start/4
> > >>
> > >>
> > >> But i want
> > >> https://localhost:8443/app/start4
> > >>
> > >>
> > >> Argo
> > >>
> > >>
> > >
> > >
> >
> > --
> > View this message in context:
> http://www.nabble.com/T5%3A-pagelink-tp18796163p18843725.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

Posted by tapestry5 <bi...@gmail.com>.
I have my app server configured to https default. 

Pages without @secure annotation and contributeAlias opens but all the links
are still http. (Not sure why that is happening). 

Pages with @Secure annotation and contributeAlias will give an exception
"The page isn't redirecting properly" (Not sure why that is happening).




Daniel Jue wrote:
> 
> You could also change the default HTTPS port in your app server
> configuration, and then your don't have to worry about modifying the
> URIs.  The default is of course 443.
> 
> "The https:// protocol can be used in exactly the same way as the
> http:// protocol.
> The differences are that HTTPS uses a default port number of 443 (80
> for HTTP) and that
> HTTPS automatically performs SSL negotiation and thus always sends
> data in encrypted form,
> i.e. web servers accessed through https:// have to be "secure web
> servers"."
> 
> For me, my development is always HTTP, and the deployed is always
> using HTTPS (for everything)
> So in the module that contributes these settings (for most people
> that's the AppModule), I look up a value stored in the local JNDI
> which tells me if I should use https or not
> 
> public void contributeMetaDataLocator(MappedConfiguration<String,String>
> configuration)
> {
>   if(thisIsDeploymentServer())
>   {
>     configuration.put(TapestryConstants.SECURE_PAGE, "true");
>   }
> }
> 
> On Tue, Aug 5, 2008 at 11:35 PM, tapestry5 <bi...@gmail.com> wrote:
>>
>> I have the same issue. I tried using it.
>> It won't open the landing page. Infact if i don't put @Secure and also
>> donot
>> contribute it opens the landing page as https and further the links were
>> http.
>>
>> Even if i make it work but still contributeAlias is good for testing but
>> not
>> for production.
>>
>> Is there any other way to get https and not http.
>>
>> As my page can be used for http and https. So if i put @Secure then it
>> won't
>> work for any http call.
>>
>>
>>
>> 9902468 wrote:
>> >
>> > Hi,
>> >
>> > Use @Secure annotation and add this to your appmodule: (Also use
>> whatever
>> > ports you wish.)
>> >
>> > public void contributeAlias(Configuration<AliasContribution>
>> > configuration)
>> >     {
>> >         BaseURLSource source = new BaseURLSource()
>> >         {
>> >             public String getBaseURL(boolean secure)
>> >             {
>> >                 String protocol = secure ? "https" : "http";
>> >
>> >                 int port = secure ? 443 : 80;
>> >
>> >                 if(port == 80 || port == 443){
>> >                     return String.format("%s://localhost", protocol);
>> >                 }
>> >
>> >                 return String.format("%s://localhost:%d", protocol,
>> port);
>> >             }
>> >         };
>> >
>> >         configuration.add(AliasContribution.create(BaseURLSource.class,
>> > source));
>> >     }
>> >
>> >
>> >
>> > Argo Vilberg wrote:
>> >>
>> >> hi,
>> >>
>> >>
>> >> I want use pagelink with port 8443 and https protocol.
>> >>
>> >> If i use:
>> >>     <t:pagelink page="Start" context="currentRole.roleId">
>> >>                         ${currentRole.roleName}
>> >>     </t:pagelink>
>> >>
>> >> then tapestry generate
>> >> http://localhost/app/start/4
>> >>
>> >>
>> >> But i want
>> >> https://localhost:8443/app/start4
>> >>
>> >>
>> >> Argo
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/T5%3A-pagelink-tp18796163p18843725.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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/T5%3A-pagelink-tp18796163p18853412.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: T5: pagelink

Posted by tapestry5 <bi...@gmail.com>.

It seams that my production application server is running in behind Http
server.





Daniel Jue wrote:
> 
> You could also change the default HTTPS port in your app server
> configuration, and then your don't have to worry about modifying the
> URIs.  The default is of course 443.
> 
> "The https:// protocol can be used in exactly the same way as the
> http:// protocol.
> The differences are that HTTPS uses a default port number of 443 (80
> for HTTP) and that
> HTTPS automatically performs SSL negotiation and thus always sends
> data in encrypted form,
> i.e. web servers accessed through https:// have to be "secure web
> servers"."
> 
> For me, my development is always HTTP, and the deployed is always
> using HTTPS (for everything)
> So in the module that contributes these settings (for most people
> that's the AppModule), I look up a value stored in the local JNDI
> which tells me if I should use https or not
> 
> public void contributeMetaDataLocator(MappedConfiguration<String,String>
> configuration)
> {
>   if(thisIsDeploymentServer())
>   {
>     configuration.put(TapestryConstants.SECURE_PAGE, "true");
>   }
> }
> 
> On Tue, Aug 5, 2008 at 11:35 PM, tapestry5 <bi...@gmail.com> wrote:
>>
>> I have the same issue. I tried using it.
>> It won't open the landing page. Infact if i don't put @Secure and also
>> donot
>> contribute it opens the landing page as https and further the links were
>> http.
>>
>> Even if i make it work but still contributeAlias is good for testing but
>> not
>> for production.
>>
>> Is there any other way to get https and not http.
>>
>> As my page can be used for http and https. So if i put @Secure then it
>> won't
>> work for any http call.
>>
>>
>>
>> 9902468 wrote:
>> >
>> > Hi,
>> >
>> > Use @Secure annotation and add this to your appmodule: (Also use
>> whatever
>> > ports you wish.)
>> >
>> > public void contributeAlias(Configuration<AliasContribution>
>> > configuration)
>> >     {
>> >         BaseURLSource source = new BaseURLSource()
>> >         {
>> >             public String getBaseURL(boolean secure)
>> >             {
>> >                 String protocol = secure ? "https" : "http";
>> >
>> >                 int port = secure ? 443 : 80;
>> >
>> >                 if(port == 80 || port == 443){
>> >                     return String.format("%s://localhost", protocol);
>> >                 }
>> >
>> >                 return String.format("%s://localhost:%d", protocol,
>> port);
>> >             }
>> >         };
>> >
>> >         configuration.add(AliasContribution.create(BaseURLSource.class,
>> > source));
>> >     }
>> >
>> >
>> >
>> > Argo Vilberg wrote:
>> >>
>> >> hi,
>> >>
>> >>
>> >> I want use pagelink with port 8443 and https protocol.
>> >>
>> >> If i use:
>> >>     <t:pagelink page="Start" context="currentRole.roleId">
>> >>                         ${currentRole.roleName}
>> >>     </t:pagelink>
>> >>
>> >> then tapestry generate
>> >> http://localhost/app/start/4
>> >>
>> >>
>> >> But i want
>> >> https://localhost:8443/app/start4
>> >>
>> >>
>> >> Argo
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/T5%3A-pagelink-tp18796163p18843725.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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/T5%3A-pagelink-tp18796163p18857720.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: T5: pagelink

Posted by Daniel Jue <te...@gmail.com>.
You could also change the default HTTPS port in your app server
configuration, and then your don't have to worry about modifying the
URIs.  The default is of course 443.

"The https:// protocol can be used in exactly the same way as the
http:// protocol.
The differences are that HTTPS uses a default port number of 443 (80
for HTTP) and that
HTTPS automatically performs SSL negotiation and thus always sends
data in encrypted form,
i.e. web servers accessed through https:// have to be "secure web servers"."

For me, my development is always HTTP, and the deployed is always
using HTTPS (for everything)
So in the module that contributes these settings (for most people
that's the AppModule), I look up a value stored in the local JNDI
which tells me if I should use https or not

public void contributeMetaDataLocator(MappedConfiguration<String,String>
configuration)
{
  if(thisIsDeploymentServer())
  {
    configuration.put(TapestryConstants.SECURE_PAGE, "true");
  }
}

On Tue, Aug 5, 2008 at 11:35 PM, tapestry5 <bi...@gmail.com> wrote:
>
> I have the same issue. I tried using it.
> It won't open the landing page. Infact if i don't put @Secure and also donot
> contribute it opens the landing page as https and further the links were
> http.
>
> Even if i make it work but still contributeAlias is good for testing but not
> for production.
>
> Is there any other way to get https and not http.
>
> As my page can be used for http and https. So if i put @Secure then it won't
> work for any http call.
>
>
>
> 9902468 wrote:
> >
> > Hi,
> >
> > Use @Secure annotation and add this to your appmodule: (Also use whatever
> > ports you wish.)
> >
> > public void contributeAlias(Configuration<AliasContribution>
> > configuration)
> >     {
> >         BaseURLSource source = new BaseURLSource()
> >         {
> >             public String getBaseURL(boolean secure)
> >             {
> >                 String protocol = secure ? "https" : "http";
> >
> >                 int port = secure ? 443 : 80;
> >
> >                 if(port == 80 || port == 443){
> >                     return String.format("%s://localhost", protocol);
> >                 }
> >
> >                 return String.format("%s://localhost:%d", protocol, port);
> >             }
> >         };
> >
> >         configuration.add(AliasContribution.create(BaseURLSource.class,
> > source));
> >     }
> >
> >
> >
> > Argo Vilberg wrote:
> >>
> >> hi,
> >>
> >>
> >> I want use pagelink with port 8443 and https protocol.
> >>
> >> If i use:
> >>     <t:pagelink page="Start" context="currentRole.roleId">
> >>                         ${currentRole.roleName}
> >>     </t:pagelink>
> >>
> >> then tapestry generate
> >> http://localhost/app/start/4
> >>
> >>
> >> But i want
> >> https://localhost:8443/app/start4
> >>
> >>
> >> Argo
> >>
> >>
> >
> >
>
> --
> View this message in context: http://www.nabble.com/T5%3A-pagelink-tp18796163p18843725.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

Posted by tapestry5 <bi...@gmail.com>.
I have the same issue. I tried using it. 
It won't open the landing page. Infact if i don't put @Secure and also donot
contribute it opens the landing page as https and further the links were
http.

Even if i make it work but still contributeAlias is good for testing but not
for production.

Is there any other way to get https and not http.

As my page can be used for http and https. So if i put @Secure then it won't
work for any http call.



9902468 wrote:
> 
> Hi,
> 
> Use @Secure annotation and add this to your appmodule: (Also use whatever
> ports you wish.)
> 
> public void contributeAlias(Configuration<AliasContribution>
> configuration)
>     {
>         BaseURLSource source = new BaseURLSource()
>         {
>             public String getBaseURL(boolean secure)
>             {
>                 String protocol = secure ? "https" : "http";
> 
>                 int port = secure ? 443 : 80;
> 
>                 if(port == 80 || port == 443){
>                     return String.format("%s://localhost", protocol);
>                 }
>                 
>                 return String.format("%s://localhost:%d", protocol, port);
>             }
>         };
> 
>         configuration.add(AliasContribution.create(BaseURLSource.class,
> source));
>     }
> 
> 
> 
> Argo Vilberg wrote:
>> 
>> hi,
>> 
>> 
>> I want use pagelink with port 8443 and https protocol.
>> 
>> If i use:
>>     <t:pagelink page="Start" context="currentRole.roleId">
>>                         ${currentRole.roleName}
>>     </t:pagelink>
>> 
>> then tapestry generate
>> http://localhost/app/start/4
>> 
>> 
>> But i want
>> https://localhost:8443/app/start4
>> 
>> 
>> Argo
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/T5%3A-pagelink-tp18796163p18843725.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: T5: pagelink

Posted by 9902468 <vi...@cerion.fi>.
Hi,

Use @Secure annotation and add this to your appmodule: (Also use whatever
ports you wish.)

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

                int port = secure ? 443 : 80;

                if(port == 80 || port == 443){
                    return String.format("%s://localhost", protocol);
                }
                
                return String.format("%s://localhost:%d", protocol, port);
            }
        };

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



Argo Vilberg wrote:
> 
> hi,
> 
> 
> I want use pagelink with port 8443 and https protocol.
> 
> If i use:
>     <t:pagelink page="Start" context="currentRole.roleId">
>                         ${currentRole.roleName}
>     </t:pagelink>
> 
> then tapestry generate
> http://localhost/app/start/4
> 
> 
> But i want
> https://localhost:8443/app/start4
> 
> 
> Argo
> 
> 

-- 
View this message in context: http://www.nabble.com/T5%3A-pagelink-tp18796163p18809513.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: T5: pagelink

Posted by Shing Hing Man <ma...@yahoo.com>.
Have you tried @secure  annotation ?
http://tapestry.apache.org/tapestry5/tapestry-core/guide/secure.html


Shing

Home page : http://www.lombok.demon.co.uk/



--- On Sun, 3/8/08, Argo Vilberg <wi...@gmail.com> wrote:

> From: Argo Vilberg <wi...@gmail.com>
> Subject: T5: pagelink
> To: "Tapestry users" <us...@tapestry.apache.org>
> Date: Sunday, 3 August, 2008, 2:03 PM
> hi,
> 
> 
> I want use pagelink with port 8443 and https protocol.
> 
> If i use:
>     <t:pagelink page="Start"
> context="currentRole.roleId">
>                         ${currentRole.roleName}
>     </t:pagelink>
> 
> then tapestry generate
> http://localhost/app/start/4
> 
> 
> But i want
> https://localhost:8443/app/start4
> 
> 
> Argo


      __________________________________________________________
Not happy with your email address?.
Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html

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