[T5.1] Application-versioned asset paths possible in CSS?
Hi all, I have a T5.1 webapp with a CSS that defines several background images and I would like to take advantage of Tapestry's asset caching and app-version-specific URLs. Is there any way to achieve this in T5.1 ? Should I perhaps code my own filter to process CSS url(...) elements? Cheers, Vassilis - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Ajax.Request to handle a multizone update?
Hi, in a page I would do the following (not really sure if you may apply this in a component, however I see no reason why you shouldn't be able to do this): 1. Include an eventlink (even if you don't want the ajax update to be invoked by means of clicking the link, include it and hide it with display:none) style="display:none"> ... ... 2. If you want to invoke this through javascript use the following javascript statement: $T('ajaxZone1').zoneManager.updateFromURL($('ajaxUpdate').href); I obtain tapestry's zone manager for the zone and invoke updateFromURL using the url formatted by tapestry in the event link. 3. (obviously :)) handle the event in your code just like you do, returning a multi zone update object. Tapestry's js handles the zone updates once the ajax response is received on the client side. This has been working fine for me, you may want to have a look in tapestry.js - the implementation of updateFromURL will show you the next steps tapestry is going through to update the zones on the client-side. Cheers, Vassilis On 18/05/10 10:27, Paul Stanton wrote: Hi all, I've set up an Ajax.Request to call a listener method in my component. The listener method returns a MultiZoneUpdate. return new MultiZoneUpdate("myZone", myZone); // this will update more zones once I get it working My question is, what do I have to do in my onComplete (or onSucess) handler in the Ajax.Request to actually perform the zone updates on the client? Or is there a better method of calling and handling an event listener which returns a MultiZoneUpdate than Ajax.Request? Thanks, p. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Redirect not from onActivate
Hi, I have seen a how-to on tapestry's wiki that describes how to implement a RedirectException which, when thrown from any part of your code, will perform a redirect (similar to the RedirectException that used to exist in Tapestry 4): http://wiki.apache.org/tapestry/Tapestry5RedirectException I have never really tried this, but could fulfill your needs. Cheers, Vassilis On Feb 24, 2010, at 21:11 , Algirdas wrote: > > Hello, > > Is there any way to do a redirect from any method? > > For example I have EnsureUserLoggedIn() which should redirect to Login page, > but this is called not in onActivate() method. > > I used response.sendRedirect(link), but since upgrage to 5.1.0.5 it throws > NPE > > > > org.apache.tapestry5.internal.services.ResponseCompressionAnalyzerImpl.isCompressable(ResponseCompressionAnalyzerImpl.java:65) > > $ResponseCompressionAnalyzer_126fd51477a.isCompressable($ResponseCompressionAnalyzer_126fd51477a.java) > > org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.openResponseOutputStream(BufferedGZipOutputStream.java:77) > > org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.checkForCutover(BufferedGZipOutputStream.java:70) > > org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.write(BufferedGZipOutputStream.java:116) > > Algirdas > -- > View this message in context: > http://n2.nabble.com/Redirect-not-from-onActivate-tp4627871p4627871.html > Sent from the Tapestry Users 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 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
URL Rewriter to support rewriting port
Hi all, I am using Tapestry 5.1.0.5 for a facebook application (which means that the Tapestry application is rendered within an iframe provided by facebook). Facebook applications have URLs of the form: http://apps.facebook.com/appName Facebook will adjust the iframe source attribute so that http://apps.facebook.com/appName/invite will render http://myserver.com/myapp/invite within the iframe (supposing http://myserver.com/myapp/ is my tapestry application). For each PageLink that is rendered, I want to rewrite the URL so that I can reload the top document using a URL in http://apps.facebook.com/appName/invite format, instead of a relative URL that is normally rendered. I have tried using a URLRewriterRule, however this will only rewrite the serverName & path elements. After some work to track down where I can render my own base URL (credits to Uli from #tapestry for helping!) it seemed I had to override the default RequestSecurityManager service so that I would provide an absolute base URL of "http://apps.facebook.com"; to page links. After many tries, I still have PageLinks' being rendered with my local server's port (my tomcat is running on port 8084), as follows: http://apps.facebook.com:8084/appName/invite I have tracked down this issue to the following method in ComponentEventLinkEncoderMethodAdvice: String fullUrl(Request request) { String protocol = request.isSecure() ? "https://"; : "http://";; final int localPort = httpServletRequest.getLocalPort(); String port = localPort == 80 ? "" : ":" + localPort; final String path = request.getPath(); final String contextPath = request.getContextPath(); return String.format("%s%s%s%s%s", protocol, request.getServerName(), port, contextPath, path); } which seems to ignore the base URL provided by the BaseURLSource service (or any other service...) and assumes that httpServletRequest.getLocalPort() is fine. Could you please advise if there is any way to achieve rewriting the port in Tapestry as is or should I file a bug on the issue? Many thanks in advance, Vassilis - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org