• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
  • Carey Brown
  • salvin francis
  • Claude Moore

After submit the link parameter get null  RSS feed

Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
Saloon Keeper
Posts: 20657
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
You get good luck from rubbing the belly of a tiny ad:
Create Edit Print & Convert PDF Using Free API with Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!