Thank you Adam a lot. Works great.
Adam Greene wrote:
Ok, then the missing line of code is:
engine.renderResponse(cycle, output);
this is what actually renders the response and usually is the last
line in your service.
----- Original Message ----- From: "Oleksandr Yuzikov"
<[EMAIL PROTECTED]>
To: "Tapestry users" <[email protected]>
Sent: Tuesday, August 23, 2005 3:23 AM
Subject: Re: Page activation in AbstractService problem
Thanks for replying, Adam.
Yes, you are totally right about saving user in the global object. I
need to switch the view to the UserActivationSuccess page. Then ask
him/her some additional info and store it.
I am using Tapestry 3.0.3. My service extends AbstractSerivce class
only. Activation link is something like this:
http://myhost/myproject/app?service=activation/username/key
-- Oleksandr Yuzikov
Adam Greene wrote:
Well, first off, be careful about setActivatedUser that it doesn't
store the user directly in the Global because global is just that,
global across all users. I assume that the setActivatedUser is
calling out to hivemind, hibernate, spring, or some other back end
process. Secondly, we need more info, like what version of Tapestry
you are using (4.0 Beta 4, 3.0.3, etc). Also did you try debugging
the code and is the value of user == null or actually contain a
value. Also what interfaces and classes does your service implement
(only really interested in the Tapestry specific ones).
----- Original Message ----- From: "Oleksandr Yuzikov"
<[EMAIL PROTECTED]>
To: "Tapestry users" <[email protected]>
Sent: Monday, August 22, 2005 1:09 PM
Subject: Page activation in AbstractService problem
Hi, respected tapestry users.
I want to activate "success" page after the user activation service
performed. But I get blank page there. Any suggestions about this
issue?
public void service(IEngineServiceView view, IRequestCycle cycle,
ResponseOutputStream out) throws ServletException, IOException {
String context[] = getServiceContext(cycle.getRequestContext());
String username = context[0];
String key = context[1];
Global glob = (Global)cycle.getEngine().getGlobal();
User user = glob.getUserManager().activate(username, key);
if (user != null){
glob.setActivatedUser(user);
UserActivationSuccess page =
(UserActivationSuccess)cycle.getPage("UserActivationSuccess");
page.setUser(user);
cycle.activate(page);
} else {
cycle.activate("UserActivationFailed");
}
}
Thanks.
-- Oleksandr Yuzikov
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]