-
1. Re: Use context as parameter
waynebagguley Mar 30, 2007 6:54 AM (in response to damianharvey)If you configure pages.xml with this:
<page view-id="/customer*" action="#{bean.method}"/>
And then extract the rest of the URL from inside the method? That might work. -
2. Re: Use context as parameter
pmuir Mar 30, 2007 6:57 AM (in response to damianharvey)Thats the way I do it (but it needs to be /customer/* iirc)
-
3. Re: Use context as parameter
damianharvey Mar 30, 2007 8:18 AM (in response to damianharvey)I've put the following in pages.xml :
<page view-id="/customer/*" action="#{customerBean.selectCustomer}"/>
If I call www.somedomain.com/someapp/customer/A.seam then this action is called.
I display my customer information on a page called DisplayCustomer.xhtml - how can I use this page in conjunction with the setup above to display the information of Customer A?
Cheers,
Damian. -
4. Re: Use context as parameter
waynebagguley Mar 30, 2007 8:39 AM (in response to damianharvey)Are you asking how to get the page to display, how to populate the page with data or how to find out which customer to find the details of?
-
5. Re: Use context as parameter
damianharvey Mar 30, 2007 9:10 AM (in response to damianharvey)The first one; how to get the DisplayCustomer.xhtml page to display while keeping the URL as .../customer/A.seam (or even .../DisplayCustomer/A.seam)
In the bean I can strip out the "A" using getRequestPathInfo(). If it was servlets this would be easier by calling getPathInfo however the getRequestPathInfo() method of ExternalContext is returning null.
Cheers,
Damian, -
6. Re: Use context as parameter
fernando_jmt Mar 30, 2007 9:54 AM (in response to damianharvey)Maybe you can use URL Rewrite Filter http://tuckey.org/urlrewrite/
You should take a look at this: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=89359 -
7. Re: Use context as parameter
waynebagguley Mar 30, 2007 9:56 AM (in response to damianharvey)You either have the action method return "DisplayCustomer.xhtml" as a String or configure pages.xml with a navigation rule and have the action method return the appropriate String.
-
8. Re: Use context as parameter
damianharvey Apr 3, 2007 10:59 AM (in response to damianharvey)"fernando_jmt" wrote:
Maybe you can use URL Rewrite Filter http://tuckey.org/urlrewrite/
This worked very well. Simple to use an simple to configure. Nice tip. Thanks!
Damian.