You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Rusty Phillips <rp...@edats.com> on 2006/01/04 19:55:38 UTC

Rewriting URLs: is something missing?

I can see from the docs
(http://jakarta.apache.org/tapestry/UsersGuide/friendly-urls.html) that
I can rewrite urls to be friendlier quite easily.

 

What I don't see anywhere is a way to stop creating pages with the
".html".  This is important because most editors consider extension when
deciding how to do markup.

 

Does anyone know where tapestry decides that a particular page is
located in the path at "[pagename].html", and how I'd change that to
something else?

 

Ultimately, my goal here is to be able to be able to make a file named,
for instance:

MyTemplate.xml

 

Which is perhaps a tapestry template that specifies an xml-fo document
when you render it, and be able to render that as:

http://localhost:8080/app/MyTemplate.pdf

 

rather than having a file named "MyTemplate.html" and having to refer to
the page as:

http://localhost:8080/app/service=xmlconverter&page=MyTemplate

 

Note that I do know how to do URL remapping, and can create encodings.
My question is how to avoid the use of the html extension.

 

Thanks for your help!


Re: Rewriting URLs: is something missing?

Posted by Kent Tong <ke...@cpttm.org.mo>.
Rusty Phillips <rphillips <at> edats.com> writes:

> Ultimately, my goal here is to be able to be able to make a file named,
> for instance:
> 
> MyTemplate.xml
> 
> Which is perhaps a tapestry template that specifies an xml-fo document
> when you render it, and be able to render that as:
> 
> http://localhost:8080/app/MyTemplate.pdf
> 
> rather than having a file named "MyTemplate.html" and having to refer to
> the page as:
> 
> http://localhost:8080/app/service=xmlconverter&page=MyTemplate

You can define a service encoder to map xxx.pdf back to
/service=xmlconverter&page=xxx. Tapestry will NOT try to
find xxx.html because you're using your own xmlconverter
service. It is up to that service to decide what to do
with that page=xxx parameter. For example, it may convert
xxx.xml to PDF and send it back to the client.

--
Author of a book for learning Tapestry (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


Re: Rewriting URLs: is something missing?

Posted by Paul Cantrell <ca...@pobox.com>.
?!!??

What you're describing is exactly what friendly URLs do ... and the  
doc page you mention describes how to do it. Looks like you just  
missed it. Read the section on "encoder."

     http://jakarta.apache.org/tapestry/UsersGuide/friendly- 
urls.html#encoder

Cheers,

Paul


On Jan 4, 2006, at 11:55 AM, Rusty Phillips wrote:

> I can see from the docs
> (http://jakarta.apache.org/tapestry/UsersGuide/friendly-urls.html)  
> that
> I can rewrite urls to be friendlier quite easily.
>
>
>
> What I don't see anywhere is a way to stop creating pages with the
> ".html".  This is important because most editors consider extension  
> when
> deciding how to do markup.
>
>
>
> Does anyone know where tapestry decides that a particular page is
> located in the path at "[pagename].html", and how I'd change that to
> something else?
>
>
>
> Ultimately, my goal here is to be able to be able to make a file  
> named,
> for instance:
>
> MyTemplate.xml
>
>
>
> Which is perhaps a tapestry template that specifies an xml-fo document
> when you render it, and be able to render that as:
>
> http://localhost:8080/app/MyTemplate.pdf
>
>
>
> rather than having a file named "MyTemplate.html" and having to  
> refer to
> the page as:
>
> http://localhost:8080/app/service=xmlconverter&page=MyTemplate
>
>
>
> Note that I do know how to do URL remapping, and can create encodings.
> My question is how to avoid the use of the html extension.
>
>
>
> Thanks for your help!
>

_________________________________________________________________
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net



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