Re: Tapestry 5.4-alpha-14
Would it be possible to include https://issues.apache.org/jira/browse/TAP5-2112, small improvement to autoload modules defined in war's meta-inf/manifest. Denis Jul 23, 2013 v 5:09 PM, Howard Lewis Ship hls...@gmail.com: What issue? On Tue, Jul 23, 2013 at 3:49 AM, Muhammad Gelbana m.gelb...@gmail.comwrote: Hopefully this issue would be addressed ? Thanks On Tue, Jul 23, 2013 at 2:55 AM, Howard Lewis Ship hls...@gmail.com wrote: I've been cranking out preview releases (for the benefit of a client project I've been moving from 5.3 to 5.4). In any case, the latest release came about because of my frustration with some testing (using Selenium and Geb). I was hitting problems, but the details were in the JavaScript console ... which Selenium makes (as far as I can tell) impossible to access. My solution was to resurrect the floating console and have an option that lets the floating console be present along with the browser's real JavaScript console. This allows all the console messages to be captured in the screen and content capture at the end of a failed test. See my twitter feed (@hlship) for some screen shots. Other changes: - ElementWrapper.fadeIn() and .fadeOut() have been removed - ElementWrapper.children() has been added - t5/core/builder module has been removed - t5/core/dom has a few new functions, including create() to create detached DOM elements - RequireJS errors are logged to the floating console and described in an expanded fashion - The t5/core/console module is exposed as window.t5console, so that Geb/Selenium tests can write to the console - RequireJS updated to latest version, 2.1.8 - Removed the well from around the alerts - TAP5-1914: Alerts needs a parameter to show/hide Dismiss all - TAP5-2064: Add 'info' style to info alerts - TAP5-1984: Do not invoke AjaxResponseRenderer callbacks when the response is an Ajax redirect Also, I learned that I don't need to be sending you a new URL for each preview release; they are all available from the Apache Staging repository: https://repository.apache.org/content/groups/staging -- 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 -- 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
Re: Tapestry IoC: @Startup with ordering constraint
I have tried to push exactly same idea but wasn't successful. https://issues.apache.org/jira/browse/TAP5-1842 Denis May 31, 2013 v 4:16 PM, Eli Doran e...@elidoran.com: There's already a @ServiceId annotation to specify the ID. This isn't a service exactly, it's close enough. On Fri, May 31, 2013 at 10:12 AM, Lance Java lance.j...@googlemail.comwrote: Perhaps a new annotation is required @OrderedStartup(id=doEarly, constraints=before:*) public static void doStuff() { … } @OrderedStartup(id=doStuff) public static void doStuff() { … } @OrderedStartup(id=doMoreStuff, constraints=after:doStuff) public static void doMoreStuff() { … } On 31 May 2013 14:50, Lance Java lance.j...@googlemail.com wrote: I'm not sure this would work. OrderedConfiguration requires that every entry has a unique id and @Startup does not require an id. I guess you could use ModuleClass.methodName for the default id but it's messy.
Re: Tapestry performance
Finally they have added test that actually tests web frameworks - Fortunes test but no Tapestry yet. Does anyone is going to contribute the fortune test? Performance can be black magic. On the one hand, I've heard some specific things about Node.js performance that are very positive. Certainly, when developing for Node, the virtually instance server startup is wonderful. Java has beaten us down into thinking that code needs lots of time to start up. It reminds me of a time a few year back when Ruby on Rails was a way to go - no threads and scale out using multiple instances. Denis May 7, 2013 v 3:48 AM, Rural Hunter ruralhun...@gmail.com: Here is a latest framework benchmark: http://www.techempower.com/benchmarks/#section=data-r4 How do you guys think about it? 于 2013/1/25 9:39, Howard Lewis Ship 写道: Performance can be black magic. On the one hand, I've heard some specific things about Node.js performance that are very positive. Certainly, when developing for Node, the virtually instance server startup is wonderful. Java has beaten us down into thinking that code needs lots of time to start up. However, Node.js is constantly switching contexts in significant ways. All those callbacks executing in, effectively, a chaotic order means that memory must be swept into and out of core quite constantly. In a Java-style synchronous server, the operating system has more clues about what memory should stay resident based on which threads have been recently active. Operating systems are very good at managing virtual memory, when you let them! It's probably impossible to compare things in an apples-to-apples way, however. I appreciate that single-thread simplicity of Node ... no locks, no deadlocks, no concerns about memory visibility between threads, no synchronize, no ConcurrentReadWriteLock, huzzah! The flip side is that in node you have to always be on your toes w.r.t. to writing everything in the callback style. That's not everyone's cup of tea ... and in some cases, can be truly complicated to manage, especially figuring out how to respond to errors when you are in the middle of an indeterminate number of partially executed work flows. On Thu, Jan 24, 2013 at 5:05 PM, Lenny Primak lpri...@hope.nyc.ny.uswrote: I was also surprised by the results when I saw them. This was a C++ project, not java, but the performance characteristics wouldn't be any different. This was also proprietary project for one of my old companies so I can't divulge anything else about it. What I can tell you, it comes down to a very simple fact: In all async servers, any single I/O operation comes down to 2 calls: poll() (or whatever equivalent you want to use) and read/write() There is also setup costs for poll() or its equivalents that are not present in a synchronous server. With synchronous server, there is no poll(), just the read and write, thus the overhead of the poll() and its setup is eliminated. Now it all comes down to the OS threading and I/O performance, and the real surprise was that the multiple threads, even 100s of thousands of them, all doing IO were not bogging down the system at all. I know that there is all hype right now around async servers, but in real world, async is just slow. I also believe that lightweight threads (green_threads, I believe) were eliminated from the JVM long time ago. On Jan 24, 2013, at 7:51 PM, Robert Zeigler wrote: I find this very difficult to swallow, at least for java apps, unless, maybe, you're using a java implementation that uses native threads instead of lightweight java threads, then I might believe it. I would also believe it if the async server is poorly written. And I can believe that many an async server is poorly written. It also depends a LOT on whether your connections are short or long lived. For something like a web server where you typically have very short-lived client connections, I can also believe this. I'm rather skeptical of general claims that an async server is slower, and would love to see some of the space research project worth of data backing the claims. Robert On Jan 24, 2013, at 1/249:29 AM , Lenny Primak lpri...@hope.nyc.ny.us wrote: I've done extensive ( no, not extensive, really, really, extensive, worthy of a space research project extensive ) testing of async IO performance vs. threaded server performance. The conclusion is that unless you have over 10,000 active, users, async IO is about 1/2 the performance of the usual thread-per-connection performance. By active users I mean connections that are actually putting out IO all the time, as opposed to just idle sitting connections. If you really, really, do have that many uses ( amazon.com type shop ) your bottleneck won't be at the web server level anyway, so the right thing to do is to load balance and scale out. Async IO won't solve any of these problems and will just introduce bugs and
Re: Tapestry performance
Isn't scaling out using multiple instances is the way to go? Yes, but I would better use more than one thread per process. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.3.5 candidate release dependency issue - yuicompressor
YUICompressor generates invalid JavaScript for me, maybe because of the Rhino conflict I don't know. I have switched to the Google Closure compiler it has better compression rate, better api and can even detect some IE only errors, from the svn repo it looks like it is an active project. For CSS compression I'm using CssCompressor class extracted from the YUI, it is only a single class without dependencies. Denis Aug 21, 2012 v 7:28 PM, Howard Lewis Ship hls...@gmail.com: On Tue, Aug 21, 2012 at 10:24 AM, Kalle Korhonen kalle.o.korho...@gmail.com wrote: On Tue, Aug 21, 2012 at 9:50 AM, Howard Lewis Ship hls...@gmail.com wrote: On Tue, Aug 21, 2012 at 8:29 AM, Kalle Korhonen kalle.o.korho...@gmail.com wrote: 2.4.7 wasn't available in Maven central for 5.3.4, see discussion at https://issues.apache.org/jira/browse/TAP5-1729. The pom specifies the correct repository. However, I can see 2.4.7 with the usual GAV coordinates is now available in central. Obtaining the play-compiled 2.4.7 seems to be a in issue for users, Howard, would you consider stopping the release and fixing this for 5.3.5 final? That would require a -1 vote and for me to redo the release. There's a bigger issue, that YUICompressor at runtime sometimes conflicts with the Rhino JS engine built into the JDK. It's been very frustrating that things work correctly in my test environment, but something in my client's deployment environment breaks YUICompressor pretty severely. Regarding the vote, I wasn't suggest you should stop it, but merely noting the possibility. As the release manager you can always stop the release for any reason though, or ignore -1's and go ahead with the release as long as you have the minimum binding votes... But boy, do you move fast :) I now see you withdrew the vote. I was going to suggest that perhaps we need to consider Lenny's solution for the rhino conflicts in the next release. I agree. I would appreciate some help on getting this correctly resolved! Kalle On Tue, Aug 21, 2012 at 4:59 AM, Blower, Andy andy.blo...@proquest.co.uk wrote: Hi, Having trouble installing the latest version of tapestry-yuicompressor for the candidate release being voted on, T5.3.5. It seems that the organisation for the yuicompressor module was changed from com.yahoo.platform.yui to com.google.code.maven-play-plugin.com.yahoo.platform.yui in T5.3.3, but since I've not updated since T5.3.2 was released I've not run into this issue. Basically I can't resolve this dependency. I can find com.yahoo.platform.yui/yuicompressor/2.4.7 but not com.google.code.maven-play-plugin.com.yahoo.platform.yui/yuicompressor/2.4.7 anywhere. What is the reason for this org change and what can I do to resolve this dependency? The rest of 5.3.5 looks good, but I can't +1 until this is resolved, although it's probably a simple thing. For info, here are the lines from my Ivy.xml dependency files for tapestry-yuicompressor, 5.3.2 first and 5.3.5 second. dependency org=com.yahoo.platform.yui name=yuicompressor rev=2.4.6 force=true conf=compile-compile(*),master(*);runtime-runtime(*)/ dependency org=com.google.code.maven-play-plugin.com.yahoo.platform.yui name=yuicompressor rev=2.4.7 force=true conf=compile-compile(*),master(*);runtime-runtime(*)/ Thanks, Andy. - 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 -- 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 - 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 Denis
Re: Tapestry 5.3.4 at JavaLobby
I have created dzone link http://www.dzone.com/links/new_release_apache_tapestry_534.html vote it up! Denis On 25.7.2012, at 2:12, Howard Lewis Ship wrote: Just a reminder; I'd still like to see a show of support on the JavaLobby announcement page. On Wed, Jul 18, 2012 at 2:45 PM, Howard Lewis Ship hls...@gmail.com wrote: As always, these release announcements are a good time to show your love in a visible way. http://java.dzone.com/announcements/apache-tapestry-534 I would love to see some posts that covered a few of these points - Tapestry keeps gettings easier/faster/better - Upgrades are easy (there's a persistent meme about how difficult Tapestry upgrade go dating back to the Tapestry 3/4 days) - Documentation and community keep getting better Keep it real; don't bash others; have fun! -- 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 -- 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: Tapestry 5.3.4-rc-5
Right, I should known that it will not lock when there are some readers. Denis Jun 14, 2012 v 7:28 PM, Howard Lewis Ship: I'm already somewhat unhappy at the complexity of the code; I'd prefer not to make it any more complicated. I think race conditions on the write lock are going to be pretty rare and probably only occur on a somewhat saturated server at initial startup. I think twisting the code ever further. In addition, in a ReentrantReadWriteLock, the write lock appears to return false if any thread has the read lock, which could result in the initialization code never being run. On Thu, Jun 14, 2012 at 2:36 AM, Denis Stepanov denis.stepa...@gmail.comwrote: Concurrency topic: Would it be possible to change the lazy init to check if write lock is already locked? It will eliminate the posibility of locking the write lock by more then one thread. try { readLock.lock(); if(is need to init) { boolean hasWriteLock = false; try { readLock.unlock(); hasWriteLock = writeLock.tryLock(); // Could be locked only once if(hasWriteLock) doInit(); } finally { if(hasWriteLock) writeLock.unlock(); readLock.lock(); // If the write lock is locked read threads will wait } } return ... } finally { readLock.unlock(); } -- 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: Tapestry 5.3.4-rc-5
Concurrency topic: Would it be possible to change the lazy init to check if write lock is already locked? It will eliminate the posibility of locking the write lock by more then one thread. try { readLock.lock(); if(is need to init) { boolean hasWriteLock = false; try { readLock.unlock(); hasWriteLock = writeLock.tryLock(); // Could be locked only once if(hasWriteLock) doInit(); } finally { if(hasWriteLock) writeLock.unlock(); readLock.lock(); // If the write lock is locked read threads will wait } } return ... } finally { readLock.unlock(); }
Re: Problem injecting a Logger
Its looked like resources are not injected when javax.inject.Inject is used. Denis Jun 14, 2012 v 2:31 AM, Howard Lewis Ship: I'm not seeing anything here. How about you put your source into a Gist ( gist.github.com) and paste the URL here? On Wed, Jun 13, 2012 at 3:12 PM, Muhammad Gelbana m.gelb...@gmail.comwrote: That's all the source for My.java. Tapestry version is 5.3 I intend to upgrade to the latest version very soon anyway. On Wed, Jun 13, 2012 at 11:17 PM, Howard Lewis Ship hls...@gmail.com wrote: What version of Tapestry is this? Can we see more source for com.skycomm.charts.My? On Wed, Jun 13, 2012 at 11:41 AM, Muhammad Gelbana m.gelb...@gmail.com wrote: The exception shows that I'm importing org.apache.log4j.Logger which is a mistake but the same happens if I fix the import to become org.slf4j.Logger The long exception stack trace again: 13-06-12 20:39:21 ERROR (OperationTrackerImpl.java:127)-[main] No service implements the interface *org.slf4j.Logger*. 13-06-12 20:39:21 ERROR (OperationTrackerImpl.java:128)-[main] Operations trace: 13-06-12 20:39:21 ERROR (OperationTrackerImpl.java:137)-[main] [ 1] Realizing service RegistryStartup 13-06-12 20:39:21 ERROR (OperationTrackerImpl.java:137)-[main] [ 2] Instantiating service RegistryStartup implementation via org.apache.tapestry5.ioc.internal.services.RegistryStartup(Logger, List) (at RegistryStartup.java:36) via org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder) (at TapestryIOCModule.java:49) 13-06-12 20:39:21 ERROR (OperationTrackerImpl.java:137)-[main] [ 3] Creating plan to instantiate org.apache.tapestry5.ioc.internal.services.RegistryStartup via public org.apache.tapestry5.ioc.internal.services.RegistryStartup(org.slf4j.Logger,java.util.List) 13-06-12 20:39:21 ERROR (OperationTrackerImpl.java:137)-[main] [ 4] Determining injection value for parameter #2 (java.util.List) 13-06-12 20:39:21 ERROR (OperationTrackerImpl.java:137)-[main] [ 5] Collecting ordered configuration for service RegistryStartup 13-06-12 20:39:21 ERROR (OperationTrackerImpl.java:137)-[main] [ 6] Invoking com.skycomm.cth.services.AppModule.contributeRegistryStartup(OrderedConfiguration, Logger) (at AppModule.java:315) 13-06-12 20:39:21 ERROR (OperationTrackerImpl.java:137)-[main] [ 7] Reloading class com.skycomm.charts.My. 13-06-12 20:39:21 ERROR (OperationTrackerImpl.java:137)-[main] [ 8] Creating plan to instantiate com.skycomm.charts.My via public com.skycomm.charts.My() 13-06-12 20:39:21 ERROR (OperationTrackerImpl.java:137)-[main] [ 9] Calculating possible injection value for field com.skycomm.charts.My.log (org.slf4j.Logger) 13-06-12 20:39:21 ERROR (OperationTrackerImpl.java:137)-[main] [10] Resolving object of type org.slf4j.Logger using MasterObjectProvider 13-06-12 20:39:23 ERROR (RecursiveServiceCreationCheckWrapper.java:64)-[main] Construction of service RegistryStartup failed: Error invoking service contribution method com.skycomm.cth.services.AppModule.contributeRegistryStartup(OrderedConfiguration, Logger): No service implements the interface org.slf4j.Logger. java.lang.RuntimeException: Error invoking service contribution method com.skycomm.cth.services.AppModule.contributeRegistryStartup(OrderedConfiguration, Logger): No service implements the interface org.slf4j.Logger. at org.apache.tapestry5.ioc.internal.ContributionDefImpl.invokeMethod(ContributionDefImpl.java:130) at org.apache.tapestry5.ioc.internal.ContributionDefImpl.contribute(ContributionDefImpl.java:80) at org.apache.tapestry5.ioc.internal.RegistryImpl$9.run(RegistryImpl.java:630) at org.apache.tapestry5.ioc.internal.OperationTrackerImpl$1.invoke(OperationTrackerImpl.java:51) at org.apache.tapestry5.ioc.internal.OperationTrackerImpl$1.invoke(OperationTrackerImpl.java:48) at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74) at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run(OperationTrackerImpl.java:47) at org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.run(PerThreadOperationTracker.java:76) at org.apache.tapestry5.ioc.internal.RegistryImpl.addToOrderedConfiguration(RegistryImpl.java:626) at org.apache.tapestry5.ioc.internal.RegistryImpl.getOrderedConfiguration(RegistryImpl.java:480) at org.apache.tapestry5.ioc.internal.ServiceResourcesImpl$2.invoke(ServiceResourcesImpl.java:110) at org.apache.tapestry5.ioc.internal.ServiceResourcesImpl$2.invoke(ServiceResourcesImpl.java:107) at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74) at org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87) at org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1121) at
Re: Tapestry 5.3.4-rc-5
Could be https://issues.apache.org/jira/browse/TAP5-1873 fixed? There is a missing parameter in a call and improved exception logging. Thanks, Denis Jun 11, 2012 v 8:36 PM, Howard Lewis Ship: On Wed, Jun 6, 2012 at 5:37 PM, Cezary Biernacki cezary...@gmail.com wrote: On Thu, Jun 7, 2012 at 1:27 AM, Howard Lewis Ship hls...@gmail.com wrote: You can even omit synchronized and volatile IFF: - only a single shared field is updated - it is ok for a race condition to exist that would create the value on multiple threads - (I learned this by getting schooled on the subject by Rich Hickey) There are many things in Tapestry that don't fit this model. Sometimes the value being lazily created is so expensive, it would be invalid to allow multiple threads to create it. In other cases, more than one shared field is updated. Hm, but the second check inside 'synchronized' block is supposed to avoid creating value on multiple threads. For example: private volatile Messages messages; public Messages getMessages() { if (messages != null) { return messages; } synchronized (this) { if (messages != null) { return messages; } messages = elementResources.getMessages(componentModel); // --- only called if no other thread did this before } return messages; } After review, in this one specific case, I've removed the concurrency code; the change to the messages field is individual and atomic, and the value from the elementResources.getMessages() method is cached by the eventual service implementation. Cezary -- 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: Tapestry Transactions
OpenSessionInViewFilter has nothing to do with detached entities, it only keeps session open till view is rendered otherwise lazy loading will no work. The filter is trying to solve it by always opening session in every request and closing it at the end. Tapestry hibernate opens session only when it is needed and closes it when thread is finished, it is how it should be, but if you use spring hibernate + tx you need to use it there is no way around it. Denis May 22, 2012 v 3:59 PM, bhorvat: The thing is I am not sure for what it is used in the first place. Based on everything that I have read it it seams to me that you use it to keep the session open until you are done with the rendering of the tml. Say that you load an object and that object has a list of objects in it, and you try to access the list in the tml page with say the loop component. Now if you dont use the OpenSessionInViewFilter you should get an exception (LazyInitalization). However I dont get that exception, so I was wondering (since most of the stuff for OSIVF is a bit old) is tapestry now handling this itself (tapestry-hibernate that is) or am I miss understanding what the filter is used for in the first place? I would like to solve 2 problems with this transaction. The first one is the LazyInitalization. I always have to reload the object in the methods that handle the form if I need to use some list of objects that have not been used when the page was rendered. The second problem is that I want to put Transaction annotation or something like that so that I have transaction behavior instead of having every part of (what should be single transaction) commit independently. tnx for your help cheers -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-Transactions-tp5713299p5713314.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 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: high thread contention during load test on InternalComponentResourcesImpl.postRenderCleanup and org.apache.tapestry5.internal.util.NamedSet.getValues
Would it be better to put synchronized block inside null check block like: if (renderVariables == null) { synchronized(this) { ... If I'm not mistaken resetParametersConduits doesn't need to be synchronized it should only change per thread value. Denis May 11, 2012 v 6:06 PM, Howard Lewis Ship: That's an interesting result. Why, oh why, did I ever implement render variables? So the conventional thinking on synchronized methods is that they where there is limited contention, and the method is short, synchronized is the best way to go. This method exists, and is synchronized, to avoid creating a PerThreadValue to store the render variable's Map on every component and mixin in the application. That adds up, given that only a tiny percentage of pages or components will ever use a render variable. I'd be willing to replace this code with something that uses an explicit per-instance Lock ... that would likely help with your high contention issues, as after the PerThreadValue is created, and the write lock is released, there would no longer be contention, as all threads could share the read lock. I can put that together shortly and crank out a 5.3.4-rc-1 snapshot, if you can then pick it up and test it. Further comments here: https://issues.apache.org/jira/browse/TAP5-1929 On Fri, May 11, 2012 at 6:07 AM, Robert Lentz rob...@teksolv.de wrote: Hi All, we want to rollout a Tapestry app very shortly, but we struggle with load testing issues. We are currently load testing on one Tomcat 6.0.32: - 500 worker threads, tapestry.production-mode=true - Intel(R) Xeon(R) CPU X7460 @ 2.66GHz - OpenJDK Runtime Environment (IcedTea6 1.7.10) (rhel-1.20.b17.el5-x86_64) OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)) and 2 loadrunner test clients. After ramping up the concurrent requests (about 5min) we reach the maximum at about 450req/sec and get server busy errors. We see a high thread contention on InternalComponentResourcesImpl.postRenderCleanup currently with the Loop component, as there 10 Loop on the Index page. Is there a workaround possible without removing the Loop component from the page to increase the throughput? The thread dumps series looks like this: 1 thread locks 0xe3858990 and over 400 threads are waiting. This lock is persistent over a thread dumps series. I guess the private synchronized MapString, Object getRenderVariables(boolean create) call hits us. http-9080-188 daemon prio=10 tid=0x4d463000 nid=0x382a runnable [0x55b2f000] java.lang.Thread.State: RUNNABLE at org.apache.tapestry5.internal.transform.ParameterWorker$3$1.getState(ParameterWorker.java:206) at org.apache.tapestry5.internal.transform.ParameterWorker$3$1.reset(ParameterWorker.java:302) at org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl$1.work(InternalComponentResourcesImpl.java:136) at org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl$1.work(InternalComponentResourcesImpl.java:133) at org.apache.tapestry5.internal.util.NamedSet.eachValue(NamedSet.java:171) - locked 0xe3858990 (a org.apache.tapestry5.internal.util.NamedSet) at org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.resetParameterConduits(InternalComponentResourcesImpl.java:546) - locked 0xe385c038 (a org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl) at org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.postRenderCleanup(InternalComponentResourcesImpl.java:522) at org.apache.tapestry5.corelib.components.Loop.postRenderCleanup(Loop.java) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl$1.run(ComponentPageElementImpl.java:85) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:956) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$1800(ComponentPageElementImpl.java:61) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl$PostRenderCleanupPhase.render(ComponentPageElementImpl.java:443) at org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:72) at org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:124) at $PageRenderQueue_135675e1f6b934.render(Unknown Source) at $PageRenderQueue_135675e1f6b933.render(Unknown Source) at org.apache.tapestry5.internal.services.MarkupRendererTerminator.renderMarkup(MarkupRendererTerminator.java:37) ... http-9080-499 daemon prio=10 tid=0x4dffb000 nid=0x3b7d waiting for monitor entry [0x69063000] java.lang.Thread.State: BLOCKED (on object monitor) at org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.getRenderVariables(InternalComponentResourcesImpl.java:476) - waiting to lock 0xe385c038 (a
Re: when return streamResponse, Ajax stop working in tapestry5
Try to add ref=external, it has something to do with tapestry.js and unloading. Denis Mar 29, 2012 v 11:57 AM, Lance Java: I just re-read your entire message (nabble messed up your code) and realise that I have answered an unrelated question. Sorry - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: when return streamResponse, Ajax stop working in tapestry5
On your ActionLink. t:actionLink ref=external ... Denis Mar 29, 2012 v 1:25 PM, Athneria, Mahendra: Thanks Denis, Could please tell me where I can add ref=external in my code? Regards, Mahendra Athneria -Original Message- From: Denis Stepanov [mailto:denis.stepa...@gmail.com] Sent: Thursday, March 29, 2012 4:36 PM To: Tapestry users Subject: Re: when return streamResponse, Ajax stop working in tapestry5 Try to add ref=external, it has something to do with tapestry.js and unloading. Denis Mar 29, 2012 v 11:57 AM, Lance Java: I just re-read your entire message (nabble messed up your code) and realise that I have answered an unrelated question. Sorry - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos group liability cannot be triggered for the message content. Although the sender endeavors to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted. - 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: How to define a private service (a service only for another service)
It makes sense to have private services, would be nice to have services which will be only exposed to the services in the current module. Denis Mar 28, 2012 v 12:43 PM, Lance Java: I have never done this myself but see here for instantiating a Tapestry IOC registry yourself http://wiki.apache.org/tapestry/Tapestry5HowToIocOnly If you want the private registry to inherit the public registry I think that you will need to use RegistryBuilder.add(ModuleDef) http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/ioc/RegistryBuilder.html#add%28org.apache.tapestry5.ioc.def.ModuleDef%29 I am surprised that Tapestry does not eat it's own dogfood, I would have thought that Registry would have implemented ModuleDef or that there was at least an adapter available. http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/ioc/def/ModuleDef.html You may need to write a RegistryModuleDef which does a job to the SpringModuleDef http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/internal/spring/SpringModuleDef.html On Wednesday, 28 March 2012, fmaylinch ferranmayli...@gmail.com wrote: Lance Java wrote Perhaps a solution is to setup a second, private Tapestry IOC registry for defining your private services. Your public service then looks up the private service from the private registry instead of from the public registry. Interesting solution... any help on how to do that will be appreciated. Anyway, I think that this solution means there would be many private services together, and they will be available to services they don't belong to. For example, if A1 needs A2 and B1 needs B2, your solution is to put A1 and B1 in the public default registry and A2 and B2 in another private registry. But that way A1 could access B2 when that is not our intention. But thank you! Maybe we could use that idea somehow. As I said, can you explain me how to do that or give me some ideas? -- View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-define-a-private-service-a-service-only-for-another-service-tp5597443p5600049.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 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Communication with the server failed: undefined
https://issues.apache.org/jira/browse/TAP5-1873 There is a description what should you change to make it work, copy function from tapestry.js, apply changes and replace it: Tapestry.ajaxRequest = ... and for better loging: Tapestry.ajaxExceptionHandler = ... Denis Mar 26, 2012 v 1:14 PM, Beat Durrer: I have this issue too. It occured with the ZoneUpdater from the jumpstart project (http://jumpstart.doublenegative.com.au/) It does not happen in every combination and I couldn't find out what's causing it so I gave up in the end. The code itself works as expected, but it records this error message on each roundtrip. 2012/3/26 Anuj Mittal anmit...@adobe.com: Hi All, I am calling server side function using ajax depending on the select control and updating a zone accordingly. Everything is working perfectly except I got Communication with the server failed: undefined on every ajax call. Has anybody faced this issue? With Regards, Anuj Mittal - 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: Why not setter injection or thread-safe field @Inject?
Where did you read about fields injection not being thread safe? It's definitely not true. Some developers like to use constructor injection because of better testing etc. personally I'm using mostly field injection. Setter injection is just not implemented, IMHO IOC should support method injection when it's annotated with @Inject just like JSR-330 describes it. Denis Mar 20, 2012 v 10:01 AM, Ferran Maylinch: Hello, Reading the documentation, I assume Tapestry does not perform setter injection (like Spring). Also, I've read that @Inject directly into fields is not thread-safe so constructor injection or build* methods are the recommended ways. I wonder why Tapestry does not allow setter injection and thread-safe @Inject if build* methods are already thread-safe (aren't they?). Setter injection would be something similar: Tapestry would instantiate the service and set dependencies before letting anyone use the service (as I presume it does with build* methods). Field @Inject would be something similar too. Thank you - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Why not setter injection or thread-safe field @Inject?
Calling setAcessible on the same field from different threads is not thread-safe, but it's a special case, don't be affraid to use field injection. Denis Mar 20, 2012 v 1:49 PM, fmaylinch: Denis Stepanov-2 wrote Where did you read about fields injection not being thread safe? It's definitely not true. Some developers like to use constructor injection because of better testing etc. personally I'm using mostly field injection. Here: http://tapestry.apache.org/defining-tapestry-ioc-services.html#DefiningTapestryIOCServices-FieldInjection Field Injection It says: Caution: injection via fields uses reflection to make the fields accessible. In addition, it may not be as thread-safe as using the constructor to assign to final fields. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Why-not-setter-injection-or-thread-safe-field-Inject-tp5579388p5579927.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 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: ComponentParameters - Binding Expressions - component:
The pattern that Paul and Thiago are suggesting works fine if that component occurs a single time on a page. However, if you use it multiple times, the client side zoneId (as well as the Tapestry JS initializers) are not unique any more, which causes the same zone to be updated all the time, no matter which EventLink got the click. Again and again randomly generated zone id confuses developers. :) Should I collect all mail posts with that problem at my issue: Warn user or disallow zone with randomly generated id? :) https://issues.apache.org/jira/browse/TAP5-1834 Denis Mar 7, 2012 v 7:09 PM, Jochen Frey: That's definitely another way of solving this. Still goes by way of the java file, but provides a different sort of flexibility. Cheers! J On Mar 7, 2012, at 9:30 AM, Thiago H. de Paula Figueiredo wrote: On Wed, 07 Mar 2012 13:41:02 -0300, Jochen Frey joc...@jochenfrey.com wrote: Thanks guys! Hi! I have a lot of components that are re-used either in loops, or just embedded in multiple components (often in the same page). The pattern that Paul and Thiago are suggesting works fine if that component occurs a single time on a page. However, if you use it multiple times, the client side zoneId (as well as the Tapestry JS initializers) are not unique any more, which causes the same zone to be updated all the time, no matter which EventLink got the click. Again, provide the id yourself, in this case dinamically (id=${generatedId}). When you don't provide the id yourself, Tapestry components generate a random one when it finds the original id, based in t:id, is already taken. -- 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 --- joc...@jochenfrey.com +1.415.366.0450 @jochen_frey
Re: Replace Coercion java.util.List -- org.apache.tapestry5.SelectModel
You can't, I have created an issue https://issues.apache.org/jira/browse/TAP5-1624 and I have also suggested and improvement for the coercion to the SelectModel https://issues.apache.org/jira/browse/TAP5-1446 with a patch almost a year ago, but noone seems to care. Denis Feb 16, 2012 v 9:19 AM, Mihail Slobodyanuk: Hi! I create own Coercion. It use my object label provider. How i can do replace old contribution to TypeCoercer? Mihail
Re: Replace Coercion java.util.List -- org.apache.tapestry5.SelectModel
If you are trying to override existing coercion - don't do it, there is no expected order of the contributions, it will not work all the time. Denis Feb 16, 2012 v 12:24 PM, Mihail Slobodyanuk: The most amazing thing is that I have it working right by adding a new Coerce to TypeCoercer's contrubution :) 2012/2/16 Denis Stepanov denis.stepa...@gmail.com You can't, I have created an issue https://issues.apache.org/jira/browse/TAP5-1624 and I have also suggested and improvement for the coercion to the SelectModel https://issues.apache.org/jira/browse/TAP5-1446 with a patch almost a year ago, but noone seems to care. Denis Feb 16, 2012 v 9:19 AM, Mihail Slobodyanuk: Hi! I create own Coercion. It use my object label provider. How i can do replace old contribution to TypeCoercer? Mihail - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: session scoped services
If you have your service in the session it also means that there is the ioc registry attached to it, it could be a problem when you have a cluster, best practices is to store only serializable objects. Denis Feb 2, 2012 v 9:35 AM, Christian Köberl: 2012-02-02, John Bush: I have a project where I need some services session scoped, not singletons or perthread. The reason is that I have some web services I use that need some session state for initialization. While the perthread approach works just fine, I don't want to be initializing that stuff with every request. Calling out to wslds and all the xml mumbo jumbo is resource intensive. Maybe it would be better to have the web service handling in a singleton service (and initializes wsld and xml stuff there) which is injected into the thread scoped - this might work as well. In Tapestry you can mix service scopes. - 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: @SetupRender not called
It's probably the same issue as https://issues.apache.org/jira/browse/TAP5-1752 Denis Feb 1, 2012 v 5:12 PM, Howard Lewis Ship: Going to need a lot more data, including the exact production platform (OS, JDK, app server, etc.) and maybe some code samples. If I can't reproduce it, I can't fix it! On Wed, Feb 1, 2012 at 7:52 AM, Emmanuel DEMEY demey.emman...@gmail.com wrote: Hi everyone I get the same issue yesterday, and I spent a lot of time to find the problem. I forgot about this existing post. Howard : Did you find something to avoid this issue ? It will be interesting to add this issue into the release note of the 5.3 release ? in the breaking changes part ? What do you thing ? Manu -- View this message in context: http://tapestry.1045711.n5.nabble.com/SetupRender-not-called-tp4864848p5447884.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 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: Zone and Eventlink refresh problem
I've created a new issue Warn user or disallow zone with randomly generated id https://issues.apache.org/jira/browse/TAP5-1834 Denis On 27.1.2012, at 6:22, Paul Stanton wrote: Just a side note, this has caught a few users over time (since t5.1). Boris' expected behaviour does not seem to me to be too unrealistic an expectation! Depending on your personality type ;) you may even consider this a bug. Maybe the zone re-rendering process should handle this client id changeover gracefully? p. On 22/01/2012 8:38 AM, bhorvat wrote: Hm... Yea this worked perfectly. I know that the new id is generated but I was under the impression that tapestry eventlink will adapt to that since I did set which zone to target I thought that once everything is refresh that will also refresh... Thank you both for assistance :) -- View this message in context: http://tapestry.1045711.n5.nabble.com/Zone-and-Eventlink-refresh-problem-tp5161722p5163366.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 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.3. rc3: event bubbling bug?
If your hierarchy is: Page - MyComponent - t:form t:id=ProductSizeForm you should use onSuccessFromMyComponent, it is probably a bug if onSuccessFromProductSizeForm works inside the Page. Denis On 6.11.2011, at 17:35, 9902468 wrote: Ok, I think I confirmed this as a bug: if I disable the checking using configuration.add(SymbolConstants.UNKNOWN_COMPONENT_ID_CHECK_ENABLED, false); then my use case works ok, so my code is absolutely legit. I have opened JIRA https://issues.apache.org/jira/browse/TAP5-1745 that should be IMHO be corrected before the 5.3 is released OR disable it by default. Otherwise every app will break that uses event bubbling.. Howard: as you implemented the original feature could you comment if this is right? - Ville -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-rc3-event-bubbling-bug-tp4966490p4968931.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 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Problem with tapestry-yuicompressor in Tomcat
Maybe the solution would be to use JarJar to repackage the Rhino, just like Google Guice uses it for including libs like ASM, commons etc. see: http://code.google.com/p/google-guice/source/browse/pom.xml#201 Denis On 27.10.2011, at 2:16, Howard Lewis Ship wrote: The Liferay folks repackaged the Rhino and YUICompressor classes into new package names to avoid conflicts. I wish that they had a public Maven repo we could pull those from. On Wed, Oct 26, 2011 at 4:55 PM, Lenny Primak lpri...@hope.nyc.ny.us wrote: I don't think this is a tapestry issue at all. I think it's a general YUIcompressor issue, and I don't know what can Tapestry do to fix this. On Oct 26, 2011, at 5:40 PM, Howard Lewis Ship wrote: https://issues.apache.org/jira/browse/TAP5-1729 I don't have a good fix for this as of yet. - 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: ActivationRequestParameter only works in a page?
I have something like this implemented in our app for component events only, a field with the special annotation will add its value as a request parameter to all links inside rendering phase and on incoming event the special filter will send restore event to restore field's previous value. Works great with deep component hierarchy, otherwise you need to preserve that state using context in all events, which is very ugly. Denis On 24.10.2011, at 20:39, trsvax wrote: In my case the page does not know about the parameter. I have a grid like component that is managing what rows in the grid to display. I don't really want to make the page care one way or another what part of the grid is displaying (or even that is is a grid). Since the value is available in the Request it's easy to get in the component which makes it seem a bit arbitrary I can use this annotation in a page and not a component. -- View this message in context: http://tapestry.1045711.n5.nabble.com/ActivationRequestParameter-only-works-in-a-page-tp4932370p4933666.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 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
@Property and existing getter or setter
Hi everyone, when using @Property anotation on a page with existing getter or setter Tapestry will throw an exception, would it be better to just ignore adding a new method rather than throwing an exception? I don't think it could lead to unexpected behavior, there is not so many cases when there is a getter/setter in super class, it will save time checking if read/write is consistent with getters/setters and fixing unexpected exceptions. Denis - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: @Property and existing getter or setter
...by adding @Property you're asking for a getter / setter pair that are benign in operation and have no side effects whereas your own getters and setters could do anything. If you have a nefarious setter but don't notice it because you were blinded by the @Property annotation I can foresee bugs creeping into code which would be hard to track down. sure, only when you expect that @Property will fail if you already have getter/setter, 5.2 used to overload methods from superclass… anyway you can also mistype onevent method and wondering what went wrong With live page reloading, surely the time taken to add (write=false) and click refresh is negligible, no? our app reloads between 10-20seconds so it does matter right now, 5.3 should improve it Denis Oct 18, 2011 v 1:26 PM, Steve Eynon: Steve. On 18 October 2011 18:35, Denis Stepanov denis.stepa...@gmail.com wrote: Hi everyone, when using @Property anotation on a page with existing getter or setter Tapestry will throw an exception, would it be better to just ignore adding a new method rather than throwing an exception? I don't think it could lead to unexpected behavior, there is not so many cases when there is a getter/setter in super class, it will save time checking if read/write is consistent with getters/setters and fixing unexpected exceptions. Denis - 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: Compiled CSS
If I understand it correctly, right now resources accesses with ResourceTransformer will have same url as the source. It would be nice to have somekind of transform resources mapping, lets say we want to transform less file or files to css: virtualTransformResource(/css/bootstrap.css, /less/bootstrap.less) - virtual resource /css/bootstrap.css will be resource /less/bootstrap.less transformed using ResourceTransformer, mimetypes are extracted from file names. Transforming all files from specified context: virtualTransformContext( /css/, /less/, text/css, text/less) - with additional from/to mimetypes to recognize what kind of files need to be transformed. Rewriting could be another solution for this but not so friendly. Denis On 12.10.2011, at 0:03, Howard Lewis Ship wrote: Just checked in some changes as discussed below; not in a preview release yet. On Mon, Oct 10, 2011 at 2:01 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: On Mon, 10 Oct 2011 17:50:12 -0300, Cezary Biernacki cezary...@gmail.com wrote: Hi, Hi! I like that proposition. Is it possible to change ResourceTransformer and include ResourceDependencies in Tapestry 5.3.* ? Tapestry 5.3 is still a beta, so this possibility exists (but don't consider this a promise). Please file a JIRA about it. -- 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 -- 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 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Bootstrap
Hello, how many of you know Bootstrap http://twitter.github.com/bootstrap/, a css toolkit designed to kickstart development of webapps and sites from Twitter? I just had an idea that Tapestry could use bootstap as defaul css stylesheet. It would be pretty impressive to have default components and examples have such goodlookin styles. Forms, Grid, Pagination, Alerts, Buttons prettymuch every component that Tapestry has. Denis
Re: Palette and Checklist don't use contributed value encoder?
Because it can't determine a type from a collection of values. Denis Aug 23, 2011 v 12:16 PM, Bob Harner: Although I don't agree with the majority, I'll work on updating the javadocs to make the meaning of required clearer for the encoder parameter. For this, can anyone tell me why Grid, GridRows, Loop, and Select mark the encoder parameter optional while AjaxFormLoop, Palette, Checklist, Hidden, RadioGroup mark it required? On Tue, Aug 23, 2011 at 1:37 AM, Robert Zeigler robert.zeig...@roxanemy.com wrote: As a developer I'm not looking at components in isolation, but rather, I'm looking at T5 as a framework. So if the framework provdes defaults and I don't need to, fantastic! Moreover, I don't need to know that attribute was ever required, for that's now unimportant information. Except when the framework can't provide a default and it blows up in your face. :) Especially with value encoders, the framework /tries/ to provide a default, and often can, but it's not guaranteed. Robert Steve. On 23 August 2011 10:18, Robert Zeigler robert.zeig...@roxanemy.com wrote: On Aug 22, 2011, at 8/229:06 PM , Bob Harner wrote: In many cases, a ValueEncoder can be generated automatically from the And this is the crux: in /many/ cases... /can/ be generated. When it can't be, you'll still get the exception that it's not bound and must be. Ergo: required. :) Robert - 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry upload and Google App Engine
Hi, try to implement you own version of org.apache.commons.fileupload.FileItemFactory which will store files in a memory. Denis On 20.8.2011, at 0:51, bhorvat wrote: Hi all, I am sure that some of you are aware that there is a problem with the tapestry-upload component and GAE. I am working on a small (as a test website) and I will later on work on a large project and I would like to use Tapestry and have it host on the GAE. The website is pretty much over you can go and take a look at it at http://chesapool.appspot.com/ http://chesapool.appspot.com/ . One of the final things that are missing is the upload functionality. So I would like someone to help me with this. I have tired all over the Internet but I couldn't find explanation that I was able to fallow. From what I did figure out is that I need to write a custom upload service using the commons-upload (or some similar name) and to integrate that service into tapestry. However I am not sure how and where to start. So can someone help me with this. Thank you -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-upload-and-Google-App-Engine-tp4717221p4717221.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 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry upload and Google App Engine
Override FileItemFactory using IOC: http://tapestry.apache.org/ioc-cookbook-overriding-ioc-services.html your FileItemFactory implementation will need to return simple implemention of FileItem, request is writing a file using outputstream, so you need a ByteArrayOutputStream to write to. http://commons.apache.org/fileupload/apidocs/org/apache/commons/fileupload/FileItemFactory.html http://commons.apache.org/fileupload/apidocs/org/apache/commons/fileupload/FileItem.html Denis On 20.8.2011, at 10:45, bhorvat wrote: I know what the problem is the problem, I have read in couple of places a general idea what one should do about all of this but sadly I do not possess the necessary knowledge to implement that. If I use the HttpServletRequest with the @Inject annotation and use getInputStream() method what else do I need to change. How do I create a form? Can I use t:form component? Also where do I send the date from that form? Where do I write the method that will handle the upload? Do I need to write a service for that and how do I do that? If you guys have some semi code or some resource link to help me out, I would appreciate it. There are a lot of things that I don't know about tapestry so a couple of words in the right direction won't help me much. Sorry about that :) -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-upload-and-Google-App-Engine-tp4717221p4718052.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: Tapestry upload and Google App Engine
Someone already have implemented it using some kind of GAE api: http://groups.google.com/group/gwtupload/browse_thread/thread/49857a006a7baa46 Denis On 20.8.2011, at 12:15, Denis Stepanov wrote: Override FileItemFactory using IOC: http://tapestry.apache.org/ioc-cookbook-overriding-ioc-services.html your FileItemFactory implementation will need to return simple implemention of FileItem, request is writing a file using outputstream, so you need a ByteArrayOutputStream to write to. http://commons.apache.org/fileupload/apidocs/org/apache/commons/fileupload/FileItemFactory.html http://commons.apache.org/fileupload/apidocs/org/apache/commons/fileupload/FileItem.html Denis On 20.8.2011, at 10:45, bhorvat wrote: I know what the problem is the problem, I have read in couple of places a general idea what one should do about all of this but sadly I do not possess the necessary knowledge to implement that. If I use the HttpServletRequest with the @Inject annotation and use getInputStream() method what else do I need to change. How do I create a form? Can I use t:form component? Also where do I send the date from that form? Where do I write the method that will handle the upload? Do I need to write a service for that and how do I do that? If you guys have some semi code or some resource link to help me out, I would appreciate it. There are a lot of things that I don't know about tapestry so a couple of words in the right direction won't help me much. Sorry about that :) -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-upload-and-Google-App-Engine-tp4717221p4718052.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: Tapestry upload and Google App Engine
From what I can see I will need to include this gwtupload library using mave and then use that to handle the file uploading and saving into Blob, right? You only need to replace the FileItemFactory with an implementation which will store files in memory or specific GAE place, try to use gwtupload lib. Include something like this into your Tapestry module: @Contribute(ServiceOverride.class) public static void overrideFileItemFactory(MappedConfigurationClass,Object configuration) { configuration.addInstance(FileItemFactory.class, FilesApiFileItemFactory.class); } But how do you use this into tapestry? You cant use their normal upload component. So do I have to create a normal form (not t:form). You should be able to use the upload component. Did someone try this? I didn't. Denis
Re: Tapestry upload and Google App Engine
What kind of error breaks application? Denis - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry upload and Google App Engine
Try to set a system property java.io.tmpdir to some value, it could be a null in the GAE. http://code.google.com/intl/cs/appengine/docs/java/runtime.html Denis
Re: Tapestry upload and Google App Engine
Now if I understand you correctly I can use tapestry-upload component like I would normally do, right? Yes One thing that I don't understand is how to I save the file into Blob? In normal application I would create a t:form with t:upload inside it. Then in the java file I would create a property for that field from the class UploadedFile Same here and then I would use that class to write the file to disk. But how do I do that or how do I save it into Blob? I don't know, you need to use GAE API, use getStream from UploadFile to read the file and write it somewhere, take a look how does the FilesApiFileItemFactory do it. http://code.google.com/p/gwtupload/source/browse/trunk/GwtUpload/gae/src/main/java/gwtupload/server/gae/FilesApiFileItemFactory.java?r=884 Denis
Re: What place the @Persist will invalid
You can't persist UploadFile because it's content is deleted one the end od the request. After a file is uploaded read the data to the byte array. Denis Aug 18, 2011 v 11:31 AM, Taha Hafeez: Hi Dick I am not sure If I fully understand the question but here is my review of the code. You are using 'files' instance variable to store all the files but the component is using 'value' as a parameter which will obviously be null. Remove @Parameter(required = true, autoconnect = true) private ListUploadedFile value; @Persist private ListUploadedFile files; instead add this @Parameter(required = true, autoconnect = true) private ListUploadedFile files; and ensure you pass a persist field to the component t:swfupload t:id=files/ public class MyPage { @Persist @Property private ListUploadFile files; } also you are not using it inside a form so don't extend AbstractField, remove processSubmission() and removeNull...() On Thu, Aug 18, 2011 at 1:09 PM, dick_hu dickan...@gmail.com wrote: first show my code page class @Property @Persist private ListUploadedFile files //this event will trigger when all the files uploaded,but I can't get the correct value //I think the Property is invalid void onUploadDone(){ //the unexpected,it's null System.out.println(files) } tml t:swfupload t:id=files/ swfupload component class, not fully @Parameter(required = true, autoconnect = true) private ListUploadedFile value; //this event will trigger when one file uploaded,when a file is uploaded it add to the @Persist list StreamResponse onUpload() { if (files == null) files = new ArrayListUploadedFile(); final UploadedFile uploadedFile; uploadedFile = multipartDecoder.getFileUpload(Filedata); files.add(uploadedFile ); System.out.println(files + aaa); return new TextStreamResponse(html/text, success); } I lost a lot of time to sovle the problem,any one can help me ,Thanks a lot. below is the fullly SwfUpload class @Import(library = { swfupload.js, swf_upload.js }) public class SwfUpload extends AbstractField { @Parameter(required = true, autoconnect = true) private ListUploadedFile value; @Persist private ListUploadedFile files; @Parameter(value = 5 MB, defaultPrefix = BindingConstants.LITERAL) private String file_size_limit; @Parameter(value = *.jpg;*.jpeg;*.bmp;*.gif;*.png, defaultPrefix = BindingConstants.LITERAL) private String file_types; @Parameter(value = 50) private int file_upload_limit; @Parameter(value = addpic, defaultPrefix = BindingConstants.LITERAL) private String button_placeholder_id; @Parameter(value = 添加文件, defaultPrefix = BindingConstants.LITERAL) private String button_text; @Inject @Path(add_imag16.png) private Asset button_image_url; @Inject @Path(swfupload_f10.swf) private Asset flash_url; @Inject private JavaScriptSupport javaScriptSupport; @Inject private ComponentResources resources; @Inject private MultipartDecoder multipartDecoder; @Parameter(defaultPrefix = BindingConstants.LITERAL) private String album; public String getUploadUrl() { Link link = resources.createEventLink(AppEventConstants.UPLOAD); return link.toAbsoluteURI(); } public String getUploadDoneUrl() { Link link = resources.createEventLink(AppEventConstants.UPLOAD_DONE); return link.toAbsoluteURI(); } void afterRender() { String upload_url = getUploadUrl(); String upload_done_url = getUploadDoneUrl(); JSONObject options = new JSONObject(); options.put(upload_url, upload_url); options.put(file_size_limit, file_size_limit); options.put(file_types, file_types); options.put(file_upload_limit, file_upload_limit); options.put(button_placeholder_id, button_placeholder_id); options.put(button_image_url, button_image_url.toClientURL()); options.put(flash_url, flash_url.toClientURL()); options.put(button_text, button_text); options.put(upload_done_url, upload_done_url); options.put(album, album); javaScriptSupport.addInitializerCall(BatchUpload, options); } @Override protected void processSubmission(String elementName) { removeNullsFromValue(value); } StreamResponse onUpload() { if (files == null) files = new ArrayListUploadedFile(); final UploadedFile uploadedFile;
Re: IOC Setter injection
I haven't found any code related to setter injection. I'm researching if it is possible to convert some old spring beans into using Tapestry IOC without a lot of work. Anonymous setter injection is the only way how to achieve it. Denis On 25.4.2011, at 2:24, Igor Drobiazko wrote: Actually setter injection is supposed to work when autobuilding services. Отправлено с iPhone 25.04.2011, в 00:00, Thiago H. de Paula Figueiredo thiag...@gmail.com написал(а): On Fri, 22 Apr 2011 08:18:24 -0300, Denis Stepanov denis.stepa...@gmail.com wrote: Is there any way to use setter injection in Tapestry IOC? Yes, but not using autobuilding. Use a builder method instead: public static YourService buildYourService(DependencyType1 type1, ...) { YourService service = new ...; service.setDependencyType1(type1); return build; } -- 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 - 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
IOC Setter injection
Is there any way to use setter injection in Tapestry IOC? I have found this article http://blog.tapestry5.de/index.php/2011/01/17/javax-inject-inject-support-in-tapestry/ which tells that Tapestry supports setter injection by default but i can't find any reference in documentation or source code. Thanks, Denis
Re: ValidationDecorator using zone updates don't seem to work
Try: public void contributeMarkupRenderer(OrderedConfigurationMarkupRendererFilter configuration, final Environment environment) { MarkupRendererFilter defaultValidationDecorator = new MarkupRendererFilter() { public void renderMarkup(MarkupWriter writer, MarkupRenderer renderer) { environment.push(ValidationDecorator.class, new MyValidatorDecorator(environment, writer)); renderer.renderMarkup(writer); environment.pop(ValidationDecorator.class); } }; configuration.add(MyValidatorDecorator, defaultValidationDecorator, after:DefaultValidationDecorator); } public void contributePartialMarkupRenderer(OrderedConfigurationPartialMarkupRendererFilter configuration, final Environment environment) { PartialMarkupRendererFilter defaultValidationDecorator = new PartialMarkupRendererFilter() { public void renderMarkup(MarkupWriter writer, JSONObject reply, PartialMarkupRenderer renderer) { environment.push(ValidationDecorator.class, new MyValidatorDecorator(environment, writer)); renderer.renderMarkup(writer, reply); environment.pop(ValidationDecorator.class); } }; configuration.add(MyValidatorDecorator, defaultValidationDecorator, after:DefaultValidationDecorator); } On 10.11.2010, at 12:15, Hugo Palma wrote: The doesn't seem to be on the render but on the injection of the ValidationDecorator into de label component in my case. I've created an issue for this here https://issues.apache.org/jira/browse/TAP5-1339 On Wed, Nov 10, 2010 at 10:20, Denis Stepanov denis.stepa...@gmail.comwrote: Ajax response uses PartialMarkupRenderer via contributePartialMarkupRenderer. Denis On 9.11.2010, at 17:00, Hugo Palma wrote: I contributed a custom ValidationDecorator which in my case simply adds a * to the label of every required field. This works fine except when i update a zone with a form. If the form is rendered on page load the ValidationDecorator is executed as excepted, but if i update a zone with a form component then the label fields on that form aren't decorated by my custom ValidationDecorator. Any idea if this is a bug or maybe i'm doing something wrong ? Thanks. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- LinkedIn http://www.linkedin.com/in/hugopalma Twitterhttp://twitter.com/hugompalma
Re: ValidationDecorator using zone updates don't seem to work
Ajax response uses PartialMarkupRenderer via contributePartialMarkupRenderer. Denis On 9.11.2010, at 17:00, Hugo Palma wrote: I contributed a custom ValidationDecorator which in my case simply adds a * to the label of every required field. This works fine except when i update a zone with a form. If the form is rendered on page load the ValidationDecorator is executed as excepted, but if i update a zone with a form component then the label fields on that form aren't decorated by my custom ValidationDecorator. Any idea if this is a bug or maybe i'm doing something wrong ? Thanks. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Component context @ActivationRequestParameter
Hello everyone, we are using tapestry in our ajax application, most web actions like creating, editing etc. are implemented using modal dialogs, problem is that only easy way how to store context is to put it in page link (on Activate approach). Now, if you think about switching page navigation layout to ajax layout with one page, you need to pass your context in all your component events. Example: EditUserPage is replaced with EditUserComponent and it is showed as the modal dialog when a user clicks on the edit link from UserAllPage, problem here is that all other component events in EditUserComponent should also have context as parameter and that you need to pass context to all child components of EditUserComponent. I have created my own component annotation like @ActivationRequestParameter which adds query parameter to all component links in that component body, in setupRender phase it adds link listener to thread scope LinkCreationHub and in clearRender phase it removes listener. Also there is a component event filter which triggers events to set parameter back when finds query parameter with specific prefix, and also adds his own listener to delegate query parameters to other component events. It works for me, you can just annotate your context properties in EditUserComponent and they will be restored on next component event like onShowDetail() { return detailBlock; }; There is a lot of use cases for that component context annotation approach using ajax. I would like to see something like that in 5.2, my implementation is 5.1 old (javassist worker etc) and maybe you have a better idea how to implement it. I know that it's a not a perfect solution, the component need to be rendered because of setupRender hook, it's not possible to use activate event because components are not activated. Thanks, Denis - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org