aspose file tools*
The moose likes JSF and the fly likes After submit the link parameter get null Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "After submit the link parameter get null" Watch "After submit the link parameter get null" New topic
Author

After submit the link parameter get null

Hoe Chin
Greenhorn

Joined: Jul 01, 2009
Posts: 23
I have a page with link http://localhost:8080/Test/Page.faces?id=asdasdasd
The page got 2 text field and one button, after user key in the details and click submit, it works well when you first time click the submit button, the id will return me the exact value, but if the user never enter the value and click submit the validation will be invoked and next click the button again the id return null? How to solve this problem anyone can help?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

JSF works by using postbacks. The important part of that word is "POST".

When you entered your original page request, it was done as an HTTP GET operation. When doing a GET, you can put parameters on the URL string (following the "?" character).

However, once the page is displayed, it will interact using HTTP POST operations. HTTP POST parameters are sent in a separate data stream and parameters on the URL are not seen.

To work around that, you should store your id value in a backing bean property so that future requests can see its value as part of the postback data stream.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: After submit the link parameter get null