You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Max Grigoriev <da...@mail.ru> on 2003/11/28 09:28:40 UTC
Re[2]: Page Name
I created MyEngine to redirect request to tapestry pages after post
form and to disabled double click and back buttons.
Redirect after post I made overloaded public void
renderResponse(IRequestCycle cycle, ResponseOutputStream output) in
MyEngine.
public void renderResponse(IRequestCycle cycle, ResponseOutputStream output)
throws ServletException, IOException {
String method = cycle.getRequestContext().getRequest().getMethod();
final IPage page = cycle.getPage();
setPageToRedirect(page.getPageName());
final Visit visit = (Visit) getVisit();
if ("POST".compareToIgnoreCase(method) == 0) {
setRedirectMe(true);
if (visit != null)
visit.setRedirect(true);
} else {
setRedirectMe(false);
if (visit != null)
visit.setRedirect(false);
super.renderResponse(cycle, output);
}
}
to solve second task i create a cookie and send it to a client, then in public boolean
service(REquestContext context) i compare cookie and key in visit
object. If they are not the same, i redirect to this page. In this
case i don't want to invoke AbstractEngine.service. But i don't know
to which page i should redirect, that's why i have to know page name
from HttpServletRequest
>> > How can i get page name from HttpRequest?
>>
>>
>> You can't (assuming you mean HttpServletRequest). Why would you want to?
>>
>> - John
>>
>> --
>> John Meredith <ps...@t-online.de>
--
Best regards,
Max mailto:darkit@mail.ru
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org