You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Waluk, Michael" <Mi...@workscape.com> on 2005/09/30 16:44:31 UTC

How to find location of a .page without the RequestCycle

In my ServiceEncoder I'd like to assign a servletPath that mimics the actual page location under WEB-INF.  For example, a link to the page located in 
    /WEB-INF/comp/Home.page 
would get the servletPath
    /comp/Home.page (or whatever extension is assigned).

Since the RequestCycle is not available (can't currently be injected) to the ServiceEncoders, I don't see how in Tapestry 4 (beta-8) I can determine the page location.  If I could somehow get the IPage instance it would be easy with 
    page.getLocation().getResource().getPath();
but I don't see how I can get the IPage or location without a RequestCycle.

The goal is to organize our site into applications and have the friendly URLs reflect this structure.  We're going to use this URL path in Filters for various permission-setting.  Tapestry 4 allows us to store the page and html in organized folders but we need a ServiceEncoder based upon the PageServiceEncoder(I think) to get the URLs to mimic this.

Any ideas?

Thanks,
Michael

***********************************************************************
This message is intended only for the use of the intended recipient and
may contain information that is PRIVILEGED and/or CONFIDENTIAL.  If you
are not the intended recipient, you are hereby notified that any use,
dissemination, disclosure or copying of this communication is strictly
prohibited.  If you have received this communication in error, please
destroy all copies of this message and its attachments and notify us
immediately.
***********************************************************************


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


Re: How to find location of a .page without the RequestCycle

Posted by Kent Tong <ke...@cpttm.org.mo>.
Waluk, Michael <Michael.Waluk <at> workscape.com> writes:

> In my ServiceEncoder I'd like to assign a servletPath that mimics the actual 
> page location under WEB-INF. 
> For example, a link to the page located in 
>     /WEB-INF/comp/Home.page 
> would get the servletPath
>     /comp/Home.page (or whatever extension is assigned).

I may not be understanding your question. The full page path is availabe
in the "page" parameter:

  http://localhost/myapp/app?service=page&page=comp/Home

So, your service encoder can easily convert it to:

  http://localhost/myapp/comp/Home.page

However, this is already provided by the page-service-encoder coming
with Tapestry. So you probably don't need to write your own.

--
Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)


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