wood burning stoves 2.0*
The moose likes JSF and the fly likes Difference Between JSF request and HttpServletRequest and how do you retreive parameters from them Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Difference Between JSF request and HttpServletRequest and how do you retreive parameters from them" Watch "Difference Between JSF request and HttpServletRequest and how do you retreive parameters from them" New topic
Author

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

Joe Richard
Ranch Hand

Joined: Aug 15, 2001
Posts: 76
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.


Persistence equals goals
SCJD (In Progress), SCJP
Guy deLyonesse
Ranch Hand

Joined: Apr 12, 2011
Posts: 200

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.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16065
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
 
subject: Difference Between JSF request and HttpServletRequest and how do you retreive parameters from them