You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Mark Shead <sh...@optimalinternet.com> on 2005/10/31 16:02:41 UTC

Friendly URLS

I am using 4b11 and trying to get friendly URLS to work with a test
application.  I added the following to web.xml:

	<servlet-mapping>
		<servlet-name>phonebook</servlet-name>
		<url-pattern>*.html</url-pattern>
	</servlet-mapping>

And the following to hivemodule.xml:

	<contribution configuration-id="tapestry.url.ServiceEncoders">
		<page-service-encoder id="page" extension="html"
service="page" />
	</contribution>

I am able to load the first page /phonebook/Home.html, but when I submit
the initial form, it tries to send it to /phonebook/app and I get a 404
saying that /phonebook/app is not available.

My guess is that the part that is receiving the requests is working
correctly, but the part that is generating the correct link is not doing
it's job.

Does anyone have any suggestion as to what I'm doing wrong or where I
should look?

--Mark


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


Re: Friendly URLS

Posted by Martin Strand <ma...@entcap.se>.
Sounds like you removed the <servlet-mapping> for /app...

<page-service-encoder> is only used for the page service. Form submissions  
are handled by the direct service. Since your direct service doesn't use  
friendly urls, the form will be posted to /app as usual.

You'll need to either (1) add a servlet-mapping for /app so that the form  
submission is handled by Tapestry:

	<servlet-mapping>
		<servlet-name>phonebook</servlet-name>
		<url-pattern>/app</url-pattern>
	</servlet-mapping>


or (2) configure friendly urls for the direct service as well:
http://jakarta.apache.org/tapestry/UsersGuide/friendly-urls.html#direct-service-encoder

You might as well add friendly urls for all four services on that page -  
page, direct, asset, extension.

--Martin

On Mon, 31 Oct 2005 16:02:41 +0100, Mark Shead  
<sh...@optimalinternet.com> wrote:

> I am using 4b11 and trying to get friendly URLS to work with a test
> application.  I added the following to web.xml:
>
> 	<servlet-mapping>
> 		<servlet-name>phonebook</servlet-name>
> 		<url-pattern>*.html</url-pattern>
> 	</servlet-mapping>
>
> And the following to hivemodule.xml:
>
> 	<contribution configuration-id="tapestry.url.ServiceEncoders">
> 		<page-service-encoder id="page" extension="html"
> service="page" />
> 	</contribution>
>
> I am able to load the first page /phonebook/Home.html, but when I submit
> the initial form, it tries to send it to /phonebook/app and I get a 404
> saying that /phonebook/app is not available.
>
> My guess is that the part that is receiving the requests is working
> correctly, but the part that is generating the correct link is not doing
> it's job.
>
> Does anyone have any suggestion as to what I'm doing wrong or where I
> should look?
>
> --Mark

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