RE: T5: Clicking on actionLonk with a zone parameter before page loads
Hi Peter, Thanks for that. To try it I guess I have to upgrade to 5.0.17 ? Cheers Russell -Original Message- From: Peter Stavrinides [mailto:[EMAIL PROTECTED] Sent: 08 December 2008 15:01 To: Tapestry users Subject: Re: T5: Clicking on actionLonk with a zone parameter before page loads Ironic that you are pointed to yahoo for a solution when the advice they advocated to the community is to load scripts after markup, all for the false hope of a performance increase, which is ultimately incorrect and is creating these types of problems... your markup (hence actionlinks etc) should never be allowed to render until the scripts have loaded and the DOM is available. See http://www.quirksmode.org/js/placejs.html at the bottom of the page: Quote: Placing scripts in the head makes sure that any functions are loaded before the buttons, links or other things that call them are loaded. If you put your scripts at the very end of a page, it is possible that a user already sees part of the page including a button with a JavaScript function call, while the rest of the page hasn't loaded yet. Result: user pushes button and gets JavaScript Error Message Alerts, because the browser can't find the script (yet). Unless there's a good reason to do otherwise, place your scripts in the head Fortunately this is now configurable in Tapestry. public static void contributeApplicationDefaults( MappedConfigurationString, String configuration) { configuration.add(SymbolConstants.SCRIPTS_AT_TOP, true); } And I bet your problem goes away. Peter -- If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Please visit http://www.albourne.com/email.html for important additional terms relating to this e-mail. - Original Message - From: Ben Gidley [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Saturday, 6 December, 2008 12:50:53 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: T5: Clicking on actionLonk with a zone parameter before page loads Russell, I you look at YUI's event model I belive it handles this better. YUI Event - http://developer.yahoo.com/yui/event/ will allow you define events before DOM Ready and queues them until after. This should be a good way to solve this problem. Ben On Fri, Dec 5, 2008 at 4:42 PM, Russell Brown [EMAIL PROTECTED]wrote: Is Ok. I read the results at https://issues.apache.org/jira/browse/TAP5-1. I guess we will have to roll our own. Can't have users clicking once and waiting and then going uh...did I click that... I think it is better if there is either some feedback or a way of trapping the event and replaying it when the page has loaded. Cheers Russell -Original Message- From: Russell Brown [mailto:[EMAIL PROTECTED] Sent: 05 December 2008 14:59 To: Tapestry users Subject: RE: T5: Clicking on actionLonk with a zone parameter before page loads Can you tell me what happens now? Is the link just dead until the page loads, is there some sort of feed back? Is It invisible? Just want to know as we were about to roll our own solution. Many thanks Russell -Original Message- From: Inge Solvoll [mailto:[EMAIL PROTECTED] Sent: 05 December 2008 14:52 To: Tapestry users Subject: Re: T5: Clicking on actionLonk with a zone parameter before page loads Last version of T5 has a fix for this. Works for me now. On Fri, Dec 5, 2008 at 3:50 PM, Russell Brown [EMAIL PROTECTED]wrote: Hi, I have some AJAX calls from actionLinks. If a user clicks on the actionLink before the page is fully loaded I get the exception A component event handler method returned the value [EMAIL PROTECTED] Return type org.apache.tapestry5.internal.structure.BlockImpl can not be handled. Configured return types are java.lang.Class, java.lang.String, java.net.URL, org.apache.tapestry5.Link, org.apache.tapestry5.StreamResponse, org.apache.tapestry5.runtime.Component. Is this something to do with javascript setting up the zones on load? Is there a work around or a planned fix for this? We use ajax calls all over the site and everyone can cause this kind of explosion if we have a fast clicker. Cheers Russell - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: Clicking on actionLonk with a zone parameter before page loads
Hi, I have some AJAX calls from actionLinks. If a user clicks on the actionLink before the page is fully loaded I get the exception A component event handler method returned the value [EMAIL PROTECTED] Return type org.apache.tapestry5.internal.structure.BlockImpl can not be handled. Configured return types are java.lang.Class, java.lang.String, java.net.URL, org.apache.tapestry5.Link, org.apache.tapestry5.StreamResponse, org.apache.tapestry5.runtime.Component. Is this something to do with javascript setting up the zones on load? Is there a work around or a planned fix for this? We use ajax calls all over the site and everyone can cause this kind of explosion if we have a fast clicker. Cheers Russell
RE: T5: Clicking on actionLonk with a zone parameter before page loads
Can you tell me what happens now? Is the link just dead until the page loads, is there some sort of feed back? Is It invisible? Just want to know as we were about to roll our own solution. Many thanks Russell -Original Message- From: Inge Solvoll [mailto:[EMAIL PROTECTED] Sent: 05 December 2008 14:52 To: Tapestry users Subject: Re: T5: Clicking on actionLonk with a zone parameter before page loads Last version of T5 has a fix for this. Works for me now. On Fri, Dec 5, 2008 at 3:50 PM, Russell Brown [EMAIL PROTECTED]wrote: Hi, I have some AJAX calls from actionLinks. If a user clicks on the actionLink before the page is fully loaded I get the exception A component event handler method returned the value [EMAIL PROTECTED] Return type org.apache.tapestry5.internal.structure.BlockImpl can not be handled. Configured return types are java.lang.Class, java.lang.String, java.net.URL, org.apache.tapestry5.Link, org.apache.tapestry5.StreamResponse, org.apache.tapestry5.runtime.Component. Is this something to do with javascript setting up the zones on load? Is there a work around or a planned fix for this? We use ajax calls all over the site and everyone can cause this kind of explosion if we have a fast clicker. Cheers Russell - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: T5: Clicking on actionLonk with a zone parameter before page loads
Is Ok. I read the results at https://issues.apache.org/jira/browse/TAP5-1. I guess we will have to roll our own. Can't have users clicking once and waiting and then going uh...did I click that... I think it is better if there is either some feedback or a way of trapping the event and replaying it when the page has loaded. Cheers Russell -Original Message- From: Russell Brown [mailto:[EMAIL PROTECTED] Sent: 05 December 2008 14:59 To: Tapestry users Subject: RE: T5: Clicking on actionLonk with a zone parameter before page loads Can you tell me what happens now? Is the link just dead until the page loads, is there some sort of feed back? Is It invisible? Just want to know as we were about to roll our own solution. Many thanks Russell -Original Message- From: Inge Solvoll [mailto:[EMAIL PROTECTED] Sent: 05 December 2008 14:52 To: Tapestry users Subject: Re: T5: Clicking on actionLonk with a zone parameter before page loads Last version of T5 has a fix for this. Works for me now. On Fri, Dec 5, 2008 at 3:50 PM, Russell Brown [EMAIL PROTECTED]wrote: Hi, I have some AJAX calls from actionLinks. If a user clicks on the actionLink before the page is fully loaded I get the exception A component event handler method returned the value [EMAIL PROTECTED] Return type org.apache.tapestry5.internal.structure.BlockImpl can not be handled. Configured return types are java.lang.Class, java.lang.String, java.net.URL, org.apache.tapestry5.Link, org.apache.tapestry5.StreamResponse, org.apache.tapestry5.runtime.Component. Is this something to do with javascript setting up the zones on load? Is there a work around or a planned fix for this? We use ajax calls all over the site and everyone can cause this kind of explosion if we have a fast clicker. Cheers Russell - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: T5 5.0.15 possible bug with forms with context on secure pages?
Still, this sounds like a potential problem, because the page will not have been activated, so it's hard to expect it to passivate itself. Does this mean I should raise a JIRA about this? More importantly shouldn't a form on a https page have https as the protocol in the action (that would solve the problem completely since there would be no need to redirect and therefore no need to create an onPassivate event to create a page render link)? I'm not sure what your response means: are you acknowledging a bug in the t:form component and the RequestSecurityManagerImpl and saying that 5.0.16 hides it a little so that there is no exception? Cheers Russell -Original Message- From: Howard Lewis Ship [mailto:[EMAIL PROTECTED] Sent: 18 November 2008 17:14 To: Tapestry users Subject: Re: T5 5.0.15 possible bug with forms with context on secure pages? 5.0.16 does not have the same problem with null/blank values and should handle this better. Still, this sounds like a potential problem, because the page will not have been activated, so it's hard to expect it to passivate itself. On Tue, Nov 18, 2008 at 8:20 AM, Russell Brown [EMAIL PROTECTED] wrote: Hi Again, Is this a bug or is it me? I have a page with the @Secure annotation. I put a t:form with a context on the tml for the page. Problem 1: The action url is http://myhost:myport/MyPage.MyForm/MyContext. Which leads to problem 2. The RequestSecurityManagerImpl method checkForInsecureRequest(String) creates a page render link using the page but then throws an exception java.lang.RuntimeException: Context values (which are added to the request URL) may not be null or blank. I guess this is because the onPassivate() method for the containing page is called and by now it's properties are null since we are in a new request... What is the correct way to get around this? Shouldn't the form just submit to https anyway since it is on an https page? And why does createPageRenderLink cause the exception to be thrown, do I have to mark ALL fields that are used in onPassivate as @Persist? And what happens to the forms context? Any answers to any of the above would be greatly appreciated. Cheers Russell -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5 5.0.16 @Paramerter and @Property on same field
Hi, With the change in 5.0.16 that means it fails fast if you have both @Property and getter and setter for a field we have removed quite a few @Property annotations as we realize some fields were silently ignoring the existing getters and setters (which sometimes have a tiny bit of logic in). The odd thing is that now we are getting an exception. Does @Parameter transform a field into a final field now? I don't see any reference to same in the release notes. The exception has at its root: Caused by: org.apache.tapestry5.ioc.internal.util.TapestryException: Binding LiteralBinding[cssClassName: slotCta] is read-only. at org.apache.tapestry5.internal.bindings.AbstractBinding.set(AbstractBindi ng.java:45) at org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.w riteParameter(InternalComponentResourcesImpl.java:329) I am was advising the team in general not to use @Property any more due to the nature of the gotchas but this would rather put a hole in that. I prefer handcoded getters and setters to simplify unit testing... Any ideas? Many thanks is advance Russell
T5 5.0.15 possible bug with forms with context on secure pages?
Hi Again, Is this a bug or is it me? I have a page with the @Secure annotation. I put a t:form with a context on the tml for the page. Problem 1: The action url is http://myhost:myport/MyPage.MyForm/MyContext. Which leads to problem 2. The RequestSecurityManagerImpl method checkForInsecureRequest(String) creates a page render link using the page but then throws an exception java.lang.RuntimeException: Context values (which are added to the request URL) may not be null or blank. I guess this is because the onPassivate() method for the containing page is called and by now it's properties are null since we are in a new request... What is the correct way to get around this? Shouldn't the form just submit to https anyway since it is on an https page? And why does createPageRenderLink cause the exception to be thrown, do I have to mark ALL fields that are used in onPassivate as @Persist? And what happens to the forms context? Any answers to any of the above would be greatly appreciated. Cheers Russell
RE: T5 document is wrong or the code is wrong or I am wrong and confused. (Return Link from action Link handler)
Hi, Yes Link from AJAX request. Like the docs say. Seems like a really good feature to cancel all the AJAXing and just redirect the browser. Doesn't work in 5.0.15. I will let you know Monday if it works in 5.0.16. I like moving target. Cheers Russell -Original Message- From: Geoff Callender [mailto:[EMAIL PROTECTED] Sent: Sat 11/15/2008 12:30 AM To: Tapestry users Subject: Re: T5 document is wrong or the code is wrong or I am wrong and confused. (Return Link from action Link handler) Perhaps I misunderstand your problem - are you trying to return a Link from an Ajax event handler? If Ajax is not involved then this might help: http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/navigation/returntypes1 On 15/11/2008, at 8:09 AM, Russell Brown wrote: I am having trouble understanding your answer: are you saying if I move to 5.0.16 the feature will work? Are you also saying that the documentation reflects 5.0.16 and not the stable release? Having read the release notes you link to I can't see a mention of this new feature. Righto...so I guess I can go to 5.0.16 and try again. Thanks and have a good weekend Russell -Original Message- From: Howard Lewis Ship [mailto:[EMAIL PROTECTED] Sent: Fri 11/14/2008 6:21 PM To: Tapestry users Subject: Re: T5 document is wrong or the code is wrong or I am wrong and confused. (Return Link from action Link handler) The docs on the website reflect the latest stable release except for when a new release is being voted, as is the case currently. The functionality you're having trouble with is part of 5.0.16. We are very good about every change being committed against a JIRA issue, so the release notes: http://tapestry.apache.org/tapestry5/release-notes.html Are a very good guide to figuring out what feature went in when. On Fri, Nov 14, 2008 at 8:42 AM, Nick Davies [EMAIL PROTECTED] wrote: Hi Howard, We're using 5.0.15 Thanks -Original Message- From: Howard Lewis Ship [mailto:[EMAIL PROTECTED] Sent: 14 November 2008 16:38 To: Tapestry users Subject: Re: T5 document is wrong or the code is wrong or I am wrong and confused. (Return Link from action Link handler) What version of Tapestry are you using? On Fri, Nov 14, 2008 at 8:07 AM, Russell Brown [EMAIL PROTECTED] wrote: Hi, So the documentation here http://tapestry.apache.org/tapestry5/guide/ajax.html says:- Event Handler Return Types In a traditional request, the return value of an event handler method is used to determine which page will render a complete response, and a redirect is sent to the client to render the new page (as a new request). With a Zone update, the return value is used to render a partial response within the same request. This return value should be an injected component or block. The value will be rendered, and that markup will be used on the client side to update the Zone's div. An event handler may return a Link http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/Link . html and the client will be redirected to that link. Returning a page name (as a String), or a page class, or a page instance will also send a redirect to the indicated page. But my method that returns a Link says throws this exception Caused by: java.lang.RuntimeException: A component event handler method returned the value http://localhost:8080/home/ Return type org.apache.tapestry5.internal.services.LinkImpl can not be handled. Configured return types are org.apache.tapestry5.StreamResponse, org.apache.tapestry5.json.JSONArray, org.apache.tapestry5.json.JSONObject, org.apache.tapestry5.runtime.Component, org.apache.tapestry5.runtime.RenderCommand. The documentation and the exception seem to be mutually exclusive, or is there a 3rd way I am missing? Any ideas appreciated as it has been a pretty unedifying afternoon of head against T5 brick walling. Cheers Russell -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail
T5 document is wrong or the code is wrong or I am wrong and confused. (Return Link from action Link handler)
Hi, So the documentation here http://tapestry.apache.org/tapestry5/guide/ajax.html says:- Event Handler Return Types In a traditional request, the return value of an event handler method is used to determine which page will render a complete response, and a redirect is sent to the client to render the new page (as a new request). With a Zone update, the return value is used to render a partial response within the same request. This return value should be an injected component or block. The value will be rendered, and that markup will be used on the client side to update the Zone's div. An event handler may return a Link http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/Link. html and the client will be redirected to that link. Returning a page name (as a String), or a page class, or a page instance will also send a redirect to the indicated page. But my method that returns a Link says throws this exception Caused by: java.lang.RuntimeException: A component event handler method returned the value http://localhost:8080/home/ Return type org.apache.tapestry5.internal.services.LinkImpl can not be handled. Configured return types are org.apache.tapestry5.StreamResponse, org.apache.tapestry5.json.JSONArray, org.apache.tapestry5.json.JSONObject, org.apache.tapestry5.runtime.Component, org.apache.tapestry5.runtime.RenderCommand. The documentation and the exception seem to be mutually exclusive, or is there a 3rd way I am missing? Any ideas appreciated as it has been a pretty unedifying afternoon of head against T5 brick walling. Cheers Russell
RE: T5 document is wrong or the code is wrong or I am wrong and confused. (Return Link from action Link handler)
I am having trouble understanding your answer: are you saying if I move to 5.0.16 the feature will work? Are you also saying that the documentation reflects 5.0.16 and not the stable release? Having read the release notes you link to I can't see a mention of this new feature. Righto...so I guess I can go to 5.0.16 and try again. Thanks and have a good weekend Russell -Original Message- From: Howard Lewis Ship [mailto:[EMAIL PROTECTED] Sent: Fri 11/14/2008 6:21 PM To: Tapestry users Subject: Re: T5 document is wrong or the code is wrong or I am wrong and confused. (Return Link from action Link handler) The docs on the website reflect the latest stable release except for when a new release is being voted, as is the case currently. The functionality you're having trouble with is part of 5.0.16. We are very good about every change being committed against a JIRA issue, so the release notes: http://tapestry.apache.org/tapestry5/release-notes.html Are a very good guide to figuring out what feature went in when. On Fri, Nov 14, 2008 at 8:42 AM, Nick Davies [EMAIL PROTECTED] wrote: Hi Howard, We're using 5.0.15 Thanks -Original Message- From: Howard Lewis Ship [mailto:[EMAIL PROTECTED] Sent: 14 November 2008 16:38 To: Tapestry users Subject: Re: T5 document is wrong or the code is wrong or I am wrong and confused. (Return Link from action Link handler) What version of Tapestry are you using? On Fri, Nov 14, 2008 at 8:07 AM, Russell Brown [EMAIL PROTECTED] wrote: Hi, So the documentation here http://tapestry.apache.org/tapestry5/guide/ajax.html says:- Event Handler Return Types In a traditional request, the return value of an event handler method is used to determine which page will render a complete response, and a redirect is sent to the client to render the new page (as a new request). With a Zone update, the return value is used to render a partial response within the same request. This return value should be an injected component or block. The value will be rendered, and that markup will be used on the client side to update the Zone's div. An event handler may return a Link http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/Link. html and the client will be redirected to that link. Returning a page name (as a String), or a page class, or a page instance will also send a redirect to the indicated page. But my method that returns a Link says throws this exception Caused by: java.lang.RuntimeException: A component event handler method returned the value http://localhost:8080/home/ Return type org.apache.tapestry5.internal.services.LinkImpl can not be handled. Configured return types are org.apache.tapestry5.StreamResponse, org.apache.tapestry5.json.JSONArray, org.apache.tapestry5.json.JSONObject, org.apache.tapestry5.runtime.Component, org.apache.tapestry5.runtime.RenderCommand. The documentation and the exception seem to be mutually exclusive, or is there a 3rd way I am missing? Any ideas appreciated as it has been a pretty unedifying afternoon of head against T5 brick walling. Cheers Russell -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: component gets access to Page Context
Hi, If I have a component in a page and I want to get to the pages context is the ONLY way to have the page pass the pertinent context information to the context as a parameter? What if there component is nested further down the tree? Will a context info I need to be passed through parent components? Even if it is irrelevant to them, or is there some direct way of accessing the containing page's activation context (without injecting the request and hacking it out of there)? Cheers Russell
RE: Persist issue with Paging
Why not use an activation context on the page to persist your parameters between requests? -Original Message- From: tapestry5 [mailto:[EMAIL PROTECTED] Sent: 28 October 2008 13:47 To: users@tapestry.apache.org Subject: Re: Persist issue with Paging Is there any other way to pass parameter without making the field @Persist. Howard Lewis Ship wrote: It can be innefficient, but setting the page's default persistent strategy to client will do the job. The Grid component will pick up this default. The persistent field data will end up in the URL. On Mon, Oct 27, 2008 at 12:39 PM, tapestry5 [EMAIL PROTECTED] wrote: I am working on 5.0.13 version of Tapestry. I have a page with list of employees using t:grid. I have a paging feature in that. Now there are 2 fields which i want to send as a parameter. I can insert @Persist annotation on those fields but i don't want any session to be maintained, as i have clustered server. So the session will not help me. Is there any other way to pass parameter in paging with making the field @Persist. Thanks, -- View this message in context: http://www.nabble.com/Persist-issue-with-Paging-tp20194836p20194836.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Persist-issue-with-Paging-tp20194836p20207516.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Persist issue with Paging
Ooops. Excuse me. My bad. Should have read a bit more closely. As you were. Russell -Original Message- From: Howard Lewis Ship [mailto:[EMAIL PROTECTED] Sent: 28 October 2008 16:22 To: Tapestry users Subject: Re: Persist issue with Paging I believe the problem is the use of the Grid, which uses @Persist fields to track the paging and sort status. On Tue, Oct 28, 2008 at 7:01 AM, Russell Brown [EMAIL PROTECTED] wrote: Why not use an activation context on the page to persist your parameters between requests? -Original Message- From: tapestry5 [mailto:[EMAIL PROTECTED] Sent: 28 October 2008 13:47 To: users@tapestry.apache.org Subject: Re: Persist issue with Paging Is there any other way to pass parameter without making the field @Persist. Howard Lewis Ship wrote: It can be innefficient, but setting the page's default persistent strategy to client will do the job. The Grid component will pick up this default. The persistent field data will end up in the URL. On Mon, Oct 27, 2008 at 12:39 PM, tapestry5 [EMAIL PROTECTED] wrote: I am working on 5.0.13 version of Tapestry. I have a page with list of employees using t:grid. I have a paging feature in that. Now there are 2 fields which i want to send as a parameter. I can insert @Persist annotation on those fields but i don't want any session to be maintained, as i have clustered server. So the session will not help me. Is there any other way to pass parameter in paging with making the field @Persist. Thanks, -- View this message in context: http://www.nabble.com/Persist-issue-with-Paging-tp20194836p20194836.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Persist-issue-with-Paging-tp20194836p20207516.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Deep linking to tapestry pages from jps. Conversion
Hi Borut, We are migrating a Struts app at the moment so if you have any specific questions about stuff then fire away as we _may_ have solved one or two problems that you might face already. Such a guide would be a good idea: it is ideal to start a nice new app with a nice new framework but in the real world most people are working on legacy applications and migration is the normal use case. If T5 wants any real penetration then thinking about migrating users from Struts to T5 is a must. Although it is essentially a marketing problem and most developers struggle with marketing. Cheers Russell -Original Message- From: Borut Bolčina [mailto:[EMAIL PROTECTED] Sent: 24 October 2008 21:04 To: Tapestry users Subject: Re: Deep linking to tapestry pages from jps. Conversion Hi, it would be great if there was also a JSP transition guide. We have a large JSP application at the moment and my intention is to replace it gradually with Tapestry 5. Any advice on how to do it *the right way* would be more than welcome! Regards, Borut 2008/10/24 Howard Lewis Ship [EMAIL PROTECTED] For deep linking purposes, could you pass the information as normal query parameters? You could then @Inject the Request object to retrieve those values. You can also use the ContextValueEncoder service to decode them to appropriate types. This work would be done in the page's activate event handler method. This is a more servlet-style of development, which may be the right approach for a transitional application. On Thu, Oct 23, 2008 at 8:33 AM, Ian Petzer [EMAIL PROTECTED] wrote: Hi, We are busy converting our Struts/Tiles based application to Tapestry. Until this is complete I have am required to generate links to the new Tapestry pages correctly from the jsp pages. Normally this isn't a problem as I used the url pattern of: HOST/PAGE/PARAM1/PARAM2/PARAM3 Now, please consider the situation where my params have following values: PARAM1 = Hello PARAM2 = relative/url PARAM3 = colon:seperated So if I follow my previous url pattern i would get HOST/PAGE/Hello/relative/url/colon:seperated This of course doesn't work as that url is interpreted as having four params: [Hello, relative, url, colon:seperated] instead of the three that I define. When I use a pageLink object on Tapestry pages this isn't a problem as param2 is double url encoded, so that relative/url -- relative%252Furl However the colon in param3 isn't double url encoded. I would really appreciate it if someone could indicate the rules which are used when forming these urls or if someone could suggest an approach to generate these urls. Possibly a reverse @Inject of the relevant Tapestry object into my Spring service where I could call a method to convert the context values. Thanks, Ian -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: class used as value in t:loop must implement serializable?
Hi, Does the class for the value param of t:loop have to implement serializable? I am using t:loop over a collection of instances of our Link type and I get this exception: UX 2008-10-21 10:39:45,509 [ERROR] u.c.v.s.u.p.Catchup Render queue error in BeginRender[Catchup:epgwrapper.epgview.loop]: Error serializing component action for component Catchup:epgwrapper.epgview.loop: uk.co.vodco.sherbet.discovery.vo.Link ip=127.0.0.1 org.apache.tapestry5.ioc.internal.util.TapestryException: Error serializing component action for component Catchup:epgwrapper.epgview.loop: uk.co.vodco.sherbet.discovery.vo.Link at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke( ComponentPageElementImpl.java:922) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$ 300(ComponentPageElementImpl.java:50) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl$11.rend er(ComponentPageElementImpl.java:351) However if I make uk.co.vodco.sherbet.discovery.vo.Link serializable then the component renders. So is it a requirement that a collection hold serializable class instances to render? Further to this, after making the Link class implement serializable I attempted to pass a property of it to a component within the t:loop body (t:my.own.component value=link.property/ ) the class of the object returned by Link.getProperty() does not implement serializable and the same exception is thrown. So further to the above question: Must any class whose instances are to be passed as component properties implement serializable too? Or am I leaping to conclusions? Does the exception indicate something else? Cheers Russell
RE: T5: class used as value in t:loop must implement serializable?
Answered my own question: further up the stack is a t:form component. This component has found itself nested in a t:form component so in this instance then the answer would seem to be yes. Thing is, right, unless you *know* for a fact your component won't be nested in a t:form somewhere down the line you must make sure that your component nests a t:loop that everything within the loop is serializable? Is that right? Cheers Russell -Original Message- From: Russell Brown [mailto:[EMAIL PROTECTED] Sent: 21 October 2008 11:09 To: Tapestry users Subject: T5: class used as value in t:loop must implement serializable? Hi, Does the class for the value param of t:loop have to implement serializable? I am using t:loop over a collection of instances of our Link type and I get this exception: UX 2008-10-21 10:39:45,509 [ERROR] u.c.v.s.u.p.Catchup Render queue error in BeginRender[Catchup:epgwrapper.epgview.loop]: Error serializing component action for component Catchup:epgwrapper.epgview.loop: uk.co.vodco.sherbet.discovery.vo.Link ip=127.0.0.1 org.apache.tapestry5.ioc.internal.util.TapestryException: Error serializing component action for component Catchup:epgwrapper.epgview.loop: uk.co.vodco.sherbet.discovery.vo.Link at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke( ComponentPageElementImpl.java:922) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$ 300(ComponentPageElementImpl.java:50) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl$11.rend er(ComponentPageElementImpl.java:351) However if I make uk.co.vodco.sherbet.discovery.vo.Link serializable then the component renders. So is it a requirement that a collection hold serializable class instances to render? Further to this, after making the Link class implement serializable I attempted to pass a property of it to a component within the t:loop body (t:my.own.component value=link.property/ ) the class of the object returned by Link.getProperty() does not implement serializable and the same exception is thrown. So further to the above question: Must any class whose instances are to be passed as component properties implement serializable too? Or am I leaping to conclusions? Does the exception indicate something else? Cheers Russell - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: tapestry 5 without sessions
One thing to notice is that a form component has a validation tracker and that is persisted in session behind the scenes. To avoid this we provide a new validation tracker to every form like this: Tml:- t:form tracker=validationTracker t:id=mySessionlessForm t:blah/ /t:form Class: - /** * This is essentially a hack to stop the session from being created. HLS told us to return a new * [EMAIL PROTECTED] ValidationTrackerImpl} per request * * @return */ public ValidationTracker getValidationTracker() { return new ValidationTrackerImpl(); } public void setValidationTracker(ValidationTracker validationTracker) { // NO OP } That is the one tip I can offer apart from don't use persist, use onActivate and onPassivate (as other poster said). If you do come across any other scalability gotchas please post them. I will do likewise if we discover any as we move forward with our development. Cheers Russell -Original Message- From: Jack Nuzbit [mailto:[EMAIL PROTECTED] Sent: 16 October 2008 15:32 To: Tapestry users Subject: tapestry 5 without sessions I'm about to start a large project and intend to use tapestry 5 but want to avoid using sessions due to scalability. The only issue I can see is losing form data when the validation fails because of the redirect after the post. I've noticed the property tapestry.suppress-redirect-from-action-requests but in general I prefer this behaviour so I'd rather not use this if there is an alternative. Plus the documentation says 'This option should be used with care' which makes me nervous about using it at all. The only time I don't want a redirect occurring is when validation fails and form data needs to be presented back to the user without being persisted. Is there a way to do this because being forced to use session just for this reason doesn't seem worthwhile. I'm wondering what other peoples thoughts and approaches were to this problem. Has anyone used tapestry5 without sessions? Cheers, Jack - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: Access Page context from sub component
Hi, When I have an action link in a sub component I notice that the query string ?t:ac=some/context/stuff/from/the/page is appended to the link target. I'd like to manipulate that very context in my component and so far I have been passing its elements down through a nest of components. Is there a way to access it programmatically without directly injecting the request and grabbing it from there? Cheers Russell
RE: T5: equivelent of c:set ?
Thanks. I have already. The docs say Allows a render variable of the component to be read or updated. Updated how, when? What is a render variable? A variable in a template without a corresponding property? But I want to SET a property of my component from the template... As far as I can see it is only of use in a loop in which case it is set at the start of the iteration. How about iteration idioms that involve setting a value at the end of the iteration to be used by the next iteration? It is fairly common to see and trivial in struts, jsps, spring mvc etc, etc. Is there a way to do this in T5? Cheers Russell -Original Message- From: Kristian Marinkovic [mailto:[EMAIL PROTECTED] Sent: 06 October 2008 11:57 To: Tapestry users Subject: Re: T5: equivelent of c:set ? hi Russell, take a look at the var: binding http://tapestry.apache.org/tapestry5/guide/parameters.html g, kris Russell Brown [EMAIL PROTECTED] 06.10.2008 12:07 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema T5: equivelent of c:set ? Hi, If I want to set some property from within the component template is that possible in Tapestry 5? Something like the c:set tag is JSP jstl? Or do you just write a set component and have it as a property of the containing component? Cheers Russell - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: equivelent of c:set ?
Hi, If I want to set some property from within the component template is that possible in Tapestry 5? Something like the c:set tag is JSP jstl? Or do you just write a set component and have it as a property of the containing component? Cheers Russell
RE: T5: equivelent of c:set ?
Ok...an example In jsp c:forEach items=${someList} var=myItem varStatus=counter c:if test=${!empty someVar} somemarkup attr=$someVar}/ /c:if someothermarkup/ c:set var=someVar value=${myItem.myProperty}/ /c:forEach So in the above example I have a variable available called someVar that is set to the value of the previous myItem's myProperty value. But with T5 and the var binding I get THIS iterations value. The SCOPE of the VAR binding is not wide enough for me. So is there an equivalent in Tapestry or do I have to create a component and call it like this t:loop source=someList value=myItem index=counter t:if test=someVar somemarkup attr=${someVar.value}/ /t:if someothermarkup/ t:mypackage.set value=${myItem.myProperty} t:id=someVar/ /t:loop And then have code like @Component(id=someVar) Private MySetComponentType someVar; And the MySetComponentType is just Public class MySetComponentType { @Parameter @Property Private String value; } But there just has to be a better way. Right? Cheers for taking the time Russell -Original Message- From: Kristian Marinkovic [mailto:[EMAIL PROTECTED] Sent: 06 October 2008 14:22 To: Tapestry users Subject: Re: T5: equivelent of c:set ? if you use the var: prefix in your template you do not need a corresponding property in your page/component. and you can use this variable in your template multiple times (as in the loop example). tapestry will generate a property on the fly during rendering for this variable. if you declare your components purley in your template you can also pass in the parameters it accepts as well. and it should work with var: variables as well. eg. ul li t:type=loop source=1..10 value=var:index t:actionlink context=${var:index}link/t:actionlink /li /ul AFAIK you cannot access the value of the var: variables in your pages or components. hope this helps... maybe you can post an example... as posted by thiago g, kris Thiago H. de Paula Figueiredo [EMAIL PROTECTED] 06.10.2008 15:10 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: T5: equivelent of c:set ? Em Mon, 06 Oct 2008 09:01:48 -0300, Russell Brown [EMAIL PROTECTED] escreveu: As far as I can see it is only of use in a loop in which case it is set at the start of the iteration. How about iteration idioms that involve setting a value at the end of the iteration to be used by the next iteration? It is fairly common to see and trivial in struts, jsps, spring mvc etc, etc. You can do that in Tapestry, but you just do it in a different way. Remember that the page class properties are always available to the template. Please post a JSP example of what you're trying to accomplish so we'll can help you better. ;) -- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: T5: equivelent of c:set ?
I get it. Thanks. -Original Message- From: Thiago H. de Paula Figueiredo [mailto:[EMAIL PROTECTED] Sent: 06 October 2008 15:28 To: Tapestry users Subject: Re: T5: equivelent of c:set ? Em Mon, 06 Oct 2008 11:01:34 -0300, Russell Brown [EMAIL PROTECTED] escreveu: In jsp c:forEach items=${someList} var=myItem varStatus=counter c:if test=${!empty someVar} somemarkup attr=$someVar}/ /c:if someothermarkup/ c:set var=someVar value=${myItem.myProperty}/ /c:forEach You don't need to create a component from that, just stop thinking JSP when coding Tapestry. :) In Tapestry, all the logic is implemented in pages classes, with no logic in templates. And this is a very good thing, as the logic is easily tested when implemented in classes. ;) Not tested, but hopefully it will give you an idea on how to do that: YourClass.java: private ItemType item; @Property /* so we don't need to provide the getter and setter, as they don't have any logic */ private ItemType lastItem; public ItemType getItem() { return item; } public void ItemType setItem(ItemType item) { lastItem = this.item; this.item = item; } public List getList() { return ...; // list to be iterated } public boolean isNotEmpty() { return lastItem != null; // or any other logic } YourTemplate.tml: t:loop source=list value=item t:if test=notEmpty somemarkup attr=${lastItem.myProperty}/ /t:if someothermarkup/ /t:loop If you don't get it, tell us. :) -- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [T5] loading tapestry configuration from properties file?
+1 for having it I the framework since virtually *everyone* seems to end up writing one or wanting one. Cheers Russell -Original Message- From: Borut Bolčina [mailto:[EMAIL PROTECTED] Sent: 03 October 2008 11:59 To: Tapestry users Subject: Re: [T5] loading tapestry configuration from properties file? Hi, will this PropertiesFileSymbolProvider make into the framework? Cheers, Borut 2008/9/18 Ulrich Stärk [EMAIL PROTECTED] Here you go: http://wiki.apache.org/tapestry/Tapestry5HowToReadSymbolsFromPropertiesFile Cheers, Uli Peter Stavrinides schrieb: Thats great thanks for sharing! - Original Message - From: Ulrich Stärk [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Thursday, 18 September, 2008 11:44:30 AM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: [T5] loading tapestry configuration from properties file? I wrote a SymbolProvider that reads a properties file either from classpath or a filesystem location. I'm going to write a wiki howto about it today. Uli Neeme Praks schrieb: Hi, I know Tapestry5 really pushes the convention-over-configuration approach, but lets face it - in every non-trivial application you eventually need to configure stuff. If not directly tapestry-related properties, then at least your application. By default, Tapestry seems to suggest that everybody should start using web.xml for all such configuration purposes. At least that's the impression that I get when looking at http://tapestry.apache.org/tapestry5/guide/conf.html. However, I don't particularly like the overly-verbose web.xml style of configuring plain-simple properties - I'd rather use (the much more concise) properties file syntax for that. Is it possible to tell to Tapestry: please load all properties from WEB-INF/myapp.properties? If not, can someone give some pointers on how to implement it? (it would also be a welcome out-of-the-box addition to Tapestry5) Rgds, Neeme - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: t:select how to disable and re-enable
Hi, I am using a T5 select component. When the form renders I wish the select to be disabled so I use disabled=true parameter. However, some javascript causes the field to become enabled. If this happens however the value selected does not get sent into the property of the component. I am assuming this is thanks to the feature decribed here http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Select.html thussly : If true, then the field will render out with a disabled attribute (to turn off client-side behavior). Further, a disabled field ignores any value in the request when the form is submitted. So how to set the select value to disabled initially but not make it stay that way for ever? Thanks in advance for your ideas, I have resorted to adding a little javascript that sets it so on load but that is a bit of hack for some fairly simple functionality. Any reason WHY Further, a disabled field ignores any value in the request when the form is submitted. this seems to offer zero advantage and loads of problems Cheers Russell - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: T5: t:select how to disable and re-enable
Maybe it's possible that you disable your select only clientside? If you do so there won't be any problems if you later on enable it again. . Andy Thanks Andy: like I said Thanks in advance for your ideas, I have resorted to adding a little javascript that sets it so on load but that is a bit of hack for some fairly simple functionality. Seems like the only way. Boo. So I have to use the RenderSupport and get the client Id using the tapestry tricks and inject the component and write a fair bit of code just to side step a pretty bizarre and unexplained feature. Sure, it is possible and it works. But the question still standswhy? Russell Russell Brown schrieb: Hi, I am using a T5 select component. When the form renders I wish the select to be disabled so I use disabled=true parameter. However, some javascript causes the field to become enabled. If this happens however the value selected does not get sent into the property of the component. I am assuming this is thanks to the feature decribed here http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Select.html thussly : If true, then the field will render out with a disabled attribute (to turn off client-side behavior). Further, a disabled field ignores any value in the request when the form is submitted. So how to set the select value to disabled initially but not make it stay that way for ever? Thanks in advance for your ideas, I have resorted to adding a little javascript that sets it so on load but that is a bit of hack for some fairly simple functionality. Any reason WHY Further, a disabled field ignores any value in the request when the form is submitted. this seems to offer zero advantage and loads of problems Cheers Russell - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: T5: t:select how to disable and re-enable
Thanks guys, Like I said in the initial post: I am doing this on the client side, because I have to. Doing it on the clientside involves jumping through some hoops. Namely, inject the component to get its id and then add some javascript to the page using RenderSupport. No problem. It iss done... but I am just wondering aloud on the list why I need to jump through the hoops. Why tapestry 5 has this feature that costs me a lot to circumvent and benefits me very little? I'd just like to know in what cases there is a benefit to this behavior so that I don't feel like I am being made to suffer (just like I used to in struts) Cheers Russell -Original Message- From: Kristian Marinkovic [mailto:[EMAIL PROTECTED] Sent: Tue 9/30/2008 2:55 PM To: Tapestry users Subject: Re: T5: t:select how to disable and re-enable it is not enough to enable the select box only on the client site. because if you render a select component with disabled=true tapestry wont even register the necessary event handler to process the submission. in tapestry 5 words: no ProcessSubmission component event will be serialized into the form thus no values will be processed. :) (see Select-AbstractField component source code) i see two possibilities: as mentiond by andy do everything on the client side or do a ajax request (zone) updatind the select component with disabled=false. g, kris Andy Pahne [EMAIL PROTECTED] 30.09.2008 15:45 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: T5: t:select how to disable and re-enable Maybe it's possible that you disable your select only clientside? If you do so there won't be any problems if you later on enable it again. Andy Russell Brown schrieb: Hi, I am using a T5 select component. When the form renders I wish the select to be disabled so I use disabled=true parameter. However, some javascript causes the field to become enabled. If this happens however the value selected does not get sent into the property of the component. I am assuming this is thanks to the feature decribed here http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Select.html thussly : If true, then the field will render out with a disabled attribute (to turn off client-side behavior). Further, a disabled field ignores any value in the request when the form is submitted. So how to set the select value to disabled initially but not make it stay that way for ever? Thanks in advance for your ideas, I have resorted to adding a little javascript that sets it so on load but that is a bit of hack for some fairly simple functionality. Any reason WHY Further, a disabled field ignores any value in the request when the form is submitted. this seems to offer zero advantage and loads of problems Cheers Russell - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: T5: 5.0.14 Bizarre ClassNotFoundException
Thanks. I think that is the second time you have told me. I'll remember this time, I'm sure. Cheers Russell -Original Message- From: Ben Gidley [mailto:[EMAIL PROTECTED] Sent: Fri 9/26/2008 8:03 AM To: Tapestry users Subject: Re: T5: 5.0.14 Bizarre ClassNotFoundException Russell, Are you using a main class to start your app? If so you need the line // Remove slf4j from list of classes not exposed to webapp webapp.setServerClasses(new String[] {-org.mortbay.jetty.plus.jaas., org.mortbay.jetty.}); In your class - see http://wiki.apache.org/tapestry/Tapestry5RunViaMain. The reason is Jetty thinks slf4j is a 'server' class and in line with the J2EE specification is stops it 'leaking' into web application classloaders. This line tells it to let it through. THis only effects T5 pages/components when you are using the runViaMain method. It won't effect your non T5 classes as they are loaded in the system classloader. Whereas the enhanced T5 pages/components load in the web class loader. Thanks Ben On Thu, Sep 25, 2008 at 5:05 PM, Russell Brown [EMAIL PROTECTED] wrote: Hi Toby, Thanks for that. I have suspicion I have a maven nightmare on my hands. I have used maven's exlusion to exclude SLF4j from being included by Tapestry as we want to control the version. I can see that the Pages and Components use a different class loader, I guess they have to for all that run time transformation that is going on but they _should_ be able to load classes that their parents can in my humble opinion. I've just had a double, triple check and there is only one SLF4j jar on the classpath, the one I intended to have there. The one that my Struts actions can access. I'll keep digging for now. Thanks for the help, it does confirm that my main problem is probably maven/dependancy based but exacerbated by Tapestry's class loading. Cheers Russell -Original Message- From: Toby Hobson [mailto:[EMAIL PROTECTED] Sent: Thu 9/25/2008 5:00 PM To: Tapestry users Subject: Re: T5: 5.0.14 Bizarre ClassNotFoundException Hi Russel, Just a thought but it might be worth checking your classpath. T5 will pull SLF4 into the classpath anyway so you could have included it twice. Because T5 uses a separate classloader for Pages and Components it may be getting confused. I've run into similar problems before. Cheers Toby 2008/9/25 Russell Brown [EMAIL PROTECTED] Hi, Not sure if this is totally a T5 issue but I am just seeing if anyone has seen this. I have a page that uses the Form component but when I call the page I get a ClassNotFoundException for org.slf4j.Logger. Now I know that the class is on the classpath as I have Struts app running in the same container and Calling Class.forName(org.slf4j.Logger, true, this.getClass().getClassLoader()) in a struts action yields a class but the toClass method in org.apache.tapestry5.internal.services.InternalClassTransformationImpl throws a ClassNotFoundException. If I change the code in that class to use the parent of the parent class loader then the class is found. Any ideas? Is this a bug, is there some way to make Tapestry's class loader aware of the Class? Cheers Russell - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: 5.0.14 Bizarre ClassNotFoundException
Hi, Not sure if this is totally a T5 issue but I am just seeing if anyone has seen this. I have a page that uses the Form component but when I call the page I get a ClassNotFoundException for org.slf4j.Logger. Now I know that the class is on the classpath as I have Struts app running in the same container and Calling Class.forName(org.slf4j.Logger, true, this.getClass().getClassLoader()) in a struts action yields a class but the toClass method in org.apache.tapestry5.internal.services.InternalClassTransformationImpl throws a ClassNotFoundException. If I change the code in that class to use the parent of the parent class loader then the class is found. Any ideas? Is this a bug, is there some way to make Tapestry's class loader aware of the Class? Cheers Russell - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: T5: 5.0.14 Bizarre ClassNotFoundException
Hi Toby, Thanks for that. I have suspicion I have a maven nightmare on my hands. I have used maven's exlusion to exclude SLF4j from being included by Tapestry as we want to control the version. I can see that the Pages and Components use a different class loader, I guess they have to for all that run time transformation that is going on but they _should_ be able to load classes that their parents can in my humble opinion. I've just had a double, triple check and there is only one SLF4j jar on the classpath, the one I intended to have there. The one that my Struts actions can access. I'll keep digging for now. Thanks for the help, it does confirm that my main problem is probably maven/dependancy based but exacerbated by Tapestry's class loading. Cheers Russell -Original Message- From: Toby Hobson [mailto:[EMAIL PROTECTED] Sent: Thu 9/25/2008 5:00 PM To: Tapestry users Subject: Re: T5: 5.0.14 Bizarre ClassNotFoundException Hi Russel, Just a thought but it might be worth checking your classpath. T5 will pull SLF4 into the classpath anyway so you could have included it twice. Because T5 uses a separate classloader for Pages and Components it may be getting confused. I've run into similar problems before. Cheers Toby 2008/9/25 Russell Brown [EMAIL PROTECTED] Hi, Not sure if this is totally a T5 issue but I am just seeing if anyone has seen this. I have a page that uses the Form component but when I call the page I get a ClassNotFoundException for org.slf4j.Logger. Now I know that the class is on the classpath as I have Struts app running in the same container and Calling Class.forName(org.slf4j.Logger, true, this.getClass().getClassLoader()) in a struts action yields a class but the toClass method in org.apache.tapestry5.internal.services.InternalClassTransformationImpl throws a ClassNotFoundException. If I change the code in that class to use the parent of the parent class loader then the class is found. Any ideas? Is this a bug, is there some way to make Tapestry's class loader aware of the Class? Cheers Russell - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [T5] loading tapestry configuration from properties file?
You can write a Property File based symbol provider implementation (or that is what I did). Mine just takes an array of strings (which are properties files on the class path) and loads them into a map. Then your imp los SymbolProvider.valueForSymbol(String) is just yourSymbolMap.get(String). To keep it all Tapestry 5esque I call .toLowerCase() on all my keys before I put them in the map and toLowerCase() on the symbol I am looking up. Cheers Russell -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Neeme Praks Sent: 18 September 2008 08:47 To: users@tapestry.apache.org Subject: [T5] loading tapestry configuration from properties file? Hi, I know Tapestry5 really pushes the convention-over-configuration approach, but lets face it - in every non-trivial application you eventually need to configure stuff. If not directly tapestry-related properties, then at least your application. By default, Tapestry seems to suggest that everybody should start using web.xml for all such configuration purposes. At least that's the impression that I get when looking at http://tapestry.apache.org/tapestry5/guide/conf.html. However, I don't particularly like the overly-verbose web.xml style of configuring plain-simple properties - I'd rather use (the much more concise) properties file syntax for that. Is it possible to tell to Tapestry: please load all properties from WEB-INF/myapp.properties? If not, can someone give some pointers on how to implement it? (it would also be a welcome out-of-the-box addition to Tapestry5) Rgds, Neeme - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: [T5] loading tapestry configuration from properties file?
I still think you need to T5-alize it and make it case insensitive. And why oh why oh why bury your exceptions and just log them? Why not let them bubble up so that they are thrown? Otherwise you will just get a symbol exception which is hard to figure out later on? Cheers Russell -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Neeme Praks Sent: 18 September 2008 14:08 To: users@tapestry.apache.org Subject: Re: [T5] loading tapestry configuration from properties file? Nice, thanks for that one. I would suggest to add that PropertiesFileSymbolProvider class also to main Tapestry5 distribution. And I took the liberty to refactor the symbol provider implementation in wiki to be more generic: it now accepts also URL and InputStream as possible places to load the properties. Rgds, Neeme PS. Sorry about the curly braces style in the refactored class - my eclipse autoformatted it to my coding style and I was too lazy to change it back Ulrich Stärk wrote: Here you go: http://wiki.apache.org/tapestry/Tapestry5HowToReadSymbolsFromPropertiesFile Cheers, Uli - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [T5] loading tapestry configuration from properties file?
What 'it'? You mean symbol names? Well the 'it' was the class, or moreover the approach but that does result in specifically the symbol names in this instance, so: Yes that it, or they. Because That's the Way I Like It! :-) Seriously, I struggled with myself about this and decided that in my case it's better to have the application start up and fail later IF a missing symbol is requested. Fair enough then. I did it differently (since I'd like to know at start up if my app is miss-configured), I guess the solution needs to fit the requirements. Cheers Russell -Original Message- From: Ulrich Stärk [mailto:[EMAIL PROTECTED] Sent: 18 September 2008 16:15 To: Tapestry users Subject: Re: [T5] loading tapestry configuration from properties file? Russell Brown schrieb: I still think you need to T5-alize it and make it case insensitive. What 'it'? You mean symbol names? And why oh why oh why bury your exceptions and just log them? Why not let them bubble up so that they are thrown? Otherwise you will just get a symbol exception which is hard to figure out later on? Because That's the Way I Like It! :-) Seriously, I struggled with myself about this and decided that in my case it's better to have the application start up and fail later IF a missing symbol is requested. Uli - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: T5: testing using PageTester and EasyMock
Hi Alex, Testing pages as POJOs is quite simple. You can roll your own very, very, very simple service injector and inject EasyMock services into the pojo. I have done it using reflection. So I have a class that takes the page instance being tested in the constructor (and the test class too) and for each field annotated with @Inject it creates a strict mock and sets the field to that value. It also adds the mock to an internal List if mocks. Then the class provides convenience replay, reset, verify methods that iterate over the whole list. The test class also has fields that use a custom annotation (@Mock) these are injected with the same values as those added to the page under test. So you end up with a test class with populated mocks, a page class with populated services and a helper class with the same mocks held in an iterable fashion for convenience. Russell -Original Message- From: Alex Kotchnev [mailto:[EMAIL PROTECTED] Sent: 16 September 2008 17:39 To: Tapestry users Subject: Re: T5: testing using PageTester and EasyMock I was grappling with this issue myself, I still don't have a good answer to it. Because T5 is so heavily annotation driven (with the IoC and the framework doing a lot of the magic heavy lifting behind the scenes), testing the pages as POJOs (e.g. setting some properties, performing an action, inspecting the state of the page) is not immediately obvious. I've looked through some of the T5 unit tests (w/ EasyMock), and often times a page has a special (e.g. package private) method to inject services that otherwise the framework would inject. So, for example, if the page used to have an : @Inject FooService fooService @Inject BarService barService Then, the page class would usually have a package private method like this : void setServices(FooService fs, BarService bs) { this.fooService = fs; this.barService = bs; } Anyway, there certainly is room for improvement, most advanced web framework have a way of testing pages/components as Pojos. Although the solution above works OK (and if you think about it, it's still pojos), it certainly isn't the first thing to think of once you get used to having Tapestry injecting a bunch of things into your pages. From a conceptual point of view, when you're *unit *testing a page, you really DON'T want to have the real services injected, and you'd probably just want to have mocks/stubs/fakes in their place that return the data needed to unit test the page. Now, if you were doing more of an integration type of test (e.g. where you test how the page works with the *real* service), then it's a different ball game, you do need the real services injected (for which you can still use the above approach and not depend on the IoC to do it for you). I guess the alternative would be to have a test context for binding test/mock instances of the dependent services and somehow ask T5 to inject them into the page being tested. But then, it wouldn't really be unit testing as the tests would depend on a whole bunch of things other than the unit being tested. Let's keep this discussion rolling, we certainly need a little more info on testing in T5. Cheers, Alex Kotchnev On Tue, Sep 16, 2008 at 10:32 AM, SergeEby [EMAIL PROTECTED] wrote: Hi, I had a similar question a few weeks ago and didn't get any response. Can someone else chime in? It would be nice to have real world example in the documentation to showcase TDD features of T5. /Serge Russell Brown-6 wrote: One more related question would be this: in the docs at http://tapestry.apache.org/tapestry5/guide/unit-testing-pages.html you tell the PageTester class the name of your filter so it can load your module. But how can you tell the PageTester to use the Spring filter not the plain tapestry filter? All my services are Spring services so as soon as I try and run a test I get a load of errors about no service realizing interface XXX (which is the type of a field annotated with @Inject). Any ideas on this one either? I'm having quite a hard time testing anything beyond the most rudimentary. I notice that tap core and tap ioc have themselves very high test coverage indeed. Cheers Russell -Original Message- From: Russell Brown [mailto:[EMAIL PROTECTED] Sent: 15 September 2008 17:09 To: Tapestry users Subject: T5: testing using PageTester and EasyMock Hi, Does anyone have any ideas for testing components using mock services? I can create a MyAppMockModule class and use that to configure the page tester. This class builds mocks of my services, so far so good. I use PageTester.getRegistry() and then Registry.getService(MyService.class) and then I have my mock to set up in my test. No? No! I have a proxy wrapped instance instead which I can't use at all. Any ideas out there? How are you testing your components pages when you have expense to construct services with complex external
RE: T5: testing using PageTester and EasyMock
Hi Peter, How have you done this? When I try to use Tapestry to Build my EasyMock services the resultant proxies are rejected by EasyMock as not being EasyMock proxies... Cheers Russell -Original Message- From: Peter Stavrinides [mailto:[EMAIL PROTECTED] Sent: 17 September 2008 11:47 To: Tapestry users Subject: Re: T5: testing using PageTester and EasyMock Hi all, I haven't got around to using PageTester yet, but I started using Easymock for my IoC services recently... Its quite amazing how you can create a full blown IoC service with all dependencies satisfied so easily, it just works since service proxies are all interfaces in Tapestry. - Original Message - From: Angelo Chen [EMAIL PROTECTED] To: users@tapestry.apache.org Sent: Wednesday, 17 September, 2008 1:16:57 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: T5: testing using PageTester and EasyMock Hi, This will be a very interesting topic, I'd like to see how TDD can be used in the development of T5 pages, my experience with T5 page tester isn't so successful, now I try to do everything in the services as it is a easy place to test. angelo akochnev wrote: Let's keep this discussion rolling, we certainly need a little more info on testing in T5. -- View this message in context: http://www.nabble.com/T5%3A-testing-using-PageTester-and-EasyMock-tp19496126p19529056.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: T5: testing using PageTester and EasyMock
Hi Peter, Thanks for that. That is just normal EasyMock testing isn't it? I don't see where tapestry comes into that at all? You are creating the instances of all the classes and you are creating the instance of the class under test aren't you? Where is the PageTester and Tapestry IoC and all that (or have you missed some code, or am I missing something?) What I meant was this:- In the src/main/java tree I have MyAppModule which has some services like Binder.bind(MyService.class, MyExpensiveExternalImpl.class) But in my src/test/java tree I have @SubModule( { MyAppModule.class }) MyAppTestModule public static MyService buildMyService () { return EasyMock.createMock(MyService.class); } (In the actual App the MyService Impl will be provided by Spring but that is by the by) So that when I use PageTester in my tests I can go MyService myMockService = pageTester.getRegistry().getService(MyService.class); EasyMock.expect(myMockService.expensiveExternalMethodCallToCreditCardGatewayIdontReallyWantToTest(myCardNumber)).andReturn(authCode); But the problem is...the registry returns a Proxy that contains a JustInTimeObjectCreator so EasyMock won't have no truck with my mock service. Boo. Cheers Russell -Original Message- From: Peter Stavrinides [mailto:[EMAIL PROTECTED] Sent: 17 September 2008 14:08 To: Tapestry users Subject: Re: T5: testing using PageTester and EasyMock Sorry about that hit the send by accident, here is the rest of it: @BeforeClass public static void setup() { // tapestry interfaces _mockAsm = createMock(ApplicationStateManager.class); _mockContext = createMock(Context.class); _mockResponse = createMock(Response.class); _mockRequest = createMock(Request.class); // an interface of my own _mockSiteError = createMock(ISiteError.class); _transport = new SMTPTransport(mailrelay,25); } /** * Test the properties for the service are set correctly and that the * service can be constructed */ @Test public final void testConstruction() { expect(_mockContext.getInitParameter(DevelopmentMode)).andReturn( false); expect(_mockContext.getInitParameter(MailServer)).andReturn( mailrelay); replay(_mockContext); // now see if we can construct an instance of the class under test _mockSiteErrorImpl = new SiteErrorImpl(_mockAsm, _mockContext, _mockResponse, _mockRequest); // run the verify verify(_mockContext); } - Original Message - From: Russell Brown [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Wednesday, 17 September, 2008 2:00:12 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: RE: T5: testing using PageTester and EasyMock Hi Peter, How have you done this? When I try to use Tapestry to Build my EasyMock services the resultant proxies are rejected by EasyMock as not being EasyMock proxies... Cheers Russell -Original Message- From: Peter Stavrinides [mailto:[EMAIL PROTECTED] Sent: 17 September 2008 11:47 To: Tapestry users Subject: Re: T5: testing using PageTester and EasyMock Hi all, I haven't got around to using PageTester yet, but I started using Easymock for my IoC services recently... Its quite amazing how you can create a full blown IoC service with all dependencies satisfied so easily, it just works since service proxies are all interfaces in Tapestry. - Original Message - From: Angelo Chen [EMAIL PROTECTED] To: users@tapestry.apache.org Sent: Wednesday, 17 September, 2008 1:16:57 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: T5: testing using PageTester and EasyMock Hi, This will be a very interesting topic, I'd like to see how TDD can be used in the development of T5 pages, my experience with T5 page tester isn't so successful, now I try to do everything in the services as it is a easy place to test. angelo akochnev wrote: Let's keep this discussion rolling, we certainly need a little more info on testing in T5. -- View this message in context: http://www.nabble.com/T5%3A-testing-using-PageTester-and-EasyMock-tp19496126p19529056.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail
RE: T5: testing using PageTester and EasyMock
Alex, Yeah. I think that the approach you outline may well work but is unworkable (if you know what I mean). I hold out for some way of stripping the proxy from my mock service (using reflection to fire the Object Creators create method and using the un proxied mock). The problem with training the mock in the test case is that you don't get the mock from the registry, you get a proxy wrapped mock. Cheers Russell -Original Message- From: Alex Kotchnev [mailto:[EMAIL PROTECTED] Sent: 17 September 2008 15:27 To: Tapestry users Subject: Re: T5: testing using PageTester and EasyMock Russell, this is just speculation, as I haven't tried this on my own, but it seems to me that you'll have to do the EasyMock setup training inside your test module, e.g. : @SubModule( { MyAppModule.class }) MyAppTestModule public static MyService buildMyService () { MyService myMockService = EasyMock.createMock(MyService.class); EasyMock.expect(myMockService. expensiveExternalMethodCallToCreditCardGatewayIdontReallyWantToTest(myCa rdNumber)).andReturn(authCode); } Unfortunately, with an approach like this, you'd have to have different buildMyService method for each test case for which you need to train the Mock... I'm not sure how that would work, maybe you can have your MyAppTestModule use something from the test case that will train the myMockService based on the individual testcase expectations. Keep us posted on how this works. Cheers, Alex Kotchnev On Wed, Sep 17, 2008 at 10:16 AM, Russell Brown [EMAIL PROTECTED]wrote: Hi Peter, Thanks for that. That is just normal EasyMock testing isn't it? I don't see where tapestry comes into that at all? You are creating the instances of all the classes and you are creating the instance of the class under test aren't you? Where is the PageTester and Tapestry IoC and all that (or have you missed some code, or am I missing something?) What I meant was this:- In the src/main/java tree I have MyAppModule which has some services like Binder.bind(MyService.class, MyExpensiveExternalImpl.class) But in my src/test/java tree I have @SubModule( { MyAppModule.class }) MyAppTestModule public static MyService buildMyService () { return EasyMock.createMock(MyService.class); } (In the actual App the MyService Impl will be provided by Spring but that is by the by) So that when I use PageTester in my tests I can go MyService myMockService = pageTester.getRegistry().getService(MyService.class); EasyMock.expect(myMockService.expensiveExternalMethodCallToCreditCardGat ewayIdontReallyWantToTest(myCardNumber)).andReturn(authCode); But the problem is...the registry returns a Proxy that contains a JustInTimeObjectCreator so EasyMock won't have no truck with my mock service. Boo. Cheers Russell -Original Message- From: Peter Stavrinides [mailto:[EMAIL PROTECTED] Sent: 17 September 2008 14:08 To: Tapestry users Subject: Re: T5: testing using PageTester and EasyMock Sorry about that hit the send by accident, here is the rest of it: @BeforeClass public static void setup() { // tapestry interfaces _mockAsm = createMock(ApplicationStateManager.class); _mockContext = createMock(Context.class); _mockResponse = createMock(Response.class); _mockRequest = createMock(Request.class); // an interface of my own _mockSiteError = createMock(ISiteError.class); _transport = new SMTPTransport(mailrelay,25); } /** * Test the properties for the service are set correctly and that the * service can be constructed */ @Test public final void testConstruction() { expect(_mockContext.getInitParameter(DevelopmentMode)).andReturn( false); expect(_mockContext.getInitParameter(MailServer)).andReturn( mailrelay); replay(_mockContext); // now see if we can construct an instance of the class under test _mockSiteErrorImpl = new SiteErrorImpl(_mockAsm, _mockContext, _mockResponse, _mockRequest); // run the verify verify(_mockContext); } - Original Message - From: Russell Brown [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Wednesday, 17 September, 2008 2:00:12 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: RE: T5: testing using PageTester and EasyMock Hi Peter, How have you done this? When I try to use Tapestry to Build my EasyMock services the resultant proxies are rejected by EasyMock as not being EasyMock proxies... Cheers Russell -Original Message- From: Peter Stavrinides [mailto:[EMAIL PROTECTED] Sent: 17 September 2008 11:47 To: Tapestry
RE: T5: testing using PageTester and EasyMock
Right. I done it. I'll write a wiki post about it this evening. In short, only services with an interface are wrapped in the ObjectCreator proxy. I just use reflection to grab the ObjectCreator field from the proxy and fire its create method and use the resultant service. Sweet Russell -Original Message- From: Russell Brown [mailto:[EMAIL PROTECTED] Sent: 17 September 2008 16:09 To: Tapestry users Subject: RE: T5: testing using PageTester and EasyMock Alex, Yeah. I think that the approach you outline may well work but is unworkable (if you know what I mean). I hold out for some way of stripping the proxy from my mock service (using reflection to fire the Object Creators create method and using the un proxied mock). The problem with training the mock in the test case is that you don't get the mock from the registry, you get a proxy wrapped mock. Cheers Russell -Original Message- From: Alex Kotchnev [mailto:[EMAIL PROTECTED] Sent: 17 September 2008 15:27 To: Tapestry users Subject: Re: T5: testing using PageTester and EasyMock Russell, this is just speculation, as I haven't tried this on my own, but it seems to me that you'll have to do the EasyMock setup training inside your test module, e.g. : @SubModule( { MyAppModule.class }) MyAppTestModule public static MyService buildMyService () { MyService myMockService = EasyMock.createMock(MyService.class); EasyMock.expect(myMockService. expensiveExternalMethodCallToCreditCardGatewayIdontReallyWantToTest(myCa rdNumber)).andReturn(authCode); } Unfortunately, with an approach like this, you'd have to have different buildMyService method for each test case for which you need to train the Mock... I'm not sure how that would work, maybe you can have your MyAppTestModule use something from the test case that will train the myMockService based on the individual testcase expectations. Keep us posted on how this works. Cheers, Alex Kotchnev On Wed, Sep 17, 2008 at 10:16 AM, Russell Brown [EMAIL PROTECTED]wrote: Hi Peter, Thanks for that. That is just normal EasyMock testing isn't it? I don't see where tapestry comes into that at all? You are creating the instances of all the classes and you are creating the instance of the class under test aren't you? Where is the PageTester and Tapestry IoC and all that (or have you missed some code, or am I missing something?) What I meant was this:- In the src/main/java tree I have MyAppModule which has some services like Binder.bind(MyService.class, MyExpensiveExternalImpl.class) But in my src/test/java tree I have @SubModule( { MyAppModule.class }) MyAppTestModule public static MyService buildMyService () { return EasyMock.createMock(MyService.class); } (In the actual App the MyService Impl will be provided by Spring but that is by the by) So that when I use PageTester in my tests I can go MyService myMockService = pageTester.getRegistry().getService(MyService.class); EasyMock.expect(myMockService.expensiveExternalMethodCallToCreditCardGat ewayIdontReallyWantToTest(myCardNumber)).andReturn(authCode); But the problem is...the registry returns a Proxy that contains a JustInTimeObjectCreator so EasyMock won't have no truck with my mock service. Boo. Cheers Russell -Original Message- From: Peter Stavrinides [mailto:[EMAIL PROTECTED] Sent: 17 September 2008 14:08 To: Tapestry users Subject: Re: T5: testing using PageTester and EasyMock Sorry about that hit the send by accident, here is the rest of it: @BeforeClass public static void setup() { // tapestry interfaces _mockAsm = createMock(ApplicationStateManager.class); _mockContext = createMock(Context.class); _mockResponse = createMock(Response.class); _mockRequest = createMock(Request.class); // an interface of my own _mockSiteError = createMock(ISiteError.class); _transport = new SMTPTransport(mailrelay,25); } /** * Test the properties for the service are set correctly and that the * service can be constructed */ @Test public final void testConstruction() { expect(_mockContext.getInitParameter(DevelopmentMode)).andReturn( false); expect(_mockContext.getInitParameter(MailServer)).andReturn( mailrelay); replay(_mockContext); // now see if we can construct an instance of the class under test _mockSiteErrorImpl = new SiteErrorImpl(_mockAsm, _mockContext, _mockResponse, _mockRequest); // run the verify verify(_mockContext); } - Original Message - From: Russell Brown [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org
WAS RE: T5: ApplicationStateObject is misleading NOW T5: Tapestry 5 and Spring WebFlow
Hi Kristian, From your post I inferred that you have integrated Spring Web Flow and Tapestry 5 in some way. I was just about to start this. Are you using tapestry 5 pages as the views but still using Spring WebFlow FormActions for the actions? Did you have to write a custom View Resolver? Did you have to write some code (like the FlowAction in Spring WebFlow) to integrate launching and ending a flow from a Tapestry request? I'd be very interesting in seeing any code that you might be willing to share. Many thanks in advance Russell -Original Message- From: Kristian Marinkovic [mailto:[EMAIL PROTECTED] Sent: 16 September 2008 14:19 To: Tapestry users Subject: Re: T5: ApplicationStateObject is misleading hi lubor, IMHO, there is a much simpler and more elegant solution: in order to save my data in a conversation state object i wrote a decorator for the PersistentFieldManager intercepting every @Persist annotation if a conversaion is active. And you can define an own persistence strategy @Persist(conversation) as well :) I'm no native speaker but ApplicationStateObject is quite fine for me... it means to me, that there is one object somewhere (instance) that is the same in the whole application. g, kris Lubor Gajda [EMAIL PROTECTED] 16.09.2008 14:40 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: T5: ApplicationStateObject is misleading Hi Geoff, I absolutely agree with you that concept of ASO objects and persistent properties is one of few downsides of current Tapestry implementation. I came across this type of problems recently when I was experimenting with Tapestry Spring Web Flow integration. One of the issues that I had to solve was to find simple solution how from tapestry pages access objects stored in different webflow scopes. To achieve this goal I couldn't use neither persistent properties nor ASO. Persisted properties can't be shared between different pages in the same flow and ASO objects require additional configuration if you want to use non default persistence strategy (to complicated solution). Therefore I was forced to develop my own solution which is based on my custom ScopeWorker that allows page properties to be annotated by my custom @Scope annotation: public class MyPage { @Scope(SESSION) private User user; @Scope(FLOW) private Facility facility; ... } @Scope annotation can be used with different scope types (APPLICATION, SESSION, CONVERSATION, FLOW, FLASH, PAGE, REQUEST, etc.) to access objects stored in these scopes (when object is not found in the scope it's automatically created). I think that it would be good idea to find (in some future Tapestry release) simple generic solution for scoping page properties that would replace currently used ASO and Persist strategies (these could be marked as obsolete and kept for backward compatibility reasons). Regards Lubor On Tue, Sep 16, 2008 at 12:49 PM, Inge Solvoll [EMAIL PROTECTED]wrote: I agree, I've always found the term ApplicationState to be a bit confusing. Some more ideas: @UserState @SessionState @SessionPersist @SaveItForLater (kidding) On Tue, Sep 16, 2008 at 1:06 PM, Geoff Callender [EMAIL PROTECTED] wrote: We want Tapestry to be as natural as possible for newcomers, so it's important to have terminology that is not misleading. Right now might be the last chance to tidy some of these up before T5.0 goes final. One term that I believe many people find misleading is ApplicationState. The problem is that it implies it will make an object available across the whole application, ie. application-scoped; which is not its purpose. The doco says that ASOs are unique to an individual user, not shared between users, which is not quite right, either. The standard usage is to tie an object's scope to that of a web session, so maybe we should put session in the name? Eg. @SessionScoped @SessionShared @ShareAcrossSession It is important to understand that the term session here is NOT a reference to the persistence mechanism, but a reference to the scope. Alternatively, let's keep it really obvious with this: @StateObject with the understanding that the default persistence strategy is session. What do others think? Are you happy with ApplicationState? Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: pageLink and a context
Do you not just need to use literal: prefix on your string? Otherwise Tapestry assumes it is a property. So how about... t:pageLink page=item/project context=literal:addAdd a project/t:pageLink Just a guess from reading http://tapestry.apache.org/tapestry5/guide/parameters.html CTRL-F Binding Expressions Cheers Russell -Original Message- From: Luther Baker [mailto:[EMAIL PROTECTED] Sent: 09 September 2008 05:41 To: Tapestry users Subject: Re: pageLink and a context Sorry, lets try that again: If I supply a number as the context: t:pageLink page=item/project context=*2*Pick a project .../t:pageLink All is well and the url looks like ... /issues/item/project/1 But if I supply text - the application breaks. t:pageLink page=item/project context=*add*Add a project .../t:pageLink | Exception: . Home does not contain a property named 'one' Home is the name of the page this link code on. Is context required to be a number? That brings up another question -- unfortunately, I am heavily schooled in the Struts and Spring MVC way and often, I would use the same controller for related functions and just pass a parameter to do the right thing. So, what I was doing here was something like: .../project?create .../project?search But - I'm guessing I shouldn't even be doing this. I should just go to project/create and project/search and then piece together the components. I shouldn't even try to share things like a controller because it just doesn't work that way. Or - per the tutorial I just read ... this should probably be a t:actionLink Does that sound correct? In general, how should one navigate when you need to go to a page that needs to do a little prep (db retrieval, etc) Many thanks - getting more productive everyday. -Luther On Mon, Sep 8, 2008 at 11:30 PM, Luther Baker [EMAIL PROTECTED] wrote: If I supply a number as the context: t:pageLink page=item/project context=*2*Pick a project .../t:pageLink All is well and the url looks like ... But if I supply text - the application breaks. Is context required to be a number? t:pageLink page=item/project context=*add*Add a project .../t:pageLink | Home does not contain a property named 'one' -Luther - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: T5 : [ANN] The book - (Index Appendices)
I think a character in Kurt Vonnegut Jr. Cat's Cradle has a fair bit of advice on indexing your own book (she says never). -Original Message- From: Alex Kotchnev [mailto:[EMAIL PROTECTED] Sent: 05 September 2008 05:35 To: Tapestry users Subject: Re: T5 : [ANN] The book - (Index Appendices) I know from experience that creating a good index is just a lot of grueling work . I really haven't given much thought to the topic, as it seems that it's quite far away in the future. Also, not to diminish the importance of the index; however, at this point, it is not very clear exactly what the printing options for the book are going to be (e.g. purchase on lulu, print a pdf on your own), and it's not even a proper technical book yet (e.g. no publisher or anything like that). So, once again, the index is very much in the future. Cheers, Alex Kotchnev On Thu, Sep 4, 2008 at 9:22 AM, [EMAIL PROTECTED] wrote: I know this is very early in the piece, but what do you intend to do about indexing the book? The Kolesnikov Tapestry book has one of the worst indexes I've ever come across and stands as a good example of how not to do it. Having a good index is a very important part of any successful technical book. Indexing a book well is a non-trivial matter and shouldn't just be a last minute thought. I'd also suggest a good set of Appendices - one, at least, should list the components and what parameters they take. Anyway, something to think about. p. Quoting Alex Kotchnev [EMAIL PROTECTED]: I've created a new project for the proposed book at http://code.google.com/p/tapestry5-book , and posted the proposed table of contents at http://code.google.com/p/tapestry5-book/wiki/ProposedTableOfContents . Now that I'm looking at it, it's a little disappointing as the TOC doesn't really have anything new in it (e.g. some of it is covered in tutorials, other is in the project docs, etc). However, I guess that the content really can't be all that different - it's all about building web apps, covering the same materials as the other documentation. In the end, I think that the book will be different from the other existing documents based on its style and breadth of content, and not so much in the topics it covers. Anyway, I would like to create a mailing list and add everyone who has expressed an interest in contributing to the book. Unfortunately, Google Code doesn't have mailng lists, so I'll probably have to look around for that (Nabble, maybe?). Any suggestions would be welcome here. In terms of moving the proposed TOC forward, here are some of my next steps : 1. Attribute the main sections of the project documentation into possible chapters in the book. 2. Discuss feedback from this list on the content of the proposed TOC : e.g. any alternative ideas on how to organize the book, changes to the proposed chapter titles, order, etc. It would be great if there are any volunteers to investigate some of the issues that were discussed previously in the thread below, I'll probably post the needed tasks somewhere on the wiki as well. When we get our mailing list set up, I think that individuals or groups of individuals can claim ownership of each chapter (and thus get voting rights on the TOC, chapter layout, further modifications, etc. Cheers, Alex Kotchnev On Thu, Aug 28, 2008 at 4:59 AM, Hugo Palma [EMAIL PROTECTED] wrote: inline Alex Kotchnev wrote: Would there be any value to having a top-level domain for the book (e.g. tapestry-book.org or something like that), or can we find it a home for the book somewhere under the Tapestry namespace ? A top-level domain should brink more visibility to the effort. Also, in the future we could probably spend some of the monetary payback to pay for the domain and some hosting solution so that we could include the live version of the book application and other cool stuff. Still, for now i think we can live with a project on some project hosting site where we can host the book files and wiki. A note on the potential mode for governing decisions : I was thinking that in the next couple of days, I'll post a list of possible chapters to include in the book. Then, we can collect a first set of volunteers for people take ownership of each chapter. After the initial set of volunteers, the chapter owners will vote on addition of new chapters and giving ownership of chapters to new contributors (if needed). Shouldn't the outline be already created in a tapestry-book wiki ? We could decide on where to host it and then move the discussion to the dedicated list and use its wiki for the outline. On whether the book would cover additional libraries (e.g. chennilekit, t5components): I think that after we get to a good place where we have enough content on the core we can probably spend some time on those as well, possibly with contributions from the project owners. Conceptually, it
RE: T5: Service disambiguation
Thanks. That isn't what I originally implemented but it will do the job just as well. My problem is/was that SecureCookiesImpl uses the Cookies service as a delegate (the constructor expects Cookies as a parameter) but doesn't extend CookiesImpl...although it could. That would be one solution. I wanted a SecureCookies service and a Cookies service, but the IoC sees that as two Cookies services. Like I said, I just de-OO'd it (no interface inheritance, no relationship, SecureCookies is a separate unrelated interface and SecureCookiesImpl is unrelated to and no longer delegates to Cookies and I just inject *both* services) I would still like to know if this sort of thing is possible. I think the autobinding of PersitantLocaleImpl is the problem. Is there any way for me to disambiguate which Cookies service it requires in its constructor? However this is an academic issue now since both of the solutions above (mine and Filip's) satisfy my requirements. Cheers Russell -Original Message- From: Filip S. Adamsen [mailto:[EMAIL PROTECTED] Sent: 29 July 2008 20:06 To: Tapestry users Subject: Re: T5: Service disambiguation Hi, You have to alias the Cookies service. public static void bind(ServiceBinder binder) { binder.bind(SecureCookies.class, SecureCookiesImpl.class).withId(SecureCookies); } public static void contributeAliasOverrides(ConfigurationAliasContribution configuration, @InjectService(SecureCookies) SecureCookies secureCookies) { configuration.add(AliasContribution.create(Cookies.class, secureCookies)); } SecureCookies extends Cookies, SecureCookiesImpl extends CookiesImpl and implements SecureCookies. I just tried it out and it worked for me on Tapestry 5.0.13. Hope this helps. -Filip On 2008-07-29 14:26, Russell Brown wrote: Hi Thanks for the response. What do I alias though? The PersistentLocaleImpl? I've tried creating an alias for Cookies and SecureCookies. The problem is when TapestryModule tries to build PersistentLocaleImpl it finds two Cookies interfaces (SecureCookies that extends Cookies and Cookies itself (arguable that they are the same interface at all (I think not))). I set it up with an alias for each of the offending services and a builder for PersistenLocaleImpl that uses an @Marker to inject my Cookies alias but the original TapestryModule still has problems creating its PersistenLocaleImpl. Why is it even creating one if I have contributed an alias? What I have done is separated SecureCookies from Cookies. Just seems simpler, though much less clean. So I lose some OO stuff, so what, eh? Cheers Russell -Original Message- From: Filip S. Adamsen [mailto:[EMAIL PROTECTED] Sent: 29 July 2008 13:11 To: Tapestry users Subject: Re: T5: Service disambiguation Hi Russell, Take a look at aliases - should do the trick: http://tapestry.formos.com/nightly/tapestry5/tapestry-core/guide/alias.h tml -Filip On 2008-07-29 13:38, Russell Brown wrote: Hi Chris, Do I? I'm not sure. Will that help the fact that PersistentLocalImpl has a problem disambiguating between SecureCookies interface impl and Cookies interface impl? I can add a marker to MY class that uses SecureCookies but I can't add a marker to the TapestryModule auto binder built PersistentLocaleImpl class (can I??) Cheers Russell -Original Message- From: Chris Lewis [mailto:[EMAIL PROTECTED] Sent: 29 July 2008 12:07 To: Tapestry users Subject: Re: T5: Service disambiguation Sounds like you want @Marker: http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/ioc/an notations/Marker.html chris Russell Brown wrote: Hi, I need to write secure session cookies and Tapestry Cookies interface and CookiesImpl don't do that. So I extend the Cookies interface like this Public interface SecureCookies extends Cookies { void writeSecureCookie(yada,yada); } And create an imple that injects the existing, TapestryModule created CookiesImpl as a delegate and delegates all method calls to the existing CookiesImpl and implements writeSecureCookie itself. The problem is...the service PersistentLocale depends on Cookies and I can't disambiguate that dependency. The question why is SecureCookies the same interface as Cookies to Tapestry IoC? How do I go about creating a service that implements the same interface as an existing tapestry service? I'm a bit confused by all this. It seems that the safest way for me to go is create a class that has no relationship to Cookies. Russell Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been
RE: T5: HttpSession id. How to get it?
Cheers Toby. That is what I was after. Good to hear from you again, too (we worked together on 4oD). Cheers Russell -Original Message- From: Toby Hobson [mailto:[EMAIL PROTECTED] Sent: 28 July 2008 17:54 To: Tapestry users Subject: Re: T5: HttpSession id. How to get it? Hi Russel, Have a look at http://wiki.apache.org/tapestry/Tapestry5ObtainingHttpServletRequest Toby - Original Message From: Russell Brown [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Monday, 28 July, 2008 12:17:25 PM Subject: T5: HttpSession id. How to get it? Hi, I need to HttpSession id. When I call request.getSession(false) I get back a org.apache.tapestry5.services.Session impl called org.apache.tapestry5.internal.services.SessionImpl. This class delegates to an HttpSession instance. But there is no way of getting the actual HttpSession or a delegating method for HttpSession.getId(). Is this a conscious design decision? If so does anyone know the rational? Also...is there some other way to get to the actual id of the current session? Many thanks Russell Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved. Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved.
T5: Service disambiguation
Hi, I need to write secure session cookies and Tapestry Cookies interface and CookiesImpl don't do that. So I extend the Cookies interface like this Public interface SecureCookies extends Cookies { void writeSecureCookie(yada,yada); } And create an imple that injects the existing, TapestryModule created CookiesImpl as a delegate and delegates all method calls to the existing CookiesImpl and implements writeSecureCookie itself. The problem is...the service PersistentLocale depends on Cookies and I can't disambiguate that dependency. The question why is SecureCookies the same interface as Cookies to Tapestry IoC? How do I go about creating a service that implements the same interface as an existing tapestry service? I'm a bit confused by all this. It seems that the safest way for me to go is create a class that has no relationship to Cookies. Russell Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved.
RE: T5: Service disambiguation
Hi Chris, Do I? I'm not sure. Will that help the fact that PersistentLocalImpl has a problem disambiguating between SecureCookies interface impl and Cookies interface impl? I can add a marker to MY class that uses SecureCookies but I can't add a marker to the TapestryModule auto binder built PersistentLocaleImpl class (can I??) Cheers Russell -Original Message- From: Chris Lewis [mailto:[EMAIL PROTECTED] Sent: 29 July 2008 12:07 To: Tapestry users Subject: Re: T5: Service disambiguation Sounds like you want @Marker: http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/ioc/an notations/Marker.html chris Russell Brown wrote: Hi, I need to write secure session cookies and Tapestry Cookies interface and CookiesImpl don't do that. So I extend the Cookies interface like this Public interface SecureCookies extends Cookies { void writeSecureCookie(yada,yada); } And create an imple that injects the existing, TapestryModule created CookiesImpl as a delegate and delegates all method calls to the existing CookiesImpl and implements writeSecureCookie itself. The problem is...the service PersistentLocale depends on Cookies and I can't disambiguate that dependency. The question why is SecureCookies the same interface as Cookies to Tapestry IoC? How do I go about creating a service that implements the same interface as an existing tapestry service? I'm a bit confused by all this. It seems that the safest way for me to go is create a class that has no relationship to Cookies. Russell Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved. -- http://thegodcode.net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: T5: Service disambiguation
Hi Thanks for the response. What do I alias though? The PersistentLocaleImpl? I've tried creating an alias for Cookies and SecureCookies. The problem is when TapestryModule tries to build PersistentLocaleImpl it finds two Cookies interfaces (SecureCookies that extends Cookies and Cookies itself (arguable that they are the same interface at all (I think not))). I set it up with an alias for each of the offending services and a builder for PersistenLocaleImpl that uses an @Marker to inject my Cookies alias but the original TapestryModule still has problems creating its PersistenLocaleImpl. Why is it even creating one if I have contributed an alias? What I have done is separated SecureCookies from Cookies. Just seems simpler, though much less clean. So I lose some OO stuff, so what, eh? Cheers Russell -Original Message- From: Filip S. Adamsen [mailto:[EMAIL PROTECTED] Sent: 29 July 2008 13:11 To: Tapestry users Subject: Re: T5: Service disambiguation Hi Russell, Take a look at aliases - should do the trick: http://tapestry.formos.com/nightly/tapestry5/tapestry-core/guide/alias.h tml -Filip On 2008-07-29 13:38, Russell Brown wrote: Hi Chris, Do I? I'm not sure. Will that help the fact that PersistentLocalImpl has a problem disambiguating between SecureCookies interface impl and Cookies interface impl? I can add a marker to MY class that uses SecureCookies but I can't add a marker to the TapestryModule auto binder built PersistentLocaleImpl class (can I??) Cheers Russell -Original Message- From: Chris Lewis [mailto:[EMAIL PROTECTED] Sent: 29 July 2008 12:07 To: Tapestry users Subject: Re: T5: Service disambiguation Sounds like you want @Marker: http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/ioc/an notations/Marker.html chris Russell Brown wrote: Hi, I need to write secure session cookies and Tapestry Cookies interface and CookiesImpl don't do that. So I extend the Cookies interface like this Public interface SecureCookies extends Cookies { void writeSecureCookie(yada,yada); } And create an imple that injects the existing, TapestryModule created CookiesImpl as a delegate and delegates all method calls to the existing CookiesImpl and implements writeSecureCookie itself. The problem is...the service PersistentLocale depends on Cookies and I can't disambiguate that dependency. The question why is SecureCookies the same interface as Cookies to Tapestry IoC? How do I go about creating a service that implements the same interface as an existing tapestry service? I'm a bit confused by all this. It seems that the safest way for me to go is create a class that has no relationship to Cookies. Russell Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: HttpSession id. How to get it?
Hi, I need to HttpSession id. When I call request.getSession(false) I get back a org.apache.tapestry5.services.Session impl called org.apache.tapestry5.internal.services.SessionImpl. This class delegates to an HttpSession instance. But there is no way of getting the actual HttpSession or a delegating method for HttpSession.getId(). Is this a conscious design decision? If so does anyone know the rational? Also...is there some other way to get to the actual id of the current session? Many thanks Russell Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved.
T5: Assets outside of the WebApp
Hi, I'm wondering if I can inject assets or better yet IncludeJavaScriptLibrary from outside the web app? For instance if I want to include the YUI libraries direct from Yahoo! rather than download and bundle them with my web app? @IncludeJavaScriptLibrary( { http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js;, http://yui.yahooapis.com/2.5.2/build/event/event-min.js; }) leads to: Render queue error in SetupRender[AjaxIncluder]: Unknown prefix for asset path 'http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js'. is there a prefix to say external: rather than context: of classpath: ? Cheers Russell Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Class not found exception
Hi, I asked about this a few weeks back and Ben Gidley pointed me at the wiki with these words What is happening is Jetty hides 'server' classes from the web application unless they are also in WEB-INF/lib. When you run in the IDE you don't have a WEB-INF/lib so it can't find the slf4j classes as they are loaded by Jetty as server classes. You are starting Tapestry inside your IDE using a Run class - you need to add a line into your startup class saying // Remove slf4j from list of classes not exposed to webapp webapp.setServerClasses(new String[] {-org.mortbay.jetty.plus.jaas., org.mortbay.jetty.}); see http://wiki.apache.org/tapestry/Tapestry5RunViaMain for more details. Hope that helps Russell -Original Message- From: Newham, Cameron [mailto:[EMAIL PROTECTED] Sent: 17 July 2008 14:13 To: Tapestry users Subject: Class not found exception I'm doing the Tapestry Tutorial. I'm getting the following for the Forms part of the tutorial: caught an exception while obtaining a class file for org.apache.tapestry5.corelib.components.Form exception org.apache.tapestry5.internal.services.TransformationException: Error obtaining injected value for field org.apache.tapestry5.corelib.components.Form.logger: java.lang.ClassNotFoundException: org.slf4j.Logger I'm using Jetty 6 and Jetty Runner in Eclipse and I'm attempting to do the Tapestry Tutorial. I see this has been raised before and is supposedly a Jetty Error. Unfortunately I am not knowledgable enough to fix this myself (and really, the Tutorial should say something about this and give a fix rather than leaving novices like me hanging with no idea what is going on. Apologies if there is something about this, but a Google search turns up very little). One solution was for jetty.xml to have: Set name=parentLoaderPrioritytrue/Set I've done this, but it doesn't fix the problem. mvn jetty:run does allow the page to load, but I want to be able to run Jetty from Eclipse. Can someone either point me at a solution or provide one? (and please, it has to be in terms a novice can understand). Thank you! ** Experience the British Library online at www.bl.uk The British Library's new interactive Annual Report and Accounts 2006/07 : www.bl.uk/mylibrary Help the British Library conserve the world's knowledge. Adopt a Book. www.bl.uk/adoptabook The Library's St Pancras site is WiFi - enabled * The information contained in this e-mail is confidential and may be legally privileged. It is intended for the addressee(s) only. If you are not the intended recipient, please delete this e-mail and notify the [EMAIL PROTECTED] : The contents of this e-mail must not be disclosed or copied without the sender's consent. The statements and opinions expressed in this message are those of the author and do not necessarily reflect those of the British Library. The British Library does not take any responsibility for the views of the author. * Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Class not found exception
I'm not sure how you run jetty from eclipse with jetty runner. Is it an eclipse plugin? -Original Message- From: Newham, Cameron [mailto:[EMAIL PROTECTED] Sent: 17 July 2008 16:10 To: Tapestry users Subject: RE: Class not found exception Thanks Russell. I had seen that one too but I'm afraid that, while I understand the underlying problem, the wiki entry solution doesn't mean a great deal to me as I am have not been using Maven for very long and don't know much about POMs or artifacts. I don't see why I should have to have a run class. Surely it should just all work out of the box (or at worst, by modifying a Jetty XML file as I initially tried). Thanks. -Original Message- From: Russell Brown [mailto:[EMAIL PROTECTED] Sent: 17 July 2008 15:15 To: Tapestry users Subject: RE: Class not found exception Hi, I asked about this a few weeks back and Ben Gidley pointed me at the wiki with these words What is happening is Jetty hides 'server' classes from the web application unless they are also in WEB-INF/lib. When you run in the IDE you don't have a WEB-INF/lib so it can't find the slf4j classes as they are loaded by Jetty as server classes. You are starting Tapestry inside your IDE using a Run class - you need to add a line into your startup class saying // Remove slf4j from list of classes not exposed to webapp webapp.setServerClasses(new String[] {-org.mortbay.jetty.plus.jaas., org.mortbay.jetty.}); see http://wiki.apache.org/tapestry/Tapestry5RunViaMain for more details. Hope that helps Russell -Original Message- From: Newham, Cameron [mailto:[EMAIL PROTECTED] Sent: 17 July 2008 14:13 To: Tapestry users Subject: Class not found exception I'm doing the Tapestry Tutorial. I'm getting the following for the Forms part of the tutorial: caught an exception while obtaining a class file for org.apache.tapestry5.corelib.components.Form exception org.apache.tapestry5.internal.services.TransformationException: Error obtaining injected value for field org.apache.tapestry5.corelib.components.Form.logger: java.lang.ClassNotFoundException: org.slf4j.Logger I'm using Jetty 6 and Jetty Runner in Eclipse and I'm attempting to do the Tapestry Tutorial. I see this has been raised before and is supposedly a Jetty Error. Unfortunately I am not knowledgable enough to fix this myself (and really, the Tutorial should say something about this and give a fix rather than leaving novices like me hanging with no idea what is going on. Apologies if there is something about this, but a Google search turns up very little). One solution was for jetty.xml to have: Set name=parentLoaderPrioritytrue/Set I've done this, but it doesn't fix the problem. mvn jetty:run does allow the page to load, but I want to be able to run Jetty from Eclipse. Can someone either point me at a solution or provide one? (and please, it has to be in terms a novice can understand). Thank you! ** Experience the British Library online at www.bl.uk The British Library's new interactive Annual Report and Accounts 2006/07 : www.bl.uk/mylibrary Help the British Library conserve the world's knowledge. Adopt a Book. www.bl.uk/adoptabook The Library's St Pancras site is WiFi - enabled * The information contained in this e-mail is confidential and may be legally privileged. It is intended for the addressee(s) only. If you are not the intended recipient, please delete this e-mail and notify the [EMAIL PROTECTED] : The contents of this e-mail must not be disclosed or copied without the sender's consent. The statements and opinions expressed in this message are those of the author and do not necessarily reflect those of the British Library. The British Library does not take any responsibility for the views of the author. * Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
RE: Class not found exception
I don't think run jetty run supports configuration by a jetty.xml. The author says in his Usage instructions There aren't many options, just the web application directory, the context and the port. I intentionally keep it basic so that it will be easy to use and maintain; if you need anything more fancy, use one of the other Eclipse app server plugins, or do what I often do: create a start up class in your project. Not sure where that leaves you. Sorry I can't be more help. The basic problem is the same. You need to tell Jetty that you don't want it to hide the slf4j server classes. One way of doing that is setting the ServerClasses property as Ben did below. How you set that property with run-jetty-run is beyond me. Sorry. If you look at the wiki post linked to in my post you can just cut and paste the code into a run class and you will be up and running very quickly indeed. I agree with your shoulds...but maybe ditching run-jetty-run would help. Cheers Russell -Original Message- From: Newham, Cameron [mailto:[EMAIL PROTECTED] Sent: 17 July 2008 16:30 To: Tapestry users Subject: RE: Class not found exception Typo on my part. I meant Run Jetty Run: http://code.google.com/p/run-jetty-run/ which is an Eclipse plugin. -Original Message- From: Russell Brown [mailto:[EMAIL PROTECTED] Sent: 17 July 2008 16:23 To: Tapestry users Subject: RE: Class not found exception I'm not sure how you run jetty from eclipse with jetty runner. Is it an eclipse plugin? -Original Message- From: Newham, Cameron [mailto:[EMAIL PROTECTED] Sent: 17 July 2008 16:10 To: Tapestry users Subject: RE: Class not found exception Thanks Russell. I had seen that one too but I'm afraid that, while I understand the underlying problem, the wiki entry solution doesn't mean a great deal to me as I am have not been using Maven for very long and don't know much about POMs or artifacts. I don't see why I should have to have a run class. Surely it should just all work out of the box (or at worst, by modifying a Jetty XML file as I initially tried). Thanks. -Original Message- From: Russell Brown [mailto:[EMAIL PROTECTED] Sent: 17 July 2008 15:15 To: Tapestry users Subject: RE: Class not found exception Hi, I asked about this a few weeks back and Ben Gidley pointed me at the wiki with these words What is happening is Jetty hides 'server' classes from the web application unless they are also in WEB-INF/lib. When you run in the IDE you don't have a WEB-INF/lib so it can't find the slf4j classes as they are loaded by Jetty as server classes. You are starting Tapestry inside your IDE using a Run class - you need to add a line into your startup class saying // Remove slf4j from list of classes not exposed to webapp webapp.setServerClasses(new String[] {-org.mortbay.jetty.plus.jaas., org.mortbay.jetty.}); see http://wiki.apache.org/tapestry/Tapestry5RunViaMain for more details. Hope that helps Russell -Original Message- From: Newham, Cameron [mailto:[EMAIL PROTECTED] Sent: 17 July 2008 14:13 To: Tapestry users Subject: Class not found exception I'm doing the Tapestry Tutorial. I'm getting the following for the Forms part of the tutorial: caught an exception while obtaining a class file for org.apache.tapestry5.corelib.components.Form exception org.apache.tapestry5.internal.services.TransformationException: Error obtaining injected value for field org.apache.tapestry5.corelib.components.Form.logger: java.lang.ClassNotFoundException: org.slf4j.Logger I'm using Jetty 6 and Jetty Runner in Eclipse and I'm attempting to do the Tapestry Tutorial. I see this has been raised before and is supposedly a Jetty Error. Unfortunately I am not knowledgable enough to fix this myself (and really, the Tutorial should say something about this and give a fix rather than leaving novices like me hanging with no idea what is going on. Apologies if there is something about this, but a Google search turns up very little). One solution was for jetty.xml to have: Set name=parentLoaderPrioritytrue/Set I've done this, but it doesn't fix the problem. mvn jetty:run does allow the page to load, but I want to be able to run Jetty from Eclipse. Can someone either point me at a solution or provide one? (and please, it has to be in terms a novice can understand). Thank you! ** Experience the British Library online at www.bl.uk The British Library's new interactive Annual Report and Accounts 2006/07 : www.bl.uk/mylibrary Help the British Library conserve the world's knowledge. Adopt a Book. www.bl.uk/adoptabook The Library's St Pancras site is WiFi - enabled * The information contained in this e-mail is confidential and may be legally privileged. It is intended for the addressee(s) only. If you
T5: upgrade to T5.0.13 from T5.0.11 ClassNotFoundException for slf4j.Logger
Hi, I have just upgraded my projects dependencies under maven from T5.0.11 to T5.0.13. Everything compiled OK (after I changed all the *.tapestry.* imports to *.tapestry5.* imports and used the new refactored constants classes). However when I request a page that includes a BeanEditForm I get a large stack trace that seems to be caused by the following : - Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.j ava:366) at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.j ava:337) at javassist.Loader.delegateToParent(Loader.java:428) at javassist.Loader.loadClass(Loader.java:314) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:242) at org.apache.tapestry5.internal.services.InternalClassTransformationImpl.t oClass(InternalClassTransformationImpl.java:1707) I had a look at the documentation of tapestry logging. I followed the instructions here http://tapestry.apache.org/tapestry5/tapestry-ioc/logging.html and added the exclusions for log4j and added a dependency for logback (which we use instead of log4j) (actually they were already in place, since this worked fine in T5.0.11). And yet I get the problem above. I know this is not specifically a Tapestry 5 issue but it is a new issue with T5.0.13 that was not present in T5.0.11 which worked fine with this configuration. Any ideas anyone? Looking at the maven dependency tree everything that needs to be there seems to be (logback, slf4j-apiare there and log4j and slf4j-log4j12 are not) Hope you can help, Russell Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved.
RE: T5: upgrade to T5.0.13 from T5.0.11 ClassNotFoundException for slf4j.Logger
That is it. Thanks Ben Russell. -Original Message- From: Ben Gidley [mailto:[EMAIL PROTECTED] Sent: 02 July 2008 12:09 To: Tapestry users Subject: Re: T5: upgrade to T5.0.13 from T5.0.11 ClassNotFoundException for slf4j.Logger Russell, I think this is a Jetty issue. Try running the application via mvn jetty:run - if this works then the problem is Jetty is hiding SLF4J from the beanEditForm class loader. What is happening is Jetty hides 'server' classes from the web application unless they are also in WEB-INF/lib. When you run in the IDE you don't have a WEB-INF/lib so it can't find the slf4j classes as they are loaded by Jetty as server classes. You are starting Tapestry inside your IDE using a Run class - you need to add a line into your startup class saying // Remove slf4j from list of classes not exposed to webapp webapp.setServerClasses(new String[] {-org.mortbay.jetty.plus.jaas., org.mortbay.jetty.}); see http://wiki.apache.org/tapestry/Tapestry5RunViaMain for more details. Thanks Ben On Wed, Jul 2, 2008 at 11:43 AM, Russell Brown [EMAIL PROTECTED] wrote: Hi, I have just upgraded my projects dependencies under maven from T5.0.11 to T5.0.13. Everything compiled OK (after I changed all the *.tapestry.* imports to *.tapestry5.* imports and used the new refactored constants classes). However when I request a page that includes a BeanEditForm I get a large stack trace that seems to be caused by the following : - Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.j ava:366) at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.j ava:337) at javassist.Loader.delegateToParent(Loader.java:428) at javassist.Loader.loadClass(Loader.java:314) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:242) at org.apache.tapestry5.internal.services.InternalClassTransformationImpl.t oClass(InternalClassTransformationImpl.java:1707) I had a look at the documentation of tapestry logging. I followed the instructions here http://tapestry.apache.org/tapestry5/tapestry-ioc/logging.html and added the exclusions for log4j and added a dependency for logback (which we use instead of log4j) (actually they were already in place, since this worked fine in T5.0.11). And yet I get the problem above. I know this is not specifically a Tapestry 5 issue but it is a new issue with T5.0.13 that was not present in T5.0.11 which worked fine with this configuration. Any ideas anyone? Looking at the maven dependency tree everything that needs to be there seems to be (logback, slf4j-apiare there and log4j and slf4j-log4j12 are not) Hope you can help, Russell Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved. Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [T5] Tapestry - Hibernate w/ multiple databases
Hmmm, create two tapestry apps that are modules/libraries rather than web apps. One for accessing DB1 with hibernate and one for accessing DB2 with hibernate (thus separate config) then create another tapestry web app that uses those to modules to display/manipulate etc the data from the database? Does that sound doable? Transaction demarcation could be interesting. Russell -Original Message- From: 9902468 [mailto:[EMAIL PROTECTED] Sent: 02 July 2008 15:14 To: users@tapestry.apache.org Subject: [T5] Tapestry - Hibernate w/ multiple databases Hi! How can one use multiple databases with hibernate integration? Is the answer use integration for the db that is largest and code by hand the rest? It should be possible IMHO. - 99 -- View this message in context: http://www.nabble.com/-T5--Tapestry---Hibernate-w--multiple-databases-tp 18238421p18238421.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Messages in modules (where to put the *.properties files)
Hi, I have created a couple of components and have jarred them up as a library. I followed the Tapestry 5 book and the how to here http://wiki.apache.org/tapestry/Tapestry5HowToCreateYourOwnComponentLibr ary on the wiki. It is working ok for me so far except that one of my components makes use of the t:beaneditform and the validate regexp pattern contained in related properties file for the component cannot be found. This component started life as a page. When it was a Page (in the *.*.*.pages package) it renedered correctly and the regexp for the corresponding field was found. Now it is a component and packaged up (and referred to as t:prefix.component / thanks to adding a LibraryMapping to the ComponentClasResolver via contributeComponentClassResolver ) I get the exception that follows ender queue error in BeginRender[core/PropertyEditBlocks:textfield]: Failure reading parameter 'validate' of component core/PropertyEditBlocks:textfield: Validator 'regexp' requires a validation constraint (of type java.util.regex.Pattern) but none was provided. Can anyone let me know what I need to do to make this work? The component is called register and the properties file is in the my.package.components package with the component. Is that correct or should it be elsewhere? Cheers Russell Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved.
RE: Messages in modules (where to put the *.properties files)
Hi, Thanks for that. That worked. Cheers Russell -Original Message- From: SergeEby [mailto:[EMAIL PROTECTED] Sent: 06 June 2008 16:11 To: users@tapestry.apache.org Subject: Re: Messages in modules (where to put the *.properties files) Hi, If you are using Maven, you should put your properties files under src/main/resources/my/package/components See details here: http://tapestry.apache.org/tapestry5/tapestry-core/guide/project-layout. html /Serge Russell Brown-6 wrote: Hi, I have created a couple of components and have jarred them up as a library. I followed the Tapestry 5 book and the how to here http://wiki.apache.org/tapestry/Tapestry5HowToCreateYourOwnComponentLibr ary on the wiki. It is working ok for me so far except that one of my components makes use of the t:beaneditform and the validate regexp pattern contained in related properties file for the component cannot be found. This component started life as a page. When it was a Page (in the *.*.*.pages package) it renedered correctly and the regexp for the corresponding field was found. Now it is a component and packaged up (and referred to as t:prefix.component / thanks to adding a LibraryMapping to the ComponentClasResolver via contributeComponentClassResolver ) I get the exception that follows ender queue error in BeginRender[core/PropertyEditBlocks:textfield]: Failure reading parameter 'validate' of component core/PropertyEditBlocks:textfield: Validator 'regexp' requires a validation constraint (of type java.util.regex.Pattern) but none was provided. Can anyone let me know what I need to do to make this work? The component is called register and the properties file is in the my.package.components package with the component. Is that correct or should it be elsewhere? Cheers Russell Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved. -- View this message in context: http://www.nabble.com/Messages-in-modules-%28where-to-put-the-*.properti es-files%29-tp17694337p17694525.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
java.lang.NoClassDefFoundError: org/apache/tapestry/test/TapestryTestConstants
Hi, Using tapestry 5.0.11 I get a NoClassDefFoundError when I try and use the PageTester class as described in the documents here (http://tapestry.apache.org/tapestry5/tapestry-core/guide/unit-testing-pages.html) when I try to create a new Instance of PageTester. The stack trace is as follows:-- --- java.lang.NoClassDefFoundError: org/apache/tapestry/test/TapestryTestConstants at org.apache.tapestry.internal.test.PageTesterContext.init(PageTesterContext.java:31) at org.apache.tapestry.test.PageTester.init(PageTester.java:104) at uk.co.vodco.sherbet.sherbetbeta.pages.StartPageIntTest.startPageSubmit(StartPageIntTest.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580) at org.testng.internal.Invoker.invokeMethod(Invoker.java:478) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:607) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:874) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) at org.testng.TestRunner.runWorkers(TestRunner.java:689) at org.testng.TestRunner.privateRun(TestRunner.java:566) at org.testng.TestRunner.run(TestRunner.java:466) at org.testng.SuiteRunner.runTest(SuiteRunner.java:301) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:296) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:276) at org.testng.SuiteRunner.run(SuiteRunner.java:191) at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:808) at org.testng.TestNG.runSuitesLocally(TestNG.java:776) at org.testng.TestNG.run(TestNG.java:701) at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124) -- These lines in PageTestContext seem to be the culprit public PageTesterContext(String contextRoot) { _contextRoot = new File(TapestryTestConstants.MODULE_BASE_DIR, contextRoot); } I looked in the jar and the svn repo and this class (TapestryTestConstants) is absent. Any ideas? Cheers Russell Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: java.lang.NoClassDefFoundError: org/apache/tapestry/test/TapestryTestConstants
Doh! Yes. Thanks. That does it. Cheers Russell -Original Message- From: David Roberts [mailto:[EMAIL PROTECTED] Sent: Wed 6/4/2008 2:43 PM To: Tapestry users Subject: Re: java.lang.NoClassDefFoundError: org/apache/tapestry/test/TapestryTestConstants Well PageTester is definitely in Tapestry Core - but I had to include tapestry test module to get TapestryTestConstants - that was being used by PageTester - like your stacktrace so just add the tapestry test module. Russell Brown wrote: Hi, Using tapestry 5.0.11 I get a NoClassDefFoundError when I try and use the PageTester class as described in the documents here (http://tapestry.apache.org/tapestry5/tapestry-core/guide/unit-testing-pages.html) when I try to create a new Instance of PageTester. The stack trace is as follows:-- --- java.lang.NoClassDefFoundError: org/apache/tapestry/test/TapestryTestConstants at org.apache.tapestry.internal.test.PageTesterContext.init(PageTesterContext.java:31) at org.apache.tapestry.test.PageTester.init(PageTester.java:104) at uk.co.vodco.sherbet.sherbetbeta.pages.StartPageIntTest.startPageSubmit(StartPageIntTest.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580) at org.testng.internal.Invoker.invokeMethod(Invoker.java:478) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:607) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:874) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) at org.testng.TestRunner.runWorkers(TestRunner.java:689) at org.testng.TestRunner.privateRun(TestRunner.java:566) at org.testng.TestRunner.run(TestRunner.java:466) at org.testng.SuiteRunner.runTest(SuiteRunner.java:301) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:296) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:276) at org.testng.SuiteRunner.run(SuiteRunner.java:191) at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:808) at org.testng.TestNG.runSuitesLocally(TestNG.java:776) at org.testng.TestNG.run(TestNG.java:701) at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124) -- These lines in PageTestContext seem to be the culprit public PageTesterContext(String contextRoot) { _contextRoot = new File(TapestryTestConstants.MODULE_BASE_DIR, contextRoot); } I looked in the jar and the svn repo and this class (TapestryTestConstants) is absent. Any ideas? Cheers Russell Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
Redirects
Hi All, New to Tapestry 5. I have read the Building Web Apps Tapestry 5 book by Alexander Kolesnikov and am working through the documentation and Wiki too and I have a functional little web app at the moment that took me all of a few hours to build and test so I am very pleased with the productivity. I haven't found how to redirect to an external url though. I think my mind is stuck in Strruts MVC groove after all these years. So I have a Page class and what I want the page to do is check for the presence of an @ApplicationState property and redirect to an external url. In struts I'd have the logic in the execute method of an Action. In Tapestry 5 do I put this code in the onBeforeRender method? And how exactly do I do a redirect to an external url please? I know I am thinking in the action-forward-to-view way and that the relationship between a page class and a page template is not exactly analogous...I think this is conceptually where I am stuck. Not all web apps are about pages so what metaphor is there for requests that aren't page based? My practical problem above stems from current failure to grok the pattern Tapestry 5 implements. Many thanks in advance if you can help (with either my practical or conceptual problem). Russell Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved.
RE: Redirects
Thanks Bill. -Original Message- From: Bill Holloway [mailto:[EMAIL PROTECTED] Sent: 30 May 2008 10:23 To: Tapestry users Subject: Re: Redirects Hi Russell, I do this in the SetupRender phase. @Inject private org.apache.tapestry.services.Response _response; void setupRender () throws Exception { if (/* condition satisfied */) _response.sendRedirect( http://example.com; ); } Cheers, Bill On Fri, May 30, 2008 at 3:23 AM, Russell Brown [EMAIL PROTECTED] wrote: Hi All, New to Tapestry 5. I have read the Building Web Apps Tapestry 5 book by Alexander Kolesnikov and am working through the documentation and Wiki too and I have a functional little web app at the moment that took me all of a few hours to build and test so I am very pleased with the productivity. I haven't found how to redirect to an external url though. I think my mind is stuck in Strruts MVC groove after all these years. So I have a Page class and what I want the page to do is check for the presence of an @ApplicationState property and redirect to an external url. In struts I'd have the logic in the execute method of an Action. In Tapestry 5 do I put this code in the onBeforeRender method? And how exactly do I do a redirect to an external url please? I know I am thinking in the action-forward-to-view way and that the relationship between a page class and a page template is not exactly analogous...I think this is conceptually where I am stuck. Not all web apps are about pages so what metaphor is there for requests that aren't page based? My practical problem above stems from current failure to grok the pattern Tapestry 5 implements. Many thanks in advance if you can help (with either my practical or conceptual problem). Russell Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved. -- Those who can make you believe absurdities can make you commit atrocities. Voltaire Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Service Configuration, ApplicationDefaults and String parameter in constructor
Hi Again, Now I have a Service that I want to configure with a string parameter and an int parameter. I add a couple of values to the ApplicationDefaults like this: configuration.add(my.long.key.string-value, aStringINeedInMyService); configuration.add(my.long.key.int-value, 180); And in my service I have a constructor like this: private final int intINeedInMyService; private final String stringINeedInMyService; public MyNewServiceImpl (@Value(${my.long.key.int-value }) final int cookieAgeInDays, @Value(${my.long.key.string-value }) final String cookieName) { this. intINeedInMyService = intINeedInMyService; this. stringINeedInMyService = stringINeedInMyService; } } This seems to work except that the value of stringINeedInMyService is always the Service's Service Id. I verified this by changing the Id of the service in the AppModule by calling binder.bind(MyNewService.class, MyNewServiceImpl.class).withId(MyDifferentId) and behold the value injected into the String constructor parameter for the MyNewServiceImpl was the new service Id. Is this expected behavior (IE have I miss understood how to configure my service)? Or is there something else going on? Has anyone configured a service this way before? Many thanks Russell Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved.
RE: Service Configuration, ApplicationDefaults and String parameter in constructor
Ok, Sorry all. Scratch that. I RTFM. Here http://tapestry.apache.org/tapestry5/tapestry-ioc/service.html#Injecting %20Dependencies at the bottom of the page it says Every once and a while, you'll have a conflict between a resource type and an object injection. For example, the following does not work as expected: It doesn't work because type String always gets the service id, as a resource (as with the serviceId parameter). In order to get this to work, we need to turn off the resource injection for the alertEmail parameter. That's what the Inject annotation does: Sorry all Cheers Russell -Original Message- From: Russell Brown [mailto:[EMAIL PROTECTED] Sent: 30 May 2008 12:14 To: Tapestry users Subject: Service Configuration, ApplicationDefaults and String parameter in constructor Hi Again, Now I have a Service that I want to configure with a string parameter and an int parameter. I add a couple of values to the ApplicationDefaults like this: configuration.add(my.long.key.string-value, aStringINeedInMyService); configuration.add(my.long.key.int-value, 180); And in my service I have a constructor like this: private final int intINeedInMyService; private final String stringINeedInMyService; public MyNewServiceImpl (@Value(${my.long.key.int-value }) final int cookieAgeInDays, @Value(${my.long.key.string-value }) final String cookieName) { this. intINeedInMyService = intINeedInMyService; this. stringINeedInMyService = stringINeedInMyService; } } This seems to work except that the value of stringINeedInMyService is always the Service's Service Id. I verified this by changing the Id of the service in the AppModule by calling binder.bind(MyNewService.class, MyNewServiceImpl.class).withId(MyDifferentId) and behold the value injected into the String constructor parameter for the MyNewServiceImpl was the new service Id. Is this expected behavior (IE have I miss understood how to configure my service)? Or is there something else going on? Has anyone configured a service this way before? Many thanks Russell Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved. Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]