The relative paths are only relevant when rendering a page. At that time, the base URL of the rendered page is known, it is the current request path. The issue for you is that you are effectively changing the base URL on the fly on the client side, and Tapestry isn't prepared for that.
On Thu, Jan 8, 2009 at 12:44 PM, raulmt <rau...@gmail.com> wrote: > > Thanks Howard. But is it normal that the path optimization doesn't considers > the context params of a page then? Are there cases where the context params > shouldn't be considered? (I understand that is the problem with the path > optimization, doesn't it?). > > > Howard Lewis Ship wrote: >> >> The Link interface has a method, toAbsoluteURI(), that does what you want. >> >> Unfortunately, Asset doesn't have that method. >> >> One approach would be to override the symbol >> SymbolConstants.FORCE_ABSOLUTE_URIS to "true". This turns off the >> request path optimizations that are causing you trouble. >> >> On Thu, Jan 8, 2009 at 11:29 AM, raulmt <rau...@gmail.com> wrote: >>> >>> Hi, >>> >>> I'm trying to obtain the URL of an image (which is in the context, but >>> the >>> path is obtained from the DB) to pass it to a Flash application. This is >>> the >>> line i'm using: >>> >>> String imageURL = assetSource.getAsset(null, sewerGraph.getMapImagePath() >>> , >>> threadLocale.getLocale()).toClientURL(); >>> >>> The value of sewerGraph.getMapImagePath() is "context:planos/plano1.png" >>> in >>> this example, and the result of the line above is >>> "../../planos/plano1.png". >>> This would be fine if I consider the URL of the page class in which this >>> line is executed, but the problem is this page has 2 variables of context >>> that onPassivate puts in the URL (the Page URL transform to >>> "pageURL/contextVar1/contextVar2). With that, the ../../planos/plano1.png >>> is >>> relativa to the contextVar2 portion of the URL and then producing a wrong >>> relative URL. >>> >>> What am i doing wrong? or is this a problem with context assets in the >>> AssetSource ? >>> >>> Regards. >>> >>> P.S.: if this is not very understandable, please ask me.... i haven't >>> slept >>> too much lately.... :( >>> -- >>> View this message in context: >>> http://www.nabble.com/Tapestry-AssetSource-tp21359198p21359198.html >>> Sent from the Tapestry - User mailing list archive at Nabble.com. >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >>> For additional commands, e-mail: users-h...@tapestry.apache.org >>> >>> >> >> >> >> -- >> Howard M. Lewis Ship >> >> Creator Apache Tapestry and Apache HiveMind >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> >> > > -- > View this message in context: > http://www.nabble.com/Tapestry-AssetSource-tp21359198p21360591.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org