dev@javaserverfaces.java.net

Re: Redirect Params

From: Michael Youngstrom <youngm_at_gmail.com>
Date: Mon, 10 Jul 2006 09:03:37 -0600

Stan,

What do you think of the idea of optionally providing a converter to
the redirect-param? Something like:

<redirect-param-converter>#{someConverter}</redirect-param-converter>

That would accept either an expression or a converter id.

Mike

On 6/12/06, Stan Silvert <stan.silvert_at_jboss.com> wrote:
>
>
>
>
> Being new to this project, I'm wondering what we do about features that go
> beyond the spec. For instance, I've implemented the ability to add params
> to a redirect:
>
>
>
> Say I have this in my managed beans declaration:
>
>
>
> <managed-bean>
>
> <managed-bean-name>random</managed-bean-name>
>
>
> <managed-bean-class>org.jboss.jsfresearch.boxofchocolates.RandomNumberBean</managed-bean-class>
>
> <managed-bean-scope>application</managed-bean-scope>
>
> </managed-bean>
>
>
>
> I can now use this in my navigation-case to set a random integer for foo:
>
>
>
> <redirect>
>
> <redirect-param>
>
> <redirect-param-name>foo</redirect-param-name>
>
> <redirect-param-value>#{random.nextInt}</redirect-param-value>
>
> </redirect-param>
>
> </redirect>
>
>
>
> When the redirect is executed, the browser will show something like this
> URL:
>
> http://localhost:8080/boxofchocolates/myredirectedpage.faces?foo=12345
>
>
>
> This is quite useful for restful applications that support bookmarking. For
> example, imagine a search form which allows a bookmarkable results screen.
>
>
>
> For redirect params, the code itself is fairly innocuous. The largest
> change is that the xsd had to be updated beyond the spec. So if you like
> the idea, the question is what to do with my code.
>
>
>
> Can it be added to the current project?
>
> Should we create a sandbox project for features that might make it into
> JSF.next?
>
>
>
> Stan Silvert
>
> JBoss, a division of RedHat
>
> ssilvert_at_jboss.com
>
>