This content has been marked as final.
Show 4 replies
-
1. Re: Querystring param from remote application
norman.richards Oct 12, 2006 10:49 AM (in response to monkeyden)@RequestParameter?
-
2. Re: Querystring param from remote application
monkeyden Oct 12, 2006 3:24 PM (in response to monkeyden)Thanks Norman. I found that in the process of digging.
Everything works fine and I'm able to log the user in, however, I can't seem to redirect to the first screen of the application (user-search.jsp). The URL looks like this:
http://localhost:8080/myapp/login.seam?id=dKGvK69gCCxqbM9Ud1RS30mhXYBOI08e
The create method of that login component looks like this:@Create public String login() { //decode userkey //query for user if(user == null){ return "/login.jsp"; }else{ //go to first page return "/private/user-search.jsp"; } }
While debugging, it gets to the else condition but always goes to login.jsp instead of user-search.jsp. This appears to be how Seam is designed to work. The question is, can I go to a some other Seam action, other than the originally requested view-id from the create method? I only want the user to go to the requested view-id if there was a problem (not able to log in), otherwise they can pass through. -
3. Re: Querystring param from remote application
monkeyden Oct 12, 2006 3:37 PM (in response to monkeyden)I looked at the Number Guess example and it got me half way, but it differs in that a successful login means redirecting to another view-id and Seam component.
-
4. Re: Querystring param from remote application
monkeyden Oct 12, 2006 6:15 PM (in response to monkeyden)For posterity sake:
@RequestParameter private String id; @Create public void login() { ... user = getUser(userId); if(user == null){ FacesMessages.instance().add("Unable to log you in. Try again."); Redirect redirect = Redirect.instance(); redirect.setViewId("/login.jsp"); redirect.execute(); }else{ Context session = Contexts.getSessionContext(); session.set("user", user); } ... }
Anyone know if there is a way to invoke a Seam action using HTTP GET, instead of using @Create?