Re: integrating T5 a login form with Spring Security?
You have to provide the login-processing-url to your template file. Look into nu.localhost.tapestry5.springsecuritytest.pages.LoginPage and the respective LoginPage.tml in the webapp of the sample. It's artefact is dependency groupIdnu.localhost.tapestry5.springsecurity/groupId artifactIdtapestry-spring-security-sample/artifactId version1.0.0-SNAPSHOT/version /dependency There will be a final 1.0.0 later this day since Howard announced the final 5.0 for T5. Further you could also use Tapestry Spring Security and exclude the dependency for Spring 2.0 in your pom and include your 2.5 Spring dependencies instead. Visit [1] for an idea about it or read the excellent free book Better builds with Maven [2]. Michael [1] http://maven.apache.org/pom.html#Exclusions [2] http://www.exist.com/better-build-maven Jean Luc schrieb: Hello, I've been trying to integrate T5 and Spring Security (2.0.4, not the older Acegi) but haven't succeeded in making the two work together. The standard way to specify a form login with Spring 2.5 is like below. See the form-login element which specified the login page (Login) and what URL Spring will intercept (the standard j_security_check). b:beans xmlns=http://www.springframework.org/schema/security; http form-login login-page=/Login default-target-url=/Start authentication-failure-url=/Login?login_error=1 login-processing-url=j_security_check / /http I have a typical Login.tml (labels and cosmetic stuff removed for brevity) t:form t:id=loginForm tabletrtdinput type=text t:id=j_username t:type=TextField t:value=j_username//td/tr trtdinput type=text t:id=j_password t:type=PasswordField t:value=j_password//td/tr trinput type=submit value=Log In//td /tr /table /t:form What happens is that the POST that occurs when submitting the form goes to the Login.onSubmit() instead of j_security_check. While it is possible to add code there to call Spring's AuthenticationManager, I would end up duplicating what Spring Security does (the logic to redirect to different pages if the login succeeded or not and so on). I'd like to use Spring since it already implements this. Is it possible to submit the login info to j_security_check instead? Or to forward the request from within Login.onSubmit() to /j_security_check? I went through the Tapestry 5 book by Alexander Kolesnikov, but didn't find this info. Also, I am aware of the tapestry5-acegi extension ( http://www.localhost.nu/java/tapestry5-acegi/) but this one seems under development and for such a simple thing I didn't want to add a dependency on another jar. As you can tell, I'm new to T5. I've had some exposure to T4 and an older version of Spring (2.0) but there things were quite different, both in Tapestry itself and in how Acegi is configured in Spring. Advice is appreciated, JL - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5.0 Final Release - 5.0.18
Thank you Howard and Team! This is really a great piece of software. In my humble opinion it's the best web application framework available. Development is straight forward, though you have to learn the Tapestry way of doing things. But that's also true for any other framework out in space. Special thanks also to the list for coaching people on the usage of T5. This is a big help in acquiring the knowledge to use T5 effectively. Michael Howard Lewis Ship schrieb: Apache Tapestry 5.0 final release (5.0.18) After nearly three years of development, the final release of Apache Tapestry 5.0 is now available for download. Apache Tapestry 5 is a total rewrite of the Tapestry web application framework, bringing forward Tapestry's core concepts: reusable components, true encapsulation, readable templates, well thought-out localization/internationalization, and easy management of server-side state. Tapestry 5 builds on top of this with a host of new features: * True POJO component classes: no base classes to extend, no interfaces to implement. * Live class reloading: no need to redeploy to see code changes. * XML templates with namespaces. * Minimal configuration via naming conventions and annotations. * Integrated Ajax support, built on top of Prototype and Scriptaculous. * Automatic client-side form input validation. * High performance via pooled objects (and by avoiding the use of reflection). * Automatic REST-style URLs. * Built-in integration with Hibernate and Spring. * Best-of-breed exception reporting. * Built-in extensible mega-components: BeanEditForm, BeanDisplay and Grid (to edit and display any JavaBean or collection of JavaBeans). Tapestry organizes your application into pages, and components within pages; pages and components are ordinary POJOs: not singletons (like servlets). Tapestry combines pages, page templates, components, component templates, and other resources together for you, managing server-side state, the creation of URLs and the dispatch of incoming requests. You build your application in terms of the methods and properties of your objects, not in terms of URLs or the Servlet API. Tapestry features great exception reporting to keep you on track, and live class reloading to keep you agile. Tapestry templates are XML documents, using a namespace for Tapestry-specific elements. Tapestry is designed to be easy to develop, using any standard IDE with an XML editor. Tapestry is simple, sensible and fun. It keeps you productive by freeing you from the boring, mechanical aspects of web application development. You can stay focused on what makes your application interesting and unique, and let Tapestry handle all the ugly plumbing. Tapestry is made available under the Apache Software License 2.0. Tapestry is free to download, free to use, free to redistribute and free to modify. Tapestry 5.0.18 * Project page: http://tapestry.apache.org/tapestry5/ * Download: http://tapestry.apache.org/download.html * Release Notes: http://tapestry.apache.org/tapestry5/release-notes.html * Upgrade Notes: http://tapestry.apache.org/tapestry5/upgrade.html * Via Maven: dependency groupIdorg.apache.tapestry/groupId artifactIdtapestry-core/artifactId version5.0.18/version /dependency - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] Handle post from external application
On Mon, Dec 15, 2008 at 7:17 AM, thermus msch...@gmail.com wrote: What is the proper way to handle a form post to a Tapestry page from an external application? I know how to encode the parameters in the URL and use the onActivate context, but in this case, the data being passed from the external application will exceed the URL length limit so I need to use post. Can anyone advise how to do this? You have to look at the generated HTML fro your page, grab the t:formdata form parameter and (hard)code it into your app which will post to T5, obviously you have to use the appropriate parameter too. Of course you will tie together with that particular version of T5. This way it'll do the job. Yep i know it's no more then an hack but is the only way to do that right now, maybe (i think so) in the future T5 will have more RESTfull features to facilitate this but for now you have to be satisfied. I would like to see more discussion in this topic since i find T5 a great framework to build web app for app (B2B or call that the way you want), non only for browsers. Regards -- Massimo http://meridio.blogspot.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5.0 Final Release - 5.0.18
Congrats Howard (and others who have contributed)! Just a naming question: wouldn't it be appropriate to name the release version something in line with 5.0.GA? It will clarify the release status of the version, considering the line of versions preceding it (5.0.1, 5.0.2, ...) Just my 2c. Olle 2008/12/15 Michael Gerzabek michael.gerza...@gmx.net Thank you Howard and Team! This is really a great piece of software. In my humble opinion it's the best web application framework available. Development is straight forward, though you have to learn the Tapestry way of doing things. But that's also true for any other framework out in space. Special thanks also to the list for coaching people on the usage of T5. This is a big help in acquiring the knowledge to use T5 effectively. Michael Howard Lewis Ship schrieb: Apache Tapestry 5.0 final release (5.0.18) After nearly three years of development, the final release of Apache Tapestry 5.0 is now available for download. Apache Tapestry 5 is a total rewrite of the Tapestry web application framework, bringing forward Tapestry's core concepts: reusable components, true encapsulation, readable templates, well thought-out localization/internationalization, and easy management of server-side state. Tapestry 5 builds on top of this with a host of new features: * True POJO component classes: no base classes to extend, no interfaces to implement. * Live class reloading: no need to redeploy to see code changes. * XML templates with namespaces. * Minimal configuration via naming conventions and annotations. * Integrated Ajax support, built on top of Prototype and Scriptaculous. * Automatic client-side form input validation. * High performance via pooled objects (and by avoiding the use of reflection). * Automatic REST-style URLs. * Built-in integration with Hibernate and Spring. * Best-of-breed exception reporting. * Built-in extensible mega-components: BeanEditForm, BeanDisplay and Grid (to edit and display any JavaBean or collection of JavaBeans). Tapestry organizes your application into pages, and components within pages; pages and components are ordinary POJOs: not singletons (like servlets). Tapestry combines pages, page templates, components, component templates, and other resources together for you, managing server-side state, the creation of URLs and the dispatch of incoming requests. You build your application in terms of the methods and properties of your objects, not in terms of URLs or the Servlet API. Tapestry features great exception reporting to keep you on track, and live class reloading to keep you agile. Tapestry templates are XML documents, using a namespace for Tapestry-specific elements. Tapestry is designed to be easy to develop, using any standard IDE with an XML editor. Tapestry is simple, sensible and fun. It keeps you productive by freeing you from the boring, mechanical aspects of web application development. You can stay focused on what makes your application interesting and unique, and let Tapestry handle all the ugly plumbing. Tapestry is made available under the Apache Software License 2.0. Tapestry is free to download, free to use, free to redistribute and free to modify. Tapestry 5.0.18 * Project page: http://tapestry.apache.org/tapestry5/ * Download: http://tapestry.apache.org/download.html * Release Notes: http://tapestry.apache.org/tapestry5/release-notes.html * Upgrade Notes: http://tapestry.apache.org/tapestry5/upgrade.html * Via Maven: dependency groupIdorg.apache.tapestry/groupId artifactIdtapestry-core/artifactId version5.0.18/version /dependency - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se
Re: Layout Border component problem
What happens is that TeacherMode is mutable, and hence leaks state between different users. You are *not* given a fresh instance on each request. Instead, instances are pooled and reused. (Starting with 5.0.17, it is forbidden to have initial values on page member variables in order to prevent bugs like this.) One way to handle this situation is: *...@persist *private TeacherMode teacherMode; public void *setupRender()* { if (teacherMode == null) { teacherMode = new TeacherMode(); // This will be a private instance per session } } HTH, Olle 2008/12/15 kawes rafal.kawe...@gmail.com Hi Jonathan, thanks for your quick response. As you asked I uploaded classes I hit the problem in. Small description: One of my sub-application is Teacher (should be able to provide a word in foreign language and accept user's answer checks wheather it is correct) When user logs in, clicks teacher link is redirected to AvailabaleSets (which is wrapped by TeacherBorder). T5.zip file uploaded and it contains: - Border.java - Border.tml (pagelinks to all stuff provided by my app) - TeacherBorder.java - TeacherBorder.tml (contains all links to navigate my Teacher sub-application - i.e. TeacherMode - resposnible for 'asking question', registering results etc) - AvailableSets.java - AvailableSets.tml (displays available sets containg words) - TeacherModePage1.java - TeacherModePage1.tml (lets user to choose the word's set and decide about the questioning mode (mingled or the sequence of words had been added to the set) ) - TeacherModePage2.java - TeacherModePage2.tml (displays questions and lets to type in answers) TeacherModePage1.java contains the following line: private TeacherMode teacherMode = new TeacherMode(); I belived that when new page would be displayed (whe user clicks TeacherMode in TeacherBorder) a brand new TeacherMode instance would be returned but is not. And is not because all the classes are already instantiated and T5 gives them back to the user for efficiency. Please keep in mind this is just the beggining of the work, so not everything is like it should be from architectural point of view (i.e. @Persist will be replaced by onPassvate and onActivate). I just wanted to see how it works. If any more details are reqiured let me know. Thanks in advance http://www.nabble.com/file/p21009484/T5.zip T5.zip -- View this message in context: http://www.nabble.com/Layout-Border-component-problem-tp21004400p21009484.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 -- Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se
Re: Tapestry 5.0 Final Release - 5.0.18
On Mon, Dec 15, 2008 at 10:03 AM, Olle Hallin olle.hal...@gmail.com wrote: Congrats Howard (and others who have contributed)! Yep, congratulation Howard, you did an amazing job! Just a naming question: wouldn't it be appropriate to name the release version something in line with 5.0.GA? It will clarify the release status of the version, considering the line of versions preceding it (5.0.1, 5.0.2, ...) About naming i like the version as is, no GA is needed for marking this release as GA, just a note on the home page is enough. Anyway is still a great release! -- Massimo http://meridio.blogspot.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Layout Border component problem
Olle, thanks a lot. I knew what was wrong but had no idea how to deal with that. I am gonna check it out at home 'cause now I am at work. thanks again Olle Hallin wrote: What happens is that TeacherMode is mutable, and hence leaks state between different users. You are *not* given a fresh instance on each request. Instead, instances are pooled and reused. (Starting with 5.0.17, it is forbidden to have initial values on page member variables in order to prevent bugs like this.) One way to handle this situation is: *...@persist *private TeacherMode teacherMode; public void *setupRender()* { if (teacherMode == null) { teacherMode = new TeacherMode(); // This will be a private instance per session } } HTH, Olle 2008/12/15 kawes rafal.kawe...@gmail.com Hi Jonathan, thanks for your quick response. As you asked I uploaded classes I hit the problem in. Small description: One of my sub-application is Teacher (should be able to provide a word in foreign language and accept user's answer checks wheather it is correct) When user logs in, clicks teacher link is redirected to AvailabaleSets (which is wrapped by TeacherBorder). T5.zip file uploaded and it contains: - Border.java - Border.tml (pagelinks to all stuff provided by my app) - TeacherBorder.java - TeacherBorder.tml (contains all links to navigate my Teacher sub-application - i.e. TeacherMode - resposnible for 'asking question', registering results etc) - AvailableSets.java - AvailableSets.tml (displays available sets containg words) - TeacherModePage1.java - TeacherModePage1.tml (lets user to choose the word's set and decide about the questioning mode (mingled or the sequence of words had been added to the set) ) - TeacherModePage2.java - TeacherModePage2.tml (displays questions and lets to type in answers) TeacherModePage1.java contains the following line: private TeacherMode teacherMode = new TeacherMode(); I belived that when new page would be displayed (whe user clicks TeacherMode in TeacherBorder) a brand new TeacherMode instance would be returned but is not. And is not because all the classes are already instantiated and T5 gives them back to the user for efficiency. Please keep in mind this is just the beggining of the work, so not everything is like it should be from architectural point of view (i.e. @Persist will be replaced by onPassvate and onActivate). I just wanted to see how it works. If any more details are reqiured let me know. Thanks in advance http://www.nabble.com/file/p21009484/T5.zip T5.zip -- View this message in context: http://www.nabble.com/Layout-Border-component-problem-tp21004400p21009484.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 -- Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se -- View this message in context: http://www.nabble.com/Layout-Border-component-problem-tp21004400p21010764.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] Handle post from external application
Em Mon, 15 Dec 2008 03:17:19 -0300, thermus msch...@gmail.com escreveu: What is the proper way to handle a form post to a Tapestry page from an external application? I know how to encode the parameters in the URL and use the onActivate context, but in this case, the data being passed from the external application will exceed the URL length limit so I need to use post. Inject the Request and use it to get the parameter values, just like you would do without Tapestry. Tapestry adds a hidden field with some values you better not try to deal with them. :) -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor Consultor, desenvolvedor e instrutor em Java http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: [ANN] t5components 0.5.18 is now available for Tapestry 5.0.18
Yes I already tried that. Also in debugging mode I can see that the AbstractEventMixin.onInternalEvent() method returns a List with the JSONObjects. Then the javascript code is called, but the response argument is undefined I have no clue what causes this problem. I had this working in a previous tapestry version. J. Date: Mon, 15 Dec 2008 14:58:47 +0100 From: hombu...@googlemail.com To: users@tapestry.apache.org Subject: Re: [ANN] t5components 0.5.18 is now available for Tapestry 5.0.18 your code looks correct, try to empty your browser cache 2008/12/15 Joe123 --- jpe...@hotmail.com Hi, I use the @OnEvent mixin to create dependent selects: I use it like below. But the problem is that the onCompleteOperatorChange javascript function response object is undefined Any ideas how this is possible. The javascript function is called, but the response is undefined @OnEvent(component = operator, value = change) public JSONArray onChangeOperatorEvent(String value) { JSONArray jsonArray = new JSONArray(); for (Plaza plaza : getDestinationSelectValues(value)) { JSONObject jsonObject = new JSONObject(); jsonObject.put(value, plaza.getId()); jsonObject.put(label, plaza.getDescription()); jsonArray.put(jsonObject); } return jsonArray; } Finally, the onCompleteOperatorChange javascript function has to parse the return JSON and update the select input options: function onCompleteOperatorChange(response) { selectElement = $(entryPlaza); responseJSON = response.evalJSON(); while (selectElement .options.length 0) { selectElement .options[0] = null; } for (index = 0; index responseJSON .length; index++) { selectElement.options[index] = new Option(responseJSON [index].label, responseJSON [index].value); } Tapestry.ElementEffect.highlight($(entryPlaza)); } any help is welcome. J Date: Mon, 15 Dec 2008 13:32:30 +0100 From: hombu...@googlemail.com To: users@tapestry.apache.org Subject: [ANN] t5components 0.5.18 is now available for Tapestry 5.0.18 Hi there, t5components 0.5.18 is now available for Tapestry 5.0.18 with some fixes project page http://tapestry5-components.googlecode.com *Impotant Information* This release of t5components will be the last. This project has been discontinued, all development effort has been moved to chenillekit.org -- with regards Sven Homburg http://www.chenillekit.org http://tapestry5-components.googlecode.com _ News, entertainment and everything you care about at Live.com. Get it now! http://www.live.com/getstarted.aspx -- with regards Sven Homburg http://www.chenillekit.org http://tapestry5-components.googlecode.com _ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vistamkt=en-USform=QBRE
Re: [ANN] t5components 0.5.18 is now available for Tapestry 5.0.18
your code looks correct, try to empty your browser cache 2008/12/15 Joe123 --- jpe...@hotmail.com Hi, I use the @OnEvent mixin to create dependent selects: I use it like below. But the problem is that the onCompleteOperatorChange javascript function response object is undefined Any ideas how this is possible. The javascript function is called, but the response is undefined @OnEvent(component = operator, value = change) public JSONArray onChangeOperatorEvent(String value) { JSONArray jsonArray = new JSONArray(); for (Plaza plaza : getDestinationSelectValues(value)) { JSONObject jsonObject = new JSONObject(); jsonObject.put(value, plaza.getId()); jsonObject.put(label, plaza.getDescription()); jsonArray.put(jsonObject); } return jsonArray; } Finally, the onCompleteOperatorChange javascript function has to parse the return JSON and update the select input options: function onCompleteOperatorChange(response) { selectElement = $(entryPlaza); responseJSON = response.evalJSON(); while (selectElement .options.length 0) { selectElement .options[0] = null; } for (index = 0; index responseJSON .length; index++) { selectElement.options[index] = new Option(responseJSON [index].label, responseJSON [index].value); } Tapestry.ElementEffect.highlight($(entryPlaza)); } any help is welcome. J Date: Mon, 15 Dec 2008 13:32:30 +0100 From: hombu...@googlemail.com To: users@tapestry.apache.org Subject: [ANN] t5components 0.5.18 is now available for Tapestry 5.0.18 Hi there, t5components 0.5.18 is now available for Tapestry 5.0.18 with some fixes project page http://tapestry5-components.googlecode.com *Impotant Information* This release of t5components will be the last. This project has been discontinued, all development effort has been moved to chenillekit.org -- with regards Sven Homburg http://www.chenillekit.org http://tapestry5-components.googlecode.com _ News, entertainment and everything you care about at Live.com. Get it now! http://www.live.com/getstarted.aspx -- with regards Sven Homburg http://www.chenillekit.org http://tapestry5-components.googlecode.com
Re: [T5]: query regarding streaming data
Yes, there is. Let your handler method return a StreamResponse object. See http://tapestry.apache.org/tapestry5/guide/pagenav.html and http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/StreamResponse.html. Olle 2008/12/15 tapestryphoto pho...@digiatlas.org Hi, possibly not Tapestry specific and I'm not knowledgable enough on this subject, so apologies. I would like to be able to display a PDF that I obtain from a database using Hibernate via Tapestry. Is there a way to stream the data? thanks, p. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se
Re: [T5] Handle post from external application
On Mon, Dec 15, 2008 at 2:41 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Mon, 15 Dec 2008 03:17:19 -0300, thermus msch...@gmail.com escreveu: What is the proper way to handle a form post to a Tapestry page from an external application? I know how to encode the parameters in the URL and use the onActivate context, but in this case, the data being passed from the external application will exceed the URL length limit so I need to use post. Inject the Request and use it to get the parameter values, just like you would do without Tapestry. Tapestry adds a hidden field with some values you better not try to deal with them. :) We are talking about the client side which is a java app (for example) that has to post data to the T5 web app for taking advantage of great processing features provider by T5 you have to deal with the hidden formadata parameter. Please correct me if I'm wrong. -- Massimo http://meridio.blogspot.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5.0 Final Release - 5.0.18
Great news! Knowing this framework is in production use for months now, is there a list of success stories? I think Howard once asked on this list for such stories and the format in which they should be reported. Cheers, Borut
Re: [T5]: query regarding streaming data
Thanks Olle, However, reading the docs I see that the Streaming applies to components. In my situation I need to open a new window, which I currently do with JavaScript (in this example I'm obviously opening a local file, but as I said, in the real version it needs to come from the DB): e.g.: pa href=javascript:openPdf('file:///c:/DMR2008.pdf')Open a PDF/a/p which is so I can auto-close the window: function openPdf(url) { windowprops = left=10,top=10,width=1000,height=1100; if (ChildWin) { return false; } ChildWin = window.open(url, ChildWin, windowprops); ResetTimer(); if (TimeOut RefreshRate) { setTimeout(CheckClose();,RefreshRate * 1000); } } I really need the streaming to be coming from a URL I am opening and as far as I can see that won't work as StreamResponse applies to Components only. Hmmm. ! p. Quoting Olle Hallin olle.hal...@gmail.com: Yes, there is. Let your handler method return a StreamResponse object. See http://tapestry.apache.org/tapestry5/guide/pagenav.html and http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/StreamResponse.html. Olle 2008/12/15 tapestryphoto pho...@digiatlas.org Hi, possibly not Tapestry specific and I'm not knowledgable enough on this subject, so apologies. I would like to be able to display a PDF that I obtain from a database using Hibernate via Tapestry. Is there a way to stream the data? thanks, p. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Composite Component
I have a composite component with two date fields (date range) and I would like to add validation to the composite component to make sure the end date is after the start date. Looking over the documentation and doing some trial and error has not worked. my component extends AbstractField, I attempted to overrided processSubmission but it seems like the child elements do not get processed before the parent, so that does not work. Any suggestions? Much appreciated. -Mark - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
[T5]: query regarding streaming data
Hi, possibly not Tapestry specific and I'm not knowledgable enough on this subject, so apologies. I would like to be able to display a PDF that I obtain from a database using Hibernate via Tapestry. Is there a way to stream the data? thanks, p. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
[ANN] t5components 0.5.18 is now available for Tapestry 5.0.18
Hi there, t5components 0.5.18 is now available for Tapestry 5.0.18 with some fixes project page http://tapestry5-components.googlecode.com *Impotant Information* This release of t5components will be the last. This project has been discontinued, all development effort has been moved to chenillekit.org -- with regards Sven Homburg http://www.chenillekit.org http://tapestry5-components.googlecode.com
[ANN] JumpStart 3.20.0 released - for T5.0.18
Hi all, JumpStart 3.20.0 is now available. It's built on the Tapestry 5.0 Final Release - 5.0.18 - which was released a couple of days ago. You can use it live: http://jumpstart.doublenegative.com.au:8080/jumpstart/ or download it: http://jumpstart.doublenegative.com.au Keep the feedback and suggestions coming - it all helps! Cheers, Geoff
[T5] onException event
I am using T 5.0.18. In my page class I have an method to catch exceptions: public Object onException(Throwable cause) { LOG.info(onException(Throwable cause); cause instanceof + cause.getClass()); if(cause instanceof OnRequestOnlyException) { return onRequestOnly; } return null; } The method is never called. Is this feature currently broken? Andy - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: integrating T5 a login form with Spring Security?
I'm using the action attribute form id=login method=post action=${loginCheckUrl} Martijn On Sun, 2008-12-14 at 19:30 -0500, Jean Luc wrote: Hello, I've been trying to integrate T5 and Spring Security (2.0.4, not the older Acegi) but haven't succeeded in making the two work together. The standard way to specify a form login with Spring 2.5 is like below. See the form-login element which specified the login page (Login) and what URL Spring will intercept (the standard j_security_check). b:beans xmlns=http://www.springframework.org/schema/security; http form-login login-page=/Login default-target-url=/Start authentication-failure-url=/Login?login_error=1 login-processing-url=j_security_check / /http I have a typical Login.tml (labels and cosmetic stuff removed for brevity) t:form t:id=loginForm tabletrtdinput type=text t:id=j_username t:type=TextField t:value=j_username//td/tr trtdinput type=text t:id=j_password t:type=PasswordField t:value=j_password//td/tr trinput type=submit value=Log In//td /tr /table /t:form What happens is that the POST that occurs when submitting the form goes to the Login.onSubmit() instead of j_security_check. While it is possible to add code there to call Spring's AuthenticationManager, I would end up duplicating what Spring Security does (the logic to redirect to different pages if the login succeeded or not and so on). I'd like to use Spring since it already implements this. Is it possible to submit the login info to j_security_check instead? Or to forward the request from within Login.onSubmit() to /j_security_check? I went through the Tapestry 5 book by Alexander Kolesnikov, but didn't find this info. Also, I am aware of the tapestry5-acegi extension ( http://www.localhost.nu/java/tapestry5-acegi/) but this one seems under development and for such a simple thing I didn't want to add a dependency on another jar. As you can tell, I'm new to T5. I've had some exposure to T4 and an older version of Spring (2.0) but there things were quite different, both in Tapestry itself and in how Acegi is configured in Spring. Advice is appreciated, JL - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5.0 Final Release - 5.0.18
Congratulations Howard and all contributors for making our lives as web developpers, architects, project managers, ... easier ! Best Regards Stephane Howard Lewis Ship a écrit : Apache Tapestry 5.0 final release (5.0.18) After nearly three years of development, the final release of Apache Tapestry 5.0 is now available for download. Apache Tapestry 5 is a total rewrite of the Tapestry web application framework, bringing forward Tapestry's core concepts: reusable components, true encapsulation, readable templates, well thought-out localization/internationalization, and easy management of server-side state. Tapestry 5 builds on top of this with a host of new features: * True POJO component classes: no base classes to extend, no interfaces to implement. * Live class reloading: no need to redeploy to see code changes. * XML templates with namespaces. * Minimal configuration via naming conventions and annotations. * Integrated Ajax support, built on top of Prototype and Scriptaculous. * Automatic client-side form input validation. * High performance via pooled objects (and by avoiding the use of reflection). * Automatic REST-style URLs. * Built-in integration with Hibernate and Spring. * Best-of-breed exception reporting. * Built-in extensible mega-components: BeanEditForm, BeanDisplay and Grid (to edit and display any JavaBean or collection of JavaBeans). Tapestry organizes your application into pages, and components within pages; pages and components are ordinary POJOs: not singletons (like servlets). Tapestry combines pages, page templates, components, component templates, and other resources together for you, managing server-side state, the creation of URLs and the dispatch of incoming requests. You build your application in terms of the methods and properties of your objects, not in terms of URLs or the Servlet API. Tapestry features great exception reporting to keep you on track, and live class reloading to keep you agile. Tapestry templates are XML documents, using a namespace for Tapestry-specific elements. Tapestry is designed to be easy to develop, using any standard IDE with an XML editor. Tapestry is simple, sensible and fun. It keeps you productive by freeing you from the boring, mechanical aspects of web application development. You can stay focused on what makes your application interesting and unique, and let Tapestry handle all the ugly plumbing. Tapestry is made available under the Apache Software License 2.0. Tapestry is free to download, free to use, free to redistribute and free to modify. Tapestry 5.0.18 * Project page: http://tapestry.apache.org/tapestry5/ * Download: http://tapestry.apache.org/download.html * Release Notes: http://tapestry.apache.org/tapestry5/release-notes.html * Upgrade Notes: http://tapestry.apache.org/tapestry5/upgrade.html * Via Maven: dependency groupIdorg.apache.tapestry/groupId artifactIdtapestry-core/artifactId version5.0.18/version /dependency
T5: How to initialize page members
Hi, Beginning with 5.0.17 is is forbidden to have initial values on page members, in order to prohibit state leakage between sessions. This is fine, since it prevents bugs that can be very tricky to isolate. On the other hand, it leads to clumsy code. Instead of *private Foo foo = new Foo(); * you have to write *...@persist private Foo foo; void setupRender() { if (foo == null) { foo = new Foo(); } } * This contradicts to the Tapestry principle *the simplest choice should be the correct choice.* IMHO it should be ok to initialize the member in the declaration if it can be guaranteed that the value is immutable. Therefore, I propose that classes that are known to be immutable (java.lang.Integer etal) and classes that are annotated @Immutable should be allowed as initializers. See http://www.jcip.net/annotations/doc/net/jcip/annotations/Immutable.html. The package is available at the Maven repo (group:net.jcip artifact:jcip-annotations version:1.0), and it's license ( http://creativecommons.org/licenses/by/2.5) is AFAIK compatible with Tapestry's. Regards, Olle -- Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se
Tapestry 5 page persistence design issues
Hello, I must say first that I really like the design concept of the Tapestry 5. It's component oriented design and IoC supporting it are really promising. But could somebody please explain me the logic behind Tapestry 5 page persistence handling. I just do not get it. I think that I have a pretty common use case where there is a page with a list of items with links to the item detail page. Users usually open many different detail pages for further investigation (in a new tab or in a new window). A real world example of this is eBay, where you can open several action items to view detailed information. Let's imagine that the detail page has to hold it's state somehow. Now the situation gets really weird. As far as I understand (please tell me that I'm wrong), Tapestry 5 keeps only one copy of the persistent state per page and session, no mater how many instances of the same page are actually created by the user on the client side. Good example of this misbehavior is Tapestry 5 grid component. Put it on the page, create two instances of the page and use the column sorting feature and look what happens. You might say that you can use the client side persistence strategy, but there is another and bigger problem. The persistence strategy must be set on the field level and not on the page level. Honestly, please tell me one use case where this is needed? This design fault disables the possibility to change grid component persistence strategy to match the page strategy. I would like to suggest also some possible solutions for the further discussion. First, a default persistence strategy should be set on the page level (with the annotation). When not set, it will default to the session strategy (or to omething that is appropriate). Now, when there is really a need for a different strategy for one field, then and only then this should be set on the field level. The second thing would be a new persistence strategy, that will keep one state per one page instance. It is quite tricky to archive because an unique id should be generated and tracked per page instance. The hardest part is to make sure that every component will include this id with it's conversation with the server side. With best regards, Kristjan Kelt -- View this message in context: http://www.nabble.com/Tapestry-5-page-persistence-design-issues-tp21013031p21013031.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]: query regarding streaming data
It works fine. Try something like this: public class TestPage { public Object onPDF(Long id) { return new PDFStreamResponse(dao.getPDF(id)); } public Link getPDFLink() { return resources.createActionLink(pdf, false); } } public class PDFStreamResponse implements StreamResponse { byte[] pdf; public PDFStreamResponse(byte[] pdf) { this.pdf = pdf; } public String getContentType() { return application/pdf; } public InputStream getStream() throws IOException { return new ByteArrayInputStream(pdf); } public void prepareResponse(Response response) { } } TestPage.tml: a href=javascript:openPdf('${pdfLink}')Open a PDF/a J On Dec 15, 2008, at 7:59 AM, tapestryphoto wrote: Thanks Olle, However, reading the docs I see that the Streaming applies to components. In my situation I need to open a new window, which I currently do with JavaScript (in this example I'm obviously opening a local file, but as I said, in the real version it needs to come from the DB): e.g.: pa href=javascript:openPdf('file:///c:/DMR2008.pdf')Open a PDF/a/p which is so I can auto-close the window: function openPdf(url) { windowprops = left=10,top=10,width=1000,height=1100; if (ChildWin) { return false; } ChildWin = window.open(url, ChildWin, windowprops); ResetTimer(); if (TimeOut RefreshRate) { setTimeout(CheckClose();,RefreshRate * 1000); } } I really need the streaming to be coming from a URL I am opening and as far as I can see that won't work as StreamResponse applies to Components only. Hmmm. ! p. Quoting Olle Hallin olle.hal...@gmail.com: Yes, there is. Let your handler method return a StreamResponse object. See http://tapestry.apache.org/tapestry5/guide/pagenav.html and http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/StreamResponse.html . Olle 2008/12/15 tapestryphoto pho...@digiatlas.org Hi, possibly not Tapestry specific and I'm not knowledgable enough on this subject, so apologies. I would like to be able to display a PDF that I obtain from a database using Hibernate via Tapestry. Is there a way to stream the data? thanks, p. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se - 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]: query regarding streaming data
Do you mean a data stream? Since you mentioned a PDF I assume this to be the case... simply return a StreamResponse... you can use a page or eventlink, see: http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/StreamResponse.html For example: return new StreamResponse() { public String getContentType() { return application/pdf; } public InputStream getStream() { return stream; } public void prepareResponse(Response response) { response.setHeader(Content-Disposition, attachment; filename= + fileName); response.setContentLength(docLength); } }; cheers, Peter - Original Message - From: tapestryphoto pho...@digiatlas.org To: users@tapestry.apache.org Sent: Monday, 15 December, 2008 3:45:06 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: [T5]: query regarding streaming data Hi, possibly not Tapestry specific and I'm not knowledgable enough on this subject, so apologies. I would like to be able to display a PDF that I obtain from a database using Hibernate via Tapestry. Is there a way to stream the data? thanks, p. - 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: [ANN] t5components 0.5.18 is now available for Tapestry 5.0.18
Hi, I use the @OnEvent mixin to create dependent selects: I use it like below. But the problem is that the onCompleteOperatorChange javascript function response object is undefined Any ideas how this is possible. The javascript function is called, but the response is undefined @OnEvent(component = operator, value = change) public JSONArray onChangeOperatorEvent(String value) { JSONArray jsonArray = new JSONArray(); for (Plaza plaza : getDestinationSelectValues(value)) { JSONObject jsonObject = new JSONObject(); jsonObject.put(value, plaza.getId()); jsonObject.put(label, plaza.getDescription()); jsonArray.put(jsonObject); } return jsonArray; } Finally, the onCompleteOperatorChange javascript function has to parse the return JSON and update the select input options: function onCompleteOperatorChange(response) { selectElement = $(entryPlaza); responseJSON = response.evalJSON(); while (selectElement .options.length 0) { selectElement .options[0] = null; } for (index = 0; index responseJSON .length; index++) { selectElement.options[index] = new Option(responseJSON [index].label, responseJSON [index].value); } Tapestry.ElementEffect.highlight($(entryPlaza)); } any help is welcome. J Date: Mon, 15 Dec 2008 13:32:30 +0100 From: hombu...@googlemail.com To: users@tapestry.apache.org Subject: [ANN] t5components 0.5.18 is now available for Tapestry 5.0.18 Hi there, t5components 0.5.18 is now available for Tapestry 5.0.18 with some fixes project page http://tapestry5-components.googlecode.com *Impotant Information* This release of t5components will be the last. This project has been discontinued, all development effort has been moved to chenillekit.org -- with regards Sven Homburg http://www.chenillekit.org http://tapestry5-components.googlecode.com _ News, entertainment and everything you care about at Live.com. Get it now! http://www.live.com/getstarted.aspx
Re: integrating T5 a login form with Spring Security?
Hi, Take a look at the Login page in tapestry5-appfuse project here: http://code.google.com/p/tapestry5-appfuse There is an example of direct integration between T5 and Spring Security 2. /Serge Jean Luc wrote: Update: I can get the response with: @Inject private RequestGlobals requestGlobals; and using requestGlobals.getHTTPServletResponse(); I'll need to change the redirect into a forward (to save a trip and to prevent the username/pwd appear in the URL) but that's standard servlet stuff. Thanks. On Sun, Dec 14, 2008 at 8:05 PM, Jean Luc jeanluc2...@gmail.com wrote: Thanks Hugo, I've [tried to] inject the request and the response as mentioned (for the request) at: http://wiki.apache.org/tapestry/Tapestry5ObtainingHttpServletRequest @Inject private HttpServletRequest request; @Inject private HttpServletResponse response; It works for the request, but not for the response (exception below). I've googled for ways to inject the response (I thought it would be similar) but no luck. exception org.apache.tapestry5.internal.services.TransformationException: Error obtaining injected value for field com.foo.tapestry.pages.Login.response: No service implements the interface javax.servlet.http.HttpServletResponse. # org.apache.tapestry5.internal.services.TransformationException Error obtaining injected value for field com.foo.tapestry.pages.Login.response: No service implements the interface javax.servlet.http.HttpServletResponse. In case it matters, I'm using T 5.0.18 and JBoss 4.2.2GA Thanks in advance, JL On Sun, Dec 14, 2008 at 7:44 PM, Hugo Palma hugo.m.pa...@gmail.com wrote: In your page class inject the check url like this: @Inject @Value(${spring-security.check.url}) private String checkUrl; then on your onSuccessMethod: response.sendRedirect(request.getContextPath() + checkUrl + ?j_username= + username + j_password= + password); where username and password are the bound variables for your username and password text fields on the form. Jean Luc wrote: Hello, I've been trying to integrate T5 and Spring Security (2.0.4, not the older Acegi) but haven't succeeded in making the two work together. The standard way to specify a form login with Spring 2.5 is like below. See the form-login element which specified the login page (Login) and what URL Spring will intercept (the standard j_security_check). b:beans xmlns=http://www.springframework.org/schema/security; http form-login login-page=/Login default-target-url=/Start authentication-failure-url=/Login?login_error=1 login-processing-url=j_security_check / /http I have a typical Login.tml (labels and cosmetic stuff removed for brevity) t:form t:id=loginForm tabletrtdinput type=text t:id=j_username t:type=TextField t:value=j_username//td/tr trtdinput type=text t:id=j_password t:type=PasswordField t:value=j_password//td/tr trinput type=submit value=Log In//td /tr /table /t:form What happens is that the POST that occurs when submitting the form goes to the Login.onSubmit() instead of j_security_check. While it is possible to add code there to call Spring's AuthenticationManager, I would end up duplicating what Spring Security does (the logic to redirect to different pages if the login succeeded or not and so on). I'd like to use Spring since it already implements this. Is it possible to submit the login info to j_security_check instead? Or to forward the request from within Login.onSubmit() to /j_security_check? I went through the Tapestry 5 book by Alexander Kolesnikov, but didn't find this info. Also, I am aware of the tapestry5-acegi extension ( http://www.localhost.nu/java/tapestry5-acegi/) but this one seems under development and for such a simple thing I didn't want to add a dependency on another jar. As you can tell, I'm new to T5. I've had some exposure to T4 and an older version of Spring (2.0) but there things were quite different, both in Tapestry itself and in how Acegi is configured in Spring. Advice is appreciated, JL - 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 -- View this message in context: http://www.nabble.com/integrating-T5-a-login-form-with-Spring-Security--tp21006586p21012513.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:
Re: Tapestry 5 page persistence design issues
There is also this issue in Jira you can comment on and vote for: https://issues.apache.org/jira/browse/TAP5-411 cheers, Peter - Original Message - From: kristjankelt kristjank...@hotmail.com To: users@tapestry.apache.org Sent: Monday, 15 December, 2008 2:28:45 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Tapestry 5 page persistence design issues Hello, I must say first that I really like the design concept of the Tapestry 5. It's component oriented design and IoC supporting it are really promising. But could somebody please explain me the logic behind Tapestry 5 page persistence handling. I just do not get it. I think that I have a pretty common use case where there is a page with a list of items with links to the item detail page. Users usually open many different detail pages for further investigation (in a new tab or in a new window). A real world example of this is eBay, where you can open several action items to view detailed information. Let's imagine that the detail page has to hold it's state somehow. Now the situation gets really weird. As far as I understand (please tell me that I'm wrong), Tapestry 5 keeps only one copy of the persistent state per page and session, no mater how many instances of the same page are actually created by the user on the client side. Good example of this misbehavior is Tapestry 5 grid component. Put it on the page, create two instances of the page and use the column sorting feature and look what happens. You might say that you can use the client side persistence strategy, but there is another and bigger problem. The persistence strategy must be set on the field level and not on the page level. Honestly, please tell me one use case where this is needed? This design fault disables the possibility to change grid component persistence strategy to match the page strategy. I would like to suggest also some possible solutions for the further discussion. First, a default persistence strategy should be set on the page level (with the annotation). When not set, it will default to the session strategy (or to omething that is appropriate). Now, when there is really a need for a different strategy for one field, then and only then this should be set on the field level. The second thing would be a new persistence strategy, that will keep one state per one page instance. It is quite tricky to archive because an unique id should be generated and tracked per page instance. The hardest part is to make sure that every component will include this id with it's conversation with the server side. With best regards, Kristjan Kelt -- View this message in context: http://www.nabble.com/Tapestry-5-page-persistence-design-issues-tp21013031p21013031.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: [ANN] JumpStart 3.20.0 released - for T5.0.18
Hi Andy, Thanks for the good rap. Regarding the dependencies, step 5 bullet 2 of the Installation guide should sort out your problem. http://jumpstart.doublenegative.com.au/installation.html Now that JBoss has moved its stuff into the maven repositories I may remove the local searches. Cheers, Geoff On 15/12/2008, at 11:03 PM, Andy Pahne wrote: Hi, it's a nice starting point for building your own apps. I use it quite frequently as reference. I tried to downlaod and import it in my favourite IDE (Eclipse), but downloading the dependencies failed. It seems that some dependencies are searched local instead of downloaded (the JBOSS stuff). Andy Geoff Callender schrieb: Hi all, JumpStart 3.20.0 is now available. It's built on the Tapestry 5.0 Final Release - 5.0.18 - which was released a couple of days ago. You can use it live: http://jumpstart.doublenegative.com.au:8080/jumpstart/ or download it: http://jumpstart.doublenegative.com.au Keep the feedback and suggestions coming - it all helps! Cheers, Geoff - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: How to initialize page members
Why is it prohibited to initialize rowsPerPage in the declaration? An int is definitely immutable. It's not even an object... True, but then the question arises will it become more confusing and appear inconsisant? Especially for new users still learning Tapestry, they may get confused as to why primitives can be initialized but not Objects? - Original Message - From: Olle Hallin olle.hal...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Monday, 15 December, 2008 3:32:00 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: T5: How to initialize page members You're correct about static final. Didn't think of that . But still I think there is room for improvement: Consider this use case that is quite clumsy to implement as it is today: public class APageThatContainsAGrid { @Persist private int rowsPerPage = 10; // forbidden! void onAction(int rows) { this.rowsPerPage = rows; } } and in the template a t:grid rowsPerPage=rowsPerPage .../ and a couple of action links for modifying rowsPerPage. Why is it prohibited to initialize rowsPerPage in the declaration? An int is definitely immutable. It's not even an object... Olle 2008/12/15 Thiago H. de Paula Figueiredo thiag...@gmail.com Em Mon, 15 Dec 2008 06:47:18 -0300, Olle Hallin olle.hal...@gmail.com escreveu: Hi, Hi! Beginning with 5.0.17 is is forbidden to have initial values on page members, in order to prohibit state leakage between sessions. This is fine, since it prevents bugs that can be very tricky to isolate. You're right. This contradicts to the Tapestry principle *the simplest choice should be the correct choice.* I don't think so. You have to remember that Tapestry polls page instances, so, after one request, Tapestry must restart the page fields values. And that the value of a non-primitive field is a reference to an object, not an object itself. IMHO it should be ok to initialize the member in the declaration if it can be guaranteed that the value is immutable. IMHO, the best way to declare a field that is immutable is to make it final and static (i.e. constant) for it, not a private field. ;) -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Layout Border component problem
Ok found an answer to my second question, some info is provided here: http://tapestry.apache.org/tapestry5/tapestry-core/guide/rendering.html but still would be happy if you could answer to my first question. cheers kawes wrote: Olle, thanks a lot. I knew what was wrong but had no idea how to deal with that. I am gonna check it out at home 'cause now I am at work. But I have some questions to the resolve you suggetsed: - Starting with 5.0.17, it is forbidden to have initial values on page - what does it mean it is forbidden? I did not notice any repoerts during runtime and no during compilantion neither. - what is setupRender() method? it will be called automatically ? thanks again Olle Hallin wrote: What happens is that TeacherMode is mutable, and hence leaks state between different users. You are *not* given a fresh instance on each request. Instead, instances are pooled and reused. (Starting with 5.0.17, it is forbidden to have initial values on page member variables in order to prevent bugs like this.) One way to handle this situation is: *...@persist *private TeacherMode teacherMode; public void *setupRender()* { if (teacherMode == null) { teacherMode = new TeacherMode(); // This will be a private instance per session } } HTH, Olle 2008/12/15 kawes rafal.kawe...@gmail.com Hi Jonathan, thanks for your quick response. As you asked I uploaded classes I hit the problem in. Small description: One of my sub-application is Teacher (should be able to provide a word in foreign language and accept user's answer checks wheather it is correct) When user logs in, clicks teacher link is redirected to AvailabaleSets (which is wrapped by TeacherBorder). T5.zip file uploaded and it contains: - Border.java - Border.tml (pagelinks to all stuff provided by my app) - TeacherBorder.java - TeacherBorder.tml (contains all links to navigate my Teacher sub-application - i.e. TeacherMode - resposnible for 'asking question', registering results etc) - AvailableSets.java - AvailableSets.tml (displays available sets containg words) - TeacherModePage1.java - TeacherModePage1.tml (lets user to choose the word's set and decide about the questioning mode (mingled or the sequence of words had been added to the set) ) - TeacherModePage2.java - TeacherModePage2.tml (displays questions and lets to type in answers) TeacherModePage1.java contains the following line: private TeacherMode teacherMode = new TeacherMode(); I belived that when new page would be displayed (whe user clicks TeacherMode in TeacherBorder) a brand new TeacherMode instance would be returned but is not. And is not because all the classes are already instantiated and T5 gives them back to the user for efficiency. Please keep in mind this is just the beggining of the work, so not everything is like it should be from architectural point of view (i.e. @Persist will be replaced by onPassvate and onActivate). I just wanted to see how it works. If any more details are reqiured let me know. Thanks in advance http://www.nabble.com/file/p21009484/T5.zip T5.zip -- View this message in context: http://www.nabble.com/Layout-Border-component-problem-tp21004400p21009484.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 -- Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se -- View this message in context: http://www.nabble.com/Layout-Border-component-problem-tp21004400p21010909.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: How to initialize page members
Em Mon, 15 Dec 2008 06:47:18 -0300, Olle Hallin olle.hal...@gmail.com escreveu: Hi, Hi! Beginning with 5.0.17 is is forbidden to have initial values on page members, in order to prohibit state leakage between sessions. This is fine, since it prevents bugs that can be very tricky to isolate. You're right. This contradicts to the Tapestry principle *the simplest choice should be the correct choice.* I don't think so. You have to remember that Tapestry polls page instances, so, after one request, Tapestry must restart the page fields values. And that the value of a non-primitive field is a reference to an object, not an object itself. IMHO it should be ok to initialize the member in the declaration if it can be guaranteed that the value is immutable. IMHO, the best way to declare a field that is immutable is to make it final and static (i.e. constant) for it, not a private field. ;) -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5 page persistence design issues
Hi! This discussion was already made in this mailing list. There's a very nice archive at http://www.nabble.com/Tapestry---User-f340.html. Search for conversation scope (http://www.nabble.com/forum/Search.jtp?query=conversation+scopesort=datelocal=yforum=340) or Seam integration. Em Mon, 15 Dec 2008 09:28:45 -0300, kristjankelt kristjank...@hotmail.com escreveu: Hello, I must say first that I really like the design concept of the Tapestry 5. It's component oriented design and IoC supporting it are really promising. But could somebody please explain me the logic behind Tapestry 5 page persistence handling. I just do not get it. I think that I have a pretty common use case where there is a page with a list of items with links to the item detail page. Users usually open many different detail pages for further investigation (in a new tab or in a new window). A real world example of this is eBay, where you can open several action items to view detailed information. Let's imagine that the detail page has to hold it's state somehow. Now the situation gets really weird. As far as I understand (please tell me that I'm wrong), Tapestry 5 keeps only one copy of the persistent state per page and session, no mater how many instances of the same page are actually created by the user on the client side. Good example of this misbehavior is Tapestry 5 grid component. Put it on the page, create two instances of the page and use the column sorting feature and look what happens. You might say that you can use the client side persistence strategy, but there is another and bigger problem. The persistence strategy must be set on the field level and not on the page level. Honestly, please tell me one use case where this is needed? This design fault disables the possibility to change grid component persistence strategy to match the page strategy. I would like to suggest also some possible solutions for the further discussion. First, a default persistence strategy should be set on the page level (with the annotation). When not set, it will default to the session strategy (or to omething that is appropriate). Now, when there is really a need for a different strategy for one field, then and only then this should be set on the field level. The second thing would be a new persistence strategy, that will keep one state per one page instance. It is quite tricky to archive because an unique id should be generated and tracked per page instance. The hardest part is to make sure that every component will include this id with it's conversation with the server side. With best regards, Kristjan Kelt -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor Consultor, desenvolvedor e instrutor em Java http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: How to initialize page members
You're correct about static final. Didn't think of that [?]. But still I think there is room for improvement: Consider this use case that is quite clumsy to implement as it is today: public class APageThatContainsAGrid { @Persist private int rowsPerPage = 10; // forbidden! void onAction(int rows) { this.rowsPerPage = rows; } } and in the template a t:grid rowsPerPage=rowsPerPage .../ and a couple of action links for modifying rowsPerPage. Why is it prohibited to initialize rowsPerPage in the declaration? An int is definitely immutable. It's not even an object... Olle 2008/12/15 Thiago H. de Paula Figueiredo thiag...@gmail.com Em Mon, 15 Dec 2008 06:47:18 -0300, Olle Hallin olle.hal...@gmail.com escreveu: Hi, Hi! Beginning with 5.0.17 is is forbidden to have initial values on page members, in order to prohibit state leakage between sessions. This is fine, since it prevents bugs that can be very tricky to isolate. You're right. This contradicts to the Tapestry principle *the simplest choice should be the correct choice.* I don't think so. You have to remember that Tapestry polls page instances, so, after one request, Tapestry must restart the page fields values. And that the value of a non-primitive field is a reference to an object, not an object itself. IMHO it should be ok to initialize the member in the declaration if it can be guaranteed that the value is immutable. IMHO, the best way to declare a field that is immutable is to make it final and static (i.e. constant) for it, not a private field. ;) -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se
Re: Layout Border component problem
Hi Olle, I finally got home and was able to check out your suggestion. Works perfectly but I still have a small question: I also used onActivate() to paste your code and it works as well. So my question is: is it big difference between those methods and can both be used interchangeably or this was only coincidence Thanks again, I can finally continue on my work. cheers Olle Hallin wrote: What happens is that TeacherMode is mutable, and hence leaks state between different users. You are *not* given a fresh instance on each request. Instead, instances are pooled and reused. (Starting with 5.0.17, it is forbidden to have initial values on page member variables in order to prevent bugs like this.) One way to handle this situation is: *...@persist *private TeacherMode teacherMode; public void *setupRender()* { if (teacherMode == null) { teacherMode = new TeacherMode(); // This will be a private instance per session } } HTH, Olle 2008/12/15 kawes rafal.kawe...@gmail.com Hi Jonathan, thanks for your quick response. As you asked I uploaded classes I hit the problem in. Small description: One of my sub-application is Teacher (should be able to provide a word in foreign language and accept user's answer checks wheather it is correct) When user logs in, clicks teacher link is redirected to AvailabaleSets (which is wrapped by TeacherBorder). T5.zip file uploaded and it contains: - Border.java - Border.tml (pagelinks to all stuff provided by my app) - TeacherBorder.java - TeacherBorder.tml (contains all links to navigate my Teacher sub-application - i.e. TeacherMode - resposnible for 'asking question', registering results etc) - AvailableSets.java - AvailableSets.tml (displays available sets containg words) - TeacherModePage1.java - TeacherModePage1.tml (lets user to choose the word's set and decide about the questioning mode (mingled or the sequence of words had been added to the set) ) - TeacherModePage2.java - TeacherModePage2.tml (displays questions and lets to type in answers) TeacherModePage1.java contains the following line: private TeacherMode teacherMode = new TeacherMode(); I belived that when new page would be displayed (whe user clicks TeacherMode in TeacherBorder) a brand new TeacherMode instance would be returned but is not. And is not because all the classes are already instantiated and T5 gives them back to the user for efficiency. Please keep in mind this is just the beggining of the work, so not everything is like it should be from architectural point of view (i.e. @Persist will be replaced by onPassvate and onActivate). I just wanted to see how it works. If any more details are reqiured let me know. Thanks in advance http://www.nabble.com/file/p21009484/T5.zip T5.zip -- View this message in context: http://www.nabble.com/Layout-Border-component-problem-tp21004400p21009484.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 -- Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se -- View this message in context: http://www.nabble.com/Layout-Border-component-problem-tp21004400p21017812.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: Which annotation to be used in page class?
Oh,I make a mistake. I ignored the content which is used with injecting a Block when I read the javadoc. Thanks. From javadoc: Currently, this is used when injecting a {...@link Block}. Martijn Brinkers wrote: It seems that @Id an only be used for injecting a Block. From javadoc: Currently, this is used when injecting a {...@link Block}. Martijn On Sun, 2008-12-14 at 21:06 +0800, d0ng wrote: Hi, I want to inject a service in a page with service id,when I use @Inject @Id(serviceid) It seems that does not inject the service with serviceid. Instead of use @Inject @Servcie(serviceid) It works well. Does the @Id annotation can't be used in a page class? Thanks. - 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
[T5] Is is possible to add Delete and Cancel buttons to BeanEditForm Component?
Is it possible to add Delete and Cancel buttons to the t:beaneditform component? If so, how? Thanks, Matt -- View this message in context: http://www.nabble.com/-T5--Is-is-possible-to-add-Delete-and-Cancel-buttons-to-BeanEditForm-Component--tp21017894p21017894.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: [ANN] JumpStart 3.20.0 released - for T5.0.18
Hi, it's a nice starting point for building your own apps. I use it quite frequently as reference. I tried to downlaod and import it in my favourite IDE (Eclipse), but downloading the dependencies failed. It seems that some dependencies are searched local instead of downloaded (the JBOSS stuff). Andy Geoff Callender schrieb: Hi all, JumpStart 3.20.0 is now available. It's built on the Tapestry 5.0 Final Release - 5.0.18 - which was released a couple of days ago. You can use it live: http://jumpstart.doublenegative.com.au:8080/jumpstart/ or download it: http://jumpstart.doublenegative.com.au Keep the feedback and suggestions coming - it all helps! Cheers, Geoff - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Which annotation to be used in page class?
It seems that @Id an only be used for injecting a Block. From javadoc: Currently, this is used when injecting a {...@link Block}. Martijn On Sun, 2008-12-14 at 21:06 +0800, d0ng wrote: Hi, I want to inject a service in a page with service id,when I use @Inject @Id(serviceid) It seems that does not inject the service with serviceid. Instead of use @Inject @Servcie(serviceid) It works well. Does the @Id annotation can't be used in a page class? Thanks. - 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: [ANN] t5components 0.5.18 is now available for Tapestry 5.0.18
Thanks, Sven. This stuff is great. I just looked into chenillekit.org, but can't find org/chenillekit in the repo1.maven.org, nor can I find your release and snapshot repository. Could you let us know where that is, and possibly add that to the chenillekit.org docs? cheers, Christian. On 15-Dec-08, at 07:32 , Sven Homburg wrote: Hi there, t5components 0.5.18 is now available for Tapestry 5.0.18 with some fixes project page http://tapestry5-components.googlecode.com *Impotant Information* This release of t5components will be the last. This project has been discontinued, all development effort has been moved to chenillekit.org -- with regards Sven Homburg http://www.chenillekit.org http://tapestry5-components.googlecode.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Custom Errors on Bean Edit Form
Hi All, I have a fairly straight forward bean edit form on a page. Its a create new user form so, I want to check the user doesn't already exist and that the two password fields match. I do this validation in the onSubmit method but I am struggling to use the error reporting mechanism to inform the user. How do I get access to the form component to generate the proper error messages? Charlie M - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] Handle post from external application
I was talking about posting from another web application to a Tapestry page, but it really shouldn't matter where the post is coming from (i.e. Java application, Perl script, etc). My goal is to have a page that operates normally for Tapestry requests or REST URL requests from onActivate contexts, but also have the same page be able to respond to posts from other applications. Thiago, can the approach you propose coexist with an onActivate context for Tapestry requests or are they mutually exclusive? In what page method does getting the request parameters happen (e.g. onActivate?) ? Thanks! Massimo Lusetti wrote: On Mon, Dec 15, 2008 at 2:41 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Mon, 15 Dec 2008 03:17:19 -0300, thermus msch...@gmail.com escreveu: What is the proper way to handle a form post to a Tapestry page from an external application? I know how to encode the parameters in the URL and use the onActivate context, but in this case, the data being passed from the external application will exceed the URL length limit so I need to use post. Inject the Request and use it to get the parameter values, just like you would do without Tapestry. Tapestry adds a hidden field with some values you better not try to deal with them. :) We are talking about the client side which is a java app (for example) that has to post data to the T5 web app for taking advantage of great processing features provider by T5 you have to deal with the hidden formadata parameter. Please correct me if I'm wrong. -- Massimo http://meridio.blogspot.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- View this message in context: http://www.nabble.com/-T5--Handle-post-from-external-application-tp21008825p21018348.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
5.0.18 released -- vote it up at DZone!
Please visit: http://www.dzone.com/links/tapestry_50_final_release_5018.html and vote up this story ... we want to get T5 on the front page for a while! -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] Is is possible to add Delete and Cancel buttons to BeanEditForm Component?
You can use the BeanEditor component and wrap it with a form. At the bottom, you can add as many submit buttons as you want. I heard somewhere in this list that the beaneditform component is nothing more than this. On Mon, Dec 15, 2008 at 2:19 PM, mraible m...@raibledesigns.com wrote: Is it possible to add Delete and Cancel buttons to the t:beaneditform component? If so, how? Thanks, Matt -- View this message in context: http://www.nabble.com/-T5--Is-is-possible-to-add-Delete-and-Cancel-buttons-to-BeanEditForm-Component--tp21017894p21017894.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 -- Atenciosamente, Marcelo Lotif Programador Java e Tapestry FIEC - Federação das Indústrias do Estado do Ceará (85) 3421-5910
Re: [T5] Is is possible to add Delete and Cancel buttons to BeanEditForm Component?
You can also add parameters to the t:beaneditform. something like ... t:beaneditform ... add=cancel,delete t:parameter name=cancel input type=submit name=cancel value=Cancel /t:parameter t:parameter name=delete input type=submit name=delete value=Delete /t:parameter /t:beaneditform or t:beaneditform ... add=both t:parameter name=both t:pagelink page=cancelPageCancel/t:pagelink t:actionlink t:id=deleteDelete/t:actionlink /t:parameter /t:beaneditform Generally, you can put most anything you'd like within the t:parameter tags. -Luther Marcelo Lotif-2 wrote: You can use the BeanEditor component and wrap it with a form. At the bottom, you can add as many submit buttons as you want. I heard somewhere in this list that the beaneditform component is nothing more than this. On Mon, Dec 15, 2008 at 2:19 PM, mraible m...@raibledesigns.com wrote: Is it possible to add Delete and Cancel buttons to the t:beaneditform component? If so, how? Thanks, Matt -- View this message in context: http://www.nabble.com/-T5--Is-is-possible-to-add-Delete-and-Cancel-buttons-to-BeanEditForm-Component--tp21017894p21017894.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 -- Atenciosamente, Marcelo Lotif Programador Java e Tapestry FIEC - Federação das Indústrias do Estado do Ceará (85) 3421-5910 -- View this message in context: http://www.nabble.com/-T5--Is-is-possible-to-add-Delete-and-Cancel-buttons-to-BeanEditForm-Component--tp21017894p21019843.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: Layout Border component problem
Thanks a lot Jonathan, your pattern seems to be sensible and I'll follow your advice. cheers Jonathan Barker wrote: They are not quite interchangeable, but it can be fun figuring out which to use. In addition to onActivate and setupRender, you should also look at onPrepare for form submissions. I tend to just set id's in onActivate and leave heavier loading for onPrepare/setupRender. Having said that, I think that the tapestry-hibernate integration does primary key encoding to allow the use of entities for onActivate/onPassivate. Jonathan -Original Message- From: kawes [mailto:rafal.kawe...@gmail.com] Sent: Monday, December 15, 2008 12:14 To: users@tapestry.apache.org Subject: Re: Layout Border component problem Hi Olle, I finally got home and was able to check out your suggestion. Works perfectly but I still have a small question: I also used onActivate() to paste your code and it works as well. So my question is: is it big difference between those methods and can both be used interchangeably or this was only coincidence Thanks again, I can finally continue on my work. cheers Olle Hallin wrote: What happens is that TeacherMode is mutable, and hence leaks state between different users. You are *not* given a fresh instance on each request. Instead, instances are pooled and reused. (Starting with 5.0.17, it is forbidden to have initial values on page member variables in order to prevent bugs like this.) One way to handle this situation is: *...@persist *private TeacherMode teacherMode; public void *setupRender()* { if (teacherMode == null) { teacherMode = new TeacherMode(); // This will be a private instance per session } } HTH, Olle 2008/12/15 kawes rafal.kawe...@gmail.com Hi Jonathan, thanks for your quick response. As you asked I uploaded classes I hit the problem in. Small description: One of my sub-application is Teacher (should be able to provide a word in foreign language and accept user's answer checks wheather it is correct) When user logs in, clicks teacher link is redirected to AvailabaleSets (which is wrapped by TeacherBorder). T5.zip file uploaded and it contains: - Border.java - Border.tml (pagelinks to all stuff provided by my app) - TeacherBorder.java - TeacherBorder.tml (contains all links to navigate my Teacher sub-application - i.e. TeacherMode - resposnible for 'asking question', registering results etc) - AvailableSets.java - AvailableSets.tml (displays available sets containg words) - TeacherModePage1.java - TeacherModePage1.tml (lets user to choose the word's set and decide about the questioning mode (mingled or the sequence of words had been added to the set) ) - TeacherModePage2.java - TeacherModePage2.tml (displays questions and lets to type in answers) TeacherModePage1.java contains the following line: private TeacherMode teacherMode = new TeacherMode(); I belived that when new page would be displayed (whe user clicks TeacherMode in TeacherBorder) a brand new TeacherMode instance would be returned but is not. And is not because all the classes are already instantiated and T5 gives them back to the user for efficiency. Please keep in mind this is just the beggining of the work, so not everything is like it should be from architectural point of view (i.e. @Persist will be replaced by onPassvate and onActivate). I just wanted to see how it works. If any more details are reqiured let me know. Thanks in advance http://www.nabble.com/file/p21009484/T5.zip T5.zip -- View this message in context: http://www.nabble.com/Layout-Border-component-problem- tp21004400p21009484.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 -- Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se -- View this message in context: http://www.nabble.com/Layout-Border- component-problem-tp21004400p21017812.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 -- View this message in context: http://www.nabble.com/Layout-Border-component-problem-tp21004400p21020533.html Sent from the Tapestry - User mailing list archive at Nabble.com.
[T5 5.0.18] - How to 'turn on' dynamic validation
Hi Guys, I have a following piece of code in my *.tml file: t:form input type=text t:type=textfield t:value=toCreate.name t:validate=required/ input type=submit t:type=submit t:id=cancelButton value=Cancel/ input type=submit t:type=submit t:id=nextButton value=Next/ /t:form As you can see I added two submit buttons and a validation to a textfield. The problem is that I would like to 'turn on' this validation only when user clicks Next button. Currently when the textfield is empty and Cancel button is clicked the T5 says that field cannot be empty. Probably this is possible on server side only but maybe I am wrong. Thanks in advance kawes -- View this message in context: http://www.nabble.com/-T5-5.0.18How-to-%27turn-on%27-dynamic-validation-tp21020626p21020626.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: How to initialize page members
What is most important: consistency or ease of use? Olle 2008/12/15 Peter Stavrinides p.stavrini...@albourne.com Why is it prohibited to initialize rowsPerPage in the declaration? An int is definitely immutable. It's not even an object... True, but then the question arises will it become more confusing and appear inconsisant? Especially for new users still learning Tapestry, they may get confused as to why primitives can be initialized but not Objects? - Original Message - From: Olle Hallin olle.hal...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Monday, 15 December, 2008 3:32:00 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: T5: How to initialize page members You're correct about static final. Didn't think of that . But still I think there is room for improvement: Consider this use case that is quite clumsy to implement as it is today: public class APageThatContainsAGrid { @Persist private int rowsPerPage = 10; // forbidden! void onAction(int rows) { this.rowsPerPage = rows; } } and in the template a t:grid rowsPerPage=rowsPerPage .../ and a couple of action links for modifying rowsPerPage. Why is it prohibited to initialize rowsPerPage in the declaration? An int is definitely immutable. It's not even an object... Olle 2008/12/15 Thiago H. de Paula Figueiredo thiag...@gmail.com Em Mon, 15 Dec 2008 06:47:18 -0300, Olle Hallin olle.hal...@gmail.com escreveu: Hi, Hi! Beginning with 5.0.17 is is forbidden to have initial values on page members, in order to prohibit state leakage between sessions. This is fine, since it prevents bugs that can be very tricky to isolate. You're right. This contradicts to the Tapestry principle *the simplest choice should be the correct choice.* I don't think so. You have to remember that Tapestry polls page instances, so, after one request, Tapestry must restart the page fields values. And that the value of a non-primitive field is a reference to an object, not an object itself. IMHO it should be ok to initialize the member in the declaration if it can be guaranteed that the value is immutable. IMHO, the best way to declare a field that is immutable is to make it final and static (i.e. constant) for it, not a private field. ;) -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se
Re: Which annotation to be used in page class?
Gotta say, it's really confusing that @InjectService doesn't work with components, but @Inject @Service does. -james On Mon, Dec 15, 2008 at 3:20 AM, Martijn Brinkers martijn.l...@gmail.comwrote: It seems that @Id an only be used for injecting a Block. From javadoc: Currently, this is used when injecting a {...@link Block}. Martijn On Sun, 2008-12-14 at 21:06 +0800, d0ng wrote: Hi, I want to inject a service in a page with service id,when I use @Inject @Id(serviceid) It seems that does not inject the service with serviceid. Instead of use @Inject @Servcie(serviceid) It works well. Does the @Id annotation can't be used in a page class? Thanks. - 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 -- James A. Hillyerd ja...@hillyerd.com
Re: Custom Errors on Bean Edit Form
For example like this (very simplified): @Component private Form myForm; // links to t:form t:id=myForm @Component private PasswordField password1; // links to t:passwordfield t:id=password1 Object onSuccess() { if (passwords unequal) { myForm.recordError(password1, Passwords does not match); return null; } // else proceed with persisting the user } HTH Olle 2008/12/15 Charles Mason charlie@gmail.com Hi All, I have a fairly straight forward bean edit form on a page. Its a create new user form so, I want to check the user doesn't already exist and that the two password fields match. I do this validation in the onSubmit method but I am struggling to use the error reporting mechanism to inform the user. How do I get access to the form component to generate the proper error messages? Charlie M - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se
PageLinkTarget, where did it go?
I am in the process of updating our application from Tapestry version 5.0.15 to 5.0.18 and it looks like PageLinkTarget has disappeared. We have been following the Unit testing as outlined http://tapestry.apache.org/tapestry5/guide/unit-testing-pages.html which uses the PageLinkTarget when testing a page with a context. I looked around and can't find the class or any documentation on what its replacement is. Any help is greatly appreciated. Thanks, Mark - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
[T5] Can I specify more than one root package for tapestry.app-package?
I want to load pages from multiple root packages. Is it possible to have more than one root package specified for tapestry.app-package? I tried a comma separated value, but it doesn't seem to work. Thanks, Matt -- View this message in context: http://www.nabble.com/-T5--Can-I-specify-more-than-one-root-package-for-tapestry.app-package--tp21022904p21022904.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: How to initialize page members
Em Mon, 15 Dec 2008 16:59:39 -0300, Olle Hallin olle.hal...@gmail.com escreveu: What is most important: consistency or ease of use? Consistency leads to ease of use. :) -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Custom Errors on Bean Edit Form
Em Mon, 15 Dec 2008 17:10:43 -0300, Olle Hallin olle.hal...@gmail.com escreveu: For example like this (very simplified): @Component private Form myForm; // links to t:form t:id=myForm @Component private PasswordField password1; // links to t:passwordfield t:id=password1 Object onSuccess() { if (passwords unequal) { myForm.recordError(password1, Passwords does not match); return null; } // else proceed with persisting the user } The injection of the form and the field and the error message recording are correct, but your suggestion of using the onSuccess() method isn't correct Validation should be done at onValidateForm() (VALIDATE_FORM event), not at the onSuccess (SUCCESS event). The SUCCESS event is meant to be fired only if validation was ok. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] Can I specify more than one root package for tapestry.app-package?
Em Mon, 15 Dec 2008 18:54:40 -0300, mraible m...@raibledesigns.com escreveu: I want to load pages from multiple root packages. Is it possible to have more than one root package specified for tapestry.app-package? I tried a comma separated value, but it doesn't seem to work. No, you can't. But you can add more modules (each one with its pages, components, mixins and base packages). To build a module, follow this steps. The examples are taken from the Tapestry CRUD package (http://www.arsmachina.com.br/project/tapestrycrud) 1) Create a class and add this method to it. I'll call it TapestryCrudModule: public static void contributeComponentClassResolver(ConfigurationLibraryMapping configuration) { String prefix = crud; String rootPackage = br.com.arsmachina.tapestrycrud; configuration.add(new LibraryMapping(prefix, rootPackage)); } 2) Add it to your application through Tapestry IoC. There are two options, and you can use both if you want: 1. In your AppModule, add the @SubModule annotation: @SubModule({TapestryCrudModule.class, AnyOtherModuleClass.class}) public class AppModule { ... } 2. Package your classes inside a JAR file and add this line to the MANIFEST.MF file: Tapestry-Module-Classes: br.com.arsmachina.tapestrycrud.ioc.TapestryCrudModule This option has a very good advantage: you don't have to configure your module: it is loaded automatically by Tapestry-IoC. Just include the package JAR in the classpath and that's all. :) More information here (http://tapestry.apache.org/tapestry5/tapestry-ioc/module.html) and here (http://tapestry.apache.org/tapestry5/tapestry-ioc/autoload.html). -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] Handle post from external application
Em Mon, 15 Dec 2008 14:44:50 -0300, thermus msch...@gmail.com escreveu: Thiago, can the approach you propose coexist with an onActivate context for Tapestry requests or are they mutually exclusive? They're not mutually exclusive. They are just different ways to receive parameters. Which one to use is all about the URLs. Suppose the page that will receive the request is named process: www.example.com/process/parameter1/parameter2/parameter3: use onActivate www.example.com/process?parameter1=1parameter2=2: use Request.getParameter www.example.com/process/parameter1/parameter2?parameter3=3: use both! onActivate to get parameters 1 and 2 and Request.getParameter to get parameter 3. In what page method does getting the request parameters happen (e.g. onActivate?) ? You can use Request in any method. You use it like you would use HttpServletRequest. The difference is that your code depends only in Tapestry, not in the Servlet API. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: How to initialize page members
Em Mon, 15 Dec 2008 10:32:00 -0300, Olle Hallin olle.hal...@gmail.com escreveu: You're correct about static final. Didn't think of that [?]. Sometimes a good solution is so simple that we try the complex ones first. :P Why is it prohibited to initialize rowsPerPage in the declaration? An int is definitely immutable. It's not even an object... Tapestry polls pages. When it needs one instance, it would need to know if it is a never used one or a used one and initialize it accordingly. How would Tapestry know that, as primitives do not accept null values? AFAIK, the Tapestry philosphy is to have just one way to do things. Accepting initialization of primitive fiels and not acception other fields would not fit. ;) Nice discussion. :) -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [ANN] t5components 0.5.18 is now available for Tapestry 5.0.18
http://www.chenillekit.org/mvnrepo.html the latest snapshot compiled right now 2008/12/15 Christian Edward Gruber christianedwardgru...@gmail.com Thanks, Sven. This stuff is great. I just looked into chenillekit.org, but can't find org/chenillekit in the repo1.maven.org, nor can I find your release and snapshot repository. Could you let us know where that is, and possibly add that to the chenillekit.org docs? cheers, Christian. On 15-Dec-08, at 07:32 , Sven Homburg wrote: Hi there, t5components 0.5.18 is now available for Tapestry 5.0.18 with some fixes project page http://tapestry5-components.googlecode.com *Impotant Information* This release of t5components will be the last. This project has been discontinued, all development effort has been moved to chenillekit.org -- with regards Sven Homburg http://www.chenillekit.org http://tapestry5-components.googlecode.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- with regards Sven Homburg http://www.chenillekit.org http://tapestry5-components.googlecode.com
T5: a default notification page
Hi, Often I need to shutdown tomcat in order to do some maintenance work, is there a way to define a page in a T5 application so that all links to the application goes to that page? thanks. Angelo -- View this message in context: http://www.nabble.com/T5%3A-a-default-notification-page-tp21023653p21023653.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: How to initialize page members
Well, I'm not totally convinced. I think it's too kludgy to be forced to write a setupRender() and a test against null/0/false just to initialize a member. There must be a simpler way... Perhaps a field-level annotation? Olle 2008/12/16 Thiago H. de Paula Figueiredo thiag...@gmail.com Em Mon, 15 Dec 2008 10:32:00 -0300, Olle Hallin olle.hal...@gmail.com escreveu: You're correct about static final. Didn't think of that [?]. Sometimes a good solution is so simple that we try the complex ones first. :P Why is it prohibited to initialize rowsPerPage in the declaration? An int is definitely immutable. It's not even an object... Tapestry polls pages. When it needs one instance, it would need to know if it is a never used one or a used one and initialize it accordingly. How would Tapestry know that, as primitives do not accept null values? AFAIK, the Tapestry philosphy is to have just one way to do things. Accepting initialization of primitive fiels and not acception other fields would not fit. ;) Nice discussion. :) -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se
Re: T5: a default notification page
Em Mon, 15 Dec 2008 19:41:19 -0300, Angelo Chen angelochen...@yahoo.com.hk escreveu: Hi, Often I need to shutdown tomcat in order to do some maintenance work, is there a way to define a page in a T5 application so that all links to the application goes to that page? thanks. I haven't tested, but maybe you can decorate ComponentClassResolver.resolvePageNameToClassName() and ComponentClassResolver.resolvePageClassNameToPageName() to always return your application-out-of-order page. The AOP possibilities in Tapestry 5 are almost endless . . . Angelo -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor Consultor, desenvolvedor e instrutor em Java http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [ANN] t5components 0.5.18 is now available for Tapestry 5.0.18
Perfect... thanks. Missed it. christian. On 15-Dec-08, at 17:32 , Sven Homburg wrote: http://www.chenillekit.org/mvnrepo.html the latest snapshot compiled right now 2008/12/15 Christian Edward Gruber christianedwardgru...@gmail.com Thanks, Sven. This stuff is great. I just looked into chenillekit.org, but can't find org/chenillekit in the repo1.maven.org, nor can I find your release and snapshot repository. Could you let us know where that is, and possibly add that to the chenillekit.org docs? cheers, Christian. On 15-Dec-08, at 07:32 , Sven Homburg wrote: Hi there, t5components 0.5.18 is now available for Tapestry 5.0.18 with some fixes project page http://tapestry5-components.googlecode.com *Impotant Information* This release of t5components will be the last. This project has been discontinued, all development effort has been moved to chenillekit.org -- with regards Sven Homburg http://www.chenillekit.org http://tapestry5-components.googlecode.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- with regards Sven Homburg http://www.chenillekit.org http://tapestry5-components.googlecode.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: a default notification page
if you shutdown tomcat, tapestry app wont be running ;) If you have apache setup in front of tomcat, you can add redirect rules to a static html page see http://significantbits.wordpress.com/2007/03/15/setting-a-maintenance-page-in-apache-2/ or similar posts On Tue, Dec 16, 2008 at 1:50 AM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Mon, 15 Dec 2008 19:41:19 -0300, Angelo Chen angelochen...@yahoo.com.hk escreveu: Hi, Often I need to shutdown tomcat in order to do some maintenance work, is there a way to define a page in a T5 application so that all links to the application goes to that page? thanks. I haven't tested, but maybe you can decorate ComponentClassResolver.resolvePageNameToClassName() and ComponentClassResolver.resolvePageClassNameToPageName() to always return your application-out-of-order page. The AOP possibilities in Tapestry 5 are almost endless . . . Angelo -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor Consultor, desenvolvedor e instrutor em Java http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / JEE Consulting - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [ANN] t5components 0.5.18 is now available for Tapestry 5.0.18
I get a 404 right now for address: http://www.chenillekit.org/mvnrepo/release Andy Sven Homburg schrieb: http://www.chenillekit.org/mvnrepo.html the latest snapshot compiled right now 2008/12/15 Christian Edward Gruber christianedwardgru...@gmail.com Thanks, Sven. This stuff is great. I just looked into chenillekit.org, but can't find org/chenillekit in the repo1.maven.org, nor can I find your release and snapshot repository. Could you let us know where that is, and possibly add that to the chenillekit.org docs? cheers, Christian. On 15-Dec-08, at 07:32 , Sven Homburg wrote: Hi there, t5components 0.5.18 is now available for Tapestry 5.0.18 with some fixes project page http://tapestry5-components.googlecode.com *Impotant Information* This release of t5components will be the last. This project has been discontinued, all development effort has been moved to chenillekit.org -- with regards Sven Homburg http://www.chenillekit.org http://tapestry5-components.googlecode.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: How to initialize page members
I think it's too kludgy to be forced to write a setupRender() and a test against null/0/false just to initialize a member. Although I don't mind the method call to be honest, this is the one point I kinda agree with, the one thing that can be a bit annoying is having to 'think' about initialization, which is something I want to do and then forget about, having to test all the permutations of initialized values, and having to think about the effects of rendering, is a bit kludgy. - Original Message - From: Olle Hallin olle.hal...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 16 December, 2008 12:43:52 AM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: T5: How to initialize page members Well, I'm not totally convinced. I think it's too kludgy to be forced to write a setupRender() and a test against null/0/false just to initialize a member. There must be a simpler way... Perhaps a field-level annotation? Olle 2008/12/16 Thiago H. de Paula Figueiredo thiag...@gmail.com Em Mon, 15 Dec 2008 10:32:00 -0300, Olle Hallin olle.hal...@gmail.com escreveu: You're correct about static final. Didn't think of that [?]. Sometimes a good solution is so simple that we try the complex ones first. :P Why is it prohibited to initialize rowsPerPage in the declaration? An int is definitely immutable. It's not even an object... Tapestry polls pages. When it needs one instance, it would need to know if it is a never used one or a used one and initialize it accordingly. How would Tapestry know that, as primitives do not accept null values? AFAIK, the Tapestry philosphy is to have just one way to do things. Accepting initialization of primitive fiels and not acception other fields would not fit. ;) Nice discussion. :) -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [ANN] t5components 0.5.18 is now available for Tapestry 5.0.18
there are no released versions right now 2008/12/16 Andy Pahne andy.pa...@googlemail.com I get a 404 right now for address: http://www.chenillekit.org/mvnrepo/release Andy Sven Homburg schrieb: http://www.chenillekit.org/mvnrepo.html the latest snapshot compiled right now 2008/12/15 Christian Edward Gruber christianedwardgru...@gmail.com Thanks, Sven. This stuff is great. I just looked into chenillekit.org, but can't find org/chenillekit in the repo1.maven.org, nor can I find your release and snapshot repository. Could you let us know where that is, and possibly add that to the chenillekit.org docs? cheers, Christian. On 15-Dec-08, at 07:32 , Sven Homburg wrote: Hi there, t5components 0.5.18 is now available for Tapestry 5.0.18 with some fixes project page http://tapestry5-components.googlecode.com *Impotant Information* This release of t5components will be the last. This project has been discontinued, all development effort has been moved to chenillekit.org -- with regards Sven Homburg http://www.chenillekit.org http://tapestry5-components.googlecode.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 -- with regards Sven Homburg http://www.chenillekit.org http://tapestry5-components.googlecode.com
Re: T5: a default notification page
It is a major pain with Tomcat IMHO. As Andreas points out if you stop Tomcat nothing will run, if you run Apache in front then Apache uses the directive 'ErrorDocument' that allows you to override a '503 Service Unavailable' error displaying your custom page. If you don't run Apache in front and simply stop the application, Tomcat will show its standard 503 page which can *NOT be overridden without fiddling with Tomcats internals, as Tomcat uses embedded code to generate 503 pages on the fly, why it does it for 503 pages and not the other is a mystery. The one thing you could do though if your configuration allows, is override the 404 page in Tomcats root (not your application) and use undeploy instead of stop before doing your changes. cheers, Peter - Original Message - From: Andreas Andreou andre...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 16 December, 2008 2:16:21 AM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: T5: a default notification page if you shutdown tomcat, tapestry app wont be running ;) If you have apache setup in front of tomcat, you can add redirect rules to a static html page see http://significantbits.wordpress.com/2007/03/15/setting-a-maintenance-page-in-apache-2/ or similar posts On Tue, Dec 16, 2008 at 1:50 AM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Mon, 15 Dec 2008 19:41:19 -0300, Angelo Chen angelochen...@yahoo.com.hk escreveu: Hi, Often I need to shutdown tomcat in order to do some maintenance work, is there a way to define a page in a T5 application so that all links to the application goes to that page? thanks. I haven't tested, but maybe you can decorate ComponentClassResolver.resolvePageNameToClassName() and ComponentClassResolver.resolvePageClassNameToPageName() to always return your application-out-of-order page. The AOP possibilities in Tapestry 5 are almost endless . . . Angelo -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor Consultor, desenvolvedor e instrutor em Java http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / JEE Consulting - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: a default notification page
IMO it is recommended to do a cold start of Tomcat after *each* redeploy of webapps. Else you will sooner or later run into mysterious problems, caused by memory leaks and such. This will also verify that Tomcat is able to start after a power outage. (In development mode, this is of course not necessary.) So I'd advice you to put an Apache in front, and let it redirect to the static service page when you take Tomcat down. This will also give you freedom to do maintenance on Tomcat itself. Olle 2008/12/16 Peter Stavrinides p.stavrini...@albourne.com It is a major pain with Tomcat IMHO. As Andreas points out if you stop Tomcat nothing will run, if you run Apache in front then Apache uses the directive 'ErrorDocument' that allows you to override a '503 Service Unavailable' error displaying your custom page. If you don't run Apache in front and simply stop the application, Tomcat will show its standard 503 page which can *NOT be overridden without fiddling with Tomcats internals, as Tomcat uses embedded code to generate 503 pages on the fly, why it does it for 503 pages and not the other is a mystery. The one thing you could do though if your configuration allows, is override the 404 page in Tomcats root (not your application) and use undeploy instead of stop before doing your changes. cheers, Peter - Original Message - From: Andreas Andreou andre...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 16 December, 2008 2:16:21 AM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: T5: a default notification page if you shutdown tomcat, tapestry app wont be running ;) If you have apache setup in front of tomcat, you can add redirect rules to a static html page see http://significantbits.wordpress.com/2007/03/15/setting-a-maintenance-page-in-apache-2/ or similar posts On Tue, Dec 16, 2008 at 1:50 AM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Mon, 15 Dec 2008 19:41:19 -0300, Angelo Chen angelochen...@yahoo.com.hk escreveu: Hi, Often I need to shutdown tomcat in order to do some maintenance work, is there a way to define a page in a T5 application so that all links to the application goes to that page? thanks. I haven't tested, but maybe you can decorate ComponentClassResolver.resolvePageNameToClassName() and ComponentClassResolver.resolvePageClassNameToPageName() to always return your application-out-of-order page. The AOP possibilities in Tapestry 5 are almost endless . . . Angelo -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor Consultor, desenvolvedor e instrutor em Java http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / JEE Consulting - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se