Re: T5 XHTML compliant markup
On Mon, 2007-06-18 at 20:21 +0200, Martin Grotzke wrote: Our template uses the following DOCTYPE definition: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; What's wrong with this to get well-formed XML? Or is the doctype correct and s.th. else might be the reason for the not well-formed xml? Cheers, Martin Thx cheers, Martin On Mon, 2007-06-18 at 10:29 -0700, Howard Lewis Ship wrote: To elaborate; Tapestry uses the !DOCTYPE of the component template to determine the type of markup it will send; when the !DOCTYPE is omitted, it is assumed to be legacy HTML as defined by SGML, where many element are unclosed. When you provide an explicit !DOCTYPE, Tapestry switches over to rendering out well-formed XML. On 6/18/07, Robin Ericsson [EMAIL PROTECTED] wrote: On 6/18/07, Martin Grotzke [EMAIL PROTECTED] wrote: Hi, T5 currently renders markup that is not XHTML compliant. Yes and no. E.g. the element 'meta http-equiv=Content-Type content=text/html; charset=utf-8 /' is rendered as 'meta content=text/html; charset=utf-8 http-equiv=Content-Type' - the tag is not closed properly. Is there any way to force T5 to generate XHTML compliant markup? If your template uses HTML (SGML) markup, T5 generates HTML markup, if your template uses XHTML, T5 generates XHTML. See previous posts on this list. -- regards, Robin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Martin Grotzke http://www.javakaffee.de/blog/ signature.asc Description: This is a digitally signed message part
Re: T5: change a grid's rowsPerPage property dynamically?
On Tue, 2007-06-19 at 10:45 +0200, Martin Dietze wrote: Hi, I am using a Grid component for displaying a larger set of data. On my page I have form which I use to allow the user to set the perferred page size. When the user selects a new setting the form submits and changes the page class'es _rowsPerPage property which is used by the grid in the template to determine its number of rows like this: | table t:type=grid | row=partner | source=partners | rowsPerPage=${rowsPerPage} | model=partnersRowModel My _rowsPerPage property get set to the right value after submit, however the grid seems to ignore any changes from the default it has been created with. Could it be the rowsPerPage setting is cached somehow? How can I get the component to honor new settings? Would it be possible to have the grid component in your page class so that you can update the rowsPerPage property directly? Cheers, Martin signature.asc Description: This is a digitally signed message part
TP4.1 Get the java.lang.NoClassDefFoundError: ognl/ClassCacheInspector in the newest Tap4.1.2 snapshot
Hi I updated the jar from maven and run the Web App Today,but get the Exception java.lang.NoClassDefFoundError: ognl/ClassCacheInspector . I have checked the version of Tap and Ognl but can't find the Class the versions are ognl-2.7-20070425.021856-29.jar tapestry-framework-4.1.2-20070618.232528-122.jar Thanks in advance -- View this message in context: http://www.nabble.com/TP4.1-Get-the-java.lang.NoClassDefFoundError%3A-ognl-ClassCacheInspector-in-the-newest-Tap4.1.2-snapshot-tf3950692.html#a11208399 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: change a grid's rowsPerPage property dynamically?
On Wed, June 20, 2007, Martin Grotzke wrote: Would it be possible to have the grid component in your page class so that you can update the rowsPerPage property directly? I tried this, too, but calling the setRowsPerPage() method from within my page class had no effect either. Cheers, Martin -- --- / http://herbert.the-little-red-haired-girl.org / - =+= What would happen in a battle between an Enterprise security team, who always get killed soon after appearing, and a squad of Imperial Stormtroopers, who can't hit the broad side of a planet? --Tom Galloway - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: getting list of assigned Mixins from component
hi all, how can i get a list of assigned mixins from a component? I've tried from within a mixin but getMixinClasses returns always an empty list: @InjectComponent private Component _component; @Environmental private JavascriptApi _jsAPI; public void afterRender() { ComponentResources _resources = _component.getComponentResources() .getComponentModel().getMixinClassNames(); from within a component i tried it too with: @Inject private ComponentResources resources; with no luck. From what i could see from the code i need a EmbeddedComponentModel instance but i did not succeed in obtaining one :) g kris.
[T5] How to retrieve the id of an event emitter in handler method ?
Hello, I would like to know how I can retrieve the ID of the component which triggered an even when I'm in an event handler method ? Well, perhaps that my problem is not this problem, so there is a little background to help you to decide... In my application, I have to create a component to manage an editable list of string. The available (functional) actions are add a string, remove a string, edit string. I need to present the edit form so that all action can be done in the same page : 8--- (note: string? are input text field) | string1 | _delete_ | string2 | _delete_ | string3 | _delete_ _add_a_value _submit_change_ _reset_ 8--- So, there's no real problem to do this : in the html template, I used a form component, with a loop component which goes through the list. I want that if an user edit some field and then want to add/delete a value, his modification are kept, so _add_a_value_ and _delete_ are submit button. The template looks like : 8--- t:loop t:source=range t:value=index p input t:type=TextField/ t:submit t:id=remove value=Remove/ /p /t:loop t:submit t:id=add value=Add/ ... 8--- In the Java code, I have two event handler : onSelectedFromAdd() and onSelectedFromRemove(), and they are called when matching button are submitted. But for the delete button, I don't know which one was really submitted. I would be happy if I can retrieve the id of the submitted remove: I can generate it so that I can retrieve the matching value to remove. An other option would be to pass a context to the submit event, but I don't think it's possible... So, if you have any idea to help me, they will be well-appreciated... Francois Armand - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T4: Localization of image assets
This seems like the easiest example but I just can't find any documention of how to do it. I have a localized Tapestry 4 app. Localization of text (messages) works great! But - how do I handle the images? I have @Image components and assets but how do I get them to automatically select the right image depending of the current locale? I'd be truly greatful I you help me :) Malin
T5 Tapestry-Test How to use with HTML attributes
Hi, I tried to use assertText() method like this assertText(html_Div_Id,expected) But It didn't work because the element html_Div_Id was not found. does Tapestry-Test used with Tapestry attributes only? Any body know how to do that . I'm learning Tapestry, so your answer will be realy helpful. Thanks in advance Tam -- View this message in context: http://www.nabble.com/T5-Tapestry-Test-How-to-use-with-HTML-attributes-tf3951169.html#a11209847 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: change a grid's rowsPerPage property dynamically?
On Wed, June 20, 2007, Martin Dietze wrote: I tried this, too, but calling the setRowsPerPage() method from within my page class had no effect either. Folowing up my own posting - the problem is still unsolved, has anyone found a solution to this? Cheers, Martin -- --- / http://herbert.the-little-red-haired-girl.org / - =+= In an organization, each person rises to the level of his own incompetency. -- The Peter Principle - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: T4: Localization of image assets
Just have two versions of the image, say, flag.gif for the default and flag_es.gif for Spanish etc. Define it as asset name=flag path=context:/images/flag.gif/ Tapestry will pick the correct localized image automatically. -Original Message- From: Malin Ljungh [mailto:[EMAIL PROTECTED] Sent: 20 June 2007 10:19 To: Tapestry users Subject: T4: Localization of image assets This seems like the easiest example but I just can't find any documention of how to do it. I have a localized Tapestry 4 app. Localization of text (messages) works great! But - how do I handle the images? I have @Image components and assets but how do I get them to automatically select the right image depending of the current locale? I'd be truly greatful I you help me :) Malin -- CONFIDENTIALITY NOTICE: If you have received this email in error, please immediately notify the sender by e-mail at the address shown. This email transmission may contain confidential information. This information is intended only for the use of the individual(s) or entity to whom it is intended even if addressed incorrectly. Please delete it from your files if you are not the intended recipient. Thank you for your compliance. Copyright 2007 CIGNA == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
t5: i18 messages without different locale files
Hi, I have the following issue. I want to internationalize my application without using the localed files. The administrator of my application should be able to write or change the texts for the template by himself. These texts are stored in a postgres db. Therefore i.e. I want to override the binding mechanism for message so that it uses instead of the default messages my own DBMessagesImpl. In the tapestry source code I found the line where the message is connected with the MessageBindingFactory but I see no way to interfere this mechanism and change it so that message is connected with another BindingFactory. Have you any suggestions? And thx for your help. Regards, Tina - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: t5: i18 messages without different locale files
you could contribute an own BindingFactory for messagedb:... g kris Tina Umlandt [EMAIL PROTECTED] 20.06.2007 15:27 Bitte antworten an Tapestry users users@tapestry.apache.org An users@tapestry.apache.org Kopie Thema t5: i18 messages without different locale files Hi, I have the following issue. I want to internationalize my application without using the localed files. The administrator of my application should be able to write or change the texts for the template by himself. These texts are stored in a postgres db. Therefore i.e. I want to override the binding mechanism for message so that it uses instead of the default messages my own DBMessagesImpl. In the tapestry source code I found the line where the message is connected with the MessageBindingFactory but I see no way to interfere this mechanism and change it so that message is connected with another BindingFactory. Have you any suggestions? And thx for your help. Regards, Tina - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: t5: i18 messages without different locale files
I'm not sure (since I'm still on Tapestry 4 and there it's done like here: http://wiki.apache.org/tapestry/UsingCustomResourceSource;), but there was a thread about that on this list just a few weeks ago. You can read it here: http://thread.gmane.org/gmane.comp.java.tapestry.user/49256;. hth, Lutz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE: t5: i18 messages without different locale files
Hi, :-D ... thats what I want to do .. But can you tell me how I could do this? Where do I register a new BindingFactory for a new keyword? Thx, Tina you could contribute an own BindingFactory for messagedb:... g kris Tina Umlandt [EMAIL PROTECTED] 20.06.2007 15:27 Bitte antworten an Tapestry users users@tapestry.apache.org An users@tapestry.apache.org Kopie Thema t5: i18 messages without different locale files Hi, I have the following issue. I want to internationalize my application without using the localed files. The administrator of my application should be able to write or change the texts for the template by himself. These texts are stored in a postgres db. Therefore i.e. I want to override the binding mechanism for message so that it uses instead of the default messages my own DBMessagesImpl. In the tapestry source code I found the line where the message is connected with the MessageBindingFactory but I see no way to interfere this mechanism and change it so that message is connected with another BindingFactory. Have you any suggestions? And thx for your help. Regards, Tina - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE: t5: i18 messages without different locale files
hi tina, in your Module Class (AppModule, or WebappnameModule) you can contributeyour own BindingFactory with following method:public static void contributeBindingSource( MappedConfigurationString, BindingFactory configuration,) { configuration.add("messagedb", new MessagedbBindingFactory(db));}When tapestry recognizes your prefix it calls your factory to obtaina Binding instance. Beforeyou returnthe binding instance you of have to lookup the message key in your database. please take a look at theMessageBindingFactory class... this class does exactly what you need...except that you have to inject your db source :)g,kris-Tina Umlandt [EMAIL PROTECTED] schrieb: -An: users@tapestry.apache.orgVon: Tina Umlandt [EMAIL PROTECTED]Datum: 20.06.2007 04:51PMThema: RE: RE: t5: i18 messages without different locale filesHi,:-D ... thats what I want to do ..But can you tell me how I could do this? Where do I register a new BindingFactory for a new keyword?Thx,Tinayou could contribute an own BindingFactory for "messagedb:"...gkrisTina Umlandt [EMAIL PROTECTED]20.06.2007 15:27Bitte antworten an"Tapestry users" users@tapestry.apache.orgAnusers@tapestry.apache.orgKopieThemat5: i18 messages without different locale filesHi,I have the following issue.I want to internationalize my application without using the localed files.The administrator of my application should beable to write or change the texts for the template by himself. These textsare stored in a postgres db.Therefore i.e. I want to override the binding mechanism for "message" sothat it uses instead of the default messages myown DBMessagesImpl.In the tapestry source code I found the line where the "message" isconnected with the MessageBindingFactory but I seeno way to interfere this mechanism and change it so that "message" isconnected with another BindingFactory.Have you any suggestions? And thx for your help.Regards,Tina-To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]-To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
t5: i18n messages without different locale files
Hi, :-D ... thats what I want to do .. But can you tell me how I could do this? Where do I register a new BindingFactory for a new keyword? Thx, Tina you could contribute an own BindingFactory for messagedb:... g kris Tina Umlandt [EMAIL PROTECTED] 20.06.2007 15:27 Bitte antworten an Tapestry users users@tapestry.apache.org An users@tapestry.apache.org Kopie Thema t5: i18 messages without different locale files Hi, I have the following issue. I want to internationalize my application without using the localed files. The administrator of my application should be able to write or change the texts for the template by himself. These texts are stored in a postgres db. Therefore i.e. I want to override the binding mechanism for message so that it uses instead of the default messages my own DBMessagesImpl. In the tapestry source code I found the line where the message is connected with the MessageBindingFactory but I see no way to interfere this mechanism and change it so that message is connected with another BindingFactory. Have you any suggestions? And thx for your help. Regards, Tina - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry
I just realized I had a bug relating to this yesterday and I could use a little help solving it. I think the solution is to force the hibernate session to flush before the response is committed, but I'm not sure how/where to inject that call into tapestry. If I knew where to make tapestry call my code, getting hibernate to flush is easy. I just spent a few minutes this morning trying to explicitly call response.sendError, but once the WebRequestServicer has called its service method, the response is committed so I get an IllegalStateException. In general, I think we should either use an open session in view or DAO approach, not a hybrid. The point of open session in view is that developers don't have to worry about transactional contexts, reenlistment and stuff like that. If you're throwing those gains away with separate request/response or listener/other transactions, you're better off letting DAOs manage transactions and getting the benefits of their narrower scope and cleaner definition of where transactions start and stop. Even if spring says it's ok to start a new transaction in a session where the previous transaction was rolled back, I think it's a bad idea. I use open session in view, which is one transaction per session in its entire lifetime. For daemon processes, a session will go through multiple transactions, but the moment something goes wrong, I start with a new session. -Steve Michael Sims wrote: Sorry again for the not 100% Tapestry related question, but I got such helpful responses from my last question, and it's clear that there are a lot of people on this list that have already solved these issues that I'm running into (and I'm getting jack from the Hibernate forums ;) )... I've implemented the open session in view pattern in my Tapestry application in the fairly conventional way. I inject a threaded Session via Hivemind using a service factory, and the service factory activates a transaction and creates a ThreadCleanupListener to commit() the transaction and close the session when the thread is done processing the user's request. So far so good. What I'm not sure how to do is handle situations where I may need to inform the user that their transaction failed. For example, let's say I have a typical CRUD application to create new users for my system, and I want to be able to correctly handle the scenario where an administrator attempts to create a new user with a name that is already in use (a primary or unique key violation). I can't simply let the ThreadCleanupListener handle the commit() in this case; if I do this, and an exception is thrown, it is too late to inform the user since the request has already been rendered. The Open Session in View page on the Hibernate web site [1] states that a good approach is to use two transactions in one Session. If I took this approach, I would attempt to commit the transaction in my listener method, and catch the exception thrown from the database, and convert this into a validation error which states that the username is already taken. The problem with this is that the Hibernate documentation is quite clear that if any exception occurs, the transaction should be rolled back, and the Session should be closed and discarded. Rolling back is not a problem, but if I close and discard the Session, I'm no longer using open session in view. I'll have to go to the trouble to initialize any lazy collections or proxies that the view might need before I attempt the commit, otherwise I'll get a LazyInitializationException. But I've read one of the Spring guys saying [2] that it's ok to begin a new transaction on the same Session that has been rolled back, if you're only using it to initialize lazy collections. This would be nice if it were actually true; it would simplify things for me quite a bit. But I hestitate to rely on that, since the Hibernate documentation says otherwise. Can someone with a bit more experience with give me some advice on how to approach this? Thanks in advance... [1] http://www.hibernate.org/43.html [2] http://forum.springframework.org/showpost.php?p=29579postcount=6 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Using GridPager
The TypeCoercer service translates a List parameter to a GridDataSource for the Grid. The Grid then passes the GridDataSource to the GridPager. On 6/19/07, Joshua Jackson [EMAIL PROTECTED] wrote: Dear all, Can anyone give me a hint on how to use GridPager? There is a property called source which is a GridDataSource. With Grid we can use a List object or array for the source. If I have a List object to be placed in GridPager, does this I have to make another class that implements GridDataSource, and then use it as a source for GridPager? I still can't figure out on how to use GridPager. Thanks in advance. -- Let's create a highly maintainable and efficient code YM!: thejavafreak Blog: http://www.nagasakti.or.id/roller/joshua/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship TWD Consulting, Inc. Independent J2EE / Open-Source Java Consultant Creator and PMC Chair, Apache Tapestry Creator, Apache HiveMind Professional Tapestry training, mentoring, support and project work. http://howardlewisship.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using Hibernate detached objects in Tapestry (thread-safety question)
Thiago H de Paula Figueiredo wrote: On Tue, 19 Jun 2007 18:24:10 -0300, Norman Franke [EMAIL PROTECTED] wrote: 1. As Michael noted, they aren't thread safe. 2. This really gets to a bigger issue, in that these objects aren't valid outside of a session. Once the session closes, they are technically invalid according to what I read in Hibernate in Action. This is because Hibernate may want to lazy fetch things, e.g. relationships. In a second request and therefore a second session, you can merge your your detached instance using the Object merge(Object o) method of Session. The returned object has the same values as yours detached one, but it is associated with the session. Unless I'm mistaken, merge()'ing the same object into two different Sessions isn't any more safe than using update() or lock(), so you still have to deal with thread safety issues when using it. Do you have reason to believe otherwise (or maybe I completely misunderstood your point)? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dynamic component injection
did you find any cleaner way to do this? I think this problem is not just related to one page applications but apply also to any page/component that depending un user actions must show different enough content (unless one wants to go with EventListener and a long ugly list of IF components...)
T5 tutorial not working out... Javassist, Maven problems
Hi, I am trying to do the T5 tutorial, but I am having many problems. First of all, I couldn't get the maven install to work at all. The mvn archetype:create -DarchetypeGroupId=org.apache.tapestry -DarchetypeArtifactId=quickstart -DarchetypeVersion=5.0.4 -DgroupId=org.example -DartifactId=hilo -DpackageName=org.example.hilo line works (now), but on doing mvn jetty:run, I get fatal compilation errors: [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'jetty'. [INFO] [INFO] Building hilo Tapestry 5 Application [INFO]task-segment: [jetty:run] [INFO] [INFO] Preparing jetty:run [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. Downloading: http://people.apache.org/~hlship/tapestry-snapshot-repository//org/apache/tapestry/tapestry-core/5.0.4-SNAPSHOT/tapestry-core-5.0.4-SNAPSHOT.pom Downloading: http://snapshots.repository.codehaus.org/org/apache/tapestry/tapestry-core/5.0.4-SNAPSHOT/tapestry-core-5.0.4-SNAPSHOT.pom Downloading: http://maven.openqa.org//org/apache/tapestry/tapestry-core/5.0.4-SNAPSHOT/tapestry-core-5.0.4-SNAPSHOT.pom [INFO] [compiler:compile] [INFO] Compiling 2 source files to C:\Projects\tapestry_tutorial\hilo\target\classes [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] Compilation failure C:\Projects\tapestry_tutorial\hilo\src\main\java\org\example\hilo\services\AppModule.java:[5,33] package org.apache.commons.logging does not exist C:\Projects\tapestry_tutorial\hilo\src\main\java\org\example\hilo\services\AppModule.java:[6,30] package org.apache.tapestry.ioc does not exist C:\Projects\tapestry_tutorial\hilo\src\main\java\org\example\hilo\services\AppModule.java:[7,30] package org.apache.tapestry.ioc does not exist C:\Projects\tapestry_tutorial\hilo\src\main\java\org\example\hilo\services\AppModule.java:[8,42] package org.apache.tapestry.ioc.annotations does not exist C:\Projects\tapestry_tutorial\hilo\src\main\java\org\example\hilo\services\AppModule.java:[21,12] cannot find symbol symbol : class MappedConfiguration location: class org.example.hilo.services.AppModule C:\Projects\tapestry_tutorial\hilo\src\main\java\org\example\hilo\services\AppModule.java:[40,49] cannot find symbol symbol : class Log location: class org.example.hilo.services.AppModule C:\Projects\tapestry_tutorial\hilo\src\main\java\org\example\hilo\services\AppModule.java:[72,41] cannot find symbol symbol : class OrderedConfiguration location: class org.example.hilo.services.AppModule C:\Projects\tapestry_tutorial\hilo\src\main\java\org\example\hilo\services\AppModule.java:[73,13] cannot find symbol symbol : class InjectService location: class org.example.hilo.services.AppModule So, I retreated to more familiar territory: Ant. Sadly, I can't even make this work. I have a war file, which I built from the example source that was downloaded by Maven. When I deploy this file in my Jetty server, it seems that some javassist classes are missing. Now, having installed javassist.jar, I am getting this in Jetty's console when I try to access the hilo application: 13860 [btpool0-7] ERROR org.example.hilo.pages.Start - Render queue error in BeginRender[org.example.hilo.pages.Start:pagelink]: org.apache.tapestry.PageRenderSupport java.lang.RuntimeException: org.apache.tapestry.PageRenderSupport at javassist.runtime.Desc.getClassType(Desc.java:153) at javassist.runtime.Desc.getType(Desc.java:119) at javassist.runtime.Desc.getType(Desc.java:75) at org.apache.tapestry.corelib.components.PageLink._$environment_read_support(PageLink.java) at org.apache.tapestry.corelib.components.PageLink.beginRender(PageLink.java:63) at org.apache.tapestry.corelib.components.PageLink.beginRender(PageLink.java) at org.apache.tapestry.internal.structure.ComponentPageElementImpl$10$1.run(ComponentPageElementImpl.java:345) at org.apache.tapestry.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:932) at org.apache.tapestry.internal.structure.ComponentPageElementImpl.access$100(ComponentPageElementImpl.java:69) .. and so on Perhpas I have the wrong version of javassist.jar? Is something installed improperly somehow? I'm at a bit of a loss. Thanks for any help, Marc -- View this message in context: http://www.nabble.com/T5-tutorial-not-working-out...-Javassist%2C-Maven-problems-tf3953119.html#a11215935 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry
Steve Shucker wrote: I just realized I had a bug relating to this yesterday and I could use a little help solving it. I think the solution is to force the hibernate session to flush before the response is committed, but I'm not sure how/where to inject that call into tapestry. If I knew where to make tapestry call my code, getting hibernate to flush is easy. If I need to commit or rollback the transaction in a listener method (or elsewhere), I inject a thread-bound transaction manager service into my pages. The transaction manager has the request-wide session injected into it, and I call methods on the manager to commit, rollback, etc. I got this idea from Tapestry 5's tapestry-hibernate project: http://tinyurl.com/3b3dok In my implementation, I have split out the ThreadCleanupListener responsibilities into another object, but the rest is pretty much the same. Does this help at all? In general, I think we should either use an open session in view or DAO approach, not a hybrid. The point of open session in view is that developers don't have to worry about transactional contexts, reenlistment and stuff like that. If you're throwing those gains away with separate request/response or listener/other transactions, you're better off letting DAOs manage transactions and getting the benefits of their narrower scope and cleaner definition of where transactions start and stop. The issue with that, in my case anyway, is that I'm using a SqueezeAdaptor to transparently squeeze a Hibernate persisted object into class + id, and then unsqueeze to the full entity on the next request. I do this for client persistence and direct link parameters, etc., to keep my objects from being serialized into the query string. My SqueezeAdaptor has to have an active session and transaction, and this occurs before any listener methods are called. I could have the SqueezeAdaptor, or anything else that needs to use Hibernate, start and finish their own transactions via DAO calls, but this would result in a high number of transactions per request, so I don't think that would be worth anything. Worse still, if any of those transactions results in an error, you are supposed to close the Session, which detaches all persistent objects and makes it impossible to access lazily-initialized properties. Even if spring says it's ok to start a new transaction in a session where the previous transaction was rolled back, I think it's a bad idea. I use open session in view, which is one transaction per session in its entire lifetime. Yes, but what about my scenario with the CRUD application? An administrator tries to persist a new user, and there is a primary key violation, but using open session in view, you don't know this until the response has already been rendered, and by then it's too late to present an error. So, how do you handle this without comitting the transaction early, before the response has been rendered? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Split mailing list for T5/T4,4.1
-1 On 6/19/07, Peter Schröder [EMAIL PROTECTED] wrote: i stopped reading the mailing list because of all the topics of T4.1 and T5... it would be a minimal afford for those who want to read all messages of all lists. but it is a time consuming job to find T4 related topics... -Ursprüngliche Nachricht- Von: Igor Drobiazko [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 15. Juni 2007 17:22 An: Tapestry users Betreff: Re: Split mailing list for T5/T4,4.1 I'm interested in both t4 and t5. For me it would be no problem to subscribe to both lists. But as Jesse already mentioned in the thread before, splitting the list would fracture the community. I'm pretty sure there are a lot of users reading but not writing to the list. Seeing the list growing up day by day they will be encouraged to participate. Splitting the list would give an impression that the tapestry community is too small. On 6/15/07, Holger Stolzenberg [EMAIL PROTECTED] wrote: The fact (mentioned earlier) is that if someone is interessted in T4 and T5 he could subscribe to both lists. -Ursprüngliche Nachricht- Von: Renat Zubairov [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 15. Juni 2007 16:26 An: Tapestry users Betreff: Re: Split mailing list for T5/T4,4.1 What if developers are working on the production version (fixing bugs) and developing new version at the same time? I guess that's the most common situation for in all companies that were using Tapestry for a while. Renat On 15/06/07, #Cyrille37# [EMAIL PROTECTED] wrote: Daniel Jue a écrit : I say we can split it. Make the original list for T3 and T4x users, and make a new one for T5. Interested parties can subscribe to both. We can't guarantee that new subscribers to the current setup will prepend the correct version in the subject line. (Although it has worked pretty well so far!) I think a split could be a proper way. a T4 list for production , a T5 list for developpers. my 2 cents. cyrille Daniel On 6/14/07, Bruce Petro [EMAIL PROTECTED] wrote: This sounds great - although you could also do multiple targets which could just prepend a key to all subjects so people could then pick what they want via that key word designation. Sent from my GoodLink synchronized handheld (www.good.com) -Original Message- From: Holger Stolzenberg [mailto:[EMAIL PROTECTED] Sent: Thursday, June 14, 2007 03:40 AM Eastern Standard Time To: Tapestry users Subject:Split mailing list for T5/T4,4.1 Hey guys, I just aksed myself if it would make sense to split up the mailing list into 2 lists. For me, only T4,T4.1 topics are relevat at the moment. Everyday I have to filter out about let me say 80% of the mails because they are T5 related. Thats a lot of overhead. How do you all think about it? Mit lieben Grüßen aus dem eWerk | Holger Stolzenberg | Softwareentwickler | | Geschäftsführer: | Frank Richter, Erik Wende, Hendrik Schubert | | eWerk IT GmbH | Markt 16 | Leipzig 04109 | http://www.ewerk.com | HRB 9065, AG Leipzig | Hauptniederlassung Leipzig | | fon +49.341.4 26 49-0 | fax +49.341.4 26 49-88 | mailto:[EMAIL PROTECTED] | | Support: | fon 0700 CALLME24 (0700 22556324) | fax 0700 CALLME24 (0700 22556324) | | Auskünfte und Angebote per Mail | sind freibleibend und unverbindlich. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Best regards, Renat Zubairov - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Patrick Y. Yip
Tapestry flash
Hi, Where can i found the tapestry-flash library on a maven repository ? Thanks in advance. Stephane - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tapestry flash
http://howardlewisship.com/repository groupIdcom.javaforge.tapestry/groupId artifactIdtapestry-flash/artifactId On 6/20/07, Stephane Decleire [EMAIL PROTECTED] wrote: Hi, Where can i found the tapestry-flash library on a maven repository ? Thanks in advance. Stephane - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry
Keep in mind the difference between a flush and a commit in hibernate. A flush executes all the queued sql against the database without committing the transaction. Hibernate does this whenever it has changes that needed to be sent to the database before a query is run. Otherwise, it defers the flush until just before the commit. Unless you're using deferred constraints in oracle, constraint violations and other db-related exceptions will be raised during the flush, not the commit. What I'd really like to do is configure something in hivemind that would run just before tapestry commits the response. Then I could call session.flush() there to force the exception before the response is committed. I just don't know how I can accomplish this. -Steve Michael Sims wrote: Steve Shucker wrote: I just realized I had a bug relating to this yesterday and I could use a little help solving it. I think the solution is to force the hibernate session to flush before the response is committed, but I'm not sure how/where to inject that call into tapestry. If I knew where to make tapestry call my code, getting hibernate to flush is easy. If I need to commit or rollback the transaction in a listener method (or elsewhere), I inject a thread-bound transaction manager service into my pages. The transaction manager has the request-wide session injected into it, and I call methods on the manager to commit, rollback, etc. I got this idea from Tapestry 5's tapestry-hibernate project: http://tinyurl.com/3b3dok In my implementation, I have split out the ThreadCleanupListener responsibilities into another object, but the rest is pretty much the same. Does this help at all? In general, I think we should either use an open session in view or DAO approach, not a hybrid. The point of open session in view is that developers don't have to worry about transactional contexts, reenlistment and stuff like that. If you're throwing those gains away with separate request/response or listener/other transactions, you're better off letting DAOs manage transactions and getting the benefits of their narrower scope and cleaner definition of where transactions start and stop. The issue with that, in my case anyway, is that I'm using a SqueezeAdaptor to transparently squeeze a Hibernate persisted object into class + id, and then unsqueeze to the full entity on the next request. I do this for client persistence and direct link parameters, etc., to keep my objects from being serialized into the query string. My SqueezeAdaptor has to have an active session and transaction, and this occurs before any listener methods are called. I could have the SqueezeAdaptor, or anything else that needs to use Hibernate, start and finish their own transactions via DAO calls, but this would result in a high number of transactions per request, so I don't think that would be worth anything. Worse still, if any of those transactions results in an error, you are supposed to close the Session, which detaches all persistent objects and makes it impossible to access lazily-initialized properties. Even if spring says it's ok to start a new transaction in a session where the previous transaction was rolled back, I think it's a bad idea. I use open session in view, which is one transaction per session in its entire lifetime. Yes, but what about my scenario with the CRUD application? An administrator tries to persist a new user, and there is a primary key violation, but using open session in view, you don't know this until the response has already been rendered, and by then it's too late to present an error. So, how do you handle this without comitting the transaction early, before the response has been rendered? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 best pattern for grid and beaneditform
Have a look: .html: table t:type=grid rowsPerPage=5 row=tUser source=usersList model=model ... some code here /table .java: void pageLoaded() { _model = _beanModelSource.create(TUser.class, true, _resources); _model.remove(password); } and: http://www.mail-archive.com/users@tapestry.apache.org/msg12953.html -- E.L. On 18/06/07, Gabriel Lozano [EMAIL PROTECTED] wrote: Hi, I'm right now working in user administration. So I have a page that list the users I have but I don't want to show passwords so I use the 'NonVisual' anotation in the User class. But, in the edit page, I want to insert some new password for a user and because of the anotation I am not able. What I decided to do is to quit the anotation and in the users page ( the one with the grid ) I use a t:parameter and just fill the password column with ***. Is there any other, more elegant, way to just not show the password column in the users page and be able to edit it in a beaneditform? Thanks in advance. Gabriel H. Lozano M.
RE: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry
Steve Shucker wrote: Keep in mind the difference between a flush and a commit in hibernate. A flush executes all the queued sql against the database without committing the transaction. Hibernate does this whenever it has changes that needed to be sent to the database before a query is run. Otherwise, it defers the flush until just before the commit. Unless you're using deferred constraints in oracle, constraint violations and other db-related exceptions will be raised during the flush, not the commit. What I'd really like to do is configure something in hivemind that would run just before tapestry commits the response. Then I could call session.flush() there to force the exception before the response is committed. I just don't know how I can accomplish this. Ah, ok. Sorry about that, I guess I need to learn to be a bit more precise in my interpretation of the terms. Still, a session manager service would allow you to expose a method to flush() in a listener, yes? Or you want to make this more transparent/automatic so you can just redirect to a static error page on any exception without having to explicitly flush()? That still doesn't help for my particular use case though... I need to catch the error and still render a response that might need to access lazily-initialized properties of Hibernate persisted objects... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry
I'm really fishing for a hivemind guru to tell me how to inject some code in the tail end of the WebRequestServicer.service() method. That would allow me to implement a general solution of flushing before the response is committed and forcing the exception to occur at a point where I can still notify the user. I want things to be automatic rather than having to explicitly call Session.flush() in every listener method. (If I was going to do that, I'd use an aspect.) I know this doesn't quite solve your problem because you want to use another session to render your error response. I'd consider a dedicated session in pageBeginRender of my error page (with some extra error handling) to set up the state for your error page. -Steve Michael Sims wrote: Steve Shucker wrote: Keep in mind the difference between a flush and a commit in hibernate. A flush executes all the queued sql against the database without committing the transaction. Hibernate does this whenever it has changes that needed to be sent to the database before a query is run. Otherwise, it defers the flush until just before the commit. Unless you're using deferred constraints in oracle, constraint violations and other db-related exceptions will be raised during the flush, not the commit. What I'd really like to do is configure something in hivemind that would run just before tapestry commits the response. Then I could call session.flush() there to force the exception before the response is committed. I just don't know how I can accomplish this. Ah, ok. Sorry about that, I guess I need to learn to be a bit more precise in my interpretation of the terms. Still, a session manager service would allow you to expose a method to flush() in a listener, yes? Or you want to make this more transparent/automatic so you can just redirect to a static error page on any exception without having to explicitly flush()? That still doesn't help for my particular use case though... I need to catch the error and still render a response that might need to access lazily-initialized properties of Hibernate persisted objects... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry
Steve Shucker wrote: I'm really fishing for a hivemind guru to tell me how to inject some code in the tail end of the WebRequestServicer.service() method. Looks like something similar was discussed here: http://www.mail-archive.com/[EMAIL PROTECTED]/msg00316.html Howard mentioned a possible feature addition to support this, and the original poster said that he would add a JIRA issue, but I wasn't able to locate it if it was ever added. This would come in handy for something unrelated... I'm implementing your WebRequestServicerFilter that handles synchronization for non-asset requests, but your code doesn't detect asset requests if friendly URLs (AssetEncoder) are enabled. I tried my best to find a way to leverage Tapestry's existing code to determine which service was scheduled for a particular request, but the only thing that can determine that is the IRequestCycle, and this isn't available in a WebRequestServicerFilter. I had to resort to code similar to yours that handles the scheme AssetEncoder uses, but this code is fragile; if a new encoding method is employed the filter will not be able to detect asset requests. Oh well, for now the kludge will have to do, I suppose. I'd consider a dedicated session in pageBeginRender of my error page (with some extra error handling) to set up the state for your error page. Thanks, but that won't work for two reasons: (1) I don't have an error page as such, many pages may need to handle these types of constraint violations, and sometimes only when certain listeners are called, and (2) that would require me to basically have two copies of all my persistent objects, one copy for each session. I'd rather manually eager fetch everything that my template is going to need before attempting the commit than to do that... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 hibernate: Illegal attempt to assoc. collection w/ 2 open sessions.
Going back to fully-nonmanaged hibernate. My DAOs now look like Session sess = factory.openSession(); Transaction tx = null; try { tx = sess.beginTransaction(); // do something. tx.commit(); } catch (RuntimeException e) { if (tx != null) tx.rollback(); throw e; } finally { sess.close(); } Works just fine. On 6/19/07, Bill Holloway [EMAIL PROTECTED] wrote: I have a Person entity (hibernate mapped) that can own multiple items. I'm using a bean edit form on the variable _item in the following: during setRender, I do _item = new Item(); _item.setOwner(person); In my save method, I have onSubmit () { _dao.saveOrUpdate (_item); } I then get the error in the subj line of this e-mail. Any ideas? Bill - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry
Unless I'm really screwing up, my check works with friendly URLs. I'm using them. They way I understand the pipeline is that service encoders take the original http request and do some preprocessing before you end up with a WebRequest. Look at RequestCycleFactoryImpl and AssetEncoder to see where this happens. The short version is that the WebRequest should have a parameter set that identifies the tapestry service being called. Thanks for the link. -Steve Michael Sims wrote: Steve Shucker wrote: I'm really fishing for a hivemind guru to tell me how to inject some code in the tail end of the WebRequestServicer.service() method. Looks like something similar was discussed here: http://www.mail-archive.com/[EMAIL PROTECTED]/msg00316.html Howard mentioned a possible feature addition to support this, and the original poster said that he would add a JIRA issue, but I wasn't able to locate it if it was ever added. This would come in handy for something unrelated... I'm implementing your WebRequestServicerFilter that handles synchronization for non-asset requests, but your code doesn't detect asset requests if friendly URLs (AssetEncoder) are enabled. I tried my best to find a way to leverage Tapestry's existing code to determine which service was scheduled for a particular request, but the only thing that can determine that is the IRequestCycle, and this isn't available in a WebRequestServicerFilter. I had to resort to code similar to yours that handles the scheme AssetEncoder uses, but this code is fragile; if a new encoding method is employed the filter will not be able to detect asset requests. Oh well, for now the kludge will have to do, I suppose. I'd consider a dedicated session in pageBeginRender of my error page (with some extra error handling) to set up the state for your error page. Thanks, but that won't work for two reasons: (1) I don't have an error page as such, many pages may need to handle these types of constraint violations, and sometimes only when certain listeners are called, and (2) that would require me to basically have two copies of all my persistent objects, one copy for each session. I'd rather manually eager fetch everything that my template is going to need before attempting the commit than to do that... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using Hibernate detached objects in Tapestry (thread-safety question)
On Wed, 20 Jun 2007 12:17:32 -0300, Michael Sims [EMAIL PROTECTED] wrote: Unless I'm mistaken, merge()'ing the same object into two different Sessions isn't any more safe than using update() or lock(), so you still have to deal with thread safety issues when using it. I was just talking about the lazy loading part. :) Anyways, merge() would at least return different objects for different o.h.Sessions. Thiago - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T4: Localization of image assets
Wooohooo! I works! Like magic :D I love Tapestry but many many things seems like a secret to me. Is there any documentation I've missed? Thanks a million to you Alexander :) Malin 2007/6/20, Kolesnikov, Alexander GNI [EMAIL PROTECTED]: Just have two versions of the image, say, flag.gif for the default and flag_es.gif for Spanish etc. Define it as asset name=flag path=context:/images/flag.gif/ Tapestry will pick the correct localized image automatically. -Original Message- From: Malin Ljungh [mailto:[EMAIL PROTECTED] Sent: 20 June 2007 10:19 To: Tapestry users Subject: T4: Localization of image assets This seems like the easiest example but I just can't find any documention of how to do it. I have a localized Tapestry 4 app. Localization of text (messages) works great! But - how do I handle the images? I have @Image components and assets but how do I get them to automatically select the right image depending of the current locale? I'd be truly greatful I you help me :) Malin -- CONFIDENTIALITY NOTICE: If you have received this email in error, please immediately notify the sender by e-mail at the address shown. This email transmission may contain confidential information. This information is intended only for the use of the individual(s) or entity to whom it is intended even if addressed incorrectly. Please delete it from your files if you are not the intended recipient. Thank you for your compliance. Copyright 2007 CIGNA == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 tutorial not working out... Javassist, Maven problems
Hi Marc, Try 5.0.5-SNAPSHOT in POM.xml instead 5.0.4-SNAPSHOT Marcus
RE: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry
Steve Shucker wrote: Unless I'm really screwing up, my check works with friendly URLs. I'm using them. They way I understand the pipeline is that service encoders take the original http request and do some preprocessing before you end up with a WebRequest. Look at RequestCycleFactoryImpl and AssetEncoder to see where this happens. The short version is that the WebRequest should have a parameter set that identifies the tapestry service being called. What version of Tapestry? In 4.0.2, the pipeline calls the WebRequestServicerFilter's before the RequestCycleFactory and the encoders have done their work. With friendly URLs, a typical path for an asset is something like: /assets/031a6b16419c47ad157a817021baa2d6/class/path/file This is still the form it is in when it hits the filter. getParameterNames() returns an empty list, getParameterValue(ServiceConstants.SERVICE) returns null. I'm currently using the following to recognize an asset request: /assets.equals(request.getActivationPath()) You can verify this in the debugger by setting a breakpoint in both the filter and line 81 of RequestCycleFactoryImpl (where decodeParameters() is called), and then issuing a request for an asset. The filter will be reached first. The problem with this too, is that it's not immediately obvious that something is wrong. The filter will still do its job, namely synchronizing the requests, but it will do it unnecessarily in the case of the asset requests. If you're on a different version where things have changed, please disregard. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tapestry 4.1 portlet support
Is portlet support for 4.1 still supported? if so could someone send me an example portlet to get me started? thanks mIke - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 tutorial not working out... Javassist, Maven problems
Marcus, wow, i can't believe that just worked! i've been fighting this thing for a whole day. thanks so much. cheers, Marc Marcus-11 wrote: Hi Marc, Try 5.0.5-SNAPSHOT in POM.xml instead 5.0.4-SNAPSHOT Marcus -- View this message in context: http://www.nabble.com/T5-tutorial-not-working-out...-Javassist%2C-Maven-problems-tf3953119.html#a11220332 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 tutorial not working out... Javassist, Maven problems
Hi May be this could help also http://wiki.apache.org/tapestry/Tapestry5HowToCreateYourQuickstartWithMaven206 Renat On 20/06/07, Marcus [EMAIL PROTECTED] wrote: Hi Marc, Try 5.0.5-SNAPSHOT in POM.xml instead 5.0.4-SNAPSHOT Marcus -- Best regards, Renat Zubairov - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 encoding issue
Hi, this is an urgent and important issue for us. Can anybody help with this? Howard? As I wrote below: request.getServletPath() (or request.getPath()) already provides the decoded path. a) Should request.getPath() provide the encoded path, or b) should the additional decoding (in PageRenderDispatcher.convertActivationContext) be skipped? Is anything else the problem? E.g. might the problem be caused by commons URLCodec? Thanx in advance, cheers, Martin On Mon, 2007-06-18 at 12:20 +0200, Martin Grotzke wrote: On Sun, 2007-06-17 at 23:24 +0200, Martin Grotzke wrote: I just stepped through the sources to see where the URI get's decoded to the activation context arguments, and found that the o.a.t.internal.services.PageRenderDispatcher.dispatch invokes convertActivationContext with the path info to convert it to the activation context args. convertActivationContext uses TapestryInternalUtils.urlDecode which invokes URLCodec.decode. It seems that this causes the problem, but I cannot say what exactly is the reason. When I remove the invocation of TapestryInternalUtils.urlDecode everything's fine... Just to provide more info: TapestryInternalUtils.urlDecode is invoked with the already decoded context parameter, e.g. trüb for the urlencoded string tr%C3%BCb. This parameter is read from request.getServletPath(), which is already /search/trüb. So it tries to decode the already decoded string, which then fails. What is the problem here? Is it that request.getServletPath() provides the already decoded string, or is the problem that the decoding is done additionally by T5? Or what else? Thanx cheers, Martin Any help with this issue? Thanx cheers, Martin On Sun, 2007-06-17 at 23:01 +0200, Martin Grotzke wrote: On Tue, 2007-06-12 at 10:38 +0200, Ulrich Stärk wrote: In case you are using Tomcat try adding URIEncoding=UTF-8 to your connector definition in server.xml. I just tried that, but it does not solve the problem. I have added a servlet filter that prints the requested uri to the std out, just to see what is the input for T5. The URIEncoding=UTF-8 does not change what's printed by the filter, but the argument that's passed to my page class' onActivate is different. Without URIEncoding=UTF-8: [INFO ] 2007-06-17 22:52:37,956 http-8080-1 org.comp.proj.presentation.util.EncodingFilter.doFilter: - uri: /shopping24-shop/search/tr%C3%BCb - path: null [INFO ] 2007-06-17 22:52:51,303 http-8080-1 org.comp.proj.presentation.pages.Search.onActivate: Got invoked args tr??b With URIEncoding=UTF-8: [INFO ] 2007-06-17 22:54:33,398 http-8080-1 org.comp.proj.presentation.util.EncodingFilter.doFilter: uri: /shopping24-shop/search/tr%C3%BCb [INFO ] 2007-06-17 22:54:44,620 http-8080-1 org.comp.proj.presentation.pages.Search.onActivate: Got invoked args tr?b Is there anything else that I could do to get the correct decoding of the request parameters / uri? Thanx cheers, Martin Uli On Mo, 11.06.2007, 23:13, Martin Grotzke sagte: Hi, I have currently an encoding issue, but am not really sure what's the reason for this. I have an url that contains a url encoded german umlaut (ü) in UTF-8 and looks like the following: http://localhost:8080/app/search/%C3%BCbel (the %C3%BC represents the ü in UTF-8, this url is created by componentResources.createPageLink( search, new Object[]{ _query } ) in the submit method of the search page) Now, when I look in the onActivate(string) method, the string is not übel but it's ?bel, both printed via logging as when I inspect the variable during debugging. AFAICS the created url from the page link is correct in terms of utf-8 encoding, but the parsed query string seems to be wrong, as it contains only the ?... We have the following in our AppModule: public void contributeRequestHandler( OrderedConfigurationRequestFilter configuration, @InjectService(TimingFilter) final RequestFilter filter, @InjectService(Utf8Filter) final RequestFilter utf8Filter ) { configuration.add( Timing, filter ); configuration.add( Utf8Filter, utf8Filter ); // handle UTF-8 } public RequestFilter buildUtf8Filter( @InjectService(RequestGlobals) final RequestGlobals requestGlobals ) { return new RequestFilter() { public boolean service( Request request, Response response, RequestHandler handler ) throws IOException { requestGlobals.getHTTPServletRequest().setCharacterEncoding( UTF-8 ); return handler.service( request,
Re: Tapestry 4.1 portlet support
No unfortunately it's not so much these days. Haven't had time to really make sure it's all still working properly. (I'd love an example portlet to test against as well :) ) On 6/20/07, Michael Lake [EMAIL PROTECTED] wrote: Is portlet support for 4.1 still supported? if so could someone send me an example portlet to get me started? thanks mIke - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
Re: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry
You're right and now I feel stupid. I'm actually using tapestry 4.1.1, but I fired up the debugger to double check. Sure enough, it was applying my filter to asset requests. I could swear this worked at one point. Anyway, I had the code lying around to decode manually (needed it in a regular servlet filter once), so here's a version that works: private ServiceEncoder[] serviceEncoders; public void service(WebRequest request, WebResponse response, WebRequestServicer servicer) throws IOException { // don't filter asset requests ServiceEncodingImpl encoding = new ServiceEncodingImpl(request.getActivationPath(),request.getPathInfo(),extractParameters(request)); for(ServiceEncoder serviceEncoder: serviceEncoders){ serviceEncoder.decode(encoding); if(encoding.isModified()){ break; } } if (Tapestry.ASSET_SERVICE.equals(encoding.getParameterValue(ServiceConstants.SERVICE))) { servicer.service(request, response); } else { filterRequest(request, response, servicer); } } // copied from somewhere in tapestry private QueryParameterMap extractParameters(WebRequest request) { QueryParameterMap result = new QueryParameterMap(); Iterator i = request.getParameterNames().iterator(); while (i.hasNext()) { String name = (String) i.next(); String[] values = request.getParameterValues(name); if (values.length == 1) { result.setParameterValue(name, values[0]); } else { result.setParameterValues(name, values); } } return result; } Here's the hivemind config to inject the encoders: construct class=com.vms.infrastructure.websession.TapestrySessionTxFilter set-object property=serviceEncoders value=service-property:tapestry.url.LinkFactory:serviceEncoders/ /construct Thanks for catching my bug! -Steve Michael Sims wrote: Steve Shucker wrote: Unless I'm really screwing up, my check works with friendly URLs. I'm using them. They way I understand the pipeline is that service encoders take the original http request and do some preprocessing before you end up with a WebRequest. Look at RequestCycleFactoryImpl and AssetEncoder to see where this happens. The short version is that the WebRequest should have a parameter set that identifies the tapestry service being called. What version of Tapestry? In 4.0.2, the pipeline calls the WebRequestServicerFilter's before the RequestCycleFactory and the encoders have done their work. With friendly URLs, a typical path for an asset is something like: /assets/031a6b16419c47ad157a817021baa2d6/class/path/file This is still the form it is in when it hits the filter. getParameterNames() returns an empty list, getParameterValue(ServiceConstants.SERVICE) returns null. I'm currently using the following to recognize an asset request: /assets.equals(request.getActivationPath()) You can verify this in the debugger by setting a breakpoint in both the filter and line 81 of RequestCycleFactoryImpl (where decodeParameters() is called), and then issuing a request for an asset. The filter will be reached first. The problem with this too, is that it's not immediately obvious that something is wrong. The filter will still do its job, namely synchronizing the requests, but it will do it unnecessarily in the case of the asset requests. If you're on a different version where things have changed, please disregard. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5 - syntax for css background images?
Question: I've learned so far, to display an image ... you do something like this: SomePage.java @Inject @Path(./art_logo.png) private Asset _someIcon; and then SomePage.html you do img src=${someIcon}/ BUT --- what's the syntax to use these in css EG: background images? style type=text/css !-- body { background-color: #2D374A; background-image: url(someBackground); } .MainTable { background-color: #B5BFD2; background-image: url(someBackground); } -- /style
RE: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry
Steve Shucker wrote: You're right and now I feel stupid. It's an easy mistake to make, I think. Especially if it used to work and something in the internals of Tapestry changed at some point. I didn't mention it before because I just assumed you weren't using friendly URLs... (needed it in a regular servlet filter once), so here's a version that works: Nice, I'll use that, thanks. That's better than my hack, for sure... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 encoding issue
On Wed, 2007-06-20 at 22:02 +0200, Martin Grotzke wrote: Hi, this is an urgent and important issue for us. Can anybody help with this? Howard? As I wrote below: request.getServletPath() (or request.getPath()) already provides the decoded path. a) Should request.getPath() provide the encoded path, or b) should the additional decoding (in PageRenderDispatcher.convertActivationContext) be skipped? An excerpt from the servlet spec 2.4 p. 243: getServletPath() [...] Returns: a String containing the name or path of the servlet being called, as specified in the request URL, decoded, or an empty string if the servlet used to process the request is matched using the “/*” pattern. So why is additional decoding done? Cheers, Martin Is anything else the problem? E.g. might the problem be caused by commons URLCodec? Thanx in advance, cheers, Martin On Mon, 2007-06-18 at 12:20 +0200, Martin Grotzke wrote: On Sun, 2007-06-17 at 23:24 +0200, Martin Grotzke wrote: I just stepped through the sources to see where the URI get's decoded to the activation context arguments, and found that the o.a.t.internal.services.PageRenderDispatcher.dispatch invokes convertActivationContext with the path info to convert it to the activation context args. convertActivationContext uses TapestryInternalUtils.urlDecode which invokes URLCodec.decode. It seems that this causes the problem, but I cannot say what exactly is the reason. When I remove the invocation of TapestryInternalUtils.urlDecode everything's fine... Just to provide more info: TapestryInternalUtils.urlDecode is invoked with the already decoded context parameter, e.g. trüb for the urlencoded string tr%C3%BCb. This parameter is read from request.getServletPath(), which is already /search/trüb. So it tries to decode the already decoded string, which then fails. What is the problem here? Is it that request.getServletPath() provides the already decoded string, or is the problem that the decoding is done additionally by T5? Or what else? Thanx cheers, Martin Any help with this issue? Thanx cheers, Martin On Sun, 2007-06-17 at 23:01 +0200, Martin Grotzke wrote: On Tue, 2007-06-12 at 10:38 +0200, Ulrich Stärk wrote: In case you are using Tomcat try adding URIEncoding=UTF-8 to your connector definition in server.xml. I just tried that, but it does not solve the problem. I have added a servlet filter that prints the requested uri to the std out, just to see what is the input for T5. The URIEncoding=UTF-8 does not change what's printed by the filter, but the argument that's passed to my page class' onActivate is different. Without URIEncoding=UTF-8: [INFO ] 2007-06-17 22:52:37,956 http-8080-1 org.comp.proj.presentation.util.EncodingFilter.doFilter: - uri: /shopping24-shop/search/tr%C3%BCb - path: null [INFO ] 2007-06-17 22:52:51,303 http-8080-1 org.comp.proj.presentation.pages.Search.onActivate: Got invoked args tr??b With URIEncoding=UTF-8: [INFO ] 2007-06-17 22:54:33,398 http-8080-1 org.comp.proj.presentation.util.EncodingFilter.doFilter: uri: /shopping24-shop/search/tr%C3%BCb [INFO ] 2007-06-17 22:54:44,620 http-8080-1 org.comp.proj.presentation.pages.Search.onActivate: Got invoked args tr?b Is there anything else that I could do to get the correct decoding of the request parameters / uri? Thanx cheers, Martin Uli On Mo, 11.06.2007, 23:13, Martin Grotzke sagte: Hi, I have currently an encoding issue, but am not really sure what's the reason for this. I have an url that contains a url encoded german umlaut (ü) in UTF-8 and looks like the following: http://localhost:8080/app/search/%C3%BCbel (the %C3%BC represents the ü in UTF-8, this url is created by componentResources.createPageLink( search, new Object[]{ _query } ) in the submit method of the search page) Now, when I look in the onActivate(string) method, the string is not übel but it's ?bel, both printed via logging as when I inspect the variable during debugging. AFAICS the created url from the page link is correct in terms of utf-8 encoding, but the parsed query string seems to be wrong, as it contains only the ?... We have the following in our AppModule: public void contributeRequestHandler( OrderedConfigurationRequestFilter configuration, @InjectService(TimingFilter) final RequestFilter filter, @InjectService(Utf8Filter) final RequestFilter utf8Filter ) { configuration.add( Timing, filter );
Re: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry
In my case, I'm using Spring's transaction management code to inject, via AOP, transaction semantics around service method calls. This means that my transaction commits when the service method (called from the listener, almost always) returns, so I can catch any exceptions before I even start rendering a response. In the vast majority of cases, if I get an error, I'm going to show an error page, so accessing objects that may cause lazy loading after the exception and rollback really isn't a problem, but I will say that in the few instances where it does occur, it doesn't appear to be a problem, precisely because anything involving lazy loading while rendering the view is guaranteed to be a read-only operation. So in our case, we don't have to explicitly handle a transaction manager, cause Spring is automatically injecting the start and commit of each transaction, as appropriate, and that is all defined in a config file rather than in code. There's almost certainly a way to use the classes provided by spring to do that work from within hiveming without actually using the spring aplpication context itself, if you don't want to eal with yet another IoC container\, and the mechanism works really well, allowing your application code to be completely independent of transaction semantics. To the listener method that makes the service call, it just looks like an exception was thrown in the service call if the transaction commit fails, and you can handle that case from within the listener pretty trivially. --sam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry
Sam wrote: In my case, I'm using Spring's transaction management code to inject, via AOP, transaction semantics around service method calls. This means that my transaction commits when the service method (called from the listener, almost always) returns, so I can catch any exceptions before I even start rendering a response. In the vast majority of cases, if I get an error, I'm going to show an error page, so accessing objects that may cause lazy loading after the exception and rollback really isn't a problem, but I will say that in the few instances where it does occur, it doesn't appear to be a problem, precisely because anything involving lazy loading while rendering the view is guaranteed to be a read-only operation. So, Spring's transaction management does in fact start a second transaction on the same session, even after an exception has been thrown, and you haven't seen an issue from this? I think I'm going to go this route too, and only worry about it if a problem comes up. If it does, I'll just make sure to eager fetch everything I might need on a listener method that might throw an expected exception, before the first transaction is committed, and then I'll just close the session rather that start a second transaction. So in our case, we don't have to explicitly handle a transaction manager, cause Spring is automatically injecting the start and commit of each transaction, as appropriate, and that is all defined in a config file rather than in code. That's very cool. At this point in time the explicit calls to manage the transactions aren't bothering me, although I will probably refactor them out in the future. I haven't gotten into AOP just yet and I'm not ready to introduce another complication, but it's definitely on my to-do list. Thanks... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dynamic component injection
Hi Guys, I don't know if this is what are you looking for but here is how we handle our dynamic components at Trails. First we have a page which contains what we call editors (our dynamic components): http://svn.codehaus.org/trails/trunk/trails/modules/trails-core/src/main/resources/org/trails/page/Editors.html http://svn.codehaus.org/trails/trunk/trails/modules/trails-core/src/main/resources/org/trails/page/Editors.page They are all wrapped by @Blocks. Then we have a map where the key is an ongl expression we use to evaluate if that is right component for render a property, and the value is a ComponentAddress. The map definition is in our sping configuration file. Here is an example of one entry: entry key valuestring and !large and !identifier/value /key bean class=org.apache.tapestry.util.ComponentAddress constructor-arg index=0 valuetrails:Editors/value !-- it refers to Editors page -- /constructor-arg constructor-arg index=1 valuestringEditor/value /constructor-arg /bean /entry So stringEditor is the name of the block we are going to look for in our Editors page. Then wherever we need to render one of those blocks we do: span jwcid=$content$ span jwcid=[EMAIL PROTECTED] block=ognl:block/ /span and public Block getBlock() { ComponentAddress componentAddress = get the ComponentAddress from the map. componentAddress.findComponent(getPage().getRequestCycle()); //activate it. // set all the properties you need to set return (Block) componentAddress; } That's all! This is safe to use inside a For or Table or wherever you need to use it. Of course an ognl expressions map is not a good fit for everyone, so you can use whatever service you need to implement your logic as long as it returns a ComponentAddress from the Editors page. I hope this helps you. Saluti. Alejandro. On 6/20/07, Martino Piccinato [EMAIL PROTECTED] wrote: did you find any cleaner way to do this? I think this problem is not just related to one page applications but apply also to any page/component that depending un user actions must show different enough content (unless one wants to go with EventListener and a long ugly list of IF components...) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 - syntax for css background images?
You can use expansions inside a style block, just as you can elsewhere in an HTML template. However, you have to eliminate the HTML comments when you do so, or the expansions will not be processed: style type=text/css body { background-color: #2D374A; background-image: url(${someBackground}); } .MainTable { background-color: #B5BFD2; background-image: url(${someBackground}); } /style On 6/20/07, Bruce Petro [EMAIL PROTECTED] wrote: Question: I've learned so far, to display an image ... you do something like this: SomePage.java @Inject @Path(./art_logo.png) private Asset _someIcon; and then SomePage.html you do img src=${someIcon}/ BUT --- what's the syntax to use these in css EG: background images? style type=text/css !-- body { background-color: #2D374A; background-image: url(someBackground); } .MainTable { background-color: #B5BFD2; background-image: url(someBackground); } -- /style -- Howard M. Lewis Ship TWD Consulting, Inc. Independent J2EE / Open-Source Java Consultant Creator and PMC Chair, Apache Tapestry Creator, Apache HiveMind Professional Tapestry training, mentoring, support and project work. http://howardlewisship.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]