dev@javaserverfaces.java.net

Redirect Params

From: Stan Silvert <stan.silvert_at_jboss.com>
Date: Mon, 12 Jun 2006 15:14:39 -0500

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.RandomNumberBe
an</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