Hi,
When doing the eval I ran into a little problem for the action events.
When doing an action post, you post to an url like:
$link.setPage("MyTemplate.vm").setAction("MyAction")
thus you are posting to an URL like:
[...]/MyTemplate.vm/actions/MyActions
Problem is that once the post is performed, the current URL is the one
above.
If you do a refresh, you're in trouble. (Not quite, since you are kindly
warned).
The ugly hack I did for now was to do a redirect as follows in my base
action class:
protected void perform( RunData data ) throws Exception {
// perform the normal actions...
super.perform(data);
// look for an action path in the URL, if it exists
// then redirect the page to the one stripped from the
action
String url = data.getRequest().getRequestURL().toString();
int pos = pathinfo.indexOf("/action");
if (pos != -1){
url = url.substring(0, pos);
data.setStatusCode(302);
data.setRedirectURI(url);
}
}
Did I miss something or there is a cleaner way to do this ?
Thanks !
--
St�phane Bailliez
Software Engineer, Paris - France
iMediation - http://www.imediation.com
Disclaimer: All the opinions expressed above are mine and not those from my
company.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]