Re: T5: Reading context before persistent fields are read
hi Kalle, i did some experiments on this some time back. my solution was to provide a decorator for the PersistentFieldManager service. This decorator would know it it was in a conversation and save the persistent fields respectivley. I also used the LinkFactory and the LinkFactoryListener to add the conversation id transparently to every link. g, kris Kalle Korhonen kalle.o.korho...@gmail.com 16.01.2009 00:19 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie ted.st...@gmail.com Thema Re: T5: Reading context before persistent fields are read Hey Ted, I happened to run into the same exact problem you were having while trying to get my custom conversational PersistentFieldStrategy implemented. Did you manage the solve the problem (reading values from activation context before gathering persistent fields) in any satisfactory way? Kalle On Fri, Jan 18, 2008 at 4:59 AM, Ted Steen ted.st...@gmail.com wrote: Hmm, i must have been very tired when i tested this yesterday. It doesnt work. The ComponentActionRequestFilter is handled after the persistent fields are gathered. So my activation context variable that I need when gathering persistent fields is not set before I gather the fields. I have tried to add the filter with before:* A solution would be to inject the Request into the PersistentFieldStrategy and get/decode the context from the path (or post variables when posting) .. but that is not very clean in my opinion. It would be nice if the gathering of fields was done a little later or maybe we could extend the Request API with a Object[] getActivationContext() Or do you have any other ideas. I feel I should explain my use case here.. We are developing a checkout service where the current cart beeing processed is passed around via a activation context variable (the cart-hash). This means that the persistent variables in the components should be per cart-hash. This can be done transparently by implementing a custom PersistentFieldStrategy which uses the first value in the activation context (we decided that the cart-hash should always be the first value). Or the hash could be a part of the domain like hash.mydomain.com, then the session is made unique per host and everything will work like expected. this is a third solution 2008/1/18, Howard Lewis Ship hls...@gmail.com: The pipelines and chains of command make it easy to slip in specific logic. OH, an alternative to defining a service to contain the data is to just write it as a Request attribute. I've used that approach for handling a few awkward cases. On Jan 17, 2008 5:56 PM, Ted Steen ted.st...@gmail.com wrote: Yep, that did it. Thanks! 2008/1/18, Howard Lewis Ship hls...@gmail.com: If you mean the event context (as opposed to the page activation context), then ... The path of least resistance is: 1) Define a service with a simple read/write property to store the context. Make sure this is perthread scope. 2) Contribute a filter to the ComponentActionRequestHandler pipeline. The filter can capture the event context and store it in your service. 3) In your PersistentFieldStrategy, inject the context-storing service and read the context. You might simplify #1 to just store the piece of data you need from the context. The approach is similar if you need page activation context, but you'll need to contribute a similar filter into the PageRenderRequestHandler pipeline as well. On Jan 17, 2008 12:13 PM, Ted Steen ted.st...@gmail.com wrote: I need to hook in somewhere between where the context is available and the persistent fields are read. I need to read a context variable just before my PersistentFieldStrategy tries to read from the session, as I need a value from the context when reading from the session. What should I inject into my PersistentFieldStrategy in order to be able to read the context? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- /ted - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind
Re: T5: Reading context before persistent fields are read
One proper solution to this is to add a decorator to handle() operations of PageRenderRequestHandler and/or ComponentEventRequestHandler that sticks the required parameters from the activation context somewhere, for example to a request attribute to keep it simple, to make it available to your custom PersistentFieldStrategy. Now I have a generic in-page conversational scope working well enough with a support for multiple tabs, not bad for one day's worth of work. A testament to the extensibility of T5, props to Howard for that! Kalle On Thu, Jan 15, 2009 at 3:19 PM, Kalle Korhonen kalle.o.korho...@gmail.comwrote: Hey Ted, I happened to run into the same exact problem you were having while trying to get my custom conversational PersistentFieldStrategy implemented. Did you manage the solve the problem (reading values from activation context before gathering persistent fields) in any satisfactory way? Kalle On Fri, Jan 18, 2008 at 4:59 AM, Ted Steen ted.st...@gmail.com wrote: Hmm, i must have been very tired when i tested this yesterday. It doesnt work. The ComponentActionRequestFilter is handled after the persistent fields are gathered. So my activation context variable that I need when gathering persistent fields is not set before I gather the fields. I have tried to add the filter with before:* A solution would be to inject the Request into the PersistentFieldStrategy and get/decode the context from the path (or post variables when posting) .. but that is not very clean in my opinion. It would be nice if the gathering of fields was done a little later or maybe we could extend the Request API with a Object[] getActivationContext() Or do you have any other ideas. I feel I should explain my use case here.. We are developing a checkout service where the current cart beeing processed is passed around via a activation context variable (the cart-hash). This means that the persistent variables in the components should be per cart-hash. This can be done transparently by implementing a custom PersistentFieldStrategy which uses the first value in the activation context (we decided that the cart-hash should always be the first value). Or the hash could be a part of the domain like hash.mydomain.com, then the session is made unique per host and everything will work like expected. this is a third solution 2008/1/18, Howard Lewis Ship hls...@gmail.com: The pipelines and chains of command make it easy to slip in specific logic. OH, an alternative to defining a service to contain the data is to just write it as a Request attribute. I've used that approach for handling a few awkward cases. On Jan 17, 2008 5:56 PM, Ted Steen ted.st...@gmail.com wrote: Yep, that did it. Thanks! 2008/1/18, Howard Lewis Ship hls...@gmail.com: If you mean the event context (as opposed to the page activation context), then ... The path of least resistance is: 1) Define a service with a simple read/write property to store the context. Make sure this is perthread scope. 2) Contribute a filter to the ComponentActionRequestHandler pipeline. The filter can capture the event context and store it in your service. 3) In your PersistentFieldStrategy, inject the context-storing service and read the context. You might simplify #1 to just store the piece of data you need from the context. The approach is similar if you need page activation context, but you'll need to contribute a similar filter into the PageRenderRequestHandler pipeline as well. On Jan 17, 2008 12:13 PM, Ted Steen ted.st...@gmail.com wrote: I need to hook in somewhere between where the context is available and the persistent fields are read. I need to read a context variable just before my PersistentFieldStrategy tries to read from the session, as I need a value from the context when reading from the session. What should I inject into my PersistentFieldStrategy in order to be able to read the context? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- /ted - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind
Re: T5: Reading context before persistent fields are read
Hey Kristian, yeah I ended up with decorators as well. Did your implementation get any further than experimental stage? If it's available somewhere, I'd gladly take a look to compare. Eventually I'll probably make this or some improved version available as part of Trails 2. Kalle On Fri, Jan 16, 2009 at 12:21 AM, Kristian Marinkovic kristian.marinko...@porsche.co.at wrote: hi Kalle, i did some experiments on this some time back. my solution was to provide a decorator for the PersistentFieldManager service. This decorator would know it it was in a conversation and save the persistent fields respectivley. I also used the LinkFactory and the LinkFactoryListener to add the conversation id transparently to every link. g, kris Kalle Korhonen kalle.o.korho...@gmail.com 16.01.2009 00:19 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie ted.st...@gmail.com Thema Re: T5: Reading context before persistent fields are read Hey Ted, I happened to run into the same exact problem you were having while trying to get my custom conversational PersistentFieldStrategy implemented. Did you manage the solve the problem (reading values from activation context before gathering persistent fields) in any satisfactory way? Kalle On Fri, Jan 18, 2008 at 4:59 AM, Ted Steen ted.st...@gmail.com wrote: Hmm, i must have been very tired when i tested this yesterday. It doesnt work. The ComponentActionRequestFilter is handled after the persistent fields are gathered. So my activation context variable that I need when gathering persistent fields is not set before I gather the fields. I have tried to add the filter with before:* A solution would be to inject the Request into the PersistentFieldStrategy and get/decode the context from the path (or post variables when posting) .. but that is not very clean in my opinion. It would be nice if the gathering of fields was done a little later or maybe we could extend the Request API with a Object[] getActivationContext() Or do you have any other ideas. I feel I should explain my use case here.. We are developing a checkout service where the current cart beeing processed is passed around via a activation context variable (the cart-hash). This means that the persistent variables in the components should be per cart-hash. This can be done transparently by implementing a custom PersistentFieldStrategy which uses the first value in the activation context (we decided that the cart-hash should always be the first value). Or the hash could be a part of the domain like hash.mydomain.com, then the session is made unique per host and everything will work like expected. this is a third solution 2008/1/18, Howard Lewis Ship hls...@gmail.com: The pipelines and chains of command make it easy to slip in specific logic. OH, an alternative to defining a service to contain the data is to just write it as a Request attribute. I've used that approach for handling a few awkward cases. On Jan 17, 2008 5:56 PM, Ted Steen ted.st...@gmail.com wrote: Yep, that did it. Thanks! 2008/1/18, Howard Lewis Ship hls...@gmail.com: If you mean the event context (as opposed to the page activation context), then ... The path of least resistance is: 1) Define a service with a simple read/write property to store the context. Make sure this is perthread scope. 2) Contribute a filter to the ComponentActionRequestHandler pipeline. The filter can capture the event context and store it in your service. 3) In your PersistentFieldStrategy, inject the context-storing service and read the context. You might simplify #1 to just store the piece of data you need from the context. The approach is similar if you need page activation context, but you'll need to contribute a similar filter into the PageRenderRequestHandler pipeline as well. On Jan 17, 2008 12:13 PM, Ted Steen ted.st...@gmail.com wrote: I need to hook in somewhere between where the context is available and the persistent fields are read. I need to read a context variable just before my PersistentFieldStrategy tries to read from the session, as I need a value from the context when reading from the session. What should I inject into my PersistentFieldStrategy in order to be able to read the context? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind -
Re: Forms
in the end I managed a different way: created a pdsQuery with @Persist and onSuccess dsQuery sets pdsQuery and it worked. But looks too lame. In jumpstart Geoff used a common submit. Also: is there a way to after the submit hide the Start? Keep it in server.ext/app/ ? On Fri, Jan 16, 2009 at 6:09 AM, Kristian Marinkovic kristian.marinko...@porsche.co.at wrote: hi sid, you need to use a Tapestry Submit component to submit the form. otherwise the request wont be processed by Tapestry g, kris Sid Ferreira sid@gmail.com 15.01.2009 20:58 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Forms Guys, Im trying to make a small search engine, but It isn't working.follows the code: TML: html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head titleTibox Test App/title /head body div id=wrap div id=top/div div id=content div class=header h1Allert/h1 h2Fast Support/h2 /div div class=middle style type=text/css .lista { width: 100%; } /style form t:type=form t:id=names class=lista t:errors/ table tr tdinput t:type=TextField t:id=dsQuery //td td width=15%input type=submit value=Atualizar//td /tr /table /form /div div class=clear id=clear/div /div div id=bottom/div /div div id=footer /div /body /html Java: public class Start { @Component(id = names) private Form _form; private Long cdCliente = new Long(7); @Property private String dsQuery; @Component(id = dsQuery) private TextField dsQueryField; void onValidateForm() { if (dsQuery == null || dsQuery.trim().equals()) { _form.recordError(dsQueryField, First Name is required.); } } Object onSuccess() { //new Exception(E... + dsQuery).printStackTrace(); return this; } } It had no onSuccess, but didn't worked either. Im using the same Start.java as response to the form. -- Sidney G B Ferreira Desenvolvedor Web - Tibox Innovations -- Sidney G B Ferreira Desenvolvedor Web - Tibox Innovations
Re: Forms
As far as I know you can use a standard submit button. -- If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Please visit http://www.albourne.com/email.html for important additional terms relating to this e-mail. - Original Message - From: Sid Ferreira sid@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Friday, 16 January, 2009 10:46:11 AM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: Forms in the end I managed a different way: created a pdsQuery with @Persist and onSuccess dsQuery sets pdsQuery and it worked. But looks too lame. In jumpstart Geoff used a common submit. Also: is there a way to after the submit hide the Start? Keep it in server.ext/app/ ? On Fri, Jan 16, 2009 at 6:09 AM, Kristian Marinkovic kristian.marinko...@porsche.co.at wrote: hi sid, you need to use a Tapestry Submit component to submit the form. otherwise the request wont be processed by Tapestry g, kris Sid Ferreira sid@gmail.com 15.01.2009 20:58 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Forms Guys, Im trying to make a small search engine, but It isn't working.follows the code: TML: html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head titleTibox Test App/title /head body div id=wrap div id=top/div div id=content div class=header h1Allert/h1 h2Fast Support/h2 /div div class=middle style type=text/css .lista { width: 100%; } /style form t:type=form t:id=names class=lista t:errors/ table tr tdinput t:type=TextField t:id=dsQuery //td td width=15%input type=submit value=Atualizar//td /tr /table /form /div div class=clear id=clear/div /div div id=bottom/div /div div id=footer /div /body /html Java: public class Start { @Component(id = names) private Form _form; private Long cdCliente = new Long(7); @Property private String dsQuery; @Component(id = dsQuery) private TextField dsQueryField; void onValidateForm() { if (dsQuery == null || dsQuery.trim().equals()) { _form.recordError(dsQueryField, First Name is required.); } } Object onSuccess() { //new Exception(E... + dsQuery).printStackTrace(); return this; } } It had no onSuccess, but didn't worked either. Im using the same Start.java as response to the form. -- Sidney G B Ferreira Desenvolvedor Web - Tibox Innovations -- Sidney G B Ferreira Desenvolvedor Web - Tibox Innovations - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Hiding the Index
Guys, at this moment Im preparing a small page with a search form wich requires login.After few tests, Ive noticed that the way I did, when I submit the search the index class (Start or Index) appear in the url address. Is there a way to hide it? Forwarding instead of redirecting? Thanks in advance -- Sidney G B Ferreira Desenvolvedor Web - Tibox Innovations
Re: T5: Reading context before persistent fields are read
hi kalle, i consider it still experimental. it is only possible to start and stop a conversation programmatically. it is still based on Tapestry 5.0.7-SNAPSHOT. i will try to update it to 5.0.18 over the weekend... g, kris Kalle Korhonen kalle.o.korho...@gmail.com 16.01.2009 09:29 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: T5: Reading context before persistent fields are read Hey Kristian, yeah I ended up with decorators as well. Did your implementation get any further than experimental stage? If it's available somewhere, I'd gladly take a look to compare. Eventually I'll probably make this or some improved version available as part of Trails 2. Kalle On Fri, Jan 16, 2009 at 12:21 AM, Kristian Marinkovic kristian.marinko...@porsche.co.at wrote: hi Kalle, i did some experiments on this some time back. my solution was to provide a decorator for the PersistentFieldManager service. This decorator would know it it was in a conversation and save the persistent fields respectivley. I also used the LinkFactory and the LinkFactoryListener to add the conversation id transparently to every link. g, kris Kalle Korhonen kalle.o.korho...@gmail.com 16.01.2009 00:19 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie ted.st...@gmail.com Thema Re: T5: Reading context before persistent fields are read Hey Ted, I happened to run into the same exact problem you were having while trying to get my custom conversational PersistentFieldStrategy implemented. Did you manage the solve the problem (reading values from activation context before gathering persistent fields) in any satisfactory way? Kalle On Fri, Jan 18, 2008 at 4:59 AM, Ted Steen ted.st...@gmail.com wrote: Hmm, i must have been very tired when i tested this yesterday. It doesnt work. The ComponentActionRequestFilter is handled after the persistent fields are gathered. So my activation context variable that I need when gathering persistent fields is not set before I gather the fields. I have tried to add the filter with before:* A solution would be to inject the Request into the PersistentFieldStrategy and get/decode the context from the path (or post variables when posting) .. but that is not very clean in my opinion. It would be nice if the gathering of fields was done a little later or maybe we could extend the Request API with a Object[] getActivationContext() Or do you have any other ideas. I feel I should explain my use case here.. We are developing a checkout service where the current cart beeing processed is passed around via a activation context variable (the cart-hash). This means that the persistent variables in the components should be per cart-hash. This can be done transparently by implementing a custom PersistentFieldStrategy which uses the first value in the activation context (we decided that the cart-hash should always be the first value). Or the hash could be a part of the domain like hash.mydomain.com, then the session is made unique per host and everything will work like expected. this is a third solution 2008/1/18, Howard Lewis Ship hls...@gmail.com: The pipelines and chains of command make it easy to slip in specific logic. OH, an alternative to defining a service to contain the data is to just write it as a Request attribute. I've used that approach for handling a few awkward cases. On Jan 17, 2008 5:56 PM, Ted Steen ted.st...@gmail.com wrote: Yep, that did it. Thanks! 2008/1/18, Howard Lewis Ship hls...@gmail.com: If you mean the event context (as opposed to the page activation context), then ... The path of least resistance is: 1) Define a service with a simple read/write property to store the context. Make sure this is perthread scope. 2) Contribute a filter to the ComponentActionRequestHandler pipeline. The filter can capture the event context and store it in your service. 3) In your PersistentFieldStrategy, inject the context-storing service and read the context. You might simplify #1 to just store the piece of data you need from the context. The approach is similar if you need page activation context, but you'll need to contribute a similar filter into the PageRenderRequestHandler pipeline as well. On Jan 17, 2008 12:13 PM, Ted Steen ted.st...@gmail.com wrote: I need to hook in somewhere between where the context is available and the persistent fields are read. I need to read a context variable just before my PersistentFieldStrategy tries to read from the session, as I need a value from the context when reading from the session. What should I inject into my
Re: Forms
Em Fri, 16 Jan 2009 05:59:00 -0300, Peter Stavrinides p.stavrini...@albourne.com escreveu: As far as I know you can use a standard submit button. You're absolutely correct. I *never* used the Submit component, and I'm writing Tapestry 5 applications since 5.0.5 (almost two years ago). :) By the way, you don't need an onSuccess method to Tapestry update your objects with the values entered by the user. You use onSucess for doing a search or writing an object to a database, for example. -- 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: Forms
Em Thu, 15 Jan 2009 16:58:10 -0300, Sid Ferreira sid@gmail.com escreveu: Object onSuccess() { //new Exception(E... + dsQuery).printStackTrace(); return this; } Never return this in a event handler method. This leads to loss of field values when they are not persisted in the session. -- 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: Forms
I was losing the values anyway... On Fri, Jan 16, 2009 at 10:13 AM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Thu, 15 Jan 2009 16:58:10 -0300, Sid Ferreira sid@gmail.com escreveu: Object onSuccess() { //new Exception(E... + dsQuery).printStackTrace(); return this; } Never return this in a event handler method. This leads to loss of field values when they are not persisted in the session. -- 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 -- Sidney G B Ferreira Desenvolvedor Web - Tibox Innovations
Re: Forms
Em Fri, 16 Jan 2009 08:35:54 -0300, Sid Ferreira sid@gmail.com escreveu: I was losing the values anyway... Ooops. I forgot to say that you should return null instead of this. And I just can't see why you say you're losing the fields values, as in no place in your code you print them in HTML nor the standard output. -- 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: T5 and hibernate slowing with more records
Hello, Thank you for everyone's input. I had originally taken out the sub queries from the main method and moved them to another method(IE check if city is there if not add it and link the foreign key) and then moved it to a map held in memory(still putting unknown ones in the db) so there were less calls to the db. This didn't help but then I moved back to the @CommitAfter(which was the original way I had started) and it worked fine. I like your clear idea and creating my own transactions. I think I'll give that a go as well. --James -Original Message- From: Jonathan Barker [mailto:jonathan.theit...@gmail.com] Sent: January-16-09 12:31 AM To: 'Tapestry users' Subject: RE: T5 and hibernate slowing with more records Been there, hit that. You need to clear() the session. Or, you can also evict() as you go. Basically, every time Hibernate needs to commit something, it needs to flush to the database, and it looks at all of the Hibernate objects that it knows about - not just those to which you have current references. For every object you handle, you add one more that it needs to check to see if it needs to have changes flushed. The clear() gets rid of anything you are not holding a reference to. I tend to do it every ten records or so, but I've never tried to optimize it. The other option, as someone suggested, is to commit a batch rather than single records, but that can be nasty for large sets. I'm working with an import of about 250,000 records as I write this. Jonathan -Original Message- From: James Sherwood [mailto:jsherw...@rgisolutions.com] Sent: Thursday, January 15, 2009 13:16 To: 'Tapestry users' Subject: T5 and hibernate slowing with more records Hello, I am using POI to take an excel file and put it into a Mysql database using hibernate. I put a counter on the records going into the database and it starts off fast but then slows to over 15 seconds a record and I cannot figure out why. My code is basically this: Public class DatabaseDump{ @Inject Private Session _session; Public void onAction(){ //they hit the go button Loop rows{ _session.beginTransaction(); Loop cells{ Fill the object from the cells _session.save(Object); } _session.getTransaction().commit(); } } Everything works fine as in the database gets filled for the rows it has completed but gradually slows to a crawl and at around 2700 records of 10500 records it's a record every 15 seconds. I run the project under eclipse using Tomcat. The memory starts at around 80mb and only goes up to around 110mb. What am I doing wrong? --James - 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: Forms
I expected to see them inside the text fields On Fri, Jan 16, 2009 at 10:45 AM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Fri, 16 Jan 2009 08:35:54 -0300, Sid Ferreira sid@gmail.com escreveu: I was losing the values anyway... Ooops. I forgot to say that you should return null instead of this. And I just can't see why you say you're losing the fields values, as in no place in your code you print them in HTML nor the standard output. -- 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 -- Sidney G B Ferreira Desenvolvedor Web - Tibox Innovations
Where to check that the user is logged in when rendering a page
Hi, I have been reading the documentation, and I haven't seen what I need to find out: How can a page finding that the user is not logged in, it should jump to a login page, and optionally jump back to the requested page? I already know how to check the session to see if a) there is a session, and b) that a user logged in correctly. What I need to know is: 1. What method/annotation do I need to write in my page class before the page renders 2. Presumably, I want to return a Page or a URL from this method, to redirect to the login page. 3. Should the login page take a hidden field to say which page it wants to go to next? BTW, I would love to see, in one place, a list of all the methods added by the classloader, how it was triggered. The list I know about are: 1. Component Rendering Methods: setupRender, beginRender, beforeRenderTemplate, beforeRenderBody, afterRenderBody, afterRenderTemplate, afterRender, cleanupRender. 2. Page Lifecycle methods: pageLoaded, pageAttached, pageDetached 3. Page activation events: onActivate, onPassivate 4. Action events: onActionFromBlah, onSubmit 5. Form events: prepareForRender, prepare, prepareForSubmit, onValidate, onSuccess, onFailure, onSubmit 6. getters and setters of @Property annotated private attributes. No doubt I've missed a few more. Thanks, Jonathan - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
[T5] creating event links without the page activation context being encoded into the URL
Hello, I've got a problem with creating stateless event links. I've got a page, which has an activation context. On the page, there's a component, that displays images. These images are rendered by a service, which I have injected into the component. In the component, I use an event link and a handler method, that uses a method of the service to have the images created. The problem I run into is, that the created event links get the page activation context encoded as t:ac URL parameter. This information is needed neither by the component nor by the service, but it prevents the browser from caching the images. Can I somehow create event links without this parameter? Regards, Jochen __ Deutschlands größte Online-Videothek schenkt Ihnen 12.000 Videos!* http://entertainment.web.de/de/entertainment/maxdome/index.html - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] creating event links without the page activation context being encoded into the URL
On Fri, Jan 16, 2009 at 8:13 AM, Jochen Kemnade jochenkemn...@web.de wrote: Hello, Hello! I've got a problem with creating stateless event links. I've got a page, which has an activation context. On the page, there's a component, that displays images. These images are rendered by a service, which I have injected into the component. In the component, I use an event link and a handler method, that uses a method of the service to have the images created. The problem I run into is, that the created event links get the page activation context encoded as t:ac URL parameter. This information is needed neither by the component nor by the service, but it prevents the browser from caching the images. Can I somehow create event links without this parameter? What value are you passing to the context field of LinkFactory.createComponentEventLink()? AFAIK, Tapestry always adds the current activation context to any links, unless you specify an activation context yourself. Try createComponentEventLink(Page page, String nestedId, String eventType, boolean forForm, new Object[0]). -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
T5 AJAX
Hi I'm considering to move to T5 for a major new project. I evaluated T4 at some length a couple of years ago but went a different way for my needs at the time. We have experience with JQuery. I understand that T5 comes with prototype and scriptaculous support. How easy is it to replace those with Jquery? Or is it possible for them to 'coexist'? Does anyone have any specific experience of using Jquery and T5? Regards Alan Chaney - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5 AJAX
On Fri, Jan 16, 2009 at 2:02 PM, Alan Chaney a...@compulsivecreative.com wrote: Hi Hi! I'm considering to move to T5 for a major new project. I evaluated T4 at some length a couple of years ago but went a different way for my needs at the time. We have experience with JQuery. I understand that T5 comes with prototype and scriptaculous support. How easy is it to replace those with Jquery? Or is it possible for them to 'coexist'? AFAIK, nobody tried to replace Prototype/Scriptaculous in Tapestry 5 yet. On the other hand, they can coexist, as documented here: http://docs.jquery.com/Using_jQuery_with_Other_Libraries. Summary: you can use both at the same time, you will just need to use $jQuery() or $j() instead of $(). -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Where to check that the user is logged in when rendering a page
Thiago, thanks very much. That's basically what I did, and it works, but I don't like: a) not having a passivate method (I have no need of one yet) and b) I feel (due to the examples in the documentation) that activate should take a parameter as the id of some object I want to resurrect. No doubt, I'll get used to it. Ciao, Jonathan On 16/01/2009 15:55, Thiago HP wrote: On Fri, Jan 16, 2009 at 1:42 PM, Jonathan O'Connorninki...@eircom.net wrote: Hi, Hi! I have been reading the documentation, and I haven't seen what I need to find out: How can a page finding that the user is not logged in, it should jump to a login page, and optionally jump back to the requested page? Use onActivate. One way to do it: @InjectPage private LoginPage loginPage; Object onActivate() { if (user is not logged in) { // you could set any properties in the login page here. return loginPage; } else { return null; // continue rendering this page normally. } } On the other hand, if you need this behaviour to be applied to more than one page, a RequestFilter would be the best way, as this would put all the code in a single place and the pages wouldn't need to bother with this issues. In this mailing list you can find some examples, maybe in the wiki too. ;) - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Where to check that the user is logged in when rendering a page
On Fri, Jan 16, 2009 at 2:14 PM, Jonathan O'Connor ninki...@eircom.net wrote: Thiago, thanks very much. You're welcome! b) I feel (due to the examples in the documentation) that activate should take a parameter as the id of some object I want to resurrect. onActivate is a method that handles (is invoked) the activate event: a page was requested and is about to be rendered. Receiving activation context parameters is just a bonus. :) Ciao, Ciao! (That's the Italian way to write it. Brazilians pronounce it always the same, but write tchau.) -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Where to check that the user is logged in when rendering a page
On Fri, Jan 16, 2009 at 1:42 PM, Jonathan O'Connor ninki...@eircom.net wrote: Hi, Hi! I have been reading the documentation, and I haven't seen what I need to find out: How can a page finding that the user is not logged in, it should jump to a login page, and optionally jump back to the requested page? Use onActivate. One way to do it: @InjectPage private LoginPage loginPage; Object onActivate() { if (user is not logged in) { // you could set any properties in the login page here. return loginPage; } else { return null; // continue rendering this page normally. } } On the other hand, if you need this behaviour to be applied to more than one page, a RequestFilter would be the best way, as this would put all the code in a single place and the pages wouldn't need to bother with this issues. In this mailing list you can find some examples, maybe in the wiki too. ;) -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T4.1] OGNL performance problem (serialization)
I found tapestry-prop-1.0.0 at http://howardlewisship.com/tapestry-javaforge/tapestry-prop/. I cannot seem to get it to work in 4.1.3 or 4.1.6. In both cases when I use it on a simple expression I get the exception below. I assumed that this was expected and that tapestry-prop was not supposed to work in 4.1.3+. Did I just do something wrong, and can I get it to work somehow? I would really prefer this if I can get it working. The alternative seems to be to re-structure my entire application to put ALL potentially slow computation in pageBeginRender, resulting in all ognl expressions being simple getters/setters. That would be a lot of work and I think it would not be a very clean solution. Does anyone have another approach? -- exception follows -- javassist.NotFoundException Stack Trace: javassist.ClassPool.get(ClassPool.java:436) org.apache.tapestry.enhance.CtClassSource.getCtClass(CtClassSource.java:50) org.apache.tapestry.enhance.AbstractFab.convertClass(AbstractFab.java:82) org.apache.tapestry.enhance.ClassFabImpl.addField(ClassFabImpl.java:238) com.javaforge.tapestry.prop.PropertyAccessorClassFactoryImpl.constructClass(PropertyAccessorClassFactoryImpl.java:74) $PropertyAccessorClassFactory_11ee0816124.constructClass($PropertyAccessorClassFactory_11ee0816124.java) $PropertyAccessorClassFactory_11ee0816123.constructClass($PropertyAccessorClassFactory_11ee0816123.java) com.javaforge.tapestry.prop.PropertyAccessorSourceImpl.createNewAccessorClass(PropertyAccessorSourceImpl.java:139) com.javaforge.tapestry.prop.PropertyAccessorSourceImpl.getCachedPropertyAccessorClass(PropertyAccessorSourceImpl.java:87) com.javaforge.tapestry.prop.PropertyAccessorSourceImpl.getAccessor(PropertyAccessorSourceImpl.java:55) $PropertyAccessorSource_11ee0816122.getAccessor($PropertyAccessorSource_11ee0816122.java) $PropertyAccessorSource_11ee0816121.getAccessor($PropertyAccessorSource_11ee0816121.java) com.javaforge.tapestry.prop.PropertyAccessorBindingFactory.createBinding(PropertyAccessorBindingFactory.java:36) $BindingFactory_11ee08160db.createBinding($BindingFactory_11ee08160db.java) $BindingFactory_11ee08160da.createBinding($BindingFactory_11ee08160da.java) org.apache.tapestry.services.impl.BindingSourceImpl.createBinding(BindingSourceImpl.java:99) $BindingSource_11ee0815f8d.createBinding($BindingSource_11ee0815f8d.java) org.apache.tapestry.services.impl.ComponentTemplateLoaderLogic.addTemplateBindings(ComponentTemplateLoaderLogic.java:277) org.apache.tapestry.services.impl.ComponentTemplateLoaderLogic.process(ComponentTemplateLoaderLogic.java:182) org.apache.tapestry.services.impl.ComponentTemplateLoaderLogic.process(ComponentTemplateLoaderLogic.java:98) org.apache.tapestry.services.impl.ComponentTemplateLoaderLogic.loadTemplate(ComponentTemplateLoaderLogic.java:75) org.apache.tapestry.services.impl.ComponentTemplateLoaderImpl.loadTemplate(ComponentTemplateLoaderImpl.java:60) $ComponentTemplateLoader_11ee0816051.loadTemplate($ComponentTemplateLoader_11ee0816051.java) org.apache.tapestry.pageload.PageLoader.loadTemplateForComponent(PageLoader.java:673) org.apache.tapestry.BaseComponent.readTemplate(BaseComponent.java:92) org.apache.tapestry.BaseComponent.finishLoad(BaseComponent.java:122) $Announcement_14.finishLoad($Announcement_14.java) org.apache.tapestry.pageload.PageLoader.constructComponent(PageLoader.java:408) org.apache.tapestry.pageload.PageLoader.loadPage(PageLoader.java:639) $IPageLoader_11ee0816045.loadPage($IPageLoader_11ee0816045.java) $IPageLoader_11ee0816046.loadPage($IPageLoader_11ee0816046.java) org.apache.tapestry.pageload.PageSource.makeObject(PageSource.java:152) org.apache.commons.pool.impl.TapestryKeyedObjectPool.borrowObject(TapestryKeyedObjectPool.java:971) org.apache.tapestry.pageload.PageSource.getPage(PageSource.java:176) $IPageSource_11ee0815fbf.getPage($IPageSource_11ee0815fbf.java) org.apache.tapestry.engine.RequestCycle.loadPage(RequestCycle.java:241) org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:228) com.adaptiveplanning.ui.page.Login.attemptLogin(Login.java:399) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeTargetMethod(ListenerMethodInvokerImpl.java:276) org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod(ListenerMethodInvokerImpl.java:221) org.apache.tapestry.listener.ListenerMethodInvokerImpl.searchAndInvoke(ListenerMethodInvokerImpl.java:157) org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod(ListenerMethodInvokerImpl.java:80) org.apache.tapestry.listener.SyntheticListener.actionTriggered(SyntheticListener.java:52)
Re: Strange ClassNotFoundException: org.slf4j.Logger
I'm having the exact same problem and I checked that it's not there twice... weird... Uli Joachim Van der Auwera schrieb: I assume slf4j is on the classpath twice... Thiago HP wrote: Hi! I'm having a very strange exception when trying to run a T5 application (www.arsmachina.com.br/project/example): Error obtaining injected value for field org.apache.tapestry5.corelib.components.Form.logger: java.lang.ClassNotFoundException: org.slf4j.Logger It seems to be a Tapestry classloading issue, as slf4j-api *is* in the classpath. At my home, when running from JettyLauncher (modified to run under Java 6), runs OK. Under Run-Jetty-Run, the exception is thrown. Running an embedded Jetty at my home, ok, at my work, exception raised. Thanks in advance. Full stack trace: java.lang.RuntimeException: java.lang.ClassNotFoundException: caught an exception while obtaining a class file for org.apache.tapestry5.corelib.components.Form at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.findClass(ComponentInstantiatorSourceImpl.java:296) at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.findInstantiator(ComponentInstantiatorSourceImpl.java:272) at $ComponentInstantiatorSource_11ed4d10948.findInstantiator($ComponentInstantiatorSource_11ed4d10948.java) at org.apache.tapestry5.internal.services.PageElementFactoryImpl.newComponentElement(PageElementFactoryImpl.java:216) ... 144 more Caused by: java.lang.ClassNotFoundException: caught an exception while obtaining a class file for org.apache.tapestry5.corelib.components.Form at javassist.Loader.findClass(Loader.java:359) at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl$PackageAwareLoader.findClass(ComponentInstantiatorSourceImpl.java:92) at javassist.Loader.loadClass(Loader.java:311) at java.lang.ClassLoader.loadClass(Unknown Source) at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.findClass(ComponentInstantiatorSourceImpl.java:292) ... 147 more Caused by: org.apache.tapestry5.internal.services.TransformationException: Error obtaining injected value for field org.apache.tapestry5.corelib.components.Form.logger: java.lang.ClassNotFoundException: org.slf4j.Logger at org.apache.tapestry5.internal.services.ComponentClassTransformerImpl.transformComponentClass(ComponentClassTransformerImpl.java:176) at $ComponentClassTransformer_11ed4d10954.transformComponentClass($ComponentClassTransformer_11ed4d10954.java) at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.onLoad(ComponentInstantiatorSourceImpl.java:201) at javassist.Loader.findClass(Loader.java:340) ... 151 more Caused by: java.lang.RuntimeException: Error obtaining injected value for field org.apache.tapestry5.corelib.components.Form.logger: java.lang.ClassNotFoundException: org.slf4j.Logger at org.apache.tapestry5.internal.transform.InjectWorker.transform(InjectWorker.java:68) at $ComponentClassTransformWorker_11ed4d109a4.transform($ComponentClassTransformWorker_11ed4d109a4.java) at $ComponentClassTransformWorker_11ed4d1099a.transform($ComponentClassTransformWorker_11ed4d1099a.java) at org.apache.tapestry5.internal.services.ComponentClassTransformerImpl.transformComponentClass(ComponentClassTransformerImpl.java:170) ... 154 more Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.slf4j.Logger at org.apache.tapestry5.internal.services.InternalClassTransformationImpl.toClass(InternalClassTransformationImpl.java:1765) at org.apache.tapestry5.internal.transform.InjectWorker.transform(InjectWorker.java:55) ... 157 more Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at javassist.Loader.delegateToParent(Loader.java:428) at javassist.Loader.loadClass(Loader.java:314) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.apache.tapestry5.internal.services.InternalClassTransformationImpl.toClass(InternalClassTransformationImpl.java:1761) - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: profiling tapestry components
Are you using Tapestry 5.0.18 or 5.1.0.0-SNAPSHOT? I've added some considerable performance improvements to 5.1. I would get a copy of YourKit and start profiling to see where the actual problems are. Tapestry takes a hit because it renders the entire document to a kind of light-weight DOM before it can start to stream the output; that's a lot of churn in the JVM's eden heap space. On Thu, Jan 15, 2009 at 8:17 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Thu, 15 Jan 2009 23:19:56 -0300, Fernando Padilla f...@alum.mit.edu escreveu: The database was just upgraded and io/cpu is really really low. So that won't be the case. I would still check this out . . . Don't forget about one transaction waiting for others to release locks in table rows . . . The root cause might be the number of db requests required to render a page, but the database it self is not the bottle neck. :) :) A real case I found as a consultant was the lack of attention to Hibernate mapping options, specially regarding lazy loading of collections. Instead of using one or two selects to load an entity object and one of its lists, it was using one for each element in the list. This absolutely kills performance. By the way, nice performance improvement hunting! :) Don't forget to share your experience with us. ;) -- 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 -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Where to check that the user is logged in when rendering a page
I would recommend checking out chenillekit-access. See http://www.chenillekit.org/chenillekit-access/index.html Documentation is minimal, but there is an example in the source code. Kind regards, Joachim Jonathan O'Connor wrote: Hi, I have been reading the documentation, and I haven't seen what I need to find out: How can a page finding that the user is not logged in, it should jump to a login page, and optionally jump back to the requested page? I already know how to check the session to see if a) there is a session, and b) that a user logged in correctly. What I need to know is: 1. What method/annotation do I need to write in my page class before the page renders 2. Presumably, I want to return a Page or a URL from this method, to redirect to the login page. 3. Should the login page take a hidden field to say which page it wants to go to next? BTW, I would love to see, in one place, a list of all the methods added by the classloader, how it was triggered. The list I know about are: 1. Component Rendering Methods: setupRender, beginRender, beforeRenderTemplate, beforeRenderBody, afterRenderBody, afterRenderTemplate, afterRender, cleanupRender. 2. Page Lifecycle methods: pageLoaded, pageAttached, pageDetached 3. Page activation events: onActivate, onPassivate 4. Action events: onActionFromBlah, onSubmit 5. Form events: prepareForRender, prepare, prepareForSubmit, onValidate, onSuccess, onFailure, onSubmit 6. getters and setters of @Property annotated private attributes. No doubt I've missed a few more. Thanks, Jonathan - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Joachim Van der Auwera PROGS bvba, progs.be - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: profiling tapestry components
I'm using 5.1.0.0. But I'm sorry to confuse you all. I'm not trying to profile Tapestry lowlevel code, I'm trying to profile my own component code :) I want to know collectively how long any one of my component takes to render. The reason I think this view of things would be useful, is that profiling at method level might not give me a clear picture of where to focus on.. ( we'll see lots of setupRenders. lots of beginRenders, but no relationship between one component and how it depends on subcomponents, etc etc) Do you understand? So it's not profiling Tapestry code precisely, but profiling pages/components via the view of tapestry's component rendering tree.. I don't know if it would be ultimately useful, but it sounds like an interesting idea.. Howard Lewis Ship wrote: Are you using Tapestry 5.0.18 or 5.1.0.0-SNAPSHOT? I've added some considerable performance improvements to 5.1. I would get a copy of YourKit and start profiling to see where the actual problems are. Tapestry takes a hit because it renders the entire document to a kind of light-weight DOM before it can start to stream the output; that's a lot of churn in the JVM's eden heap space. On Thu, Jan 15, 2009 at 8:17 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Thu, 15 Jan 2009 23:19:56 -0300, Fernando Padilla f...@alum.mit.edu escreveu: The database was just upgraded and io/cpu is really really low. So that won't be the case. I would still check this out . . . Don't forget about one transaction waiting for others to release locks in table rows . . . The root cause might be the number of db requests required to render a page, but the database it self is not the bottle neck. :) :) A real case I found as a consultant was the lack of attention to Hibernate mapping options, specially regarding lazy loading of collections. Instead of using one or two selects to load an entity object and one of its lists, it was using one for each element in the list. This absolutely kills performance. By the way, nice performance improvement hunting! :) Don't forget to share your experience with us. ;) -- 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: Strange ClassNotFoundException: org.slf4j.Logger
Found the problem: http://docs.codehaus.org/display/JETTY/Classloading By default Jetty hides org.slf4j.* from webapp context classloaders, therefore the Form component can't see it. This can be fine-tuned by calling org.mortbay.jetty.webapp.WebAppContext.setServerClasses(String[]) which the run-jetty-run plugin isn't doing. So there is no chance to get this running without modifying the run-jetty-run plugin. I'll now try to go back to the JettyLauncher (http://jettylauncher.sourceforge.net/) plugin. HTH, Uli Ulrich Stärk schrieb: I'm having the exact same problem and I checked that it's not there twice... weird... Uli Joachim Van der Auwera schrieb: I assume slf4j is on the classpath twice... Thiago HP wrote: Hi! I'm having a very strange exception when trying to run a T5 application (www.arsmachina.com.br/project/example): Error obtaining injected value for field org.apache.tapestry5.corelib.components.Form.logger: java.lang.ClassNotFoundException: org.slf4j.Logger It seems to be a Tapestry classloading issue, as slf4j-api *is* in the classpath. At my home, when running from JettyLauncher (modified to run under Java 6), runs OK. Under Run-Jetty-Run, the exception is thrown. Running an embedded Jetty at my home, ok, at my work, exception raised. Thanks in advance. Full stack trace: java.lang.RuntimeException: java.lang.ClassNotFoundException: caught an exception while obtaining a class file for org.apache.tapestry5.corelib.components.Form at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.findClass(ComponentInstantiatorSourceImpl.java:296) at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.findInstantiator(ComponentInstantiatorSourceImpl.java:272) at $ComponentInstantiatorSource_11ed4d10948.findInstantiator($ComponentInstantiatorSource_11ed4d10948.java) at org.apache.tapestry5.internal.services.PageElementFactoryImpl.newComponentElement(PageElementFactoryImpl.java:216) ... 144 more Caused by: java.lang.ClassNotFoundException: caught an exception while obtaining a class file for org.apache.tapestry5.corelib.components.Form at javassist.Loader.findClass(Loader.java:359) at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl$PackageAwareLoader.findClass(ComponentInstantiatorSourceImpl.java:92) at javassist.Loader.loadClass(Loader.java:311) at java.lang.ClassLoader.loadClass(Unknown Source) at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.findClass(ComponentInstantiatorSourceImpl.java:292) ... 147 more Caused by: org.apache.tapestry5.internal.services.TransformationException: Error obtaining injected value for field org.apache.tapestry5.corelib.components.Form.logger: java.lang.ClassNotFoundException: org.slf4j.Logger at org.apache.tapestry5.internal.services.ComponentClassTransformerImpl.transformComponentClass(ComponentClassTransformerImpl.java:176) at $ComponentClassTransformer_11ed4d10954.transformComponentClass($ComponentClassTransformer_11ed4d10954.java) at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.onLoad(ComponentInstantiatorSourceImpl.java:201) at javassist.Loader.findClass(Loader.java:340) ... 151 more Caused by: java.lang.RuntimeException: Error obtaining injected value for field org.apache.tapestry5.corelib.components.Form.logger: java.lang.ClassNotFoundException: org.slf4j.Logger at org.apache.tapestry5.internal.transform.InjectWorker.transform(InjectWorker.java:68) at $ComponentClassTransformWorker_11ed4d109a4.transform($ComponentClassTransformWorker_11ed4d109a4.java) at $ComponentClassTransformWorker_11ed4d1099a.transform($ComponentClassTransformWorker_11ed4d1099a.java) at org.apache.tapestry5.internal.services.ComponentClassTransformerImpl.transformComponentClass(ComponentClassTransformerImpl.java:170) ... 154 more Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.slf4j.Logger at org.apache.tapestry5.internal.services.InternalClassTransformationImpl.toClass(InternalClassTransformationImpl.java:1765) at org.apache.tapestry5.internal.transform.InjectWorker.transform(InjectWorker.java:55) ... 157 more Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at javassist.Loader.delegateToParent(Loader.java:428) at javassist.Loader.loadClass(Loader.java:314) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at
Re: profiling tapestry components
Tapestry so aggressively intermixes framework code and user code that it's going to be hard to pick it out. Futher, Tapestry's queue based (rather than tail recursive) approach makes it much harder to see what's going on. I would still advise you to use YourKit to measure across a long period of activity and look for the hot spots. And report them back here! The abiding rule of performance is that after careful thought and analysis to identify where your problems are, profiling always points you to a completely different area that is your real problem. On Fri, Jan 16, 2009 at 11:44 AM, Fernando Padilla f...@alum.mit.edu wrote: I'm using 5.1.0.0. But I'm sorry to confuse you all. I'm not trying to profile Tapestry lowlevel code, I'm trying to profile my own component code :) I want to know collectively how long any one of my component takes to render. The reason I think this view of things would be useful, is that profiling at method level might not give me a clear picture of where to focus on.. ( we'll see lots of setupRenders. lots of beginRenders, but no relationship between one component and how it depends on subcomponents, etc etc) Do you understand? So it's not profiling Tapestry code precisely, but profiling pages/components via the view of tapestry's component rendering tree.. I don't know if it would be ultimately useful, but it sounds like an interesting idea.. Howard Lewis Ship wrote: Are you using Tapestry 5.0.18 or 5.1.0.0-SNAPSHOT? I've added some considerable performance improvements to 5.1. I would get a copy of YourKit and start profiling to see where the actual problems are. Tapestry takes a hit because it renders the entire document to a kind of light-weight DOM before it can start to stream the output; that's a lot of churn in the JVM's eden heap space. On Thu, Jan 15, 2009 at 8:17 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Thu, 15 Jan 2009 23:19:56 -0300, Fernando Padilla f...@alum.mit.edu escreveu: The database was just upgraded and io/cpu is really really low. So that won't be the case. I would still check this out . . . Don't forget about one transaction waiting for others to release locks in table rows . . . The root cause might be the number of db requests required to render a page, but the database it self is not the bottle neck. :) :) A real case I found as a consultant was the lack of attention to Hibernate mapping options, specially regarding lazy loading of collections. Instead of using one or two selects to load an entity object and one of its lists, it was using one for each element in the list. This absolutely kills performance. By the way, nice performance improvement hunting! :) Don't forget to share your experience with us. ;) -- 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 -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Strange ClassNotFoundException: org.slf4j.Logger
But I'm using run-jetty-run successfully for a long time already. I only had to add -Dorg.mortbay.jetty.webapp.parentLoaderPriority=true to the VM-arguments box in the run-jetty-run debug configuration (in Eclipse) Martijn On Fri, 2009-01-16 at 20:52 +0100, Ulrich Stärk wrote: Found the problem: http://docs.codehaus.org/display/JETTY/Classloading By default Jetty hides org.slf4j.* from webapp context classloaders, therefore the Form component can't see it. This can be fine-tuned by calling org.mortbay.jetty.webapp.WebAppContext.setServerClasses(String[]) which the run-jetty-run plugin isn't doing. So there is no chance to get this running without modifying the run-jetty-run plugin. I'll now try to go back to the JettyLauncher (http://jettylauncher.sourceforge.net/) plugin. HTH, Uli Ulrich Stärk schrieb: I'm having the exact same problem and I checked that it's not there twice... weird... Uli Joachim Van der Auwera schrieb: I assume slf4j is on the classpath twice... Thiago HP wrote: Hi! I'm having a very strange exception when trying to run a T5 application (www.arsmachina.com.br/project/example): Error obtaining injected value for field org.apache.tapestry5.corelib.components.Form.logger: java.lang.ClassNotFoundException: org.slf4j.Logger It seems to be a Tapestry classloading issue, as slf4j-api *is* in the classpath. At my home, when running from JettyLauncher (modified to run under Java 6), runs OK. Under Run-Jetty-Run, the exception is thrown. Running an embedded Jetty at my home, ok, at my work, exception raised. Thanks in advance. Full stack trace: java.lang.RuntimeException: java.lang.ClassNotFoundException: caught an exception while obtaining a class file for org.apache.tapestry5.corelib.components.Form at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.findClass(ComponentInstantiatorSourceImpl.java:296) at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.findInstantiator(ComponentInstantiatorSourceImpl.java:272) at $ComponentInstantiatorSource_11ed4d10948.findInstantiator($ComponentInstantiatorSource_11ed4d10948.java) at org.apache.tapestry5.internal.services.PageElementFactoryImpl.newComponentElement(PageElementFactoryImpl.java:216) ... 144 more Caused by: java.lang.ClassNotFoundException: caught an exception while obtaining a class file for org.apache.tapestry5.corelib.components.Form at javassist.Loader.findClass(Loader.java:359) at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl$PackageAwareLoader.findClass(ComponentInstantiatorSourceImpl.java:92) at javassist.Loader.loadClass(Loader.java:311) at java.lang.ClassLoader.loadClass(Unknown Source) at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.findClass(ComponentInstantiatorSourceImpl.java:292) ... 147 more Caused by: org.apache.tapestry5.internal.services.TransformationException: Error obtaining injected value for field org.apache.tapestry5.corelib.components.Form.logger: java.lang.ClassNotFoundException: org.slf4j.Logger at org.apache.tapestry5.internal.services.ComponentClassTransformerImpl.transformComponentClass(ComponentClassTransformerImpl.java:176) at $ComponentClassTransformer_11ed4d10954.transformComponentClass($ComponentClassTransformer_11ed4d10954.java) at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.onLoad(ComponentInstantiatorSourceImpl.java:201) at javassist.Loader.findClass(Loader.java:340) ... 151 more Caused by: java.lang.RuntimeException: Error obtaining injected value for field org.apache.tapestry5.corelib.components.Form.logger: java.lang.ClassNotFoundException: org.slf4j.Logger at org.apache.tapestry5.internal.transform.InjectWorker.transform(InjectWorker.java:68) at $ComponentClassTransformWorker_11ed4d109a4.transform($ComponentClassTransformWorker_11ed4d109a4.java) at $ComponentClassTransformWorker_11ed4d1099a.transform($ComponentClassTransformWorker_11ed4d1099a.java) at org.apache.tapestry5.internal.services.ComponentClassTransformerImpl.transformComponentClass(ComponentClassTransformerImpl.java:170) ... 154 more Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.slf4j.Logger at org.apache.tapestry5.internal.services.InternalClassTransformationImpl.toClass(InternalClassTransformationImpl.java:1765) at org.apache.tapestry5.internal.transform.InjectWorker.transform(InjectWorker.java:55) ... 157 more Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native
Re: Strange ClassNotFoundException: org.slf4j.Logger
Indeed. That works. Next time I shouldn't rely on what other's are saying doesn't work :) Thanks Martijn. Uli Martijn Brinkers schrieb: But I'm using run-jetty-run successfully for a long time already. I only had to add -Dorg.mortbay.jetty.webapp.parentLoaderPriority=true to the VM-arguments box in the run-jetty-run debug configuration (in Eclipse) Martijn On Fri, 2009-01-16 at 20:52 +0100, Ulrich Stärk wrote: Found the problem: http://docs.codehaus.org/display/JETTY/Classloading By default Jetty hides org.slf4j.* from webapp context classloaders, therefore the Form component can't see it. This can be fine-tuned by calling org.mortbay.jetty.webapp.WebAppContext.setServerClasses(String[]) which the run-jetty-run plugin isn't doing. So there is no chance to get this running without modifying the run-jetty-run plugin. I'll now try to go back to the JettyLauncher (http://jettylauncher.sourceforge.net/) plugin. HTH, Uli Ulrich Stärk schrieb: I'm having the exact same problem and I checked that it's not there twice... weird... Uli Joachim Van der Auwera schrieb: I assume slf4j is on the classpath twice... Thiago HP wrote: Hi! I'm having a very strange exception when trying to run a T5 application (www.arsmachina.com.br/project/example): Error obtaining injected value for field org.apache.tapestry5.corelib.components.Form.logger: java.lang.ClassNotFoundException: org.slf4j.Logger It seems to be a Tapestry classloading issue, as slf4j-api *is* in the classpath. At my home, when running from JettyLauncher (modified to run under Java 6), runs OK. Under Run-Jetty-Run, the exception is thrown. Running an embedded Jetty at my home, ok, at my work, exception raised. Thanks in advance. Full stack trace: java.lang.RuntimeException: java.lang.ClassNotFoundException: caught an exception while obtaining a class file for org.apache.tapestry5.corelib.components.Form at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.findClass(ComponentInstantiatorSourceImpl.java:296) at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.findInstantiator(ComponentInstantiatorSourceImpl.java:272) at $ComponentInstantiatorSource_11ed4d10948.findInstantiator($ComponentInstantiatorSource_11ed4d10948.java) at org.apache.tapestry5.internal.services.PageElementFactoryImpl.newComponentElement(PageElementFactoryImpl.java:216) ... 144 more Caused by: java.lang.ClassNotFoundException: caught an exception while obtaining a class file for org.apache.tapestry5.corelib.components.Form at javassist.Loader.findClass(Loader.java:359) at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl$PackageAwareLoader.findClass(ComponentInstantiatorSourceImpl.java:92) at javassist.Loader.loadClass(Loader.java:311) at java.lang.ClassLoader.loadClass(Unknown Source) at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.findClass(ComponentInstantiatorSourceImpl.java:292) ... 147 more Caused by: org.apache.tapestry5.internal.services.TransformationException: Error obtaining injected value for field org.apache.tapestry5.corelib.components.Form.logger: java.lang.ClassNotFoundException: org.slf4j.Logger at org.apache.tapestry5.internal.services.ComponentClassTransformerImpl.transformComponentClass(ComponentClassTransformerImpl.java:176) at $ComponentClassTransformer_11ed4d10954.transformComponentClass($ComponentClassTransformer_11ed4d10954.java) at org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.onLoad(ComponentInstantiatorSourceImpl.java:201) at javassist.Loader.findClass(Loader.java:340) ... 151 more Caused by: java.lang.RuntimeException: Error obtaining injected value for field org.apache.tapestry5.corelib.components.Form.logger: java.lang.ClassNotFoundException: org.slf4j.Logger at org.apache.tapestry5.internal.transform.InjectWorker.transform(InjectWorker.java:68) at $ComponentClassTransformWorker_11ed4d109a4.transform($ComponentClassTransformWorker_11ed4d109a4.java) at $ComponentClassTransformWorker_11ed4d1099a.transform($ComponentClassTransformWorker_11ed4d1099a.java) at org.apache.tapestry5.internal.services.ComponentClassTransformerImpl.transformComponentClass(ComponentClassTransformerImpl.java:170) ... 154 more Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.slf4j.Logger at org.apache.tapestry5.internal.services.InternalClassTransformationImpl.toClass(InternalClassTransformationImpl.java:1765) at org.apache.tapestry5.internal.transform.InjectWorker.transform(InjectWorker.java:55) ... 157 more Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at
Finding a block..
I'm working in Tapestry 4.1.6. I've been reading the docs for the Block/RenderBlock and this second sentence has my focus. The Block may be on the same page as the RenderBlock or on another page entirely. Which is followed by an example where the block that is found is on the same page (a contained block). return (Block) getContainer().getComponent(selectedId); What is not at all obvious is how you find a block on a another page. Can someone give me a brief description of how you search blocks contained on other pages, that you can be rendered on the current page. I recognize that there's some issues with the render listeners on the page/component that contains the block that is not contained on my current page.. My test case, is like this: BlockA (BlockA.html, BlockA.jwc, BlockPageA.java) is a component that renders a simple table. The Table is wrapped in a block with the title blockA (notice my lowercase first letter for the block name). BlockA (BlockB.html, BlockB.jwc, BlockPageB.java) is a component that renders a paragraph of text. My Home Page, has the following markup... span jwcid=@RenderBlock block=ognl:thisBlock span style=background-color: grey;Block Goes Here/span /span What I want to do is render either the Acomponent or Bcomponent, based on the string that's returned from Home.java:getThisBlock()
Pages vs Components
In the last couple of days I have been working with Tapestry. I have read Tutorial #1 and all the User Guides articles found here: http://tapestry.apache.org/tapestry5/ I think I understand enough to get going at this point; however, one main point I still don't quite understand (and seems like it is probably something I should understand) is the difference between a Page and a Component. I understand what pages are and have done some simple things over the last couple of days but I don't understand when I would use a Component and what they are for. Are they somewhat like a tag in a tag library? BTW, I really like what I am seeing with Tapestry, vastly better than the XML hell that is Struts. However, since it is a vast departure from most web frameworks there is a pretty big learning curve. Seems worth it so far though. -- View this message in context: http://www.nabble.com/Pages-vs-Components-tp21508386p21508386.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: Pages vs Components
In some ways, a Page is just a Component that has no parent. I'm not 100% sure why they're separated, except that it's a historical artifact. Components (and pages being a special-case component) are a piece of java software that renders itself (usually as tags and possibly with a body, which may contain the renderings of other components.) It's quite different than tag-libs. Taglibs get turned into generated code that executes with other JSP code. Components don't generate code, they are live objects with life-cycles that respond to events, just like a swing or Mac-OS Cocoa component. JSP's code gets turned into a very very long execute() method on a servlet, so there's lots of entanglement. There was a good article on this in the t5 docs, but I can't remember which one. Christian. On 16-Jan-09, at 16:01 , mjparme wrote: In the last couple of days I have been working with Tapestry. I have read Tutorial #1 and all the User Guides articles found here: http://tapestry.apache.org/tapestry5/ I think I understand enough to get going at this point; however, one main point I still don't quite understand (and seems like it is probably something I should understand) is the difference between a Page and a Component. I understand what pages are and have done some simple things over the last couple of days but I don't understand when I would use a Component and what they are for. Are they somewhat like a tag in a tag library? BTW, I really like what I am seeing with Tapestry, vastly better than the XML hell that is Struts. However, since it is a vast departure from most web frameworks there is a pretty big learning curve. Seems worth it so far though. -- View this message in context: http://www.nabble.com/Pages-vs-Components-tp21508386p21508386.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 Christian Edward Gruber christianedwardgru...@gmail.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
T5: SetupRender before parameters binding in 5.1.0.0-SNAPSHOT?
Hello, Is SetupRender phase changed to be in front of parameters binding in 5.1.0.0-SNAPSHOT? I have a EntityGrid component which is a sub-class of Grid and providing its own GridDataSource; it worked well with 5.0.18. Today I tried the snapshot but got following exceptions: org.apache.tapestry5.corelib.components.Grid$CachingDataSource.getAvailableRows(Grid.java:324) org.apache.tapestry5.corelib.components.Grid.setupDataSource(Grid.java:484) org.apache.tapestry5.corelib.components.Grid.setupRender(Grid.java:468) org.apache.tapestry5.corelib.components.Grid.setupRender(Grid.java) org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.invokeComponent(ComponentPageElementImpl.java:177) org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.run(ComponentPageElementImpl.java:157) org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:970) org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$400(ComponentPageElementImpl.java:50) org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.callback(ComponentPageElementImpl.java:152) org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.render(ComponentPageElementImpl.java:182) org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:74) org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121) $PageRenderQueue_11ee15ba809.render($PageRenderQueue_11ee15ba809.java) $PageRenderQueue_11ee15ba800.render($PageRenderQueue_11ee15ba800.java) org.apache.tapestry5.services.TapestryModule$20.renderMarkup(TapestryModule.java:1239) org.apache.tapestry5.services.TapestryModule$30.renderMarkup(TapestryModule.java:1606) $MarkupRenderer_11ee15ba80b.renderMarkup($MarkupRenderer_11ee15ba80b.java) org.apache.tapestry5.services.TapestryModule$29.renderMarkup(TapestryModule.java:1587) $MarkupRenderer_11ee15ba80b.renderMarkup($MarkupRenderer_11ee15ba80b.java) org.apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryModule.java:1569) $MarkupRenderer_11ee15ba80b.renderMarkup($MarkupRenderer_11ee15ba80b.java) org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1551) $MarkupRenderer_11ee15ba80b.renderMarkup($MarkupRenderer_11ee15ba80b.java) org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1521) $MarkupRenderer_11ee15ba80b.renderMarkup($MarkupRenderer_11ee15ba80b.java) $MarkupRenderer_11ee15ba808.renderMarkup($MarkupRenderer_11ee15ba808.java) org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64) $PageMarkupRenderer_11ee15ba806.renderPageMarkup($PageMarkupRenderer_11ee15ba806.java) org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:61) $PageResponseRenderer_11ee15ba79c.renderPageResponse($PageResponseRenderer_11ee15ba79c.java) org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:63) org.apache.tapestry5.services.TapestryModule$36.handle(TapestryModule.java:1805) $PageRenderRequestHandler_11ee15ba79d.handle($PageRenderRequestHandler_11ee15ba79d.java) $PageRenderRequestHandler_11ee15ba78b.handle($PageRenderRequestHandler_11ee15ba78b.java) org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:115) org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:94) $Dispatcher_11ee15ba793.dispatch($Dispatcher_11ee15ba793.java) $Dispatcher_11ee15ba789.dispatch($Dispatcher_11ee15ba789.java) org.apache.tapestry5.services.TapestryModule$18.service(TapestryModule.java:1061) org.cihi.apricot.services.AppModule$2.service(AppModule.java:132) $RequestHandler_11ee15ba78a.service($RequestHandler_11ee15ba78a.java) ... It looks like the parameter source is not bound in setupRender phase (other parameters not bound too). Thanks, Yunhua - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: SetupRender before parameters binding in 5.1.0.0-SNAPSHOT?
There shouldn't be a change there. What is the exception (you only included the stack trace). On Fri, Jan 16, 2009 at 2:01 PM, Yunhua Sang yunhua.s...@gmail.com wrote: Hello, Is SetupRender phase changed to be in front of parameters binding in 5.1.0.0-SNAPSHOT? I have a EntityGrid component which is a sub-class of Grid and providing its own GridDataSource; it worked well with 5.0.18. Today I tried the snapshot but got following exceptions: org.apache.tapestry5.corelib.components.Grid$CachingDataSource.getAvailableRows(Grid.java:324) org.apache.tapestry5.corelib.components.Grid.setupDataSource(Grid.java:484) org.apache.tapestry5.corelib.components.Grid.setupRender(Grid.java:468) org.apache.tapestry5.corelib.components.Grid.setupRender(Grid.java) org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.invokeComponent(ComponentPageElementImpl.java:177) org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.run(ComponentPageElementImpl.java:157) org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:970) org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$400(ComponentPageElementImpl.java:50) org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.callback(ComponentPageElementImpl.java:152) org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.render(ComponentPageElementImpl.java:182) org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:74) org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121) $PageRenderQueue_11ee15ba809.render($PageRenderQueue_11ee15ba809.java) $PageRenderQueue_11ee15ba800.render($PageRenderQueue_11ee15ba800.java) org.apache.tapestry5.services.TapestryModule$20.renderMarkup(TapestryModule.java:1239) org.apache.tapestry5.services.TapestryModule$30.renderMarkup(TapestryModule.java:1606) $MarkupRenderer_11ee15ba80b.renderMarkup($MarkupRenderer_11ee15ba80b.java) org.apache.tapestry5.services.TapestryModule$29.renderMarkup(TapestryModule.java:1587) $MarkupRenderer_11ee15ba80b.renderMarkup($MarkupRenderer_11ee15ba80b.java) org.apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryModule.java:1569) $MarkupRenderer_11ee15ba80b.renderMarkup($MarkupRenderer_11ee15ba80b.java) org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1551) $MarkupRenderer_11ee15ba80b.renderMarkup($MarkupRenderer_11ee15ba80b.java) org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1521) $MarkupRenderer_11ee15ba80b.renderMarkup($MarkupRenderer_11ee15ba80b.java) $MarkupRenderer_11ee15ba808.renderMarkup($MarkupRenderer_11ee15ba808.java) org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64) $PageMarkupRenderer_11ee15ba806.renderPageMarkup($PageMarkupRenderer_11ee15ba806.java) org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:61) $PageResponseRenderer_11ee15ba79c.renderPageResponse($PageResponseRenderer_11ee15ba79c.java) org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:63) org.apache.tapestry5.services.TapestryModule$36.handle(TapestryModule.java:1805) $PageRenderRequestHandler_11ee15ba79d.handle($PageRenderRequestHandler_11ee15ba79d.java) $PageRenderRequestHandler_11ee15ba78b.handle($PageRenderRequestHandler_11ee15ba78b.java) org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:115) org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:94) $Dispatcher_11ee15ba793.dispatch($Dispatcher_11ee15ba793.java) $Dispatcher_11ee15ba789.dispatch($Dispatcher_11ee15ba789.java) org.apache.tapestry5.services.TapestryModule$18.service(TapestryModule.java:1061) org.cihi.apricot.services.AppModule$2.service(AppModule.java:132) $RequestHandler_11ee15ba78a.service($RequestHandler_11ee15ba78a.java) ... It looks like the parameter source is not bound in setupRender phase (other parameters not bound too). Thanks, Yunhua - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Pages vs Components
On Fri, Jan 16, 2009 at 1:42 PM, Christian Edward Gruber christianedwardgru...@gmail.com wrote: In some ways, a Page is just a Component that has no parent. A page is a top level component. Technically, the page component is actually the root component of the actual page (true pages are a concept internal to Tapestry) but it all works out the same in the end. Pages have a lifecycle (loaded, attached and detached). I'm not 100% sure why they're separated, except that it's a historical artifact. A bit more than that. Naming: page names can appear in URLs whereas component types do not, instead component ids. Pages do have some special responsibilities (activation, passivation, error handling). Components (and pages being a special-case component) are a piece of java software that renders itself (usually as tags and possibly with a body, which may contain the renderings of other components.) It's quite different than tag-libs. Taglibs get turned into generated code that executes with other JSP code. Components don't generate code, they are live objects with life-cycles that respond to events, just like a swing or Mac-OS Cocoa component. JSP's code gets turned into a very very long execute() method on a servlet, so there's lots of entanglement. There was a good article on this in the t5 docs, but I can't remember which one. Christian. On 16-Jan-09, at 16:01 , mjparme wrote: -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Pages vs Components
I don't understand when I would use a Component and what they are for. Typically a web-application is built from a number of pages. And each page is different. Many elements on the pages will be the same or similar though. For those elements it is usually wise to create a separate component and then use it on all pages that should show that element. This way you have a single block of code to test and when you need to make changes you can do it in a single place and all pages that use that component will be updated at once. in that regard it is a little bit like a taglib, but better and much, much easier to create yourself. regards, Onno
Re: T5: SetupRender before parameters binding in 5.1.0.0-SNAPSHOT?
The exception is NPE, On Fri, Jan 16, 2009 at 5:42 PM, Howard Lewis Ship hls...@gmail.com wrote: There shouldn't be a change there. What is the exception (you only included the stack trace). On Fri, Jan 16, 2009 at 2:01 PM, Yunhua Sang yunhua.s...@gmail.com wrote: Hello, Is SetupRender phase changed to be in front of parameters binding in 5.1.0.0-SNAPSHOT? I have a EntityGrid component which is a sub-class of Grid and providing its own GridDataSource; it worked well with 5.0.18. Today I tried the snapshot but got following exceptions: org.apache.tapestry5.corelib.components.Grid$CachingDataSource.getAvailableRows(Grid.java:324) org.apache.tapestry5.corelib.components.Grid.setupDataSource(Grid.java:484) org.apache.tapestry5.corelib.components.Grid.setupRender(Grid.java:468) org.apache.tapestry5.corelib.components.Grid.setupRender(Grid.java) org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.invokeComponent(ComponentPageElementImpl.java:177) org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.run(ComponentPageElementImpl.java:157) org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:970) org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$400(ComponentPageElementImpl.java:50) org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.callback(ComponentPageElementImpl.java:152) org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.render(ComponentPageElementImpl.java:182) org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:74) org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121) $PageRenderQueue_11ee15ba809.render($PageRenderQueue_11ee15ba809.java) $PageRenderQueue_11ee15ba800.render($PageRenderQueue_11ee15ba800.java) org.apache.tapestry5.services.TapestryModule$20.renderMarkup(TapestryModule.java:1239) org.apache.tapestry5.services.TapestryModule$30.renderMarkup(TapestryModule.java:1606) $MarkupRenderer_11ee15ba80b.renderMarkup($MarkupRenderer_11ee15ba80b.java) org.apache.tapestry5.services.TapestryModule$29.renderMarkup(TapestryModule.java:1587) $MarkupRenderer_11ee15ba80b.renderMarkup($MarkupRenderer_11ee15ba80b.java) org.apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryModule.java:1569) $MarkupRenderer_11ee15ba80b.renderMarkup($MarkupRenderer_11ee15ba80b.java) org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1551) $MarkupRenderer_11ee15ba80b.renderMarkup($MarkupRenderer_11ee15ba80b.java) org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1521) $MarkupRenderer_11ee15ba80b.renderMarkup($MarkupRenderer_11ee15ba80b.java) $MarkupRenderer_11ee15ba808.renderMarkup($MarkupRenderer_11ee15ba808.java) org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64) $PageMarkupRenderer_11ee15ba806.renderPageMarkup($PageMarkupRenderer_11ee15ba806.java) org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:61) $PageResponseRenderer_11ee15ba79c.renderPageResponse($PageResponseRenderer_11ee15ba79c.java) org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:63) org.apache.tapestry5.services.TapestryModule$36.handle(TapestryModule.java:1805) $PageRenderRequestHandler_11ee15ba79d.handle($PageRenderRequestHandler_11ee15ba79d.java) $PageRenderRequestHandler_11ee15ba78b.handle($PageRenderRequestHandler_11ee15ba78b.java) org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:115) org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:94) $Dispatcher_11ee15ba793.dispatch($Dispatcher_11ee15ba793.java) $Dispatcher_11ee15ba789.dispatch($Dispatcher_11ee15ba789.java) org.apache.tapestry5.services.TapestryModule$18.service(TapestryModule.java:1061) org.cihi.apricot.services.AppModule$2.service(AppModule.java:132) $RequestHandler_11ee15ba78a.service($RequestHandler_11ee15ba78a.java) ... It looks like the parameter source is not bound in setupRender phase (other parameters not bound too). Thanks, Yunhua - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - 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
Re: T5: SetupRender before parameters binding in 5.1.0.0-SNAPSHOT?
I would be useful to see some of the code of EntityGrid. On Fri, Jan 16, 2009 at 3:22 PM, Yunhua Sang yunhua.s...@gmail.com wrote: The exception is NPE, On Fri, Jan 16, 2009 at 5:42 PM, Howard Lewis Ship hls...@gmail.com wrote: There shouldn't be a change there. What is the exception (you only included the stack trace). On Fri, Jan 16, 2009 at 2:01 PM, Yunhua Sang yunhua.s...@gmail.com wrote: Hello, Is SetupRender phase changed to be in front of parameters binding in 5.1.0.0-SNAPSHOT? I have a EntityGrid component which is a sub-class of Grid and providing its own GridDataSource; it worked well with 5.0.18. Today I tried the snapshot but got following exceptions: org.apache.tapestry5.corelib.components.Grid$CachingDataSource.getAvailableRows(Grid.java:324) org.apache.tapestry5.corelib.components.Grid.setupDataSource(Grid.java:484) org.apache.tapestry5.corelib.components.Grid.setupRender(Grid.java:468) org.apache.tapestry5.corelib.components.Grid.setupRender(Grid.java) org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.invokeComponent(ComponentPageElementImpl.java:177) org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.run(ComponentPageElementImpl.java:157) org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:970) org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$400(ComponentPageElementImpl.java:50) org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.callback(ComponentPageElementImpl.java:152) org.apache.tapestry5.internal.structure.ComponentPageElementImpl$SetupRenderPhase.render(ComponentPageElementImpl.java:182) org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:74) org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121) $PageRenderQueue_11ee15ba809.render($PageRenderQueue_11ee15ba809.java) $PageRenderQueue_11ee15ba800.render($PageRenderQueue_11ee15ba800.java) org.apache.tapestry5.services.TapestryModule$20.renderMarkup(TapestryModule.java:1239) org.apache.tapestry5.services.TapestryModule$30.renderMarkup(TapestryModule.java:1606) $MarkupRenderer_11ee15ba80b.renderMarkup($MarkupRenderer_11ee15ba80b.java) org.apache.tapestry5.services.TapestryModule$29.renderMarkup(TapestryModule.java:1587) $MarkupRenderer_11ee15ba80b.renderMarkup($MarkupRenderer_11ee15ba80b.java) org.apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryModule.java:1569) $MarkupRenderer_11ee15ba80b.renderMarkup($MarkupRenderer_11ee15ba80b.java) org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1551) $MarkupRenderer_11ee15ba80b.renderMarkup($MarkupRenderer_11ee15ba80b.java) org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1521) $MarkupRenderer_11ee15ba80b.renderMarkup($MarkupRenderer_11ee15ba80b.java) $MarkupRenderer_11ee15ba808.renderMarkup($MarkupRenderer_11ee15ba808.java) org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64) $PageMarkupRenderer_11ee15ba806.renderPageMarkup($PageMarkupRenderer_11ee15ba806.java) org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:61) $PageResponseRenderer_11ee15ba79c.renderPageResponse($PageResponseRenderer_11ee15ba79c.java) org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:63) org.apache.tapestry5.services.TapestryModule$36.handle(TapestryModule.java:1805) $PageRenderRequestHandler_11ee15ba79d.handle($PageRenderRequestHandler_11ee15ba79d.java) $PageRenderRequestHandler_11ee15ba78b.handle($PageRenderRequestHandler_11ee15ba78b.java) org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:115) org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:94) $Dispatcher_11ee15ba793.dispatch($Dispatcher_11ee15ba793.java) $Dispatcher_11ee15ba789.dispatch($Dispatcher_11ee15ba789.java) org.apache.tapestry5.services.TapestryModule$18.service(TapestryModule.java:1061) org.cihi.apricot.services.AppModule$2.service(AppModule.java:132) $RequestHandler_11ee15ba78a.service($RequestHandler_11ee15ba78a.java) ... It looks like the parameter source is not bound in setupRender phase (other parameters not bound too). Thanks, Yunhua - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] improve documentation
I quite like the existing tutorial, I was just disappointed it ended so abruptly. :) I think whatever docs come around in the future, they need to cover more on Encoders/Translators/Coercers - as that was one of the most difficult things for me to learn. Honestly, I still barely understand when to use which. -james On Tue, Jan 13, 2009 at 10:15 AM, Howard Lewis Ship hls...@gmail.comwrote: I've been coming to the same conclusion. I'm clearing time with my boss to pursue this, along with several online articles. I have an idea for an application that can demonstrate every bit of Tapestry and be useful to boot. So the guide is the reference, what I have planned is the tour. It would replace the tutorial. -- James A. Hillyerd ja...@hillyerd.com
Re: Finding a block..
Try requestCycle.getPage(otherPage).getComponent(compId) On Fri, Jan 16, 2009 at 10:59 PM, Giaccone, Anthony CTR DTIC-A agiaccon@dtic.mil wrote: I'm working in Tapestry 4.1.6. I've been reading the docs for the Block/RenderBlock and this second sentence has my focus. The Block may be on the same page as the RenderBlock or on another page entirely. Which is followed by an example where the block that is found is on the same page (a contained block). return (Block) getContainer().getComponent(selectedId); What is not at all obvious is how you find a block on a another page. Can someone give me a brief description of how you search blocks contained on other pages, that you can be rendered on the current page. I recognize that there's some issues with the render listeners on the page/component that contains the block that is not contained on my current page.. My test case, is like this: BlockA (BlockA.html, BlockA.jwc, BlockPageA.java) is a component that renders a simple table. The Table is wrapped in a block with the title blockA (notice my lowercase first letter for the block name). BlockA (BlockB.html, BlockB.jwc, BlockPageB.java) is a component that renders a paragraph of text. My Home Page, has the following markup... span jwcid=@RenderBlock block=ognl:thisBlock span style=background-color: grey;Block Goes Here/span /span What I want to do is render either the Acomponent or Bcomponent, based on the string that's returned from Home.java:getThisBlock() -- Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / JEE Consulting - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Transmitting a javascript-value to the server using JSON
What's the closest equivalent of T4's EventListener in T5? You can do ActionLink with zone and @OnEvent on the server, but what I loved about T4's EventListener was that you could hook an arbitrary Javascript call to a server side operation with one annotation. I have a case where I'd like to do communicate in the background from plain Javascript rather than click a link. Kalle On Tue, Aug 5, 2008 at 3:30 PM, Toby Hobson toby.hob...@googlemail.comwrote: Does anyone know if something similar is available (or planned) for T5? Toby 2008/8/5 Thiago Henrique de Carvalho kalis...@gmail.com Hi, Take a look at @EventListener annotation. Docs show example of transmiting JSON from page to Tapestry. Thiago -Mensagem original- De: Peer Brink [mailto:peerbr...@gmail.com] Enviada em: terça-feira, 5 de agosto de 2008 06:41 Para: users@tapestry.apache.org Assunto: Transmitting a javascript-value to the server using JSON Hello, I try to transmit the users/browsers timezone-offset to the server. The timeZone-offset can easily be retrieved by script type=text/javascript var offset = new Date().getTimezoneOffset(); /script But how can it be transmitted? Could this be done using a JSONObject by adding Object.toJSON(offset);? I found quite some conversations in the mailing-list about JSON-communication but they are all about transmitting data in the other direction (server to client). Where would the code go in the html-source and what java-code is needed to receive the value on the server-side? Or is there a complete other way to get this value? Sorry for this rookie-question. But I am not too familiar with java-script and JSON. Thanks for any help, Peer. - 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