You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ford prefect <fo...@yahoo.de> on 2004/03/24 09:36:08 UTC
Re: Visit object
>why store it in the visit?
I would like to display conditional components on
client specific stuff, e.g. the subdomain, ip
address/country etc.
With the visit object it would be easy to do.
Or am I wrong there?
Mit schönen Grüßen von Yahoo! Mail - http://mail.yahoo.de
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Visit object
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Mar 24, 2004, at 3:36 AM, ford prefect wrote:
>> why store it in the visit?
>
> I would like to display conditional components on
> client specific stuff, e.g. the subdomain, ip
> address/country etc.
>
> With the visit object it would be easy to do.
>
> Or am I wrong there?
If you simply have page getters, you can access them directly with
OGNL expressions. For example, to write out the IP address:
<span jwcid="@Insert" value="ognl:ip(cycle)"/>
with
public String ip(IRequestCycle cycle) {
return cycle...... // (whatever it takes to drill down to getting
the IP address)
}
Or you could store the IP address at PageRenderListener.pageBeginRender
time (and clear it during initialize) so your express could be as
simple as "ognl:ip" - even shorter than using Visit :)
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org