Michael, I'm a little confused as to what you're trying to do... (see below)
On Tue, 7 Jan 2003, Eigen Technology Pty Ltd wrote: > I am asking a slightly different question (which has been asked before). > > I want to direct a user to a page that is passed on to him, via an email, > say. > > http://somewhere.com/somecomp/servlet/somecomp/SOME.vm,id?1 > Do you mean a user is being sent an email with URL in the text that he then requests (clicks on)? > I would imagine that this link is passed on as a parameter and read by a > .class file, then passon to Velocity via > context.put("somelink", "the_above_link"); then, read by the Login.vm file > using: from the above link the class that will be executed is SOME.class, and it's doBuildTemplate() method. The Turbine "Controller" class (of MVC fame) extends HTTPServlet and gets called by the servlet container. The internal Turbine system takes care of executing the class whose name matches the template name. > > <form method="post" > action="$link.setAction("Login").setPage($the_above_link)"> > $the_above_link is not going to be stuffed into the context automatically, you have to do this in the class that gets executed. > 1. I don't know which .java file I should use to read the link. > 2. in the file that reads this link, what should be put in place of the XXXX > > String link = data.getParameters().getString("XXXX"); it looks like you have a parameter named id from above, so do getString("id"). I wouldn't stuff data into the context with the key "link" though, use something else. "link" is sent into the context by turbine for calling setPage(), setAction() like methods that resolve to parts of a URL. > > 3. setAction("Login").setPage($YYY) in the Form field does not seem to > work, $YYY is not accepted, a String (i.e. Somefile.vm) is OK. > has "YYY" ben put into the context with context.put("YYY", "SomePage")? hth, Fred > thanks > michael > > > > > > > > > > > > > On Tue, 7 Jan 2003 14:44, you wrote: > >> Hello, > >> > >> I've also been looking at this post and want to have users with > >> different Roles be directed to different Screens after they log in. > >> > >> What I don't get about this post his how all the parameters that he's > >> placing in the Login.vm form are going to be related to the user in > >> the MyLoginUser action when the server processes the login request. > >> > >> What I've tried is using data.getACL() and then using the > >> AccessControlList's hasRole() method in my MyLoginUser class, but > >> getACL() returns null in the LoginUser class so that didn't get me too > >> far. > > > > You can use the ACL in your Login action, but only after you have > > properly logged in the user. We use the following code in our Login > > action before redirecting them to the appropriate homepage: > > ------------ > > User user = TurbineSecurity > > .getAuthenticatedUser( username, password ); > > data.setUser(user); > > data.setACL(TurbineSecurity.getACL(user)); > > user.setHasLoggedIn(new Boolean(true)); > > user.updateLastLogin(); > > TurbineSecurity.saveUser(user); > > data.save(); > > ------------ > > > >> The below post has the quote "It is not possible to do a redirect > >> after login. TDK 2.1 does not permit this yet." Is this true? I'm > >> using 2.1, has this been fixed in 2.2? > > > > This should work fine in 2.1. > > > > Regards, > > > > -- Rodney > > > > -- > > To unsubscribe, e-mail: > > <mailto:[EMAIL PROTECTED]> For additional > > commands, e-mail: <mailto:[EMAIL PROTECTED]> > > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
