You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by gs...@smm.de on 2005/11/30 20:05:49 UTC
Question about 'scheme https' ...
Hi !
I just ran into a problem when setting a link to a secured login page.
My local server (Tomcat) ist running on port 8080, https is listening on
port 8443.
In the border-component there is the following definition:
<component id="loginpage" type="PageLink">
<binding name="page" value="'Login'"/>
<binding name="scheme" value="'https'"/>
</component>
The generated link looks like https://localhost:8080/... .
When using a proxy server (Apache 2.x) to get requests to port 80 forwarded
to my container, having https on port 443, the generated link is
https://mydomain:80/.... :(
Is there a simple solution to this problem ?
Can I use hivemind to inject the https-port ? Or is there a binding I have
overseen ?
It would be the perfect solution, if it can distinguish the two situations
(like 'httpsPort = httpPort==80 ? 443 : 8443 ;' :) ).
Any suggestions ?
Thank you in advance,
Gerald
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Question about 'scheme https' ...
Posted by Kent Tong <ke...@cpttm.org.mo>.
<gs <at> smm.de> writes:
> My local server (Tomcat) ist running on port 8080, https is listening on
> port 8443.
>
> In the border-component there is the following definition:
>
> <component id="loginpage" type="PageLink">
> <binding name="page" value="'Login'"/>
> <binding name="scheme" value="'https'"/>
> </component>
>
> The generated link looks like https://localhost:8080/... .
I'd suggest that you submit a feature request or bug report at
http://issues.apache.org/jira/secure/BrowseProject.jspa?id=10573.
To workaround the problem at hand, try creating a LinkRenderer that
extends the DefaultLinkRenderer and change its constructLink() to
something like:
protected String constructURL(ILinkComponent component, IRequestCycle cycle)
{
ILink link = component.getLink(cycle);
String scheme = component.getScheme();
String anchor = component.getAnchor();
int port = scheme != null && scheme.equals("https") ? 80 : 0;
return link.getURL(scheme, null, port, anchor, true);
}
Then of course use that LinkRenderer for your PageLink.
--
Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org