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/27 17:45:19 UTC

Page Name

Hello Tapestry Users,

How can i get page name from HttpRequest?
  

-- 
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


Re[2]: Page Name

Posted by Max Grigoriev <da...@mail.ru>.
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


Re: Page Name

Posted by Paul Ferraro <pm...@columbia.edu>.
Actually, the page name is parsed by the appropriate engine service
implementation on every request and is available in the RequestCycle
object - which is merely an abstraction of the HTTP request and session.

requestCycle.getPage().getPageName();

No?

Paul Ferraro

On Thu, 27 Nov 2003 17:55:28 +0100, "John Meredith" <ps...@t-online.de>
said:
> > 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>
-- 
  Paul Ferraro
  paul_ferraro@fastmail.fm

-- 
http://www.fastmail.fm - A no graphics, no pop-ups email service

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Page Name

Posted by John Meredith <ps...@t-online.de>.
> 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>

Re: Page Name

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Thursday, November 27, 2003, at 11:45  AM, Max Grigoriev wrote:
> How can i get page name from HttpRequest?

Why would you want to do this?  I'm just curious, as there really is no 
need for this if you are staying within the confines of Tapestry itself.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org