Re: New Tapestry tutorial to replace the quickstart tutorial
Spanish and Portuguese are both important languages. This would be great. In my opinion, we would have to find at least two people to allows reviews and as backup. snippet from Thiagos Mail: >> I think that this would be a very nice addition to the documentation. It >> could replace the current one or, more probably, to be added alongside the My impression is that it is mostly a question of reorganizing and structuring the content. Most questions, I run into are already answered somewhere. More choice especially for new users doesn't improve things but makes it harder. As a consequence, I would prefer to drop the existing tutorial. Alfonso Quiroga schrieb: I can help translating to spanish. On Tue, Sep 8, 2009 at 9:14 PM, Thiago H. de Paula Figueiredo wrote: Em Tue, 08 Sep 2009 19:31:45 -0300, Sebastian Hennebrueder escreveu: Hello, Hi! I would like to update the quick start documentation and defined the following goals: [snip] Very good points. Are you interested in this effort and is this likely to be accepted? (A question to be answered by commiters.) I think that this would be a very nice addition to the documentation. It could replace the current one or, more probably, to be added alongside the current one. The more good documentation, the better. :) I started to write the tutorial and prepared some chapters. You can find the current state at the end of this mail. I would appreciate your comments. I'll take a lookt at it later. What do you think about taking the effort to translate this tutorial? It would be very good to promote Tapestry and raise its adoption in non-English-speaking places. I could help the (Brazilian) Portuguese translation in my free time (unfortunately, very little lately). -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - 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 -- Best Regards / Viele Grüße Sebastian Hennebrueder - Software Developer and Trainer for Hibernate / Java Persistence http://www.laliluna.de - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to create analog of Spring FactoryBean?
Also interesting, is in Tapestry dispose mechanism like in spring? (Implementing DisposableBean) On Wed, Sep 9, 2009 at 09:06, Andrey Larionov wrote: > thanks paul. > > On Tue, Sep 8, 2009 at 20:46, Paul Field wrote: >> Hi Andrey, >> >> "Thiago H. de Paula Figueiredo" wrote on 08/09/2009 >> 15:51:14: >> >>> Em Tue, 08 Sep 2009 11:27:06 -0300, Andrey Larionov >> >>> escreveu: >>> >>> > No, FactoryBean can create new instance on every call of getObject. >>> >>> Then you can create a new Tapestry-IoC scope (ServiceLifecycle >>> implementation) that creates a new object everytime an injection is >> made. >> >> Do you mean you want a service that acts like a "prototype" bean in >> Spring? You could create a new scope as Thiago suggests but you are likely >> to end up with a service that creates a new underlying object for every >> method call - and that probably isn't what you want. >> >> I suggest simply creating a service that is a Factory; maybe something >> like this: >> >> public final class AppModule { >> public static void bind(ServiceBinder binder) { >> binder.bind(ConnectionFactory.class, ConnectionFactoryWithPool. >> class); >> } >> } >> >> >> public interface ConnectionFactory { >> Connection createConnection(); >> } >> >> >> public class ConnectionFactoryWithPool implements ConnectionFactory { >> >> >> >> public Conection createConnection() { >> return pool.getConnection(); >> } >> } >> >> >> public class MyPage { >> �...@inject >> private ConnectionFactory connectionFactory; >> >> public void myAction() { >> Connection connection = connectionFactory.createConnection(); >> try { >> ... >> } finally { >> connection.close(); >> } >> } >> } >> >> >> - Paul >> >> >> --- >> >> This e-mail may contain confidential and/or privileged information. If you >> are not the intended recipient (or have received this e-mail in error) >> please notify the sender immediately and delete this e-mail. Any >> unauthorized copying, disclosure or distribution of the material in this >> e-mail is strictly forbidden. >> >> Please refer to http://www.db.com/en/content/eu_disclosures.htm for >> additional EU corporate and regulatory disclosures. > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Comment in .tml file
You could use , but it's not too pretty either... On Wed, Sep 9, 2009 at 7:35 AM, Xuan Tran Le wrote: > I want to comment in .tml file and all the comments will not be displayed > when we view page source (on browser). Anybody help me... >
Comment in .tml file
I want to comment in .tml file and all the comments will not be displayed when we view page source (on browser). Anybody help me...
Error when remove html tag when run in portlet mode
I'm running tapestry in portlet mode, so in the .tml template I want to remove the html tag. But I encounters this error: *The root element of the rendered document was , not . A root element of is needed when linking JavaScript and stylesheet resources.* Stack trace: - org.apache.tapestry5.internal.services.DocumentLinkerImpl.addScriptElements(DocumentLinkerImpl.java:153) - org.apache.tapestry5.internal.services.DocumentLinkerImpl.updateDocument(DocumentLinkerImpl.java:139) - org.apache.tapestry5.services.TapestryModule$22.renderMarkup(TapestryModule.java:1666) - $MarkupRenderer_12398899ae8.renderMarkup($MarkupRenderer_12398899ae8.java) - $MarkupRenderer_12398899ae2.renderMarkup($MarkupRenderer_12398899ae2.java) - org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64) - $PageMarkupRenderer_12398899ade.renderPageMarkup($PageMarkupRenderer_12398899ade.java) - org.apache.tapestry5.internal.portlet.services.PortletPageResponseRendererImpl.renderPageResponse(PortletPageResponseRendererImpl.java:91) - $PageResponseRenderer_12398899a6f.renderPageResponse($PageResponseRenderer_12398899a6f.java) - org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:63) - org.apache.tapestry5.services.TapestryModule$33.handle(TapestryModule.java:1943) - $PageRenderRequestHandler_12398899aa8.handle($PageRenderRequestHandler_12398899aa8.java) - $PageRenderRequestHandler_12398899a92.handle($PageRenderRequestHandler_12398899a92.java) - org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handlePageRender(ComponentRequestHandlerTerminator.java:48) - $ComponentRequestHandler_12398899a97.handlePageRender($ComponentRequestHandler_12398899a97.java) - org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:45) - $Dispatcher_12398899a99.dispatch($Dispatcher_12398899a99.java) - $Dispatcher_12398899a90.dispatch($Dispatcher_12398899a90.java) - org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:245) - org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26) - $RequestHandler_12398899a91.service($RequestHandler_12398899a91.java) - org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:778) - $RequestHandler_12398899a91.service($RequestHandler_12398899a91.java) - org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:767) - $RequestHandler_12398899a91.service($RequestHandler_12398899a91.java) - org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85) - $RequestHandler_12398899a91.service($RequestHandler_12398899a91.java) - org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90) - org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:81) - org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85) - org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103) - $RequestHandler_12398899a91.service($RequestHandler_12398899a91.java) - $RequestHandler_12398899a8a.service($RequestHandler_12398899a8a.java) - org.apache.tapestry5.portlet.services.PortletModule$3.service(PortletModule.java:290) - $PortletRenderRequestHandler_12398899a87.service($PortletRenderRequestHandler_12398899a87.java) - org.apache.tapestry5.portlet.ApplicationPortlet.render(ApplicationPortlet.java:114) - org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:208) - org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:139) - javax.servlet.http.HttpServlet.service(HttpServlet.java:689) - javax.servlet.http.HttpServlet.service(HttpServlet.java:802) - org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) - org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
Re: How to create analog of Spring FactoryBean?
thanks paul. On Tue, Sep 8, 2009 at 20:46, Paul Field wrote: > Hi Andrey, > > "Thiago H. de Paula Figueiredo" wrote on 08/09/2009 > 15:51:14: > >> Em Tue, 08 Sep 2009 11:27:06 -0300, Andrey Larionov > >> escreveu: >> >> > No, FactoryBean can create new instance on every call of getObject. >> >> Then you can create a new Tapestry-IoC scope (ServiceLifecycle >> implementation) that creates a new object everytime an injection is > made. > > Do you mean you want a service that acts like a "prototype" bean in > Spring? You could create a new scope as Thiago suggests but you are likely > to end up with a service that creates a new underlying object for every > method call - and that probably isn't what you want. > > I suggest simply creating a service that is a Factory; maybe something > like this: > > public final class AppModule { > public static void bind(ServiceBinder binder) { > binder.bind(ConnectionFactory.class, ConnectionFactoryWithPool. > class); > } > } > > > public interface ConnectionFactory { > Connection createConnection(); > } > > > public class ConnectionFactoryWithPool implements ConnectionFactory { > > > > public Conection createConnection() { > return pool.getConnection(); > } > } > > > public class MyPage { > �...@inject > private ConnectionFactory connectionFactory; > > public void myAction() { > Connection connection = connectionFactory.createConnection(); > try { > ... > } finally { > connection.close(); > } > } > } > > > - Paul > > > --- > > This e-mail may contain confidential and/or privileged information. If you > are not the intended recipient (or have received this e-mail in error) please > notify the sender immediately and delete this e-mail. Any unauthorized > copying, disclosure or distribution of the material in this e-mail is > strictly forbidden. > > Please refer to http://www.db.com/en/content/eu_disclosures.htm for > additional EU corporate and regulatory disclosures. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Error when remove html tag when run in portlet mode
I'm running tapestry in portlet mode, so in the .tml template I want to remove the html tag. But I encounters this error: *The root element of the rendered document was , not . A root element of is needed when linking JavaScript and stylesheet resources.* Stack trace: - org.apache.tapestry5.internal.services.DocumentLinkerImpl.addScriptElements(DocumentLinkerImpl.java:153) - org.apache.tapestry5.internal.services.DocumentLinkerImpl.updateDocument(DocumentLinkerImpl.java:139) - org.apache.tapestry5.services.TapestryModule$22.renderMarkup(TapestryModule.java:1666) - $MarkupRenderer_12398899ae8.renderMarkup($MarkupRenderer_12398899ae8.java) - $MarkupRenderer_12398899ae2.renderMarkup($MarkupRenderer_12398899ae2.java) - org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64) - $PageMarkupRenderer_12398899ade.renderPageMarkup($PageMarkupRenderer_12398899ade.java) - org.apache.tapestry5.internal.portlet.services.PortletPageResponseRendererImpl.renderPageResponse(PortletPageResponseRendererImpl.java:91) - $PageResponseRenderer_12398899a6f.renderPageResponse($PageResponseRenderer_12398899a6f.java) - org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:63) - org.apache.tapestry5.services.TapestryModule$33.handle(TapestryModule.java:1943) - $PageRenderRequestHandler_12398899aa8.handle($PageRenderRequestHandler_12398899aa8.java) - $PageRenderRequestHandler_12398899a92.handle($PageRenderRequestHandler_12398899a92.java) - org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handlePageRender(ComponentRequestHandlerTerminator.java:48) - $ComponentRequestHandler_12398899a97.handlePageRender($ComponentRequestHandler_12398899a97.java) - org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:45) - $Dispatcher_12398899a99.dispatch($Dispatcher_12398899a99.java) - $Dispatcher_12398899a90.dispatch($Dispatcher_12398899a90.java) - org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:245) - org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26) - $RequestHandler_12398899a91.service($RequestHandler_12398899a91.java) - org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:778) - $RequestHandler_12398899a91.service($RequestHandler_12398899a91.java) - org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:767) - $RequestHandler_12398899a91.service($RequestHandler_12398899a91.java) - org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85) - $RequestHandler_12398899a91.service($RequestHandler_12398899a91.java) - org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90) - org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:81) - org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85) - org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103) - $RequestHandler_12398899a91.service($RequestHandler_12398899a91.java) - $RequestHandler_12398899a8a.service($RequestHandler_12398899a8a.java) - org.apache.tapestry5.portlet.services.PortletModule$3.service(PortletModule.java:290) - $PortletRenderRequestHandler_12398899a87.service($PortletRenderRequestHandler_12398899a87.java) - org.apache.tapestry5.portlet.ApplicationPortlet.render(ApplicationPortlet.java:114) - org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:208) - org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:139) - javax.servlet.http.HttpServlet.service(HttpServlet.java:689) - javax.servlet.http.HttpServlet.service(HttpServlet.java:802) - org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) - org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
Re: New Tapestry tutorial to replace the quickstart tutorial
I can help translating to spanish. On Tue, Sep 8, 2009 at 9:14 PM, Thiago H. de Paula Figueiredo wrote: > Em Tue, 08 Sep 2009 19:31:45 -0300, Sebastian Hennebrueder > escreveu: > >> Hello, > > Hi! > >> I would like to update the quick start documentation and defined the >> following goals: > > [snip] > > Very good points. > >> Are you interested in this effort and is this likely to be accepted? (A >> question to be answered by commiters.) > > I think that this would be a very nice addition to the documentation. It > could replace the current one or, more probably, to be added alongside the > current one. The more good documentation, the better. :) > >> I started to write the tutorial and prepared some chapters. You can find >> the current state at the end of this mail. I would appreciate your comments. > > I'll take a lookt at it later. > >> What do you think about taking the effort to translate this tutorial? > > It would be very good to promote Tapestry and raise its adoption in > non-English-speaking places. I could help the (Brazilian) Portuguese > translation in my free time (unfortunately, very little lately). > > -- > Thiago H. de Paula Figueiredo > Independent Java consultant, developer, and instructor > http://www.arsmachina.com.br/thiago > > - > 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: New Tapestry tutorial to replace the quickstart tutorial
Em Tue, 08 Sep 2009 19:31:45 -0300, Sebastian Hennebrueder escreveu: Hello, Hi! I would like to update the quick start documentation and defined the following goals: [snip] Very good points. Are you interested in this effort and is this likely to be accepted? (A question to be answered by commiters.) I think that this would be a very nice addition to the documentation. It could replace the current one or, more probably, to be added alongside the current one. The more good documentation, the better. :) I started to write the tutorial and prepared some chapters. You can find the current state at the end of this mail. I would appreciate your comments. I'll take a lookt at it later. What do you think about taking the effort to translate this tutorial? It would be very good to promote Tapestry and raise its adoption in non-English-speaking places. I could help the (Brazilian) Portuguese translation in my free time (unfortunately, very little lately). -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
New Tapestry tutorial to replace the quickstart tutorial
Hello, before continuing to evaluate JSF 2, I would like to help out to improve the Tapestry documentation. This is something, I have quite some experience with. I would like to update the quick start documentation and defined the following goals: - setup with and without Maven - stable Maven setup (possibly fall back to old archetype configuration) - the sample application should look smart - Expect a minimum of Java and IDE knowhow but take care that everything is explained in details - Always explain first, what we are going to do, show diagrams or screen shots and then go forward step by step - Provide enough 'power functionality' like mixins or self made components and explain the usefulness - Provide a helpful outlook, where to go next after the tutorial. I would like to publish the tutorial on my website and in addition give it under Apache licence to the Tapestry project. In my opinion this should live either on the normal Tapestry website or in the Tapestry Wiki area. Are you interested in this effort and is this likely to be accepted? (A question to be answered by commiters.) I started to write the tutorial and prepared some chapters. You can find the current state at the end of this mail. I would appreciate your comments. Which functionality should be included in addition? What do you think about taking the effort to translate this tutorial? Keep in mind that this comes with a lot of effort as we have continuously translate all changes into all support languages. We would probably need to have 2-3 people per language, to have enough fall backs to keep this in sync. -- Best Regards / Viele Grüße Sebastian Hennebrueder - Software Developer and Trainer for Hibernate / Java Persistence http://www.laliluna.de My sample structure and content 1Introduction to Tapestry 5 Tapestry is an innovative Java based web framework. It provides great support for modern Ajax enabled applications. It is component and object oriented, which allows to build a web application with a minimum of duplicated code. In this tutorial we are going to have a look at important concepts of Tapestry, while building a nice application. 2Setting up the application There are three setup options: • Generating a sample application using Apache Maven The generated project can be imported into your preferred development environment like Eclipse, Netbeans or IntelliJ • Using a prepared project for the Eclipse development environment • Using a prepared project for the IntelliJ development environment 2.1 Setup with Apache Maven You need to install Apache Maven first. The download and documentation of Maven can be found on its website http://maven.apache.org/ If Maven is successfully installed, you should be able to type the following command in a shell or in a terminal. mvn -version Outputs something like: Maven version: 2.0.10 Java version: 1.6.0_13 OS name: "mac os x" version: "10.5.8" arch: "x86_64" Family: "mac" The following command will use a Maven archetype to setup a ready to run Tapestry application. An archetype is just a kind of prototype or template. In addition all required libraries will be downloaded. 2.2 Setup with Eclipse project First, we download the prepared Eclipse project and the Tapestry libraries, then we are going to copy the required libraries to the library folder of the web application. Download the project at http://www.laliluna.de/download/tapestry-5-eclipse.zip Unzip the project Download a stable Tapestry 5 release at http://tapestry.apache.org/download.html Unzip the Tapestry download and copy the following libraries to the folder Webroot/WEB-INF/ of the unzipped project. • antlr-runtime-3.1.1.jar • commons-codec-1.3.jar • javassist-3.9.0.GA.jar • log4j-1.2.14.jar • slf4j-api-1.5.2.jar • slf4j-log4j12-1.5.2.jar • stax-api-1.0.1.jar • stax2-api-3.0.1.jar • tapestry-core-5.1.0.5.jar • tapestry-ioc-5.1.0.5.jar • tapestry5-annotations-5.1.0.5.jar • woodstox-core-asl-4.0.3.jar 2.3 Setup with IntelliJ project We are going to use the option to import a standard Eclipse project. Follow the steps of the Eclipse project setup. Once this is finished, select new project from the file menu and select Import model from external source. You need to input or select the folder of the Eclipse project and just accept the other settings. 2.4 Starting the application a first time For development we recommend the Jetty servlet engine. It starts up extremely fast and is easy to integrate into Eclipse, Netbeans and IntelliJ. Eclipse Netbeans IntelliJ 3Exploring the application We are going to have a look, what was already prepared for you. Web.xml default resource bundle a page class 4Extending the application We will add a page showing a list of turtles, then we will add a page to show details of a turtle, create, edit and finally delete a turtle. Show the use of page links Show the use of beaneditform, validation and overwriting defaults to show a texta
Re: auto java reloading depends on package?
If u r using tomcat u can use the sysdeo plugin, it's not as good as JavaRebel but u don't have to use those "tricks" On Tue, Sep 8, 2009 at 7:00 PM, Alfonso Quiroga wrote: > Sebastian: yes I can see the problem of reloading other objets, that's > why I use javarebel by now in this special cases. Answering your > question, I'm developing an open source system, so I don't expect > payment for it, and the tip was for using the trial period a longer > time, I didn't say "don't buy it", that wasn't my idea, thanks > > On Tue, Sep 8, 2009 at 5:07 AM, Sebastian > Hennebrueder wrote: >> Hello Alfonso, >> >> it is not only the session, it is any kind of library which has parsed the >> bean for example or any kind of bean having a relation ship to the bean. It >> might be simpler to provide your own reloading mechanism for a complete >> module of the application. >> >> I am surprised that you publish tips on destroying other people work and >> income. Don't you expect payment for your work as well? >> >> >> -- >> Best Regards / Viele Grüße >> >> Sebastian Hennebrueder >> - >> Software Developer and Trainer for Hibernate / Java Persistence >> http://www.laliluna.de >> >> >> >> - >> 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: NPE when trying to store an ASO
Peaked into the source.. the filter responsible for storing the objects is named "StoreIntoGlobals". However, I just couldn't get it to work properly by trying to position my existing filter differently, partly because I'm also using a request decorator that is dependent on the filter. Solved it by contributing another filter to the end of pipeline (just before the page render) which is responsible for creating the sessionstate object. Makes some sense to me and helps keeping the responsibilities separate. Finally, if anybody is reading this - is there are way set @SessionState(create=false) as a default? Couldn't find any symbol for it in the documentation. Kalle On Tue, Sep 8, 2009 at 10:59 AM, Kalle Korhonen wrote: > Hey Uli & others, > > I dug up this old thread as I run into the same issue myself with > T5.1. Did you ever manage to solve this in a satisfactory way? It's > clear that the issue is the same - requestGlobals.getRequest() returns > null since I'm contributing my handler before everything else but I > also want to create a sessionstate object. It's entirely possible that > things have changed since and I simply should be contributing my > handler right after the handler (if so, named what?) that stores the > request globals objects but I didn't check yet. Is there any better > workaround than Thiago's httpSession.set("aso:" + > User.class.getName(), user)? > > Kalle > > > On Thu, Oct 9, 2008 at 12:06 PM, Ulrich Stärk wrote: >> Ok, I think I know what's going on. I think the service I'm decorating is >> being called before the terminator of the HttpServletRequestHandler pipeline >> makes the Request available. In a mail from december 2007 Peter Stavrinides >> seems to have stumbled over the same issue: >> http://markmail.org/message/4qup7wyjsb7kavy3 >> >> Howard, you mentioned the possibility to change this and there is also an >> open issue for one of the impacts of this >> (https://issues.apache.org/jira/browse/TAP5-257). Should I open an issue for >> populating the Request and Response earlier on in the pipeline? >> >> Cheers, >> >> Uli >> >> >> Ulrich Stärk schrieb: >>> >>> I'm decorating one of my services in order to store the result of a method >>> call as an ASO. I therefore inject the ApplicationStatemanager service into >>> my decorator implementation and call >>> applicationStateManager.set(UserDetails.class, (UserDetails) o);, but I >>> always get the NullPointerException below. Is what I'm doing supposed to >>> work and am I seeing a bug or should I do this somehow different? >>> >>> Cheers, >>> >>> Uli >>> >>> java.lang.NullPointerException >>> at $Request_11ce2775261.getSession($Request_11ce2775261.java) >>> at $Request_11ce2775226.getSession($Request_11ce2775226.java) >>> at >>> org.apache.tapestry5.internal.services.SessionApplicationStatePersistenceStrategy.getSession(SessionApplicationStatePersistenceStrategy.java:47) >>> at >>> org.apache.tapestry5.internal.services.SessionApplicationStatePersistenceStrategy.set(SessionApplicationStatePersistenceStrategy.java:88) >>> at >>> $ApplicationStatePersistenceStrategy_11ce2775316.set($ApplicationStatePersistenceStrategy_11ce2775316.java) >>> at >>> org.apache.tapestry5.internal.services.ApplicationStateManagerImpl$ApplicationStateAdapter.set(ApplicationStateManagerImpl.java:50) >>> at >>> org.apache.tapestry5.internal.services.ApplicationStateManagerImpl.set(ApplicationStateManagerImpl.java:138) >>> at >>> $ApplicationStateManager_11ce2775276.set($ApplicationStateManager_11ce2775276.java) >>> at >>> de.spielviel.mailadmin.services.impl.UserDetailsDecoratorImpl$1.advise(UserDetailsDecoratorImpl.java:43) >>> at >>> org.apache.tapestry5.ioc.internal.services.AbstractInvocation.proceed(AbstractInvocation.java:121) >>> at >>> $UserDetailsService_11ce2775313.loadUserByUsername($UserDetailsService_11ce2775313.java) >>> at >>> $UserDetailsService_11ce2775242.loadUserByUsername($UserDetailsService_11ce2775242.java) >>> at >>> org.springframework.security.providers.openid.OpenIDAuthenticationProvider.authenticate(OpenIDAuthenticationProvider.java:70) >>> at >>> org.springframework.security.providers.ProviderManager.doAuthentication(ProviderManager.java:195) >>> at >>> org.springframework.security.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:46) >>> at >>> $AuthenticationManager_11ce2775218.authenticate($AuthenticationManager_11ce2775218.java) >>> at >>> org.springframework.security.ui.openid.OpenIDAuthenticationProcessingFilter.attemptAuthentication(OpenIDAuthenticationProcessingFilter.java:84) >>> at >>> org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:252) >>> at >>> org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) >>> at >>> nu.localhost.tapestry5.springsecurity.services.internal.HttpServletRequestFilterWrapper.service(HttpServletRequestFilterWrapper
saving a interface in session
Hi! I want to ask something, maybe someone did this and can answer me. I have the "Wizard" interface, and 2 o 3 implementations. As I want to store in session only one of them in a specific moment (user can't use 2 wizards in the same time), I would like to store the interface, say: @SessionState private Wizard currentWizard; My question maybe is performance, I mean, when WizardImpl1 is in session, then I change it to WizardImpl2.. talking about session size, Impl1 will disapear by the GC? or both impl will be in the session? thanks in advance, and sorry for my english - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] how to pass a component reference to another component ?
hi Sebastian, thx for your reply. Do you mean that I should pass in a block instead of a component reference ? Is my code should be something like this ? toolbar.java === class Toolbar { @Parameter Block block; Object onActionFromToolbarAdd () { System.out.println("trigger in toolbar"); return block; } } template for my container Rgds, CG On Tue, Sep 8, 2009 at 7:44 PM, Sebastian Hennebrueder wrote: > Have a look at zones. Your action method could return a block. > > > -- > Best Regards / Viele Grüße > > Sebastian Hennebrueder > - > Software Developer and Trainer for Hibernate / Java Persistence > http://www.laliluna.de > > > CG schrieb: >> >> Hi all, I hv read through the wiki page on the passing parameter , and >> try a few times of code but not luck. >> >> I may hv the wrong concept , therefore, hopefully someone can help me >> this newbie .. >> >> My scenerio is like this >> >> I have a toolbar component , contain "Add", "Save" and "Delete" button. >> >> and I have a form which contain in another component , let's named it >> as Viewer. >> >> Both toolbar and Viewer are place on a Page >> >> When the user click "Add" , "Save", the Viewer should be updated in AJAX >> way. >> >> The "Add" , "Save" and "Delete" are ActionLink . >> >> Therefore, I have a event handler as below >> >> >> Object onActionFromToolbarAdd () >> { >> System.out.println("trigger in toolbar"); >> return ; >> >> } >> >> Is it correct ? >> >> >> Thx ... >> >> - >> 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: NPE when trying to store an ASO
Hey Uli & others, I dug up this old thread as I run into the same issue myself with T5.1. Did you ever manage to solve this in a satisfactory way? It's clear that the issue is the same - requestGlobals.getRequest() returns null since I'm contributing my handler before everything else but I also want to create a sessionstate object. It's entirely possible that things have changed since and I simply should be contributing my handler right after the handler (if so, named what?) that stores the request globals objects but I didn't check yet. Is there any better workaround than Thiago's httpSession.set("aso:" + User.class.getName(), user)? Kalle On Thu, Oct 9, 2008 at 12:06 PM, Ulrich Stärk wrote: > Ok, I think I know what's going on. I think the service I'm decorating is > being called before the terminator of the HttpServletRequestHandler pipeline > makes the Request available. In a mail from december 2007 Peter Stavrinides > seems to have stumbled over the same issue: > http://markmail.org/message/4qup7wyjsb7kavy3 > > Howard, you mentioned the possibility to change this and there is also an > open issue for one of the impacts of this > (https://issues.apache.org/jira/browse/TAP5-257). Should I open an issue for > populating the Request and Response earlier on in the pipeline? > > Cheers, > > Uli > > > Ulrich Stärk schrieb: >> >> I'm decorating one of my services in order to store the result of a method >> call as an ASO. I therefore inject the ApplicationStatemanager service into >> my decorator implementation and call >> applicationStateManager.set(UserDetails.class, (UserDetails) o);, but I >> always get the NullPointerException below. Is what I'm doing supposed to >> work and am I seeing a bug or should I do this somehow different? >> >> Cheers, >> >> Uli >> >> java.lang.NullPointerException >> at $Request_11ce2775261.getSession($Request_11ce2775261.java) >> at $Request_11ce2775226.getSession($Request_11ce2775226.java) >> at >> org.apache.tapestry5.internal.services.SessionApplicationStatePersistenceStrategy.getSession(SessionApplicationStatePersistenceStrategy.java:47) >> at >> org.apache.tapestry5.internal.services.SessionApplicationStatePersistenceStrategy.set(SessionApplicationStatePersistenceStrategy.java:88) >> at >> $ApplicationStatePersistenceStrategy_11ce2775316.set($ApplicationStatePersistenceStrategy_11ce2775316.java) >> at >> org.apache.tapestry5.internal.services.ApplicationStateManagerImpl$ApplicationStateAdapter.set(ApplicationStateManagerImpl.java:50) >> at >> org.apache.tapestry5.internal.services.ApplicationStateManagerImpl.set(ApplicationStateManagerImpl.java:138) >> at >> $ApplicationStateManager_11ce2775276.set($ApplicationStateManager_11ce2775276.java) >> at >> de.spielviel.mailadmin.services.impl.UserDetailsDecoratorImpl$1.advise(UserDetailsDecoratorImpl.java:43) >> at >> org.apache.tapestry5.ioc.internal.services.AbstractInvocation.proceed(AbstractInvocation.java:121) >> at >> $UserDetailsService_11ce2775313.loadUserByUsername($UserDetailsService_11ce2775313.java) >> at >> $UserDetailsService_11ce2775242.loadUserByUsername($UserDetailsService_11ce2775242.java) >> at >> org.springframework.security.providers.openid.OpenIDAuthenticationProvider.authenticate(OpenIDAuthenticationProvider.java:70) >> at >> org.springframework.security.providers.ProviderManager.doAuthentication(ProviderManager.java:195) >> at >> org.springframework.security.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:46) >> at >> $AuthenticationManager_11ce2775218.authenticate($AuthenticationManager_11ce2775218.java) >> at >> org.springframework.security.ui.openid.OpenIDAuthenticationProcessingFilter.attemptAuthentication(OpenIDAuthenticationProcessingFilter.java:84) >> at >> org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:252) >> at >> org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) >> at >> nu.localhost.tapestry5.springsecurity.services.internal.HttpServletRequestFilterWrapper.service(HttpServletRequestFilterWrapper.java:52) >> at >> $HttpServletRequestFilter_11ce277523f.service($HttpServletRequestFilter_11ce277523f.java) >> at >> $HttpServletRequestHandler_11ce2775241.service($HttpServletRequestHandler_11ce2775241.java) >> at >> nu.localhost.tapestry5.springsecurity.services.internal.HttpServletRequestFilterWrapper$1.doFilter(HttpServletRequestFilterWrapper.java:56) >> at >> org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235) >> at >> org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) >> at >> nu.localhost.tapestry5.springsecurity.services.internal.HttpServletRequestFilterWrapper.service(HttpServletRequestFilterWrapper.java:52) >> at >> $HttpServletRequestFilter_11ce2775238.service($HttpS
Re: auto java reloading depends on package?
Sebastian: yes I can see the problem of reloading other objets, that's why I use javarebel by now in this special cases. Answering your question, I'm developing an open source system, so I don't expect payment for it, and the tip was for using the trial period a longer time, I didn't say "don't buy it", that wasn't my idea, thanks On Tue, Sep 8, 2009 at 5:07 AM, Sebastian Hennebrueder wrote: > Hello Alfonso, > > it is not only the session, it is any kind of library which has parsed the > bean for example or any kind of bean having a relation ship to the bean. It > might be simpler to provide your own reloading mechanism for a complete > module of the application. > > I am surprised that you publish tips on destroying other people work and > income. Don't you expect payment for your work as well? > > > -- > Best Regards / Viele Grüße > > Sebastian Hennebrueder > - > Software Developer and Trainer for Hibernate / Java Persistence > http://www.laliluna.de > > > > - > 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 create analog of Spring FactoryBean?
Hi Andrey, "Thiago H. de Paula Figueiredo" wrote on 08/09/2009 15:51:14: > Em Tue, 08 Sep 2009 11:27:06 -0300, Andrey Larionov > escreveu: > > > No, FactoryBean can create new instance on every call of getObject. > > Then you can create a new Tapestry-IoC scope (ServiceLifecycle > implementation) that creates a new object everytime an injection is made. Do you mean you want a service that acts like a "prototype" bean in Spring? You could create a new scope as Thiago suggests but you are likely to end up with a service that creates a new underlying object for every method call - and that probably isn't what you want. I suggest simply creating a service that is a Factory; maybe something like this: public final class AppModule { public static void bind(ServiceBinder binder) { binder.bind(ConnectionFactory.class, ConnectionFactoryWithPool. class); } } public interface ConnectionFactory { Connection createConnection(); } public class ConnectionFactoryWithPool implements ConnectionFactory { public Conection createConnection() { return pool.getConnection(); } } public class MyPage { @Inject private ConnectionFactory connectionFactory; public void myAction() { Connection connection = connectionFactory.createConnection(); try { ... } finally { connection.close(); } } } - Paul --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.
Re: Projects and sites powered by Tapestry
On Tue, Sep 8, 2009 at 5:27 PM, Thiago H. de Paula Figueiredo wrote: > Hi! > > I guess this was already discussed some time ago, but I couldn't find it. :( > Anyway, it's been a long time, so let's get it started again. ;) > > Tapestry is a wonderful framework, but it isn't the best known one around. > Sometimes, managers ask us to provide some projects/sites/success > stories/etc using it so they can be more confident about Tapestry. There's a > Success Stories page in the wiki > (http://wiki.apache.org/tapestry/SuccessStories), but it hasn't had any edit > since 2007-10-05. > > What about sharing your success stories with us, promoting Tapestry > (specially T5)? If the project is a public website, please post the URL > here. I think we should have a list of Tapestry-powered sites. > > Thanks in advance. It would be great to have that page more up to date but i remember Howard asking for "private" user stories and more then one have replied him even personally so i guess if that would make sense too to have that stories online. Do i remember correctly Howard? -- Massimo http://meridio.blogspot.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Projects and sites powered by Tapestry
Hi! I guess this was already discussed some time ago, but I couldn't find it. :( Anyway, it's been a long time, so let's get it started again. ;) Tapestry is a wonderful framework, but it isn't the best known one around. Sometimes, managers ask us to provide some projects/sites/success stories/etc using it so they can be more confident about Tapestry. There's a Success Stories page in the wiki (http://wiki.apache.org/tapestry/SuccessStories), but it hasn't had any edit since 2007-10-05. What about sharing your success stories with us, promoting Tapestry (specially T5)? If the project is a public website, please post the URL here. I think we should have a list of Tapestry-powered sites. Thanks in advance. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to create analog of Spring FactoryBean?
Em Tue, 08 Sep 2009 11:27:06 -0300, Andrey Larionov escreveu: No, FactoryBean can create new instance on every call of getObject. Then you can create a new Tapestry-IoC scope (ServiceLifecycle implementation) that creates a new object everytime an injection is made. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to create analog of Spring FactoryBean?
Andrey Larionov schrieb: If i provide a factory bean as a property value, Spring use getObject return, to set property. On Tue, Sep 8, 2009 at 18:27, Andrey Larionov wrote: No, FactoryBean can create new instance on every call of getObject. On Tue, Sep 8, 2009 at 18:10, Sebastian Hennebrueder wrote: Spring or Pico Container or Guice or whatevery you like. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org With one I didn't mean a singleton but rather one kind of type. -- Best Regards / Viele Grüße Sebastian Hennebrueder - Software Developer and Trainer for Hibernate / Java Persistence http://www.laliluna.de - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to create analog of Spring FactoryBean?
If i provide a factory bean as a property value, Spring use getObject return, to set property. On Tue, Sep 8, 2009 at 18:27, Andrey Larionov wrote: > No, FactoryBean can create new instance on every call of getObject. > > On Tue, Sep 8, 2009 at 18:10, Sebastian Hennebrueder > wrote: >> Spring or Pico Container or Guice or whatevery you like. > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to create analog of Spring FactoryBean?
No, FactoryBean can create new instance on every call of getObject. On Tue, Sep 8, 2009 at 18:10, Sebastian Hennebrueder wrote: > Spring or Pico Container or Guice or whatevery you like. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to create analog of Spring FactoryBean?
Andrey Larionov schrieb: I want to remove a spring part from my project if possible. But i need analog of spring FactoryBean. Read documentation but dosnt found any point. I think solution is near of ObjectLocator or ObjectProvider, but have no idea how to start. Anybody solve this problem? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org Hello, as far as I remember a SpringFactoryBean creates only one service or bean. An ObjectProvider is something like a beanContext. It allows to integrate Spring or Pico Container or Guice or whatevery you like. You might be interesting in the buildFoo methods in the AppModule http://tapestry.apache.org/tapestry5.1/tapestry-ioc/service.html and in Advisor or Decorator. -- Best Regards / Viele Grüße Sebastian Hennebrueder - Software Developer and Trainer for Hibernate / Java Persistence http://www.laliluna.de - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to create analog of Spring FactoryBean?
Just more specific info. In spring i have FactoryBean for connections pool. it answers on FactoryBean.getObject calls with some db connection object. On Tue, Sep 8, 2009 at 18:01, Andrey Larionov wrote: > I want to remove a spring part from my project if possible. But i need > analog of spring FactoryBean. Read documentation but dosnt found any > point. I think solution is near of ObjectLocator or ObjectProvider, > but have no idea how to start. Anybody solve this problem? > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
How to create analog of Spring FactoryBean?
I want to remove a spring part from my project if possible. But i need analog of spring FactoryBean. Read documentation but dosnt found any point. I think solution is near of ObjectLocator or ObjectProvider, but have no idea how to start. Anybody solve this problem? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to .tml template access a class's static variable
Em Tue, 08 Sep 2009 01:39:41 -0300, Xuan Tran Le escreveu: - A.java -- public class A { private static String name; public static String getName() { return name; } /*some method here*/ } -- And from B.tml I want to get "name" value from getName() method. What should I do now? Easy: public class B { public String getName() { return A.getName(); } } Then use ${name} in your template. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: streamresponse actionlink and zone problem
Cheers, tried a little more to figure it out. Made a dead simple page, but the same problem. So I just rewrote the actionlink to a pagelink to a new page using target="_blank". That works, but flickers a little. The new download page returns the streamresponse in onActivate. thx Magnus On 8. sep.. 2009, at 11.37, Joost Schouten (ml) wrote: I think your pdf download will be upsetting your page state in some way. I generally choose to make a separate page to handle downloads. Otherwise isolation seems the way forward I would say and focus on the debuging javascript and the errors you might get there. Magnus Rundberget wrote: Cheers, Thx for swift reply. - Not using zone param in the actionlink for downloading the pdf though. I can't post the complete code (as its a whole lot going on :-) The page has the following layout; - Left column; Listing reports. Each report represented by an actionlink with zone param="reportDetails" (t:id="selectReport" context="report.id" zone="reportDetails">$ {report.name}) - Right column: Showing details about a report. The details are wrapped in a zone "reportDetails". Inside the zone is an actionlink to download a pdf (${message:report-downloadPdf }) the page class has the following code for the actionlinks mentioned above; // download pdf StreamResponse onActionFromDownloadPdf() { /* this code basically constructs a pdf and returns a StreamResponse, as described in http://wiki.apache.org/tapestry/Tapestry5HowToStreamAnExistingBinaryFile */ return new PDFTransformer().generatePDF(report); } // actionlink for returning reportDetails Zone Object onActionFromSelectReport(int id) { Report report = reportRepository.findById(id); return reportDetails.getBody(); } not much magic in this. Obviously since the page has lots of other stuff, this could be the cause, I might have to make a simpler page to isolate the problem, but was hoping that maybe someone else has stumbled upon a similar scenario... kind regards Magnus On 8. sep.. 2009, at 10.51, Joost Schouten (ml) wrote: Hi Magnus, I can't quite oversee your situation correctly, but it sounds like you have might have set the zone parameter on your actionlink for downloading your pdf. If your link returns a stream, tapestry cannot add the required JSON needed for appropriate zone handling and consequently obstructing the next zone updates. If this is the case, remove the zone parameter from your downloading link and it should work fine. Otherwise, post your code. Cheers, Joost Magnus Rundberget wrote: Hi, I have a page with a left hand listing of reports and a righthand zone showing details for the reports when clicking reportlinks in the listing. In the zone I have an actionlink for downloading a pdf version of the report. When clicking the links in the listing the zone updates correctly. But as soon as I click and download a pdf, the report- links on the lefthand side seizes to work. To get them working again I have to refresh the page. Using firebug I can see that the actionlink posts and receives the correct response, but the zone is never updated. Tried debugging the Tapestry Javascript but can't figure out where exactly it fails. (It does enter ZoneManager.updateFromURL, but never invokes ZoneManager.processReply) I've used the following wiki page as inspiration for returing the pdf: http://wiki.apache.org/tapestry/Tapestry5HowToStreamAnExistingBinaryFile anyone got any ideas ? regards Magnus - 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: [T5] how to pass a component reference to another component ?
Have a look at zones. Your action method could return a block. -- Best Regards / Viele Grüße Sebastian Hennebrueder - Software Developer and Trainer for Hibernate / Java Persistence http://www.laliluna.de CG schrieb: Hi all, I hv read through the wiki page on the passing parameter , and try a few times of code but not luck. I may hv the wrong concept , therefore, hopefully someone can help me this newbie .. My scenerio is like this I have a toolbar component , contain "Add", "Save" and "Delete" button. and I have a form which contain in another component , let's named it as Viewer. Both toolbar and Viewer are place on a Page When the user click "Add" , "Save", the Viewer should be updated in AJAX way. The "Add" , "Save" and "Delete" are ActionLink . Therefore, I have a event handler as below Object onActionFromToolbarAdd () { System.out.println("trigger in toolbar"); return ; } Is it correct ? Thx ... - 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
[T5] how to pass a component reference to another component ?
Hi all, I hv read through the wiki page on the passing parameter , and try a few times of code but not luck. I may hv the wrong concept , therefore, hopefully someone can help me this newbie .. My scenerio is like this I have a toolbar component , contain "Add", "Save" and "Delete" button. and I have a form which contain in another component , let's named it as Viewer. Both toolbar and Viewer are place on a Page When the user click "Add" , "Save", the Viewer should be updated in AJAX way. The "Add" , "Save" and "Delete" are ActionLink . Therefore, I have a event handler as below Object onActionFromToolbarAdd () { System.out.println("trigger in toolbar"); return ; } Is it correct ? Thx ... - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Problem with testify and @SessionState injection
Paul Field wrote: > Mats Henricson wrote on 08/09/2009 09:41:56: >> Mats Henricson wrote: >>> So, how should I inject my mocked @SessionState object? Is it >>> possible through the tester object, before I render the page? >> I'm testing this now. Hopefully it is kosher: >> >> ApplicationStateManager stateManager = >> tester.getRegistry().getService(ApplicationStateManager.class); >> stateManager.set(GameUserState.class, myMockGameUserState); >> tester.renderPage(...); > > That looks sensible to me - and it does make sense to use a mock in that > case. And it works too! My Testify machinery is now functional, and I've ironed out all ugly hacks as well. I promise to help out on the mailing list if testify issues pops up. Mats - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: How to .tml template access a class's static variable
Since it is public static can you not just have: - B.java -- public class B { public String getNameOfA() { return A.getName(); } } - B.tml -- ${nameOfA} Or am I missing something? If it was not static you could @InjectPage A as a field in page B and access it that way? Regards, Alfie. -Original Message- From: Xuan Tran Le [mailto:lexuanttk...@gmail.com] Sent: 08 September 2009 05:40 To: Tapestry users Subject: Re: How to .tml template access a class's static variable I have a stable system, so I don't want to modify so much code. In addition, your suggestion can cause the code duplicated and very hard to maintain. I will make clear my idea: for example, I have A class - A.java -- public class A { private static String name; public static String getName() { return name; } /*some method here*/ } -- And from B.tml I want to get "name" value from getName() method. What should I do now?
Re: Problem with testify and @SessionState injection
Mats Henricson wrote on 08/09/2009 09:41:56: > Mats Henricson wrote: > > So, how should I inject my mocked @SessionState object? Is it > > possible through the tester object, before I render the page? > > I'm testing this now. Hopefully it is kosher: > > ApplicationStateManager stateManager = > tester.getRegistry().getService(ApplicationStateManager.class); > stateManager.set(GameUserState.class, myMockGameUserState); > tester.renderPage(...); That looks sensible to me - and it does make sense to use a mock in that case. Paul --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.
Re: streamresponse actionlink and zone problem
I think your pdf download will be upsetting your page state in some way. I generally choose to make a separate page to handle downloads. Otherwise isolation seems the way forward I would say and focus on the debuging javascript and the errors you might get there. Magnus Rundberget wrote: Cheers, Thx for swift reply. - Not using zone param in the actionlink for downloading the pdf though. I can't post the complete code (as its a whole lot going on :-) The page has the following layout; - Left column; Listing reports. Each report represented by an actionlink with zone param="reportDetails" (t:id="selectReport" context="report.id" zone="reportDetails">${report.name}) - Right column: Showing details about a report. The details are wrapped in a zone "reportDetails". Inside the zone is an actionlink to download a pdf (t:id="downloadPdf">${message:report-downloadPdf}) the page class has the following code for the actionlinks mentioned above; // download pdf StreamResponse onActionFromDownloadPdf() { /* this code basically constructs a pdf and returns a StreamResponse, as described in http://wiki.apache.org/tapestry/Tapestry5HowToStreamAnExistingBinaryFile */ return new PDFTransformer().generatePDF(report); } // actionlink for returning reportDetails Zone Object onActionFromSelectReport(int id) { Report report = reportRepository.findById(id); return reportDetails.getBody(); } not much magic in this. Obviously since the page has lots of other stuff, this could be the cause, I might have to make a simpler page to isolate the problem, but was hoping that maybe someone else has stumbled upon a similar scenario... kind regards Magnus On 8. sep.. 2009, at 10.51, Joost Schouten (ml) wrote: Hi Magnus, I can't quite oversee your situation correctly, but it sounds like you have might have set the zone parameter on your actionlink for downloading your pdf. If your link returns a stream, tapestry cannot add the required JSON needed for appropriate zone handling and consequently obstructing the next zone updates. If this is the case, remove the zone parameter from your downloading link and it should work fine. Otherwise, post your code. Cheers, Joost Magnus Rundberget wrote: Hi, I have a page with a left hand listing of reports and a righthand zone showing details for the reports when clicking reportlinks in the listing. In the zone I have an actionlink for downloading a pdf version of the report. When clicking the links in the listing the zone updates correctly. But as soon as I click and download a pdf, the report-links on the lefthand side seizes to work. To get them working again I have to refresh the page. Using firebug I can see that the actionlink posts and receives the correct response, but the zone is never updated. Tried debugging the Tapestry Javascript but can't figure out where exactly it fails. (It does enter ZoneManager.updateFromURL, but never invokes ZoneManager.processReply) I've used the following wiki page as inspiration for returing the pdf: http://wiki.apache.org/tapestry/Tapestry5HowToStreamAnExistingBinaryFile anyone got any ideas ? regards Magnus - 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: streamresponse actionlink and zone problem
Cheers, Thx for swift reply. - Not using zone param in the actionlink for downloading the pdf though. I can't post the complete code (as its a whole lot going on :-) The page has the following layout; - Left column; Listing reports. Each report represented by an actionlink with zone param="reportDetails" (t:id="selectReport" context="report.id" zone="reportDetails">$ {report.name}) - Right column: Showing details about a report. The details are wrapped in a zone "reportDetails". Inside the zone is an actionlink to download a pdf (${message:report-downloadPdf }) the page class has the following code for the actionlinks mentioned above; // download pdf StreamResponse onActionFromDownloadPdf() { /* this code basically constructs a pdf and returns a StreamResponse, as described in http://wiki.apache.org/tapestry/Tapestry5HowToStreamAnExistingBinaryFile */ return new PDFTransformer().generatePDF(report); } // actionlink for returning reportDetails Zone Object onActionFromSelectReport(int id) { Report report = reportRepository.findById(id); return reportDetails.getBody(); } not much magic in this. Obviously since the page has lots of other stuff, this could be the cause, I might have to make a simpler page to isolate the problem, but was hoping that maybe someone else has stumbled upon a similar scenario... kind regards Magnus On 8. sep.. 2009, at 10.51, Joost Schouten (ml) wrote: Hi Magnus, I can't quite oversee your situation correctly, but it sounds like you have might have set the zone parameter on your actionlink for downloading your pdf. If your link returns a stream, tapestry cannot add the required JSON needed for appropriate zone handling and consequently obstructing the next zone updates. If this is the case, remove the zone parameter from your downloading link and it should work fine. Otherwise, post your code. Cheers, Joost Magnus Rundberget wrote: Hi, I have a page with a left hand listing of reports and a righthand zone showing details for the reports when clicking reportlinks in the listing. In the zone I have an actionlink for downloading a pdf version of the report. When clicking the links in the listing the zone updates correctly. But as soon as I click and download a pdf, the report-links on the lefthand side seizes to work. To get them working again I have to refresh the page. Using firebug I can see that the actionlink posts and receives the correct response, but the zone is never updated. Tried debugging the Tapestry Javascript but can't figure out where exactly it fails. (It does enter ZoneManager.updateFromURL, but never invokes ZoneManager.processReply) I've used the following wiki page as inspiration for returing the pdf: http://wiki.apache.org/tapestry/Tapestry5HowToStreamAnExistingBinaryFile anyone got any ideas ? regards Magnus - 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: streamresponse actionlink and zone problem
Hi Magnus, I can't quite oversee your situation correctly, but it sounds like you have might have set the zone parameter on your actionlink for downloading your pdf. If your link returns a stream, tapestry cannot add the required JSON needed for appropriate zone handling and consequently obstructing the next zone updates. If this is the case, remove the zone parameter from your downloading link and it should work fine. Otherwise, post your code. Cheers, Joost Magnus Rundberget wrote: Hi, I have a page with a left hand listing of reports and a righthand zone showing details for the reports when clicking reportlinks in the listing. In the zone I have an actionlink for downloading a pdf version of the report. When clicking the links in the listing the zone updates correctly. But as soon as I click and download a pdf, the report-links on the lefthand side seizes to work. To get them working again I have to refresh the page. Using firebug I can see that the actionlink posts and receives the correct response, but the zone is never updated. Tried debugging the Tapestry Javascript but can't figure out where exactly it fails. (It does enter ZoneManager.updateFromURL, but never invokes ZoneManager.processReply) I've used the following wiki page as inspiration for returing the pdf: http://wiki.apache.org/tapestry/Tapestry5HowToStreamAnExistingBinaryFile anyone got any ideas ? regards Magnus - 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 testify and @SessionState injection
Mats Henricson wrote: > Paul Field wrote: >> Mats Henricson wrote on 07/09/2009 12:48:39: >> >>> I am really close to get my Testify machinery working for >>> my first non-trivial page. The last hurdle (touch on wood) >>> is that the @ForComponents annotation doesn't inject my >>> mock object in fields annotated with @SessionState. >> I wouldn't expect you to use mock objects with @SessionState. Tapestry's >> PageTester (on which Testify is built) runs with a fake session so is able >> to store session information during your test. So I would expect >> @SessionState to work as it does in a live site. However, I haven't >> actually tried it - so I could be wrong. > > So, how should I inject my mocked @SessionState object? Is it > possible through the tester object, before I render the page? I'm testing this now. Hopefully it is kosher: ApplicationStateManager stateManager = tester.getRegistry().getService(ApplicationStateManager.class); stateManager.set(GameUserState.class, myMockGameUserState); tester.renderPage(...); Mats - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
streamresponse actionlink and zone problem
Hi, I have a page with a left hand listing of reports and a righthand zone showing details for the reports when clicking reportlinks in the listing. In the zone I have an actionlink for downloading a pdf version of the report. When clicking the links in the listing the zone updates correctly. But as soon as I click and download a pdf, the report-links on the lefthand side seizes to work. To get them working again I have to refresh the page. Using firebug I can see that the actionlink posts and receives the correct response, but the zone is never updated. Tried debugging the Tapestry Javascript but can't figure out where exactly it fails. (It does enter ZoneManager.updateFromURL, but never invokes ZoneManager.processReply) I've used the following wiki page as inspiration for returing the pdf: http://wiki.apache.org/tapestry/Tapestry5HowToStreamAnExistingBinaryFile anyone got any ideas ? regards Magnus - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: auto java reloading depends on package?
Hello Alfonso, it is not only the session, it is any kind of library which has parsed the bean for example or any kind of bean having a relation ship to the bean. It might be simpler to provide your own reloading mechanism for a complete module of the application. I am surprised that you publish tips on destroying other people work and income. Don't you expect payment for your work as well? -- Best Regards / Viele Grüße Sebastian Hennebrueder - Software Developer and Trainer for Hibernate / Java Persistence http://www.laliluna.de - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: auto java reloading depends on package?
Howard, first: thanks for the detailed answer. I only was thinking about web-tier-beans with no-dependecy, simple POJOs, but I think is tricky too, because you can have in the session the first version of "FooBean", and when you change it, the session will have a old implementation. So by now, for this specific case (I use wizard beans in web project) I'm using javarebel 2 and works OK, cons: it gives you a little overhead to your application, so I suggest to use it only when neccesary. The trial version gives you 30 day, because it doesn't have a license (javarebel.lic)... the tip is.. it creates a license with random name in %TEMP% (in my case.. C:\Documents and Settings\Administrador\Configuración local\Temp). The file name is random (6ZeEzVhue14Kw.tmp for me) and it's always 1kb. Just keep this folder clean and use it. I hope this is usefull for someone. Thanks again On Mon, Sep 7, 2009 at 1:42 PM, Howard Lewis Ship wrote: > Doing auto-reloading right is very tricky. You have to have control over > the lifecycle of objects, and the class loaders for those objects. For > Tapestry components this is possible and is, in effect, a side-effect of the > transforming technology that allows components to operate. To allow the > same kind of reloading beyond components is more involved, and would turn > Tapestry into an application server, rather than a framework. > Simply reloading a class may not be enough. For example, what if the class > being reloaded is a module class, thus changing the configuration of the IoC > container (including the configuration passed to some services)? > > Changing even a service implementation can have a rippling effect: the new > implementation may have new dependencies. Values obtained from the old > service may have been passed to other services; with external XML > configuration it might be possible to track this, but with Tapestry's > Java-centric approach, it is virtually impossible to know what data has > moved about the system. > > On Mon, Sep 7, 2009 at 9:03 AM, Alfonso Quiroga wrote: > >> Thanks for the fast answer. I think is very common in a >> web-application to have own web-tier objects, my example are Wizard >> Beans that I store in sessions. It would be great in the future to >> auto-reload this beans, by now I will try javarebel and I'll tell you >> my experience. Thanks again >> >> On Mon, Sep 7, 2009 at 12:53 PM, Howard Lewis Ship >> wrote: >> > Only components, inside the designated packages, can be auto-reloaded. >> > >> > On Sun, Sep 6, 2009 at 10:06 PM, Alfonso Quiroga > >wrote: >> > >> >> Hi! >> >> I have java classes in root.components... root.pages and root.base as >> >> usual. That works perfectly... >> >> but I was needing a new class to store in session, just a java bean >> >> (WizardBean) and I dropped it in "root.wizard", and auto-reloading >> >> does NOT work in that package. I tried to put in root.base.wizard, but >> >> there was an exception. Where can I put it for reloading works? thanks >> >> in advance! >> >> >> >> - >> >> 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! >> > >> >> - >> 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! > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org