JSF, automatic execution of backing bean action  
Author Message
Micke





PostPosted: 2005-10-4 6:19:00 Top

java-programmer, JSF, automatic execution of backing bean action Hi,
I am new to JSF and can not quite figure out how to solve the following
problem.

I would like to be able to call JSF like a servlet, by having the
request parameters mapped to a managed bean in request scope. Then have
an action executed automatically which processes the request parameters
and returns control to an ordinary JSF page. It would be nice to have
the action prepare the data to be displayed, and then have a normal JSF
page display it.

Example of the URL style I am thinking of:
http://www.hello.com/tool/getJob.jsf?id=abracadabra&tool=toolname&sorting=col2

(This would only be a small part of a larger applicaton, otherwise I
would have used a servlet to do this.)

Is it at all possible and sane to use JSF in this way.
Other stategy:

Thank you, Mikael

 
HGA03630





PostPosted: 2005-10-4 7:29:00 Top

java-programmer >> JSF, automatic execution of backing bean action I think your problem could be readily solved by a proper
navigation-rule
entry in your faces-config.xml.

> request parameters mapped to a managed bean
<h:textInput id="abracadabra" value="myBackingBean.foo" ..... />

 
Micke





PostPosted: 2005-10-4 14:33:00 Top

java-programmer >> JSF, automatic execution of backing bean action Hi,
the thing is that I don't want the user to have to click on a link, but
have and action method on a backing bean be i invoked without the user
having to do anything. I also was thinking I could wire the request
parameters to the backing bean in the faces-config.xml file (when I set
up the managed bean).

Thanks, Mikael

 
 
HGA03630





PostPosted: 2005-10-4 15:03:00 Top

java-programmer >> JSF, automatic execution of backing bean action Micke 銇儭銉冦偦銉笺偢:

> Hi,
> the thing is that I don't want the user to have to click on a link, but
> have and action method on a backing bean be i invoked without the user
> having to do anything. I also was thinking I could wire the request
> parameters to the backing bean in the faces-config.xml file (when I set
> up the managed bean).
>
> Thanks, Mikael
If the component is a <h:inputText />, you could use some attributes
including valueChangeListener, converter, validator and variety of
onXXXXXs. In some cases you could even use setter methods for bean
properties to do something. Wiring the request parameter to the backing
bean will also be done via simple EL expression on the JSF component.

 
 
Micke





PostPosted: 2005-10-5 1:08:00 Top

java-programmer >> JSF, automatic execution of backing bean action Hi,
thanks for you replies, but I'm not sure they solve my problem.

I want the example URL to execute Java logic immediately without the
user having to press a link or button, just like when calling an
ordinary servlet (doPost() ). I don't think your proposals help me do
that, do they?

Cheers, Mikael

 
 
Micke





PostPosted: 2005-10-6 2:58:00 Top

java-programmer >> JSF, automatic execution of backing bean action Some help please, anyone.