• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Difference Between JSF request and HttpServletRequest and how do you retreive parameters from them

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am having a problem retreiving the values from my form submit.
I never have any of the input parameters come back.

Here is my code:



Here are the bean methods:



Any help would be greatly appreciated.
 
Ranch Hand
Posts: 200
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you say you aren't getting the input parameters back, what do you mean? If I understand your code correctly you're trying to do a form submit when the selectOneMenu value changes. It seems to be the only input control on the form.

For JSF to do a form submit you need an ActionListener, usually triggered by a commandButton or commandLink control with a type="submit" attribute.

 
Saloon Keeper
Posts: 28100
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Guy deLyonesse wrote:

For JSF to do a form submit you need an ActionListener, usually triggered by a commandButton or commandLink control with a type="submit" attribute.



Listeners are used too much in JSF. A simple action method is usually sufficient, simpler to code, and doesn't tie the backing bean as strongly to a particular technology. I think the whole listener thing came about because stale information has a remarkable way of hanging around the Internet forever. Listeners have their uses, but not as often as people think. I don't think I've ever done an ActionListener, for example, since the only real reason to would be to fire multiple methods from a single command.

The original post misses the point, however. It's an attempt to apply legacy design to an entire new paradigm. JSF is intended to allow people to be able to design a View, present it to the client, go through a series of postbacks until all submitted data in the form passes validation, then fire an Action to act on the submitted data. You don't retrieve data, it's presented to you. The more logic you code in JSF, the more likely you're doing it wrong. And the more times you explicitly reference classes in the javax.faces package tree - excepting the datamodel classes - the more likely you're doing it wrong.

JSF is designed to make things simple and easy, and the biggest problem with it is that too many people keep trying to make it not be simple and easy.
 
Alas, poor Yorick, he knew this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic