Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing hidden values to sendRedirect() in JSF  RSS feed

 
prash patil
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I am at beginer level for JSF; Need help.
I am using JSF in my application in which I want to pass values in request which is being redirected using sendRedirect() method.
and also the paramerters should not be visible in URL.

Or in other words:

The line in bold; I want to pass some key-values for the above page request.

Is there any facility availabel in JSF where I can pass the key/value to the above page request which
is not visible in URL?


Thanks in advance!!

Regards,
PP

 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you'll notice, the faces-config element is named view-id, not view-url. It means literally that. It's not a URL, it's the name of the view.

JSF works primarily using HTTP POST's, and putting parameters on a URL is a feature of HTTP GET, not POST.

There's basically 2 ways to handle this.

1. Encode an HTTP Link, instead of a command on the source view. This has the disadvantage of not invoking an JSF action.

2. Pass the parameter data to the destination view using a backing bean. This is the common solution.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!