-
1. Re: How to redirect flow between two beans?
gavin.king Jul 11, 2006 7:09 PM (in response to shasho)Show your code.
-
2. Re: How to redirect flow between two beans?
shasho Jul 11, 2006 9:51 PM (in response to shasho)Following seam booking demo program
Let?s say that after a successful login we want to perform an automated search that shows all the available hotels
In the file LoginAction.java under the login function in case of successful login
?..user = results.get(0); Contexts.getSessionContext().set("loggedIn", true); FacesMessages.instance().add("Welcome, #{user.name}"); // here I want to redirect to hotel search instead of displaying the main page // need to call HotelSearchingAction.find return "main";
-
3. Re: How to redirect flow between two beans?
cptnkirk Jul 11, 2006 9:57 PM (in response to shasho)and return "hotelSearch" or whatever instead of "main" isn't what you want?
-
4. Re: How to redirect flow between two beans?
shasho Jul 13, 2006 5:47 AM (in response to shasho)I want to call specific function in hotelsearch - find and not just load it
I want to know how to direct to a specific fucntion inside hotelsearch which is a Java bean -
5. Re: How to redirect flow between two beans?
cptnkirk Jul 13, 2006 11:11 AM (in response to shasho)If all you want to do is call some method you could use a page action.
http://docs.jboss.com/seam/latest/reference/en/html/concepts.html#d0e2740
I have a feeling there's more to your story, but will need more information about what it is you're trying to do. You may also benefit from reading about the @Factory and @Unwrap annotations. -
6. Re: How to redirect flow between two beans?
iradix Jul 13, 2006 12:09 PM (in response to shasho)I'm not sure I follow, but if as your comment states you want to call the method from another seam managed bean try:
@In(create = true) private HotelSearchingAction hotelSearchingAction
user = results.get(0); Contexts.getSessionContext().set("loggedIn", true); FacesMessages.instance().add("Welcome, #{user.name}"); // here I want to redirect to hotel search instead of displaying the main page // need to call HotelSearchingAction.find return hotelSearchingAction.find();