"action=#{myBackingBean.goToResults} " needs to be on a JSF page though

I'm coming from an email link and not an action though.

 

I want to do this

User clicks Email link->do database lookup on link parameter->serve JSF
view page1 or serve JSF page2

 

I think what you are talking about which is normal JSF:

JSF view->submit link or button->do database lookup on link
parameter->navigate to JSF view 1 or JSF view 2

 

 

Shawn 

________________________________

From: Romanowski, Tim [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 18, 2007 11:50 AM
To: MyFaces Discussion
Subject: RE: preprocessing static email link params before view

 

One way is to call a method for your action, such as
action=#{myBackingBean.goToResults}

 

In your goToResults method, grab the parameter, look up what you need to
in the db, then return the appropriate string corresponding to the page
you want to go to.  Something like this:

 

public String goToResults(){

            String param =
FacesContext.getCurrentInstance().getExternalContext().getRequestParamet
erMap().get("parameter_set_in_my_jsf_page");

            String returnValue;

            // ... access db, execute some logic

            If ( testDbCondition ){

                        // ...

                        returnValue = 'someString';

            }

            else{

                        // ...

                        returnValue = 'someString';

            }

            return returnValue;

}

 

If you do a web search, you'll find dozens of examples for this very
question.  Another way is using an actionListener, of which Tomahawk and
JSF 1.2 offer different approaches.  Or is your question really
something more complicated than this?

 

Tim

 

________________________________

From: Garner, Shawn [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 18, 2007 11:14 AM
To: [email protected]
Subject: preprocessing static email link params before view

 

I need the users to click on a link sent in an email to the user and go
to a JSF view.

However prior to serving the view I need to process a parameter in the
link, look up some information the DB based on the parameter, and send
them to one view or another.

I see in the WIKI there is a redirect Servlet but that seems like too
much work and there should be an easier way.

Can somebody recommend a method to do this?

 

Shawn

************************************************************************
**** 

This email may contain confidential 
material. If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network.

 
************************************************************************
*** 

 


**************************************************************************** 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 
****************************************************************************

Reply via email to