tapestry-service-cache with tapestry 5.3.*
I want to use tapestry-service-cache ( https://github.com/ciaranw/tapestry-service-cache ) ,but it has a bug with tapestry 5.3.* In tapestry 5.3.* ,ServiceResources. getImplementationClass(), just return null; but in class com.ciaranwood.tapestry.cache.services.advice.CacheMethodDecoratorImpl ,is there a replacement of this or another way to use? souce code in com.ciaranwood.tapestry.cache.services.advice.CacheMethodDecoratorImpl public T T build(ClassT serviceInterface, T delegate, ServiceResources resources) { String serviceId = resources.getServiceId(); Logger log = resources.getLogger(); ClassT implementation = resources.getImplementationClass(); if(implementation == null) { return delegate; }
Re: confused using tapestry page to return json data
Yes ,I do think pages / components don't need a template,I'm using tapestry 5.3.4 On Wed, Aug 29, 2012 at 4:49 PM, Lance Java lance.j...@googlemail.comwrote: Pages / components don't need a template. If your page always returns a StreamResponse from onActivate() then it should not have a template. I'm not sure why you're seeing this strange behaviour though? I would have assumed that tapestry would ignore the TML. -- View this message in context: http://tapestry.1045711.n5.nabble.com/confused-using-tapestry-page-to-return-json-data-tp5715865p5715871.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
confused with Page ContextType and onActivate with StreamResponse
Some code like this Page class public class SearchUser{ @ActivationRequestParameter(value=filer) private String filter; @Inject private IStaffService staffService; private String staffId; protected void onActivate(String staffId){ this.staffId = staffId; } StreamResponse onActivate(){ JSONObject json= new JSONObject(); return new TextStreamResponse(application/json, json.toString()); } }
Re: Lightweight TapestryTools update site
I just installed Tapestry Tools on Juno EE version. Installs fine. Green icon for .tml files works fine. Suggestion for variable expansion in tml file *does not* works fine... On Tue, Jul 24, 2012 at 8:23 AM, Chris Mylonas ch...@opencsta.org wrote: Hi Gavin, I just installed Tapestry Tools on Juno EE version. Installs fine. Green icon for .tml files works fine. Suggestion for variable expansion (ctrl space) in tml file works fine. Haven't tested anything else. OSX 10.6 Juno EE Great work! Cheers Chris On 24/07/2012, at 1:45 AM, Nicolas Barrera wrote: Hi Gavin, I 've just tested with a clean new installation of juno *CLASSIC* and It works like a charm, last time I was testing with Juno for Java developers. So I think that was the problem.., stick to Eclipse Classic! thanks again and sorry for the inconvenience, cheers! Nicolás.- On Mon, Jul 23, 2012 at 6:09 AM, Gavin Lei gavingui2...@gmail.com wrote: Hi Nicolas, I have not UBuntu environment, but it works well in Mac. I want to confirm what your problem is: 1. Can not see auto-complete panel in TML editor at all. 2. Can see auto-complete panel, but can not find Tapestry components in it. If it is problem 1, you should find out how to pop up auto-complete panel in your Eclipse. Thanks 2012/7/18 Nicolas Barrera nbarr...@gmail.com: I 'm running Ubuntu 12.04 LTS so it's woking for you in your environment :S, I 'm afraid I 'm doing something wrong... perhaps someone else has already test it in a linux environment and can tell us, well If you get to know about an issue and fix it please send an announcement here. thanks, and cheers Nicolás.- On Wed, Jul 18, 2012 at 12:16 PM, Gavin Lei gavingui2...@gmail.com wrote: Thanks for your work, Nicolas :-) You are in Windows or Mac? I will double check this issue. In my test of Eclipse Juno in Win 7, everything works well. If it appears here, i will fix it soon. 2012/7/18 Nicolas Barrera nbarr...@gmail.com: Hi Gavin, thanks for the quick As I told you I 'm using maven and I was careful that *through maven* tapestry-core*.jar was included as a dependency. Anyway as you told me to double check that, I 've manually added in build path configuration the tapestry-core*.jar and the behaviour is still the same... no auto-complete. I thought that perhaps maven was bringing in some trouble so I decided to start a new java web project, added tapetsry-core*.jar to the java build path library configuration, created a page using tapestrytools' wizard, added a @Property String hello; variable to the .java class... but that property isn't auto-completed within the tml editor when hitting ${ctrl+space, nor are tapestry core components when hitting t:ctrl+space In TML Editor if I click on design view it says: The document is empty. Right mouse click here to insert content. But, right clicking does nothing... and above that when switching to source I see that the document is NOT empty but has this content: html xmlns:t= http://tapestry.apache.org/schema/tapestry_5_1_0.xsd body /body /html Hope I 'm helping with some clues... regards, Nicolás.- On Wed, Jul 18, 2012 at 10:47 AM, Gavin Lei gavingui2...@gmail.com wrote: Hi Nicolas, Thank you for your feedback, TapestryTools' auto-complete feature need tapestry-core-*.jar which contains org.apache.tapestry5.corelib.components in your eclipse project build path. I think this is not a Juno version issue, please check your build path. Right click project - properties - Java build path - Libraries. 2012/7/18 Nicolas Barrera nbarr...@gmail.com: Hi Gavin, I wanted to ask this prior to open a new issue... I 'm testing TapestryTools 1.0.0.201207172033 with Eclipse Juno Version: Juno Release / Build id: 20120614-1722 and although tapestrytools seems to be working fine, auto-complete features aren't popping out when writing t:, nor responding when hitting ctrl+space, alt+/ I 'm using this maven archetype to generate the project where I 'm exercising this test (groupId=org.apache.tapestry; artifactId=quickstart; version=5.1.0.5) which depends on tapestry-core-5.1.0.5.jar I can see that dependency right inside the Maven Dependencies Library of the project. As I 've never tested tapestrytools in any other eclipse version so perhaps I 'm doing something wrong and wanted to check with you before submitting a new issue, do you think this may be an issue concerning Juno only? cheers and thanks! Nicolás.- On Tue, Jul 17, 2012 at 9:49 AM, Gavin Lei gavingui2...@gmail.com wrote: TapestryTools update at 2012-07-17: 1. Support Eclipse Juno now, the update site(both for Indigo and Juno) is still: http://tapestrytools.googlecode.com/svn/TapestryTools/ 2.Finish basic
How to add add a random number in requset path to avoid IE cache?
tynamo tapestry-security 0.4.0 role based url peimission questions
my config // public static void contributeSecurityConfiguration(ConfigurationSecurityFilterChain configuration, SecurityFilterChainFactory factory) { configuration.add(factory.createChain(/channel/**).add(factory.roles(), manager).build()); } if user does not have the manager role,request will redirect to error 401 error page. why not redirect to SecuritySymbols.UNAUTHORIZED_URL
Howard ,can you send me a copy of tapx based on tapestry 5.2.* ,Iwant to use tree components in my production Environment.
I can not find it on https://github.com/hlship/tapx, and can not update to 5.3.*
How can I add media=screen to tapestry build in css,such as default.css,tapestry-console.css...I'm using tapestry 5.2.6
thanks!
Re: How can I add media=screen to tapestry build in css,such as default.css,tapestry-console.css...I'm using tapestry 5.2.6
thanks for reply. I know how to add my own stylesheet like this. Now I want to know how to add this with tapestry build in default.css, core/tapestry-console.css On Sun, Aug 21, 2011 at 9:00 AM, Taha Hafeez tawus.tapes...@gmail.comwrote: @Environmental private JavaScriptSupport javaScriptSupport; @Inject @Path(context:layout/mycss.css) private Asset mycss; void afterRender() { javaScriptSupport.importStylesheet(new StylesheetLink(mycss, new StylesheetOptions(screen, null)) ); } On Sun, Aug 21, 2011 at 6:25 AM, jqzone jqz...@gmail.com wrote: thanks! -- Regards Taha Hafeez Siddiqi (tawus) http://tawus.wordpress.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Architecture advice for app and API
I want to do this too,but I don't konw how to do it. On Tue, Jun 14, 2011 at 8:40 AM, David Woods dwood...@gmail.com wrote: Hi, I am currently developing a SAAS webapp using Tapestry 5.2.5. My goal is to make much of the functionality also available as a RESTful web service, using tapestry-resteasy, for additional clients such as iPhone apps to use. I would really like my tapestry web client to use the same API that I am making available to others, but I am having difficulty with the exact architecture. Both the web client and the API will be served from the same tapestry webapp (at least initially), but this webapp will be installed on multiple servers. My prototype setup has the tapestry client pages interacting directly with the service classes behind the API, rather than calling the API through its RESTful interface. This has the advantage that it all happens on the same server, and I can avoid the latency involved with calls over the internet. I'd like to have my web client use the API as just another client, however I'm afraid that this means that the API calls will go over the internet and the application will become less responsive. What is the best practice for web services where the web client uses their own API? Is there a way of making sure that the call is routed to the same server that the client is using? Thanks David
Re: Hi,Howard ,need some help with Tapx component Dynamic
I'm sorry,that is own fault. My Resource implementation had some mistakes On Fri, May 20, 2011 at 2:34 PM, jqzone jqz...@gmail.com wrote: I'm using Tapx component Dynamic with some dynamic template,I meet a problem like this: My online shop application is designed to be able to change its template online. For example ,there are two template named as one and two.When I change template one to template two , it fails. I debug into the dynamic component ,It seems the parameter template is still the template one.How can I change it so the dynamic component can be without cache. thanks!
Re: [Tapestry Central] Rethinking JavaScript in Tapestry 5.3
That great! On Thu, Mar 17, 2011 at 8:17 AM, Howard hls...@gmail.com wrote: I've always had a love/hate relationship with JavaScript; some of the earliest motivations for Tapestry was to encapsulate that ugly JavaScript stuff so I don't have to worry about it again. However, as I've come to appreciate JavaScript, over time, as a powerful functional language, and not as an incompletely implemented object oriented language, my revulsion for the language has disappeared ... even reversed. Back around 2006, I started adding the client-side JavaScript features to Tapestry 5; this started with client-side form field validation, and grew to include a number of more sophisticated components. The good news is these features and components are fully encapsulated: they can be used freely throughout at Tapestry application without even knowing JavaScript. Tapestry includes the libraries (and related CSS documents) as needed, and encapsulates the necessary initialization JavaScript. The APIs for this were revamped a bit in Tapestry 5.2, but the core concept is unchanged. The bad news is that the client-side is directly linked to Prototype and Scriptaculous (which are bundled right inside the Tapestry JAR file). These were great choices back in 2006, when jQuery was new and undocumented (or so my quite fallible memory serves). It seemed safe to follow Rails. Now, of course, jQuery rules the world. I've been talking for a couple of years about introducing an abstraction layer to break down the Prototype/Scriptaculous dependency; meanwhile I've recently seen that Rails and Grails are themselves moving to jQuery. However, that abstraction layer is still important; I have clients that like MooTools; I have clients that are using YUI and ExtJS. Certainly, it would have been too ambitious to try to start with such an abstraction layer from day 1. At the time, I had no real idea what the relationship between JavaScript on the client, and the application running on the server, would look like. Also, my JavaScript skills in 2006 are a fraction of what they are now. With several years of coding complex JavaScript and Ajax components for Tapestry, for TapX, and for clients, I think I have a much better understanding of what the APIs and abstraction layers should look like. So suddenly, I have a number of goals: - Allow Tapestry to work on top any JavaScript framework - Support Prototype/Scriptaculous and jQuery as substrate frameworks out of the box - Make the built-in Tapestry library first class: documented and release-on-release compatible - Keep backwards compatibility to Tapestry 5.2 What I'm proposing is a gradual transition, over Tapestry 5.3 and 5.4, where new, documented, stable JavaScript APIs are introduced. and Tapestry and 3rd party libraries can code to the new APIs rather than to Prototype/Scriptaculous. The goal is that, eventually, it will be possible to switch the default substrate from Prototype/Scriptaculous over to jQuery. -- Posted By Howard to Tapestry Central at 3/16/2011 05:16:00 PM
Re: Is there anyway to change the behavior of ComponentTemplateSource,because I don't want to cache page templates or cache page templates with my own logic
hi,Howard,I'm using tax component Dynamic.It works fine. Now I would like to add a loop support just like freemaker in Dynamic,so it will support separating data and view. the freemaker sample code is : #list 0..n_ as n_ div class=giftBPic div class=giftBPicimg img height=80 width=115 alt=test src= /a/div pa href= target=_blank/a/p/div /#list Have you ever done this, I hope you can give me some suggestions.
asset expansion question
Hallo,I have a new question! I'm writing a asset expansion like this lmg src=${asset:uri:http://people.apache.org/~uli/images/tapestry.png} / I implememt a Resource using URI, and add a asset configure,It works well Now I want to change it like this img src=${asset:uri:images/tapestry.png}/img I want the server root path http://people.apache.org/~uli/ to be configurable ,so it can be configured using tapestry symbols.I tried this using AssetFactory,URIResource,and symbols,but failed Can anyone help me?
Re: asset expansion question
Here is my code. TemplateResource.java public class TemplateResource implements Resource{ private URI uri; public TemplateResource(String uri) { try { this.uri = new URI(uri); } catch (URISyntaxException e) { throw new RuntimeException(e); } } public TemplateResource(URI uri) throws MalformedURLException { this.uri = uri; } public TemplateResource(File file) throws MalformedURLException { this(file.toURI()); } public TemplateResource(URL url) throws URISyntaxException, MalformedURLException { this(url.toURI()); } protected Resource newResource(String uri) { return new TemplateResource(uri); } @Override public boolean exists() { InputStream is = null; try { is = uri.toURL().openStream(); int i = is.read(); return true; } catch (Exception e) { return false; } finally { try { if (is != null) is.close(); } catch (Exception e) { // do nothing } } } @Override public Resource forFile(String relativePath) { return createResource(relativePath); } @Override public Resource forLocale(Locale locale) { for (String path : new LocalizedNameGenerator(this.uri.toString(), locale)) { Resource potential = createResource(path); if (potential.exists()) return potential; } return null; } private Resource createResource(String path) { if (this.uri.toString().equals(path)) return this; return newResource(path); } @Override public String getFile() { String fileName = ; String completePath = toURL().getPath(); if (completePath != null) { if (completePath.lastIndexOf('/') 0) fileName = completePath.substring(completePath.lastIndexOf('/') + 1); else fileName = completePath; } return fileName; } @Override public String getFolder() { String folderName = ; String completePath = toURL().getPath(); if (completePath != null) { int lastSlash = completePath.lastIndexOf('/'); if (lastSlash 0) folderName = completePath.substring(0, lastSlash); } return folderName; } @Override public String getPath() { return toURL().toExternalForm(); } @Override public InputStream openStream() throws IOException { return uri.toURL().openStream(); } @Override public URL toURL() { try { if (exists()) return uri.toURL(); } catch (Exception e) { // do nothing } return null; } @Override public Resource withExtension(String extension) { throw new RuntimeException(not implemented yet!); } @Override public boolean equals(Object obj) { if (obj == null) return false; if (obj == this) return true; if (obj.getClass() != getClass()) return false; TemplateResource other = (TemplateResource) obj; return other.getPath().equals(getPath()); } } TemplateAssetFactory.java public class TemplateAssetFactory implements AssetFactory { private final boolean invariant; private Resource rootResource; public TemplateAssetFactory() { this.invariant = true; } @Override public Asset createAsset(final Resource resource) { return new AbstractAsset(invariant) { @Override public String toClientURL() { return resource.getPath(); } @Override public Resource getResource() { return resource; } }; } @Override public Resource getRootResource() { rootResource = new TemplateResource(/); return rootResource; } } TemplateProvider.java @Target({ ElementType.PARAMETER, ElementType.FIELD, ElementType.METHOD }) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface TemplateProvider { } TemplateAssetConstants.java public class TemplateAssetConstants extends AssetConstants { public static final String TEMPLATE = template; } Some config in AppModule.java @Marker(TemplateProvider.class) public AssetFactory buildTemplateAssetFactory() { return new TemplateAssetFactory(); } public void contributeAssetSource( MappedConfigurationString, AssetFactory configuration, @TemplateProvider AssetFactory templateAssetFactory) { configuration .add(TemplateAssetConstants.TEMPLATE, templateAssetFactory); } some code in tml : x:dynamic template=asset:template: http://192.168.1.105:8080/dynamic2.html; It works well. Now I wnat to change it like this x:dynamic template=asset:template:dynamic2.html I want the server root path http://192.168.1.105:8080/ is configurable using tapestry symbols,so how can i change my code ?
Is there anyway to change the behavior of ComponentTemplateSource,because I don't want to cache page templates or cache page templates with my own logic
I extending template locator just follow the link below,it works well. http://blog.tapestry5.de/index.php/2010/08/06/extending-template-lookup-mechanism/ My situation is ,when the same page is requested,I should check the config and decide which tml to use,for example ,different sub domains use different tml, ComponentTemplateSource caches the first requested template,so how can I change this?
Re: Is there anyway to change the behavior of ComponentTemplateSource,because I don't want to cache page templates or cache page templates with my own logic
Thanks ! Can you show me some code examples , I don't know how to decorate them. 2011/3/9 Igor Drobiazko igor.drobia...@gmail.com Currently, there is no built-in solution for it. We plan to add it in 5.3. See here: http://markmail.org/thread/d45pg6jpjc62e4qg Right now I have a proprietary solution decorating three services: http://tapestry.apache.org/tapestry5.2-dev/apidocs/org/apache/tapestry5/internal/services/PageSource.html http://tapestry.apache.org/tapestry5.2-dev/apidocs/org/apache/tapestry5/internal/services/PageLoader.html http://tapestry.apache.org/tapestry5.2-dev/apidocs/org/apache/tapestry5/internal/services/ComponentTemplateSource.html On Wed, Mar 9, 2011 at 10:08 AM, jqzone jqz...@gmail.com wrote: I extending template locator just follow the link below,it works well. http://blog.tapestry5.de/index.php/2010/08/06/extending-template-lookup-mechanism/ My situation is ,when the same page is requested,I should check the config and decide which tml to use,for example ,different sub domains use different tml, ComponentTemplateSource caches the first requested template,so how can I change this? -- Best regards, Igor Drobiazko http://tapestry5.de
Re: Is there anyway to change the behavior of ComponentTemplateSource,because I don't want to cache page templates or cache page templates with my own logic
Hi,Howard,that's what I want ! How can I do this? 2011/3/10 Howard Lewis Ship hls...@gmail.com What you want is a more complex page name (+ other information) mapping to page class, but something fixed and predictable ... and properly cached, for performance reasons. On Wed, Mar 9, 2011 at 1:08 AM, jqzone jqz...@gmail.com wrote: I extending template locator just follow the link below,it works well. http://blog.tapestry5.de/index.php/2010/08/06/extending-template-lookup-mechanism/ My situation is ,when the same page is requested,I should check the config and decide which tml to use,for example ,different sub domains use different tml, ComponentTemplateSource caches the first requested template,so how can I change this? -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Is there anyway to change the behavior of ComponentTemplateSource,because I don't want to cache page templates or cache page templates with my own logic
Do you mean this? https://github.com/hlship/tapx/blob/master/tapx-core/src/main/java/com/howardlewisship/tapx/core/components/Dynamic.java 在 2011年3月10日 上午3:33,Howard Lewis Ship hls...@gmail.com写道: 2011/3/9 jqzone jqz...@gmail.com: Hi,Howard,that's what I want ! How can I do this? I'm not sure off the top of my head. Thiago pointed out the underlying services that would need overriding. Currently, the page instance is derived from a key consisting of the canoncial page name and the user locale; this is used to locate and build the page instance. For 5.3/5.4 we want to extend this so that the key can be more complicated: more dimensions, so that it would be possible to identify other factors, such as virtual domain, or active skin, or such, to drive the location and creation of the page (and all components within the page). I think that where today we pass the Locale as a parameter, we need to pass around a more structured but more extensive object. In any case, right now, it takes surgery of the T5 code to get what you want. Perhaps you could accomplish your goals using something less drastic ... search the mailing list archives for information about the Dynamic component that's part of TapX. 2011/3/10 Howard Lewis Ship hls...@gmail.com What you want is a more complex page name (+ other information) mapping to page class, but something fixed and predictable ... and properly cached, for performance reasons. On Wed, Mar 9, 2011 at 1:08 AM, jqzone jqz...@gmail.com wrote: I extending template locator just follow the link below,it works well. http://blog.tapestry5.de/index.php/2010/08/06/extending-template-lookup-mechanism/ My situation is ,when the same page is requested,I should check the config and decide which tml to use,for example ,different sub domains use different tml, ComponentTemplateSource caches the first requested template,so how can I change this? -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.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 of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Is there anyway to change the behavior of ComponentTemplateSource,because I don't want to cache page templates or cache page templates with my own logic
OK,I will try this. If it supports tapestry tml grammar,it will be fine 在 2011年3月10日 上午4:03,Howard Lewis Ship hls...@gmail.com写道: Yes. 2011/3/9 jqzone jqz...@gmail.com: Do you mean this? https://github.com/hlship/tapx/blob/master/tapx-core/src/main/java/com/howardlewisship/tapx/core/components/Dynamic.java 在 2011年3月10日 上午3:33,Howard Lewis Ship hls...@gmail.com写道: 2011/3/9 jqzone jqz...@gmail.com: Hi,Howard,that's what I want ! How can I do this? I'm not sure off the top of my head. Thiago pointed out the underlying services that would need overriding. Currently, the page instance is derived from a key consisting of the canoncial page name and the user locale; this is used to locate and build the page instance. For 5.3/5.4 we want to extend this so that the key can be more complicated: more dimensions, so that it would be possible to identify other factors, such as virtual domain, or active skin, or such, to drive the location and creation of the page (and all components within the page). I think that where today we pass the Locale as a parameter, we need to pass around a more structured but more extensive object. In any case, right now, it takes surgery of the T5 code to get what you want. Perhaps you could accomplish your goals using something less drastic ... search the mailing list archives for information about the Dynamic component that's part of TapX. 2011/3/10 Howard Lewis Ship hls...@gmail.com What you want is a more complex page name (+ other information) mapping to page class, but something fixed and predictable ... and properly cached, for performance reasons. On Wed, Mar 9, 2011 at 1:08 AM, jqzone jqz...@gmail.com wrote: I extending template locator just follow the link below,it works well. http://blog.tapestry5.de/index.php/2010/08/06/extending-template-lookup-mechanism/ My situation is ,when the same page is requested,I should check the config and decide which tml to use,for example ,different sub domains use different tml, ComponentTemplateSource caches the first requested template,so how can I change this? -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.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 of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.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 of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Is there anyway to change the behavior of ComponentTemplateSource,because I don't want to cache page templates or cache page templates with my own logic
Thank. That's what I want! 在 2011年3月10日 上午4:14,jqzone jqz...@gmail.com写道: OK,I will try this. If it supports tapestry tml grammar,it will be fine 在 2011年3月10日 上午4:03,Howard Lewis Ship hls...@gmail.com写道: Yes. 2011/3/9 jqzone jqz...@gmail.com: Do you mean this? https://github.com/hlship/tapx/blob/master/tapx-core/src/main/java/com/howardlewisship/tapx/core/components/Dynamic.java 在 2011年3月10日 上午3:33,Howard Lewis Ship hls...@gmail.com写道: 2011/3/9 jqzone jqz...@gmail.com: Hi,Howard,that's what I want ! How can I do this? I'm not sure off the top of my head. Thiago pointed out the underlying services that would need overriding. Currently, the page instance is derived from a key consisting of the canoncial page name and the user locale; this is used to locate and build the page instance. For 5.3/5.4 we want to extend this so that the key can be more complicated: more dimensions, so that it would be possible to identify other factors, such as virtual domain, or active skin, or such, to drive the location and creation of the page (and all components within the page). I think that where today we pass the Locale as a parameter, we need to pass around a more structured but more extensive object. In any case, right now, it takes surgery of the T5 code to get what you want. Perhaps you could accomplish your goals using something less drastic ... search the mailing list archives for information about the Dynamic component that's part of TapX. 2011/3/10 Howard Lewis Ship hls...@gmail.com What you want is a more complex page name (+ other information) mapping to page class, but something fixed and predictable ... and properly cached, for performance reasons. On Wed, Mar 9, 2011 at 1:08 AM, jqzone jqz...@gmail.com wrote: I extending template locator just follow the link below,it works well. http://blog.tapestry5.de/index.php/2010/08/06/extending-template-lookup-mechanism/ My situation is ,when the same page is requested,I should check the config and decide which tml to use,for example ,different sub domains use different tml, ComponentTemplateSource caches the first requested template,so how can I change this? -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.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 of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.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 of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Hello,Can anyone tell how to use servlet session Listener with tapestry IoC services ?
Thank for your replies. Finally ,I found TapestryFilter has put registry into servlet context,so I do it like this, MyHttpSessionListoner.java @Override public void sessionDestroyed(HttpSessionEvent se) { //Get Tapestry IoC Registry Registry registry = (Registry) se.getSession().getServletContext().getAttribute(TapestryFilter.REGISTRY_CONTEXT_NAME); ISocialPartyOnlineService socialPartyOnlineService = registry.getService(ISocialPartyOnlineService.class); //Do my session sessionDestroyed logic } 2011/2/23 Kristian Marinkovic kristian.marinko...@porscheinformatik.at hi thiage, you're right HttpSessionActivationListener is another possibility :) i dont recreate the registry in my HttpSessionListener, i just reuse the one created by my tapestry listener My TapestryListener snippet (could be a filter): public class TapestryListener implements ServletContextListener { public static final String REGISTRY_CONTEXT_NAME = org.apache.tapestry5.application-registry; public void contextInitialized(ServletContextEvent sce) { // same code as in TapestryFilter registry = appInitializer.createRegistry(); // set registry in context context.setAttribute(REGISTRY_CONTEXT_NAME, registry); ... // same code as in TapestryFilter } } My HttpSessionListener: public final class MyHttpSessionListener implements HttpSessionListener { ... public void sessionDestroyed(HttpSessionEvent event) { HttpSession httpSession = event.getSession(); ... Registry registry = (Registry) httpSession.getServletContext().getAttribute(TapestryListener. REGISTRY_CONTEXT_NAME); if(registry == null) throw new RuntimeException(No Tapestry registry found. Please check that TapestryListener or -Filter is added as listener); ... //do something } } g, kris Von:Thiago H. de Paula Figueiredo thiag...@gmail.com An: Tapestry users users@tapestry.apache.org, Kristian Marinkovic kristian.marinko...@porscheinformatik.at Datum: 23.02.2011 12:15 Betreff:Re: Hello,Can anyone tell how to use servlet session Listener with tapestry IoC services ? On Wed, 23 Feb 2011 06:18:24 -0300, Kristian Marinkovic kristian.marinko...@porscheinformatik.at wrote: we've written an own listener (you can create a filter as well) that starts tapestry. this listener saves the registry in the servlet context so another serlvet listener can then access it. we use it in a HttpSessionListener to clear lock if the user session expires. My approach was to use a RequestFilter to put in the session an object that implements HttpSessionActivationListener. It will be notified when the session is created and when its destroyed. No need to create the Registry manually. :) -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: onActivate called before onSuccessFrom
I met this problem before , I change the onActivatereturn type to void . 2011/2/17 Alessandro Badin jave...@gmail.com Hello guys, What about I have something like this: Object onActivate() { condition = service.findSomething(); return (condition == null) ? OtherPage.class : null; } Thanks. Alessandro Badin -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-onActivate-called-before-onSuccessFrom-tp2430026p3389328.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
Re: Hello,Can anyone tell how to use servlet session Listener with tapestry IoC services ?
Can you show me the code ? 2011/2/23 Kristian Marinkovic kristian.marinko...@porscheinformatik.at we've written an own listener (you can create a filter as well) that starts tapestry. this listener saves the registry in the servlet context so another serlvet listener can then access it. we use it in a HttpSessionListener to clear lock if the user session expires. g, kris Von:jqzone jqz...@gmail.com An: Tapesty users@tapestry.apache.org Datum: 23.02.2011 08:10 Betreff:Hello,Can anyone tell how to use servlet session Listener with tapestry IoC services ?
Hello,Can anyone tell how to use servlet session Listener with tapestry IoC services ?
Re: Hello,How can I add a dynamic value in URL,just like encode current locale
Thanks for all your replies! Actually,We are developing an application in Multi-Tenant mode,Every tenant shares the same web domain.In a private network(every tenant login in before use the app for example),tapestry works well.But now we meet a new problem,our customers need to publish some pages to SNS(FaceBook,twitter...),so I want to perssit the current tenant id into urls ,In this way when people come from external links,we can know which tenant they wants to see. I have looked into tapestry's source code,the way tapesty deals with encoding locale into path is just the way we want.So I want to know how to implement this winthout changing tapestry's source code. Can anyone help me ?