Re: How to pass parameters from a Page to another Page in java code?
It works! Thanks a lot! On Mon, Feb 21, 2011 at 3:18 PM, Taha Hafeez tawus.tapes...@gmail.comwrote: On Mon, Feb 21, 2011 at 9:50 AM, leon mail@gmail.com wrote: Hi All, Hi I know that we can pass a parameter through context attribute of tag in template, but how to achieve it in java code? like this: public class Edit { @Property @Autowired private Employee employee; @InjectPage private View view; @Log Object onSuccess() { employee.persist(); view.setEmployeeId(employee.getId()); // Pass parameter employeeId to view Page return view; } } public class View { @Parameter private Long employeeId; public void setEmployeeId(Long employeeId){ this.employeeId = employeeId; } Long onPassivate(){ return employeeId; } @Property private Employee employee; void onActivate(Long employeeId) { if (employeeId != null) employee = Employee.findEmployee(employeeId); } } Thanks! -- Best Regards Rock Lee regards Taha -- Best Regards Li Guoqiang
Re: Access displayed rows of grid component in page
Hi, I assume that I can use Grid.getCurrentPage() and Grid.getRowsPerPage() for that. Correct, but even better would be to implement your own GridDataSource since then you can do all the data fetching and preperations in one go. Your own GridDataSource forms the source @Parameter for the Grid. Cheers, Joost - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [Bulk] Re: 10 Minute Web Application Demo
good point 於 2011/2/18 4:06, Howard Lewis Ship 提到: I spend a lot of time when teaching Tapestry getting people to do One Small Step at a time. Everyone feels the need to jump from a blank page to the final solution in one go, and that's really hard. I do a lot of placeholder goes here, then do a series of refinements. That's how I work on real projects as well, not just tutorials and demos. On Thu, Feb 17, 2011 at 6:39 AM, Inge Solvoll inge.tapes...@gmail.com wrote: Nice work, Mark! I have some feedback for you here: Tapestry is great because it enables me to work tiny iterations. These tiny iteratinos are enabled by live reloading and excellent error reporting. I use this to work in a TDD way (without actually doing TDD), adding one bit at a time and verifying its behaviour in the browser before continuing. Being used to that, I was a bit overwhelmed by your speed in this tutorial, adding lots of things before reloading in the browser. That approach might work very well for you, but probably not for beginners. I believe a lot of people out there are used to quite long development cycles. They are used to coding lots of lines before restarting the server and checking the GUI. Upon arrival in the T5 world, it might be hard to adjust quickly. Sure, everyone loves live class reloading and it works instantly. But do they understand how to get the full power out of it? I'll give a (hopefully understandable) example: If you ask your grandmother to send you an email, she might print it, put it in an envelope and go for a walk to the post office. Not what you intended when you provided her with the very effective tools necessary :) Don't get me wrong, I love this tutorial! Just wanted to write a few words about how I feel T5 could gain more popularity. Highly efficient tools aren't enought, we should also focus on showing a set of simple and simplifying techniques that makes it very hard to fail and very much fun to be a T5 programmer. Also for newbies :) On Thu, Feb 17, 2011 at 9:46 AM, Peter Stavrinides p.stavrini...@albourne.com wrote: :) Excellent Mark! I know the feeling... does she also give the blank expression? - Original Message - From: Mark mark-li...@xeric.net To: Tapestry users users@tapestry.apache.org Sent: Wednesday, 16 February, 2011 23:25:47 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: 10 Minute Web Application Demo I keep showing my wife, but she doesn't ever seem to get very excited about it. :) On Wed, Feb 16, 2011 at 2:27 PM, Michael Gentry mgen...@masslight.net wrote: Sure, but I don't general show people Tapestry 5 at home. I'll bet most of us don't do that, either. :-) mrg On Wed, Feb 16, 2011 at 2:28 PM, Christian Riedel cr.ml...@googlemail.com wrote: don't you have internet at home? :p Am 16.02.2011 um 19:54 schrieb Michael Gentry: That's not an option for some of us, either. :-) On Wed, Feb 16, 2011 at 1:48 PM, Lenny Primak lpri...@hope.nyc.ny.us wrote: That's what the your mobile device is for :) On Feb 16, 2011, at 1:47 PM, Michael Gentry wrote: Hi Mark, Keep in mind that a lot of companies block YouTube access (and other media sites), so putting it on YouTube might actually restrict access more than you intended. mrg - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry app using JDBC
User user = userDao.get(loginName); The above line, is the user entity class? And what is the userDao doing? stateManager.set(User.class, user); This is setting the user as the current state? User user = stateManager.get(User.class); And the above is just returning the current user? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-app-using-JDBC-tp3390993p3393932.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry app using JDBC
On Mon, 2011-02-21 at 02:27 -0800, robnangle wrote: User user = userDao.get(loginName); The above line, is the user entity class? And what is the userDao doing? User could be an entity, depends on whether you are using an ORM or not. Generally though your DAO is going to return an object of some description, right? userDao is just a hypothetical DAO for retrieving users from the db. Most applications I imagine have something similar. If you're using spring you can just inject the DAO into your page or component: @Inject private UserDao userDao; stateManager.set(User.class, user); This is setting the user as the current state? This just puts the retrieved user object into the session as an SSO. This means it is accessible from all pages/components, unlike say @Persist'd quantities which are scoped to individual pages/components. You can stick whatever you like into the session, but for reasons of overhead should really be limited to simple objects or primitive types. User user = stateManager.get(User.class); And the above is just returning the current user? Correct. So now you could get some records for that user: ListRecord records = recordDao.get(user.getId()); (or if using an ORM: recordDao.get(user); - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Access displayed rows of grid component in page
Hi. I have my own GridDataSource for that, but I want to extend the data fetched by the GridDataSource. I can see the following options for that. * lazily init reference data by using the objects return from dataSource.getRowValue(0) to dataSource.getRowValue(grid.getRowsPerPage() -1) * add a listener to dataSource.prepare which initializes the reference data For the first approach I couldn't find a proper page lifecycle hook to do it and the second approach means lots of work. Is there really no better approach? Br, Timo Westkämper On 02/21/2011 11:35 AM, Joost Schouten (ml) wrote: Hi, I assume that I can use Grid.getCurrentPage() and Grid.getRowsPerPage() for that. Correct, but even better would be to implement your own GridDataSource since then you can do all the data fetching and preperations in one go. Your own GridDataSource forms the source @Parameter for the Grid. Cheers, Joost - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry app using JDBC
So I have a 'User' entity class and then my Login class. So in my login I should have: private String username; private String password; @Inject private ApplicationStateManager stateManager; private Object userDao; User user = userDao.get(username); stateManager.set(User.class, users); User user = stateManager.get(User.class); -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-app-using-JDBC-tp3390993p3393984.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry app using JDBC
Assuming Login is a tapestry page then yes, exactly. (although you can skip the last line: User user = stateManager.get(User.class); as user is already defined here.) On Mon, 2011-02-21 at 02:57 -0800, robnangle wrote: So I have a 'User' entity class and then my Login class. So in my login I should have: private String username; private String password; @Inject private ApplicationStateManager stateManager; private Object userDao; User user = userDao.get(username); stateManager.set(User.class, users); User user = stateManager.get(User.class); - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry app using JDBC
What if I have created the Login as a form component? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-app-using-JDBC-tp3390993p3393999.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry app using JDBC
On Mon, 2011-02-21 at 03:07 -0800, robnangle wrote: What if I have created the Login as a form component? Sure, that's fine. It'll work with a page or component - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry app using JDBC
On Mon, 21 Feb 2011 07:40:42 -0300, Richard Hill r...@su3analytics.com wrote: This just puts the retrieved user object into the session as an SSO. This means it is accessible from all pages/components, unlike say @Persist'd quantities which are scoped to individual pages/components. You can stick whatever you like into the session, but for reasons of overhead should really be limited to simple objects or primitive types. Remember that, for @SessionState, it's not recommended to use types like String or primitive types, as @SessionState is segregated by object type. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry app using JDBC
Yes, sorry, was thinking of @Persists there. SSO's are keyed by class: stateManager.get(User.class) so for SSOs you can only have one of each class type. On Mon, 2011-02-21 at 08:33 -0300, Thiago H. de Paula Figueiredo wrote: On Mon, 21 Feb 2011 07:40:42 -0300, Richard Hill r...@su3analytics.com wrote: This just puts the retrieved user object into the session as an SSO. This means it is accessible from all pages/components, unlike say @Persist'd quantities which are scoped to individual pages/components. You can stick whatever you like into the session, but for reasons of overhead should really be limited to simple objects or primitive types. Remember that, for @SessionState, it's not recommended to use types like String or primitive types, as @SessionState is segregated by object type. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Java based spring configuration
Hi all, Versions Tapestry: 5.2.4 Spring: 3.1.0.M1 We're using java based container configuration with spring - so no xml files are used for configuring beanfactories. With tapestry-spring this is currently unsupported as TapestryApplicationContext extends from XmlWebApplicationContext. As a workaround I've tried setting the tapestry.use-external-spring-context (Compatibility mode). I then get runtime exceptions due to service naming conflicts. Service id 'environment' has already been defined... Believe this is an internal spring bean introduced in 3.1.0.M1. Anyways - I don't really need the compatibility mode where spring beans are exposed as services. I know it's possible to have an applicationcontext.xml that defines a single bean entry - which is annotated with @Configuration. But the mission was to get rid of all xml configurations to begin with. Any plans for tapestry-spring to support AnnotationConfigWebApplicationContext? Or perhaps - use the Compatibility mode with the (new) option of turning off exposure of spring beans as tapestry services. Any suggestions? thanks Magnus
Re: Access displayed rows of grid component in page
I have a few places where I do this sort of thing. Preferable I wrap the original value obtained from my DAO in the GridDataSource right after obtaining it. Where the wrapper does the further initilization required. If that is not an option, you can always do the wrapping in @SetupRender and pass a List of Wrapped objects to the Grid. Hope it helps, Joost On 21/02/11 11:46 AM, Timo Westkämper wrote: Hi. I have my own GridDataSource for that, but I want to extend the data fetched by the GridDataSource. I can see the following options for that. * lazily init reference data by using the objects return from dataSource.getRowValue(0) to dataSource.getRowValue(grid.getRowsPerPage() -1) * add a listener to dataSource.prepare which initializes the reference data For the first approach I couldn't find a proper page lifecycle hook to do it and the second approach means lots of work. Is there really no better approach? Br, Timo Westkämper On 02/21/2011 11:35 AM, Joost Schouten (ml) wrote: Hi, I assume that I can use Grid.getCurrentPage() and Grid.getRowsPerPage() for that. Correct, but even better would be to implement your own GridDataSource since then you can do all the data fetching and preperations in one go. Your own GridDataSource forms the source @Parameter for the Grid. Cheers, Joost - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5 - cache issue when accessed via proxy
If your problem occurs in multiple pages I recommend put the cache configuration in your AppModule. public RequestFilter cacheFilter() { return new RequestFilter() { public boolean service(Request request, Response response, RequestHandler handler) throws IOException { response.setHeader(Cache-Control,no-cache); //HTTP 1.1 response.setHeader(Pragma,no-cache); //HTTP 1.0 response.setDateHeader (Expires, 0); //prevents caching response.setHeader(Cache-Control,no-store); //HTTP 1.1 return handler.service(request, response); } }; } 2011/2/21 Martin Strand do.not.eat.yellow.s...@gmail.com If you want to use the exact same URL to serve different content, you'll need to make sure the response is never cached by the client. Add appropriate HTTP headers to the response: @Inject private Response response; void onActivate(...) { response.setHeader(Cache-Control, no-cache); response.setDateHeader(Expires, 0); } On Mon, 21 Feb 2011 05:11:43 +0100, sunmoor007 sunmoo...@gmail.com wrote: Hi Josh Thanks for your response. You're right. We dont have the search parameter in the URL but wondering how does it work in a scenario where there no proxy server. I have seen an option disableCaching. If i enable that, will it work. Considering the option you mentioned, am guessing if we can add some dynamic parameter in url which changes for each request which should resolve the problem. I will anyway check the proxy logs. Thanks Sundar - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Pablo Henrique dos Reis
Re: Tapestry 5.1.0.5 and HTML 5 Doctype
By the way, I have added Nille Hammer's work-around (for emitting the HTML5 doctype) to the documentation, at https://cwiki.apache.org/confluence/display/TAPESTRY/Component+Templates On Sun, Feb 20, 2011 at 3:13 PM, Christian Riedel cr.ml...@googlemail.com wrote: Hi François, the central template parser class is org.apache.tapestry5.internal.services.SaxTemplateParser. Look at the parse() method. From there you'll get to org.apache.tapestry5.internal.services.XMLTokenStream and its inner class SaxHandler. You'll have to patch somewhere in there, I think :-) Good luck! Christian Am 20.02.2011 um 16:22 schrieb François Facon: I use nille's trick on Tapestr5-jquery-mobile http://bit.ly/fBNNzi. As excepted, I have now the right doctype for html5 but I still not able to use HTML entities. I did not get the time to look how tapestry 5.2 sax parser works. What is the best class entry point to get into tapestry's parser? Regards 2011/1/14 nille hammer tapestry.nilleham...@winfonet.eu Hi Benny, put the following method into your class file: @SetupRender final void renderDocType(final MarkupWriter writer) { writer.getDocument().raw(!DOCTYPE html); } If you use a central Layout component, put it there. Otherwise put it into the page classes. I have tested this with Tap 5.2, but it should work in 5.1 too. Regards nillehammer original Nachricht Betreff: Re: Tapestry 5.1.0.5 and HTML 5 Doctype Gesendet: Fr, 14. Jan 2011 Von: Benny Lawbenny.mk@gmail.com I have looked at the patch provided in https://issues.apache.org/jira/browse/TAP5-840 but it seems to be dealing with the issue of entities only and it's not for Tapestry 5.1.0.5. What I really want is to be able to output !DOCTYPE html. Putting this in the .tml file isn't working. Can somebody suggest a solution for this please? Benny On Wed, Jan 12, 2011 at 9:47 AM, Benny Law benny.mk@gmail.com wrote: Hi François, Thanks for the info. I am aware of TAPS-840 but haven't studied the patch. It looks like that's the only solution for now. Without !DOCTYPE html, Firefox 3.6 renders the page in Quirks mode instead of Standards compliance mode, and I have already noticed some minor issues. I hope this patch gets integrated with Tapestry soon. Benny 2011/1/12 François Facon francois.fa...@atosorigin.com Hi Benny, In order to use html5 in our Web Mobile Solution, I have ask Robin to work on html5 compatibility last year. He had post our feedback in the mailing list. The thread is here http://tapestry.1045711.n5.nabble.com/State-on-HTML5-integration-woodstox-ro llback-td2470926.html I suggest you also to have a look on the related Jira https://issues.apache.org/jira/browse/TAP5-840 If you don't want to patch Tapestry, you have to know that currently most of modern browser run html5 tag even if you are not using !DOCTYPE html. For client side detection Modernizr http://www.modernizr.com/%20is very fine. 2011/1/12 Benny Law benny.mk@gmail.com I am trying to convert my pages to HTML5 but am having problem getting the correct DOCTYPE to be output. The !DOCTYPE html I put in the .tml file is ignored, and the generated HTML code has no DOCTYPE. I'm interested in how people are working around this. Thanks. Benny --- original Nachricht Ende - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5.1.0.5 and HTML 5 Doctype
Correction, the URL should be: http://tapestry.apache.org/component-templates.html (once the change propagates in an hour or two, and the apache site comes back up) On Mon, Feb 21, 2011 at 9:21 AM, Bob Harner bobhar...@gmail.com wrote: By the way, I have added Nille Hammer's work-around (for emitting the HTML5 doctype) to the documentation, at https://cwiki.apache.org/confluence/display/TAPESTRY/Component+Templates On Sun, Feb 20, 2011 at 3:13 PM, Christian Riedel cr.ml...@googlemail.com wrote: Hi François, the central template parser class is org.apache.tapestry5.internal.services.SaxTemplateParser. Look at the parse() method. From there you'll get to org.apache.tapestry5.internal.services.XMLTokenStream and its inner class SaxHandler. You'll have to patch somewhere in there, I think :-) Good luck! Christian Am 20.02.2011 um 16:22 schrieb François Facon: I use nille's trick on Tapestr5-jquery-mobile http://bit.ly/fBNNzi. As excepted, I have now the right doctype for html5 but I still not able to use HTML entities. I did not get the time to look how tapestry 5.2 sax parser works. What is the best class entry point to get into tapestry's parser? Regards 2011/1/14 nille hammer tapestry.nilleham...@winfonet.eu Hi Benny, put the following method into your class file: @SetupRender final void renderDocType(final MarkupWriter writer) { writer.getDocument().raw(!DOCTYPE html); } If you use a central Layout component, put it there. Otherwise put it into the page classes. I have tested this with Tap 5.2, but it should work in 5.1 too. Regards nillehammer original Nachricht Betreff: Re: Tapestry 5.1.0.5 and HTML 5 Doctype Gesendet: Fr, 14. Jan 2011 Von: Benny Lawbenny.mk@gmail.com I have looked at the patch provided in https://issues.apache.org/jira/browse/TAP5-840 but it seems to be dealing with the issue of entities only and it's not for Tapestry 5.1.0.5. What I really want is to be able to output !DOCTYPE html. Putting this in the .tml file isn't working. Can somebody suggest a solution for this please? Benny On Wed, Jan 12, 2011 at 9:47 AM, Benny Law benny.mk@gmail.com wrote: Hi François, Thanks for the info. I am aware of TAPS-840 but haven't studied the patch. It looks like that's the only solution for now. Without !DOCTYPE html, Firefox 3.6 renders the page in Quirks mode instead of Standards compliance mode, and I have already noticed some minor issues. I hope this patch gets integrated with Tapestry soon. Benny 2011/1/12 François Facon francois.fa...@atosorigin.com Hi Benny, In order to use html5 in our Web Mobile Solution, I have ask Robin to work on html5 compatibility last year. He had post our feedback in the mailing list. The thread is here http://tapestry.1045711.n5.nabble.com/State-on-HTML5-integration-woodstox-ro llback-td2470926.html I suggest you also to have a look on the related Jira https://issues.apache.org/jira/browse/TAP5-840 If you don't want to patch Tapestry, you have to know that currently most of modern browser run html5 tag even if you are not using !DOCTYPE html. For client side detection Modernizr http://www.modernizr.com/%20is very fine. 2011/1/12 Benny Law benny.mk@gmail.com I am trying to convert my pages to HTML5 but am having problem getting the correct DOCTYPE to be output. The !DOCTYPE html I put in the .tml file is ignored, and the generated HTML code has no DOCTYPE. I'm interested in how people are working around this. Thanks. Benny --- original Nachricht Ende - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: 10 Minute Web Application Demo
Thanks, and I appreciate your suggestions. There is probably a big difference between the pacing necessary to actually teach Tapestry (what this mailing list audience may be more interested in) and the pacing to get people interested in learning Tapestry (what this video was really designed for). Obviously there is a need for both. Mark On Sat, Feb 19, 2011 at 11:53 AM, Kalle Korhonen kalle.o.korho...@gmail.com wrote: Mark, I linked to your screencast from Getting Started and Presentations pages of Tapestry's official documentation. I linked to your blog rather than the YouTube clip directly, I assume that's how you wanted it. I wouldn't worry too much about fixing every little issue people have reported. I know how long it takes to make one short video if you want to do a decent job. There are always things you can improve but it doesn't matter too much in a demo like this. I thought the pace is good, instead of explaining every little detail, it's good to leave some for the audience to discover themselves. Likewise, if you are making more of these, I would advise against making them any longer. The net crowd just doesn't have the attention span anymore :) Plus, if you make more shorter ones, you'll get more hits and it's likely better marketing for Tapestry overall. Kalle On Mon, Feb 14, 2011 at 8:24 PM, Mark mark-li...@xeric.net wrote: If anyone is interested, I made a short screencast showing the building of a ten minute demo application with Tapestry. http://blog.markwshead.com/900/tapestry-5-10-minute-demo/ The text is a bit smaller than I would have liked, but I think you can still get a general idea of what is going on. Mark - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Exciting opportunity in Berlin
Hi guys, are here any tapestry pros which will mind about to take a really exciting offer as a tapestry developer in a permanent position here in Berlin/Germany? Please feel free to contact me! - Stefan smime.p7s Description: S/MIME cryptographic signature
Enum or Drop Down
Hi all, Is it possible to populate an enum class with data from a database or what component acts like a drop down box in tapestry? Cheers -- View this message in context: http://tapestry.1045711.n5.nabble.com/Enum-or-Drop-Down-tp3394312p3394312.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry app using JDBC
Cheers got that sorted.. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-app-using-JDBC-tp3390993p3394313.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
[T5] Tapestry and Servlet 3.0 web fragments (zero configuration)
Hey! Is Tapestry going to support the Servlet 3.0 and it's specification for web fragments? I mean, load itself without the need for us to speficy it's filter in the app's web.xml? I'm anxious to see it trully zero configuration! I guess this is the only thing left for it, even though it's far from a hardcore config right now. If it's already done, my bad. I was away from tapestry for a while, and haven't found info related to this subject... Thanks! ___ Everton Agner Ramos
Re: Enum or Drop Down
You want to take a look at the t:select component. It takes a select model but tap can provide one automatically for an enum On Mon, 2011-02-21 at 07:45 -0800, robnangle wrote: Hi all, Is it possible to populate an enum class with data from a database or what component acts like a drop down box in tapestry? Cheers - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Enum or Drop Down
On Mon, 21 Feb 2011 12:55:59 -0300, Richard Hill r...@su3analytics.com wrote: You want to take a look at the t:select component. It takes a select model but tap can provide one automatically for an enum Plus see the SelectModelFactory interface to generate the select model easily. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Exciting opportunity in Berlin
hi, I'd like this position. 2011/2/21 Stefan Schuetz ste...@wammel.com Hi guys, are here any tapestry pros which will mind about to take a really exciting offer as a tapestry developer in a permanent position here in Berlin/Germany? Please feel free to contact me! - Stefan -- *Gutemberg A. Da Silva* Analista De Sistemas S E S A - Secretária Estadual De Saúde - CE NuInf - Núcleo De Informática
Re: Enum or Drop Down
So there is no way of doing it like a grid: t:grid source=players / //players being a list populated from a database.. You have to create a model ect... -- View this message in context: http://tapestry.1045711.n5.nabble.com/Enum-or-Drop-Down-tp3394312p3394364.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: Enum or Drop Down
No, because tap needs to know how to remap the values on a form submit. So you need to provide a select model. But it's really easy stuff! Take a look: http://jumpstart.doublenegative.com.au/jumpstart/ - Stefan Am 21.02.2011 um 17:26 schrieb robnangle: So there is no way of doing it like a grid: t:grid source=players / //players being a list populated from a database.. You have to create a model ect... -- View this message in context: http://tapestry.1045711.n5.nabble.com/Enum-or-Drop-Down-tp3394312p3394364.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 smime.p7s Description: S/MIME cryptographic signature
Re: Enum or Drop Down
I always thought it would be nice if tap could generate a drop down given just a list - it could take the object id and toString() as values for example. But sadly this does not exist so you have to build a model, which as Stefan says is actually pretty simple. And in fact being forced to supply your own model gives you a lot more flexibility. If you need an example of select (and option) models for a list I can send you something. On Mon, 2011-02-21 at 17:29 +0100, Stefan Schuetz wrote: No, because tap needs to know how to remap the values on a form submit. So you need to provide a select model. But it's really easy stuff! Take a look: http://jumpstart.doublenegative.com.au/jumpstart/ - Stefan Am 21.02.2011 um 17:26 schrieb robnangle: So there is no way of doing it like a grid: t:grid source=players / //players being a list populated from a database.. You have to create a model ect... -- View this message in context: http://tapestry.1045711.n5.nabble.com/Enum-or-Drop-Down-tp3394312p3394364.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Enum or Drop Down
Richard Hill-7 wrote: I always thought it would be nice if tap could generate a drop down given just a list - it could take the object id and toString() as values for example. But sadly this does not exist so you have to build a model, which as Stefan says is actually pretty simple. And in fact being forced to supply your own model gives you a lot more flexibility. If you need an example of select (and option) models for a list I can send you something. On Mon, 2011-02-21 at 17:29 +0100, Stefan Schuetz wrote: No, because tap needs to know how to remap the values on a form submit. So you need to provide a select model. But it's really easy stuff! Take a look: http://jumpstart.doublenegative.com.au/jumpstart/ - Stefan Am 21.02.2011 um 17:26 schrieb robnangle: So there is no way of doing it like a grid: t:grid source=players / //players being a list populated from a database.. You have to create a model ect... -- View this message in context: http://tapestry.1045711.n5.nabble.com/Enum-or-Drop-Down-tp3394312p3394364.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org Ye if you could that would be very handy cheers.. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Enum-or-Drop-Down-tp3394312p3394387.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: Enum or Drop Down
On Mon, 21 Feb 2011 13:36:55 -0300, Richard Hill r...@su3analytics.com wrote: I always thought it would be nice if tap could generate a drop down given just a list - it could take the object id and toString() as values for example. There are two problems that you need to solve when writing a select: * How do you map objects to option values? If you're using tapestry-hibernate, this is already done. If not, Tapestry just cannot know how to do that. Anyway, writing your own ValueEncoder is easy. * What objects will be used as options? There's no way for Tapestry to do that automatically in a reasonable way even when using tapestry-hibernate. And SelectModelFactory already does the heavy lifting for you. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Enum or Drop Down
know how to do that. Anyway, writing your own ValueEncoder is easy. * What objects will be used as options? There's no way for Tapestry to do that automatically in a reasonable way even when using tapestry-hibernate. And SelectModelFactory already does the heavy lifting for you. To be honest I never understood value encoder and don't use it. When rendering a page all you need are a) the list of options and b) which one is selected. Then you have a handler: onChangeFromYourSelect(int value) and the value gets passed in. Then it's up to you to map that value/id back to an object :) On Mon, 2011-02-21 at 13:41 -0300, Thiago H. de Paula Figueiredo wrote: On Mon, 21 Feb 2011 13:36:55 -0300, Richard Hill r...@su3analytics.com wrote: I always thought it would be nice if tap could generate a drop down given just a list - it could take the object id and toString() as values for example. There are two problems that you need to solve when writing a select: * How do you map objects to option values? If you're using tapestry-hibernate, this is already done. If not, Tapestry just cannot know how to do that. Anyway, writing your own ValueEncoder is easy. * What objects will be used as options? There's no way for Tapestry to do that automatically in a reasonable way even when using tapestry-hibernate. And SelectModelFactory already does the heavy lifting for you. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] Tapestry and Servlet 3.0 web fragments (zero configuration)
On Mon, 21 Feb 2011 12:51:31 -0300, Everton Agner ton.ag...@gmail.com wrote: Hey! Hi! Is Tapestry going to support the Servlet 3.0 and it's specification for web fragments? I mean, load itself without the need for us to speficy it's filter in the app's web.xml? I don't know, but there's an issue to be solved: how Tapestry will get the base package, as it's currently informed as a servlet filter parameter? I'm not saying this isn't solvable (of course it is). I'm just saying that this isn't that easy. :) And what servlet containers are already implementing the Servlet 3.0 specification? Just curious. :) -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Enum or Drop Down
On Mon, 21 Feb 2011 13:52:46 -0300, Richard Hill r...@su3analytics.com wrote: To be honest I never understood value encoder and don't use it. Recommendation: learn it and use it. In software development, ignorance is not bliss. :) When rendering a page all you need are a) the list of options and b) which one is selected. This is not correct at all. You still need an object - value mapping, even if it is provided automatically some way (Tapestry itself for String and primitive types, tapestry-hibernate for Hibernate entities. In other words, what will be the value of the value attribute in the option element corresponding to your object that represents an option? Then you have a handler: onChangeFromYourSelect(int value) and the value gets passed in. What is the type of the options you're presenting to your users? In the above case, if it's not integer values, the parameter could be of the type you're editing. Then it's up to you to map that value/id back to an object :) Are you using tapestry-hibernate? If yes, you're using ValueEncoders provided by it. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Enum or Drop Down
I am not using tapestry-hibernate, is there any examples out there because the few I have came across seem to be very complex? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Enum-or-Drop-Down-tp3394312p3394431.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: [T5] Tapestry and Servlet 3.0 web fragments (zero configuration)
Hi, Tomcat 7, Jetty 8, Glassfish 3.0.1 + 3.1, JBOSS AS 6.0 support 3.0 spec. (Just a list from my memory, if I made a mistake please correct me.) If you know more, please add to the list, I really would like to know. :) - Ville -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-Tapestry-and-Servlet-3-0-web-fragments-zero-configuration-tp3394320p3394441.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: Enum or Drop Down
On Mon, 21 Feb 2011 14:05:25 -0300, robnangle robnan...@gmail.com wrote: I am not using tapestry-hibernate, is there any examples out there because the few I have came across seem to be very complex? There are some examples out there that I consider the wrong approach, specifically implementing both ValueEncoder and SelectModel in the same class. Suppose you have a class User and a DAO for it named UserDAO (not tested): class UserValueEncoderUser() { final private UserDAO dao; public UserValueEncoder(UserDAO dao) { this.dao = dao; } public String toClient(User user) { return user.getLogin(); } public User toValue(String clientValue) { return dao.findByLogin(clientValue); } } @Property private User user; select t:type=Select value=user .../ You could use any logic for that. For example, you could use the user id instead of login and your application would behave exactly the same. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Default Ordering for BeanEditForm
http://download.oracle.com/javase/6/docs/api/java/lang/Class.html#getDeclaredMethods() The elements in the array returned are not sorted and are not in any particular order. Java's reflection mechanism doesn't guarantee the order of methods returned so it would be hard for Tapestry to do much about that given the current architecture. It's possible that the behavior you were seeing previously was particular to a specific JVM implementation. Josh On Sun, Feb 20, 2011 at 2:06 PM, Mark mark-li...@xeric.net wrote: On Sun, Feb 20, 2011 at 9:33 AM, Ulrich Stärk u...@spielviel.de wrote: I'm just guessing, but Tapestry might reorder accessor methods alphabetically when enhancing the page class. Hm. I'm also seeing this behavior on Java Beans now if they implement an interface and are Injected into the page. Should I file this as a bug or is it intentional. Mark - 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: Default Ordering for BeanEditForm
Acutally, Tapestry 5.2 uses Javassist to get at attribute information for the methods, including the line numbers where available. However, I'm honestly not sure what happens in a transformed component class. Certainly, if the @Property annotation is used, there is no line number information to be had. On Mon, Feb 21, 2011 at 10:03 AM, Josh Canfield joshcanfi...@gmail.com wrote: http://download.oracle.com/javase/6/docs/api/java/lang/Class.html#getDeclaredMethods() The elements in the array returned are not sorted and are not in any particular order. Java's reflection mechanism doesn't guarantee the order of methods returned so it would be hard for Tapestry to do much about that given the current architecture. It's possible that the behavior you were seeing previously was particular to a specific JVM implementation. Josh On Sun, Feb 20, 2011 at 2:06 PM, Mark mark-li...@xeric.net wrote: On Sun, Feb 20, 2011 at 9:33 AM, Ulrich Stärk u...@spielviel.de wrote: I'm just guessing, but Tapestry might reorder accessor methods alphabetically when enhancing the page class. Hm. I'm also seeing this behavior on Java Beans now if they implement an interface and are Injected into the page. Should I file this as a bug or is it intentional. Mark - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: RequestFilter not called (sometimes)
I've made a RequestFilter that's only loaded in development mode, but the problem is it isn't always loaded properly - when I start tapestry (maven jetty:run) about 1/3rd of the time it works, but the rest of the time it doesn't. Where in the list are you putting your request filter? RequestFilter's are added via an ordered configuration so if you want to make sure yours runs then you need to put it before:*. Other RequestFilters may handle the request without forwarding it on to you, for instance Tapestry's ResourceStreamer will return 304 if the if-modified-since http header is sent and the file has not been modified. Both the context and classpath request handlers use the resource streamer. Josh On Sat, Feb 19, 2011 at 8:07 AM, Donny Nadolny donny.nado...@gmail.com wrote: I have a few static javascript files which are used on 3rd party websites, so they have the full url to my website hard coded in to them (for ajax calls). In order to test things locally, I need to replace that url with localhost. I've made a page which returns the modified file, and I want to replace all requests for /js/myfile.js with page render requests to /js/localhostjs which gives the modified file. I've made a RequestFilter that's only loaded in development mode, but the problem is it isn't always loaded properly - when I start tapestry (maven jetty:run) about 1/3rd of the time it works, but the rest of the time it doesn't. I tried this out with the quickstart app and the same thing happens: if you run the quickstart app and grab a css file ( http://localhost:8080/tapestryquickstart/layout/layout.css) then sometimes you'll see the timing filter, sometimes you won't. It doesn't change during the run, so in order to see this you need to start jetty, hit the file, kill jetty, repeat. This seems like a bug, the RequestFilter isn't always used for static file requests (race condition in Tapestry's startup?) How can I consistently rewrite the request for the js file (for development only)? (I tried the new LinkTransformer api but it seems it isn't called for static file requests. Same for the old URL Rewriting api) - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5 - cache issue when accessed via proxy
Considering the option you mentioned, am guessing if we can add some dynamic parameter in url which changes for each request which should resolve the problem. You should consider putting your search terms in the url either as a path parameter or a query parameter so that you can take advantage of caching. Unless it's user specific data which you don't want exposed, then you want to tell the proxy not to cache using the appropriate http headers. Either way it's worthwhile to learn about the built in HTTP caching options so that you can be sure you're using it correctly. Josh On Sun, Feb 20, 2011 at 8:11 PM, sunmoor007 sunmoo...@gmail.com wrote: Hi Josh Thanks for your response. You're right. We dont have the search parameter in the URL but wondering how does it work in a scenario where there no proxy server. I have seen an option disableCaching. If i enable that, will it work. Considering the option you mentioned, am guessing if we can add some dynamic parameter in url which changes for each request which should resolve the problem. I will anyway check the proxy logs. Thanks Sundar -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-5-cache-issue-when-accessed-via-proxy-tp3388994p3393672.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] Tapestry and Servlet 3.0 web fragments (zero configuration)
Is Tapestry going to support the Servlet 3.0 and it's specification for web fragments? I mean, load itself without the need for us to speficy it's filter in the app's web.xml? The other thing that I'd love to get into Tapestry is the support for long running requests using request.startAsync(). I've done some prototyping with the Jetty library but it's a ways from being able to add to the core. @Async(timeout=5 minutes) void onSomeLongEvent() { } Josh On Mon, Feb 21, 2011 at 7:51 AM, Everton Agner ton.ag...@gmail.com wrote: Hey! Is Tapestry going to support the Servlet 3.0 and it's specification for web fragments? I mean, load itself without the need for us to speficy it's filter in the app's web.xml? I'm anxious to see it trully zero configuration! I guess this is the only thing left for it, even though it's far from a hardcore config right now. If it's already done, my bad. I was away from tapestry for a while, and haven't found info related to this subject... Thanks! ___ Everton Agner Ramos - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] Tapestry and Servlet 3.0 web fragments (zero configuration)
That's something that's much more interesting for me ... long running processes that can push updates (such as a progress bar) to a client. On Mon, Feb 21, 2011 at 10:38 AM, Josh Canfield joshcanfi...@gmail.com wrote: Is Tapestry going to support the Servlet 3.0 and it's specification for web fragments? I mean, load itself without the need for us to speficy it's filter in the app's web.xml? The other thing that I'd love to get into Tapestry is the support for long running requests using request.startAsync(). I've done some prototyping with the Jetty library but it's a ways from being able to add to the core. @Async(timeout=5 minutes) void onSomeLongEvent() { } Josh On Mon, Feb 21, 2011 at 7:51 AM, Everton Agner ton.ag...@gmail.com wrote: Hey! Is Tapestry going to support the Servlet 3.0 and it's specification for web fragments? I mean, load itself without the need for us to speficy it's filter in the app's web.xml? I'm anxious to see it trully zero configuration! I guess this is the only thing left for it, even though it's far from a hardcore config right now. If it's already done, my bad. I was away from tapestry for a while, and haven't found info related to this subject... Thanks! ___ Everton Agner Ramos - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Global Configuration/Logging/Properties files locations
Hi guys, So far, I counted two places to put global properties in tapestry: - WEB-INF/app.properties - resources/log4j.properties What is the proper place to put global properties, WEB-INF or resources? Also, I am deploying on glassfish and I don't think log4j.properties actually works for this. What's the proper logging level configuration solution in my case? Thanks - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Default Ordering for BeanEditForm
Acutally, Tapestry 5.2 uses Javassist to get at attribute information for the methods, including the line numbers where available. The getMethods in CtClass is not documented as being ordered, so I peeked at the code and unless I'm looking at the wrong spot it comes from an un-ordered HashMap. public CtMethod[] getMethods() { HashMap h = new HashMap(); getMethods0(h, this); return (CtMethod[])h.values().toArray(new CtMethod[h.size()]); } I haven't tried to chase down what Tapestry is doing in transformed classes, but I'm pretty sure counting on the undocumented ordering of methods is a bad idea. Josh On Mon, Feb 21, 2011 at 10:14 AM, Howard Lewis Ship hls...@gmail.com wrote: Acutally, Tapestry 5.2 uses Javassist to get at attribute information for the methods, including the line numbers where available. However, I'm honestly not sure what happens in a transformed component class. Certainly, if the @Property annotation is used, there is no line number information to be had. On Mon, Feb 21, 2011 at 10:03 AM, Josh Canfield joshcanfi...@gmail.com wrote: http://download.oracle.com/javase/6/docs/api/java/lang/Class.html#getDeclaredMethods() The elements in the array returned are not sorted and are not in any particular order. Java's reflection mechanism doesn't guarantee the order of methods returned so it would be hard for Tapestry to do much about that given the current architecture. It's possible that the behavior you were seeing previously was particular to a specific JVM implementation. Josh On Sun, Feb 20, 2011 at 2:06 PM, Mark mark-li...@xeric.net wrote: On Sun, Feb 20, 2011 at 9:33 AM, Ulrich Stärk u...@spielviel.de wrote: I'm just guessing, but Tapestry might reorder accessor methods alphabetically when enhancing the page class. Hm. I'm also seeing this behavior on Java Beans now if they implement an interface and are Injected into the page. Should I file this as a bug or is it intentional. Mark - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Global Configuration/Logging/Properties files locations
On Mon, 21 Feb 2011 16:05:29 -0300, Lenny Primak lpri...@hope.nyc.ny.us wrote: Hi guys, So far, I counted two places to put global properties in tapestry: - WEB-INF/app.properties - resources/log4j.properties What is the proper place to put global properties, WEB-INF or resources? What are these properties? If they are messages used by Tapestry, app.properties. If not, resources. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Global Configuration/Logging/Properties files locations
That's the question, what goes into resources (globally?) i.e. resources/app.properties, etc. Are there any other properties that goes into resources/ root folder? And how does log4j.properties work in case of glassfish then/? On Feb 21, 2011, at 2:19 PM, Thiago H. de Paula Figueiredo wrote: On Mon, 21 Feb 2011 16:05:29 -0300, Lenny Primak lpri...@hope.nyc.ny.us wrote: Hi guys, So far, I counted two places to put global properties in tapestry: - WEB-INF/app.properties - resources/log4j.properties What is the proper place to put global properties, WEB-INF or resources? What are these properties? If they are messages used by Tapestry, app.properties. If not, resources. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Global Configuration/Logging/Properties files locations
That's the question, what goes into resources (globally?) i.e. resources/app.properties, etc. Are there any other properties that goes into resources/ root folder? And how does log4j.properties work in case of glassfish then/? log4j.properties is for log4j and is only included by the tapestry archetype as a convenience. When you put things into the resources folder they get copied into your compiled output hierarchy along side your classes. This is an artifact of the use of a traditional maven layout. Generally in Tapestry property files are used for localization. http://tapestry.apache.org/tapestry5/guide/localization.html quote Application Message Catalog If the file WEB-INF/AppName.properties exists in the context, it will be used as an application-wide message catalog. The AppName is derived from the name of the filter inside the web.xml file; this is most often just app, thus WEB-INF/app.properties. The search for the file is case sensitive. The properties files may be localized. /quote Josh On Mon, Feb 21, 2011 at 11:44 AM, Lenny Primak lpri...@hope.nyc.ny.us wrote: That's the question, what goes into resources (globally?) i.e. resources/app.properties, etc. Are there any other properties that goes into resources/ root folder? And how does log4j.properties work in case of glassfish then/? On Feb 21, 2011, at 2:19 PM, Thiago H. de Paula Figueiredo wrote: On Mon, 21 Feb 2011 16:05:29 -0300, Lenny Primak lpri...@hope.nyc.ny.us wrote: Hi guys, So far, I counted two places to put global properties in tapestry: - WEB-INF/app.properties - resources/log4j.properties What is the proper place to put global properties, WEB-INF or resources? What are these properties? If they are messages used by Tapestry, app.properties. If not, resources. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Global Configuration/Logging/Properties files locations
Just a note: http://tapestry.apache.org/localization.html is the newer version of that page. On Mon, Feb 21, 2011 at 3:00 PM, Josh Canfield joshcanfi...@gmail.com wrote: That's the question, what goes into resources (globally?) i.e. resources/app.properties, etc. Are there any other properties that goes into resources/ root folder? And how does log4j.properties work in case of glassfish then/? log4j.properties is for log4j and is only included by the tapestry archetype as a convenience. When you put things into the resources folder they get copied into your compiled output hierarchy along side your classes. This is an artifact of the use of a traditional maven layout. Generally in Tapestry property files are used for localization. http://tapestry.apache.org/tapestry5/guide/localization.html quote Application Message Catalog If the file WEB-INF/AppName.properties exists in the context, it will be used as an application-wide message catalog. The AppName is derived from the name of the filter inside the web.xml file; this is most often just app, thus WEB-INF/app.properties. The search for the file is case sensitive. The properties files may be localized. /quote Josh On Mon, Feb 21, 2011 at 11:44 AM, Lenny Primak lpri...@hope.nyc.ny.us wrote: That's the question, what goes into resources (globally?) i.e. resources/app.properties, etc. Are there any other properties that goes into resources/ root folder? And how does log4j.properties work in case of glassfish then/? On Feb 21, 2011, at 2:19 PM, Thiago H. de Paula Figueiredo wrote: On Mon, 21 Feb 2011 16:05:29 -0300, Lenny Primak lpri...@hope.nyc.ny.us wrote: Hi guys, So far, I counted two places to put global properties in tapestry: - WEB-INF/app.properties - resources/log4j.properties What is the proper place to put global properties, WEB-INF or resources? What are these properties? If they are messages used by Tapestry, app.properties. If not, resources. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Global Configuration/Logging/Properties files locations
So basically in my glassfish deployment, there is nothing that needs to be put into resources/ folder, as far as tapestry configuration is concerned, correct? And the logging is controlled through glassfish itself, not through a file in this folder. Thanks for your answer/confirmation On Feb 21, 2011, at 3:00 PM, Josh Canfield wrote: That's the question, what goes into resources (globally?) i.e. resources/app.properties, etc. Are there any other properties that goes into resources/ root folder? And how does log4j.properties work in case of glassfish then/? log4j.properties is for log4j and is only included by the tapestry archetype as a convenience. When you put things into the resources folder they get copied into your compiled output hierarchy along side your classes. This is an artifact of the use of a traditional maven layout. Generally in Tapestry property files are used for localization. http://tapestry.apache.org/tapestry5/guide/localization.html quote Application Message Catalog If the file WEB-INF/AppName.properties exists in the context, it will be used as an application-wide message catalog. The AppName is derived from the name of the filter inside the web.xml file; this is most often just app, thus WEB-INF/app.properties. The search for the file is case sensitive. The properties files may be localized. /quote Josh On Mon, Feb 21, 2011 at 11:44 AM, Lenny Primak lpri...@hope.nyc.ny.us wrote: That's the question, what goes into resources (globally?) i.e. resources/app.properties, etc. Are there any other properties that goes into resources/ root folder? And how does log4j.properties work in case of glassfish then/? On Feb 21, 2011, at 2:19 PM, Thiago H. de Paula Figueiredo wrote: On Mon, 21 Feb 2011 16:05:29 -0300, Lenny Primak lpri...@hope.nyc.ny.us wrote: Hi guys, So far, I counted two places to put global properties in tapestry: - WEB-INF/app.properties - resources/log4j.properties What is the proper place to put global properties, WEB-INF or resources? What are these properties? If they are messages used by Tapestry, app.properties. If not, resources. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: RequestFilter not called (sometimes)
Ah that's why, thanks Josh. I didn't specify any order, so some of the time my filter (and the TimingFilter) would be added before the StaticFilesFilter in which case the timing filter will print out the time, and sometimes it will be placed after, so the static files filter handles the request first without passing it on. For reference, my fix was to change: configuration.add(Timing, filter); to configuration.add(Timing, filter, before:StaticFiles); On Mon, Feb 21, 2011 at 1:21 PM, Josh Canfield joshcanfi...@gmail.comwrote: I've made a RequestFilter that's only loaded in development mode, but the problem is it isn't always loaded properly - when I start tapestry (maven jetty:run) about 1/3rd of the time it works, but the rest of the time it doesn't. Where in the list are you putting your request filter? RequestFilter's are added via an ordered configuration so if you want to make sure yours runs then you need to put it before:*. Other RequestFilters may handle the request without forwarding it on to you, for instance Tapestry's ResourceStreamer will return 304 if the if-modified-since http header is sent and the file has not been modified. Both the context and classpath request handlers use the resource streamer. Josh On Sat, Feb 19, 2011 at 8:07 AM, Donny Nadolny donny.nado...@gmail.com wrote: I have a few static javascript files which are used on 3rd party websites, so they have the full url to my website hard coded in to them (for ajax calls). In order to test things locally, I need to replace that url with localhost. I've made a page which returns the modified file, and I want to replace all requests for /js/myfile.js with page render requests to /js/localhostjs which gives the modified file. I've made a RequestFilter that's only loaded in development mode, but the problem is it isn't always loaded properly - when I start tapestry (maven jetty:run) about 1/3rd of the time it works, but the rest of the time it doesn't. I tried this out with the quickstart app and the same thing happens: if you run the quickstart app and grab a css file ( http://localhost:8080/tapestryquickstart/layout/layout.css) then sometimes you'll see the timing filter, sometimes you won't. It doesn't change during the run, so in order to see this you need to start jetty, hit the file, kill jetty, repeat. This seems like a bug, the RequestFilter isn't always used for static file requests (race condition in Tapestry's startup?) How can I consistently rewrite the request for the js file (for development only)? (I tried the new LinkTransformer api but it seems it isn't called for static file requests. Same for the old URL Rewriting api) - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Enum or Drop Down
To add to Thiago's golden words, you can have a simple ListValueEncoder for using index/toString() like this class ListValueEncoderT(){ final private ListT values; public ListValueEncoder(ListT values){ this.values = values; } public String toClient(T value){ return values.indexOf(value); } public Value toValue(String index){ return values.get(Integer.parseInt(index)); } } (Yes, you have to ensure equals() and hash() are properly overridden) regards Taha On Mon, Feb 21, 2011 at 10:43 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: On Mon, 21 Feb 2011 14:05:25 -0300, robnangle robnan...@gmail.com wrote: I am not using tapestry-hibernate, is there any examples out there because the few I have came across seem to be very complex? There are some examples out there that I consider the wrong approach, specifically implementing both ValueEncoder and SelectModel in the same class. Suppose you have a class User and a DAO for it named UserDAO (not tested): class UserValueEncoderUser() { final private UserDAO dao; public UserValueEncoder(UserDAO dao) { this.dao = dao; } public String toClient(User user) { return user.getLogin(); } public User toValue(String clientValue) { return dao.findByLogin(clientValue); } } @Property private User user; select t:type=Select value=user .../ You could use any logic for that. For example, you could use the user id instead of login and your application would behave exactly the same. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Default Ordering for BeanEditForm
This wasn't using the @Property annotations. I was using getters and setters. The ordering isn't working when using a bean that is injected either. I'm not sure if this is a bug or if it is just something where it is impossible to get the information for ordering. Mark On Mon, Feb 21, 2011 at 12:14 PM, Howard Lewis Ship hls...@gmail.com wrote: Acutally, Tapestry 5.2 uses Javassist to get at attribute information for the methods, including the line numbers where available. However, I'm honestly not sure what happens in a transformed component class. Certainly, if the @Property annotation is used, there is no line number information to be had. On Mon, Feb 21, 2011 at 10:03 AM, Josh Canfield joshcanfi...@gmail.com wrote: http://download.oracle.com/javase/6/docs/api/java/lang/Class.html#getDeclaredMethods() The elements in the array returned are not sorted and are not in any particular order. Java's reflection mechanism doesn't guarantee the order of methods returned so it would be hard for Tapestry to do much about that given the current architecture. It's possible that the behavior you were seeing previously was particular to a specific JVM implementation. Josh On Sun, Feb 20, 2011 at 2:06 PM, Mark mark-li...@xeric.net wrote: On Sun, Feb 20, 2011 at 9:33 AM, Ulrich Stärk u...@spielviel.de wrote: I'm just guessing, but Tapestry might reorder accessor methods alphabetically when enhancing the page class. Hm. I'm also seeing this behavior on Java Beans now if they implement an interface and are Injected into the page. Should I file this as a bug or is it intentional. Mark - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Default Ordering for BeanEditForm
Josh, But it is documented--at least for normal beans. The notes section paragraph of the BeanEditForm documentation discusses the reorder parameter and then says: You can accomplish the same thing by changing the order of the getter methods in the bean class. The default order for properties is not alphabetical, it is the order of the getter methods. I understand that this doesn't necessarily mean it is going to work in transformed or injected classes, but the idea of ordering things by the getter method is covered in the documentation. Mark On Mon, Feb 21, 2011 at 1:02 PM, Josh Canfield joshcanfi...@gmail.com wrote: Acutally, Tapestry 5.2 uses Javassist to get at attribute information for the methods, including the line numbers where available. The getMethods in CtClass is not documented as being ordered, so I peeked at the code and unless I'm looking at the wrong spot it comes from an un-ordered HashMap. public CtMethod[] getMethods() { HashMap h = new HashMap(); getMethods0(h, this); return (CtMethod[])h.values().toArray(new CtMethod[h.size()]); } I haven't tried to chase down what Tapestry is doing in transformed classes, but I'm pretty sure counting on the undocumented ordering of methods is a bad idea. Josh On Mon, Feb 21, 2011 at 10:14 AM, Howard Lewis Ship hls...@gmail.com wrote: Acutally, Tapestry 5.2 uses Javassist to get at attribute information for the methods, including the line numbers where available. However, I'm honestly not sure what happens in a transformed component class. Certainly, if the @Property annotation is used, there is no line number information to be had. On Mon, Feb 21, 2011 at 10:03 AM, Josh Canfield joshcanfi...@gmail.com wrote: http://download.oracle.com/javase/6/docs/api/java/lang/Class.html#getDeclaredMethods() The elements in the array returned are not sorted and are not in any particular order. Java's reflection mechanism doesn't guarantee the order of methods returned so it would be hard for Tapestry to do much about that given the current architecture. It's possible that the behavior you were seeing previously was particular to a specific JVM implementation. Josh On Sun, Feb 20, 2011 at 2:06 PM, Mark mark-li...@xeric.net wrote: On Sun, Feb 20, 2011 at 9:33 AM, Ulrich Stärk u...@spielviel.de wrote: I'm just guessing, but Tapestry might reorder accessor methods alphabetically when enhancing the page class. Hm. I'm also seeing this behavior on Java Beans now if they implement an interface and are Injected into the page. Should I file this as a bug or is it intentional. Mark - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org