Re: Forwarding the request to Spring Controller

Splash Forums PrettyFaces Users Forwarding the request to Spring Controller Re: Forwarding the request to Spring Controller

#22579

Hi,

first of all you should really update the PrettyFaces version you are using. Version 1.2.6 is VERY old. The current version is 3.3.3 and contains MANY improvements over 1.2.6.

If you only want to transform the path parameter from the pretty URL into a query parameter, the following mapping should work fine:

<url-mapping id="profileId">
<pattern>/profile/#{id}</pattern>
<view-id>/userProfile.html</view-id>
</url-mapping>

In this example the path parameter is automatically converted into a query parameter with the corresponding name.

Could could additionally inject the path parameter into a bean property using something like this:

<url-mapping id="profileId">
<pattern>/profile/#{ id : forwarderBean.profileId }</pattern>
<view-id>/userProfile.html</view-id>
</url-mapping>

In this case the path parameter is injected into #{forwarderBean.profileId} and also converted into a query parameter named id.

I hope this helps. :)

Christian