You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by paha <ch...@yahoo.com> on 2010/01/10 18:48:54 UTC

T5: Yet another relative path question

Hello, 

sorry for my newbie question and poor english, but i was unable to find an
answer neither in tutorials nor in this maillist. 
i want my tapestry filter to process all request going to let's say
http://www.someurl.com/myapp/...
(to let requests going to root be processed by some other servlet)
what is the best practice (some tapestry magic) of taking into account this
"relative" path when referring pages inside of  components like PageLink
etc.
what should be written here
<t:pagelink page="${my_root_context}/administration/user/create">create
user</t:pagelink> to honor /myapp relative path?
because now if my index page is located at localhost/myapp/Index pagelink to
administration/user renders to localhost/administration/user and not to
localhost/myapp/administration/user

the only idea i've got is to resolve the root context in the parent page
with request.getPath() and to supply it in every page via parent class
property or something - don't really like to reinvent a wheel :) especially
if there is some common solution to this problem




-- 
View this message in context: http://old.nabble.com/T5%3A-Yet-another-relative-path-question-tp27100545p27100545.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: T5: Yet another relative path question

Posted by paha <ch...@yahoo.com>.

Thiago H. de Paula Figueiredo wrote:
> 
> As far as I know, Tapestry only works if you set its URL to /* in web.xml.
> 
well it does work under myapp/* , but page links are still mapped to root :(
. not big deal. thanks anyway
-- 
View this message in context: http://old.nabble.com/T5%3A-Yet-another-relative-path-question-tp27100545p27111136.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: T5: Yet another relative path question

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Sun, 10 Jan 2010 19:52:10 -0200, paha <ch...@yahoo.com> escreveu:

> ok, but it doesn't change the fact that if it is run not under host/...  
> but under host/myapp/...

As far as I know, Tapestry only works if you set its URL to /* in web.xml.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

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


Re: T5: Yet another relative path question

Posted by paha <ch...@yahoo.com>.

Thiago H. de Paula Figueiredo wrote:
> 
> Tapestry is a servlet filter, not a servlet, so it can be used with  
> servlets without interfering with them. 
> 
ok, but it doesn't change the fact that if it is run not under host/... but
under host/myapp/... all urls are still translated to absolute and not to
relative ones? may be i've done something wrong in my embedded jetty
configuration :(  (i don't use web.xml and create all servlets and mappings
in java code)



Thiago H. de Paula Figueiredo wrote:
> 
> Add this to AppModule:
> 
> public static void contributeIgnoredPathsFilter(Configuration<String>  
> configuration) {
>      configuration.add("/else/.*");
> }
> i know this trick, but i don't have a problem of servlet and tapestry
> interfering now. i have a problem of relative urls not being treated
> properly. 


-- 
View this message in context: http://old.nabble.com/T5%3A-Yet-another-relative-path-question-tp27100545p27102935.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: T5: Yet another relative path question

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Sun, 10 Jan 2010 15:48:54 -0200, paha <ch...@yahoo.com> escreveu:

> Hello,

Hi!

> sorry for my newbie question and poor english, but i was unable to find  
> an
> answer neither in tutorials nor in this maillist.
> i want my tapestry filter to process all request going to let's say
> http://www.someurl.com/myapp/...
> (to let requests going to root be processed by some other servlet)

Tapestry is a servlet filter, not a servlet, so it can be used with  
servlets without interfering with them. If you run into some problem, you  
can tell Tapestry to ignore some paths. Suppose you have a servlet  
handling requests to /else. Add this to AppModule:

public static void contributeIgnoredPathsFilter(Configuration<String>  
configuration) {
     configuration.add("/else/.*");
}

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

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