Hi Thiago! My code handles properly all event URL's, however not in the following scenario: localhost ( this is index page ) and it can't handle any event url from there, however, in all other scenarios ( for instance if I type localhost/about in my browser bar, it gets me to about page, and from there every event link works just fine ). To be more clear to you, here is the matrix of scenarios and is as follows:
localhost/about -> localhost ( works ) localhost/about -> localhost/contact ( works ) localhost/* -> localhost/* ( works, where * denotes any page ) localhost -> localhost/* ( doesn't work ) Also, how could I change to ComponentEventLinkEncoder, change what? > To: users@tapestry.apache.org > Subject: Re: Index broken reference > Date: Mon, 29 Jul 2013 07:56:18 -0300 > From: thiag...@gmail.com > > On Sun, 28 Jul 2013 17:15:08 -0300, Nomen Nominus <geribi...@outlook.com> > wrote: > > > My code for links is just fine, and I see no reason why it's not working > > in the one case, and works in the next. > > Your Dispatcher may not be working in 100% of the situations. > > > Maybe, following code is > > public class ProtectPageService implements Dispatcher { > > Dispatchers are supposed to return content in requests. This is not the > case here, so you can write a Dispatcher and make it work, but writing a > RequestFilter would be more adequate > > > > > private final static String LOGIN_PAGE = "/"; > > private ApplicationStateManager applicationStateManager; > > private final ComponentClassResolver componentClassResolver; > > private final ComponentSource componentSource; > > > > public ProtectPageService(ApplicationStateManager asm, > > ComponentClassResolver resolver, ComponentSource componentSource) { > > this.applicationStateManager = asm; > > this.componentClassResolver = resolver; > > this.componentSource = componentSource; > > } > > > > public boolean dispatch(Request request, Response response) throws > > IOException { > > /* > > * We need to get the Tapestry page requested by the user. So we > > parse the path extracted from the request > > */ > > You're trying to parse URLs yourself. That's a bad idea: First, you don't > need to: the ComponentEventLinkEncoder service and its decode() methods > already do that for you. That's exactly what Tapestry itself uses. Second, > *your code* is probably not handling event URLs correctly. Just change it > to using ComponentEventLinkEncoder and it'll work. > > -- > Thiago H. de Paula Figueiredo > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org >