This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes how to use managed bean property in navigation rule tag of faces config. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "how to use managed bean property in navigation rule tag of faces config." Watch "how to use managed bean property in navigation rule tag of faces config." New topic
Author

how to use managed bean property in navigation rule tag of faces config.

roby george
Ranch Hand

Joined: Sep 08, 2010
Posts: 31
how to use managed bean property in navigation rule tag of faces config.
i am using JSF1.2.

<navigation-rule>
<from-view-id>/Reports.jsp</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/Reports.jsp</to-view-id>
</navigation-case>
</navigation-rule>

I have a menaged bean which has the scope session. How can i use that managed bean property in navigation rule
like

<navigation-rule>
<from-view-id>/Reports.jsp</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/Reports.jsp?username=${myBean.userName}</to-view-id>
</navigation-case>
</navigation-rule>
i want to add "username=${myBean.userName}"

Please suggest its urgent
Thanks in advance
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15964
    
  19

You cannot do that.

The "to-view-id" is exactly what its name says. It's a View ID, and NOT a URL. You can use it to navigate to JSF Views, but not to JSPs or servlets, and you cannot parameterize it.

To pass information from one JSF process to another, the recommend procedure is to use internal server-side variables. As far as it goes, sending out the user ID to the client and receiving it again - whether in URLs, cookies, or form contents - is an extremely high security risk.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to use managed bean property in navigation rule tag of faces config.
 
Similar Threads
commandLink param problem
How to know the outcome of backing bean method
managing Faces-config in jSF ...please explain.
Creating List/Array of Managed Beans
FacesContext is null inside managed bean