You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Alberto Lepe <al...@gmail.com> on 2005/06/04 19:24:33 UTC

No just friendly URLs

Recenlty we developed a Directory with Tapestry. The problem is that
we need to change the way URL are displayed for example:
Right now:
www.directory.com/app?service=external/Result?sp=154
It's like:
www.directory.com/app?service=external/Result?sp=Shops/Pets/Dogs

We need:
www.directory.com/Shops/Pets/Dogs

Any Idea?
has anyone done something like it?? I n33d ur h31p!

Thanks.

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


Re: Tapestry Component Reference lacks

Posted by Robert Zeigler <ro...@scazdl.org>.
There is absolutely nothing preventing you from implementing your own
method. Just don't declare the property. I do this /all/ the time for
models which don't change... (and even for ones that do; you just can't
"stash" the ones that do change frequently.  So, the next question is:
what if you want a /persistent/ property, AND you want to initialize it?
There are two possible solutions. One is to implement
PageRenderListener.  I used to use this technique a lot...
pageBeginRender(PageEvent event) {
	if (getCustomModel() == null) {
		setCustomModel(new MyModel());
	}
}
Lately, however, I've been shying away from using it, because I tend to
do a fair amount of rendering using block/render block, often with the
render'ed blocks being contained in other pages than the rendering page
(which means that pageBeginRender doesn't get called on these
components).  So, one alternative that I've used is to use wrappers...
<property-specification name="customModel" type="MyModel" persistent="yes">

public abstract MyModel getCustomModel();
public abstract void setCustomModel(MyModel m);

public MyModel getMyModel() {
	if (getCustomModel() == null) {
		setCustomModel(new MyModel());
	}
	return getCustomModel();
}

then, in your ognl reference, use myModel instead of customModel.
If you're into keeping your page/component classes concrete, then
instead of declaring the abstract accessors, you would do:
if (getProperty("customModel") == null) {
	setProperty("customModel",new MyModel());
}
return getProperty("MyModel");


Robert
Olexandr Yuzikov wrote:
> Hi guys,
> 
> I have a problem with initialization of a IPropertySelectionModel.
> I saw at
> http://jakarta.apache.org/tapestry/doc/ComponentReference/PropertySelection.
> html and there is a property-specification with name="itemSelectionModel":
> 
> ---
> <property-specification name="itemSelectionModel" type="ItemSelectionModel"
> persistent="yes"/>
> ---
> 
> This string makes impossible to write own getter which returns custom
> implementation of the IPropertySelection interface.
> 
> Regards,
> 
> Oleksandr Yuzikov.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


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


Tapestry Component Reference lacks

Posted by Olexandr Yuzikov <yu...@sac.com.ua>.
Hi guys,

I have a problem with initialization of a IPropertySelectionModel.
I saw at
http://jakarta.apache.org/tapestry/doc/ComponentReference/PropertySelection.
html and there is a property-specification with name="itemSelectionModel":

---
<property-specification name="itemSelectionModel" type="ItemSelectionModel"
persistent="yes"/>
---

This string makes impossible to write own getter which returns custom
implementation of the IPropertySelection interface.

Regards,

Oleksandr Yuzikov.


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


Re: No just friendly URLs

Posted by Eric Fesler <er...@audaxis.com>.
Alberto Lepe said the following on 06/04/2005 07:24 PM:

>Recenlty we developed a Directory with Tapestry. The problem is that
>we need to change the way URL are displayed for example:
>Right now:
>www.directory.com/app?service=external/Result?sp=154
>It's like:
>www.directory.com/app?service=external/Result?sp=Shops/Pets/Dogs
>
>We need:
>www.directory.com/Shops/Pets/Dogs
>
>Any Idea?
>has anyone done something like it?? I n33d ur h31p!
>
>Thanks.
>
>  
>
Take a look at http://tuckey.org/urlrewrite <http://tuckey.org/urlrewrite/>

We use it on a project and it works fine.

--ERic

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


RE: No just friendly URLs

Posted by Patrick Casey <pa...@adelphia.net>.
	Have you tried using the external service and building your own
links?

	--- Pat

> -----Original Message-----
> From: Alberto Lepe [mailto:alepe.com@gmail.com]
> Sent: Saturday, June 04, 2005 10:25 AM
> To: Tapestry users
> Subject: No just friendly URLs
> 
> Recenlty we developed a Directory with Tapestry. The problem is that
> we need to change the way URL are displayed for example:
> Right now:
> www.directory.com/app?service=external/Result?sp=154
> It's like:
> www.directory.com/app?service=external/Result?sp=Shops/Pets/Dogs
> 
> We need:
> www.directory.com/Shops/Pets/Dogs
> 
> Any Idea?
> has anyone done something like it?? I n33d ur h31p!
> 
> Thanks.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org




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