This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes JSF and the fly likes Post Parameters in JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Post Parameters in JSF" Watch "Post Parameters in JSF" New topic

Post Parameters in JSF

Cory Max
Ranch Hand

Joined: Jul 20, 2005
Posts: 83
Hi Everyone,

I am new to JSF and having some troubles with parameters. Here is what I am trying to do: Someone has logged in to my site (site a). I have their username and password to another site (site b). I would like them to click on to a link in my site and get passed through directly to the next site without entering their username and password. This would work:

<form name="someform"
action="http://someurl/somepage.asp?Param1=asdf&Param2=fdsa" method="POST">
<input type="hidden" name="HTTP_REFERRER" value="somejsp.jsp"/>
<input type="hidden" name="UserID" value="#{}"/>
<input type="hidden" name="Password" value="#{}"/>
<input type="submit"/>

That being said, I dont want to have their username and passwords in hidden fields. I never want them to be sent the browser. Ideally, I would like for them to click a link, have that link go through the jsf controller, find a method to construct the url and the post parameters, then open a new window containing the page for the external site. Sure hope this made sense to someone. Please help :-)



There are only 10 types of people in this world... Those who understand binary and those who don't.
Cory Max
Ranch Hand

Joined: Jul 20, 2005
Posts: 83
Oops, that wouldnt work. This would though

<form name="scfrm" action="¶m2=fdsa" method="POST">
<input type="hidden" name="UserID" value="theusername"/>
<input type="hidden" name="Password" value="thepass"/>
<input type="submit"/>
I agree. Here's the link:
subject: Post Parameters in JSF
It's not a secret anymore!