Re: T5: FileUpload and time out
Hi, probably I did not make my original question clear, the UploadExample works, however, there are situations that we got a time out exception, how to track this exception in the following example? thanks for the help, Angelo Angelo Chen wrote: Hi, following sample works, but how to determine if timeout error occurs? thanks. public class UploadExample { private UploadedFile file; public UploadedFile getFile() { return file; } public void setFile(UploadedFile file) { this.file = file; } public void onSuccess() { File copied = new File(/my/file/location/ + file.getFileName()); file.write(copied); } } -- View this message in context: http://www.nabble.com/T5%3A-FileUpload-and-time-out-tp18355064p18377198.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]
specify background color of dialogUnderlay div
Hi, I'm working with Tapestry 4.1.1 and I'm using client side validation. Is it possible to specify the background color of the dialogUnderlay div somewhere? Kind regards, Nils
Re: AW: AW: AW: AW: Strange behavior of special characters
Thank you i will have a look at this. At the moment we don't have the time to deal with this problem, but since yesterday we have a clue what is the problem and probably will be able to resolve this next few days. I will inform you when i can say exactly what went wrong. Andreas Andreou wrote: Try searching the bug tracker... I found http://issues.apache.org/jira/browse/TAPESTRY-607 'Output encoding problem with some versions of Tomcat 5' (btw, what's your servlet container?) and some others that may help... For the record, tapestry 3-4 used a custom resourcebundle loader that didn't require you to pass the properties through native2ascii... I think it used the ending of the file name of the property to determine the indended encoding allowing you to use UTF-8 and be done with it... That's also the reason why GWT gives credit to Tapestry in Help-About (they've reused the code) On 7/9/08, Sebastian Altmann [EMAIL PROTECTED] wrote: Ok seems like this won't get me anywhre. I just can repeat: All my properties filese are 100% encoded in UTF-8 (checked this in eclipse and in an external editor) and all umlauts are displayed properly (except in the special case described above). To this problem you mentioned concerning Java Properties Files and UTF-8 encoding i just can guess, that it seems that this problem doesn't inflict the usage of properties inside tapestry. After i did a lot of testing concerning encoding both on UNIX and Windows machines, i just can say that special characters in UTF-8 are display properly (except in the special case described above) as long you set the concerning meta information in .application or rather in .library properly. Maximilian Weißböck wrote: I'm very sure the property files that work are not utf-8 encoded but iso-8895-1 encoded. You can use ÄÖÜß and so on with no problem in property files (we do it), just be very sure they are iso-8895-1 encoded. If you use Eclipse, right click on the file, open Properties and look at the Text file Encoding. Max -Ursprüngliche Nachricht- Von: Sebastian Altmann [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 8. Juli 2008 15:11 An: users@tapestry.apache.org Betreff: Re: AW: AW: AW: Strange behavior of special characters Sorry but I just don't get it... After you mentioned the first time that there are problems concerning properties files in UTF-8 I also found this and similar articles on the sam topic. I would quietly accept this, if my special characters were displayed wrong all over the application and in other applications too, but i can't understand why this should be a general Java problem even though in 99% of cases my special characters are displayed properly. Maximilian Weißböck wrote: The load and store methods load and store properties in a simple line-oriented format specified below. This format uses the ISO 8859-1 character encoding. Characters that cannot be directly represented in this encoding can be written using Unicode escapes ; only a single 'u' character is allowed in an escape sequence. The native2ascii tool can be used to convert property files to and from other character encodings. from http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html Max -Ursprüngliche Nachricht- Von: Sebastian Altmann [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 8. Juli 2008 09:19 An: users@tapestry.apache.org Betreff: Re: AW: AW: Strange behavior of special characters Yes I'm reading my values from properties files which are utf-8 encoded, but what really confuses me is that you tell me they aren't allowed i utf-8. Because we're running an application with utf-8 properties-files without any problems. This strange behavior can only be found in anatoher application. Maximilian Weißböck wrote: Do you read this values from a property file? Property files in Java may not be utf-8 encoded. The have to be iso-8859-1 encoded. Many thanks to Sun ... Max -Ursprüngliche Nachricht- Von: Sebastian Altmann [mailto:[EMAIL PROTECTED] Gesendet: Montag, 7. Juli 2008 14:54 An: users@tapestry.apache.org Betreff: Re: AW: Strange behavior of special characters No i didn't because i am using tapestry 4.0.2 (forgot to mention this :-(() but i read similar atricles on tapestry 4. The weird thing is that my encoding basically is ok, and this strange things happen just under certain circumstances. Another thing that confuses me is that for example in löschen not just the ö isn't displayed correct but also the 3 following characters (sch). This happens to every string with special characters (mostly not the next 3 but the next 2 characters ). Maximilian
[T5Components] multiple palettes on page
Hi, I am trying to put multiple palette components on a page to edit multiple lists at the same time. It seems that only the last palette actually writes its data correctly in the list. Is there a known issue when using multiple palettes on a page? Regards Moritz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Rendering a block a component received as parameter
Hi Josh, thanks, this works great! I think I understand the rendering process now a little bit better, so a Delegate would have been fine too - thank you, Howard. I just didn't understand how to render that Delegate before, since it is a component too. (I hope I now understand it correctly that I just would've put it in the Template and set the Block which should be rendered in beforeRenderTemplate.) - Tobias Josh Canfield schrieb: I don't recall if you can use MarkupWriter to write blocks yet, but one method I've used is to return the block from the beginRender method, it's rendered after whatever you write within the method. I believe for both blocks you would have to use both beginRender and beforeRenderTemplate, or I suppose you could loop from the beginRender method. If you want to wrap your blocks in an element you would start it in beginRender and finish it in afterRender... In the case you've laid out though, it might be easier to just create a template. Josh On Wed, Jul 9, 2008 at 8:56 AM, Tobias Wehrum [EMAIL PROTECTED] wrote: Hi there, I am developing a tree component which can take several classes as nodes. Each class should have it's own body, stored in parameters - and then rendered, of course. Now, lets say I have I have this code in my Test.tml: -- t:ExTree t:id=taskTree source=treeNodes currentNode=currentTreeNode t:parameter name=taskClassContent t:pagelink t:page=Task context=${ognl:currentTreeNode.id}${ognl:currentTreeNode.title}/t:pagelink /t:parameter t:parameter name=projectClassContent t:pagelink t:page=Project context=${ognl:currentTreeNode.id}${ognl:currentTreeNode.projectName}/t:pagelink /t:parameter /t:ExTree -- As you can see, taskClassContent and projectClassContent are Block elements. Now how can I render this Block element in my ExTree component? By the way, ExTree hasn't a template, just a class. Hope that someone can help me, Tobias - 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: Different behavior of Palette Component in FireFox, Safari and IE
Hi, we experience exactly the same issue: with FF3 the palette submits the form, with FF2 this is not the case. Max, when you submit the issue in jira please send a ping here, so that I can vote :) Cheers, Martin On Wed, 2008-07-09 at 18:23 +0200, Maximilian Weißböck wrote: Palette Component behaves different in FireFox then it does in Safari and IE If palette item is moved in FireFox the following events are triggered onSuccess() onSubmit() If palette item is moved in Safari or IE none of the above events is triggered. Is this suggested to be a bug? Then I would file a Jira Issue. Tested with FF 3.0, Safari 3.1 and IE 6 (all on Windows) Regards, Max signature.asc Description: This is a digitally signed message part
[T5] Read informal parameters
Hi everyone, is there any way to read the informal parameters a component received? componentResources.getBlockParameter makes it easy for blocks - but how can I do it with strings, for example? Furthermore, is there maybe any way to get a list of the informal parameters? I looked in the source code and and InternalComponentResourcesImpl implements all what I need -readParameter, getBinding, getInformalParameterBindings- but they are not being published in the Interface ComponentResources. Am I looking in the wrong place or is there simply no other way than to use InternalComponentResourcesImpl - which, of course, I would rather like not to? - Tobias - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Different behavior of Palette Component in FireFox, Safari and IE
What version of T5 are you guys using? I think there was a jira about it and it has been fixed already. see. https://issues.apache.org/jira/browse/TAPESTRY-2507 - Palette component forces an unwanted form submit under FireFox 3 Yunhua On Thu, Jul 10, 2008 at 5:44 AM, Martin Grotzke [EMAIL PROTECTED] wrote: Hi, we experience exactly the same issue: with FF3 the palette submits the form, with FF2 this is not the case. Max, when you submit the issue in jira please send a ping here, so that I can vote :) Cheers, Martin On Wed, 2008-07-09 at 18:23 +0200, Maximilian Weißböck wrote: Palette Component behaves different in FireFox then it does in Safari and IE If palette item is moved in FireFox the following events are triggered onSuccess() onSubmit() If palette item is moved in Safari or IE none of the above events is triggered. Is this suggested to be a bug? Then I would file a Jira Issue. Tested with FF 3.0, Safari 3.1 and IE 6 (all on Windows) Regards, Max - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Different behavior of Palette Component in FireFox, Safari and IE
Sorry the link was wrong, it should be https://issues.apache.org/jira/browse/TAPESTRY-2490 On Thu, Jul 10, 2008 at 7:37 AM, Yunhua Sang [EMAIL PROTECTED] wrote: What version of T5 are you guys using? I think there was a jira about it and it has been fixed already. see. https://issues.apache.org/jira/browse/TAPESTRY-2507 - Palette component forces an unwanted form submit under FireFox 3 Yunhua On Thu, Jul 10, 2008 at 5:44 AM, Martin Grotzke [EMAIL PROTECTED] wrote: Hi, we experience exactly the same issue: with FF3 the palette submits the form, with FF2 this is not the case. Max, when you submit the issue in jira please send a ping here, so that I can vote :) Cheers, Martin On Wed, 2008-07-09 at 18:23 +0200, Maximilian Weißböck wrote: Palette Component behaves different in FireFox then it does in Safari and IE If palette item is moved in FireFox the following events are triggered onSuccess() onSubmit() If palette item is moved in Safari or IE none of the above events is triggered. Is this suggested to be a bug? Then I would file a Jira Issue. Tested with FF 3.0, Safari 3.1 and IE 6 (all on Windows) Regards, Max - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Displaying image on T5 page
Hi, I am new to Tapestry. Using Tapestry 5.0.10 with my application. I need to display a chart image on my application using dynamic data. I am using JFreeChart for that. But, I couldn't get the way to display the image on my page. I have to display the image while rendering the page, not as an ActionLink. Can anyone help with this? Regards, Yeeswar DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ---
Re: Displaying image on T5 page
add to your page template: img src=${asset:context:assets/images/mychart.jpg}/ further informations you find here http://tapestry.apache.org/tapestry5/tapestry-core/guide/assets.html 2008/7/10 Yeeswara Nadapana (HCL Financial Services) [EMAIL PROTECTED]: Hi, I am new to Tapestry. Using Tapestry 5.0.10 with my application. I need to display a chart image on my application using dynamic data. I am using JFreeChart for that. But, I couldn't get the way to display the image on my page. I have to display the image while rendering the page, not as an ActionLink. Can anyone help with this? Regards, Yeeswar DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. --- -- with regards Sven Homburg http://tapestry5-components.googlecode.com http://chenillekit.googlecode.com
Re: Displaying image on T5 page
This should help http://wiki.apache.org/tapestry/Tapestry5HowToCreatePieChartsInAPage 2008/7/10 Yeeswara Nadapana (HCL Financial Services) [EMAIL PROTECTED]: Hi, I am new to Tapestry. Using Tapestry 5.0.10 with my application. I need to display a chart image on my application using dynamic data. I am using JFreeChart for that. But, I couldn't get the way to display the image on my page. I have to display the image while rendering the page, not as an ActionLink. Can anyone help with this? Regards, Yeeswar DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ---
RE: Displaying image on T5 page
Hi Sven, This will only work when the mychart.jpg already exists at that specified path. But, as per my requirement I have to generate the JPG dynamically and show it on the page. I got a reference at http://wiki.apache.org/tapestry/Tapestry5HowToCreateASimpleGraphComponen t But, it doesn't help much with my requirement. Thanks, Yeeswar. -Original Message- From: Sven Homburg [mailto:[EMAIL PROTECTED] Sent: Thursday, July 10, 2008 6:09 PM To: Tapestry users Subject: Re: Displaying image on T5 page add to your page template: img src=${asset:context:assets/images/mychart.jpg}/ further informations you find here http://tapestry.apache.org/tapestry5/tapestry-core/guide/assets.html 2008/7/10 Yeeswara Nadapana (HCL Financial Services) [EMAIL PROTECTED]: Hi, I am new to Tapestry. Using Tapestry 5.0.10 with my application. I need to display a chart image on my application using dynamic data. I am using JFreeChart for that. But, I couldn't get the way to display the image on my page. I have to display the image while rendering the page, not as an ActionLink. Can anyone help with this? Regards, Yeeswar DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. --- -- with regards Sven Homburg http://tapestry5-components.googlecode.com http://chenillekit.googlecode.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Displaying image on T5 page
On Thu, Jul 10, 2008 at 2:45 PM, Yeeswara Nadapana (HCL Financial Services) [EMAIL PROTECTED] wrote: But, it doesn't help much with my requirement. Have you tried to help yourself and search through the ML's archive... at least? -- Massimo http://meridio.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Routing and REST
Greetings, I am new to tapestry and I have a few questions about what is and is not possible within the Tapestry framework. Im helping to spearhead a new project for my company to determine the feasability and cost of a new platform for our product. Tapestry seems like a perfect fit for the UI level but a couple of things are holding me back from serving up the Kool-Aid :). I'm not looking for technical handouts, just an assurance that tapestry will not bind me and maybe a point in the right direction. Our product runs as a SAAS but maintains the ability to feel different for different clients and so serves as a portal. We also need to keep costs down on things like SSL certs domain names. You can think of each client as being in a Silo. So the URL standard embeds the silo name as the first directory in the path: http://www.SaaS.com/ClientsName/TapestryStartsHere.html It's not apparent to me that tapestry will allow me to do this within it. I might be able to do it with a Apache mod but I would rather not do that. THe ClientName would need to exist for every request and would tie into just about everything. The other piece I need that's somewhat related is that I want to be able to expose RESTful web services as part of the same system. So while right now I can go to: http://www.SaaS.com/ClientsName/CreateUser/ to get a user form I also want http://www.SaaS.com/ClientsName/CreateUser/JSON/ to access the same service as a REST web service using JSON or XML or just GET and POST params. Would this just require some custom components? and can I access and manipulate HTTP state and return codes from within Tapestry? Thats it! Thank you all so much for your time I really like tapestry so far and would love to put my mind at ease and get to coding. Ryan -- View this message in context: http://www.nabble.com/Routing-and-REST-tp18382935p18382935.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]
Re: Routing and REST
On Thu, Jul 10, 2008 at 3:33 PM, Ryan.Bergman [EMAIL PROTECTED] wrote: Greetings, I am new to tapestry and I have a few questions about what is and is not possible within the Tapestry framework. Im helping to spearhead a new project for my company to determine the feasability and cost of a new platform for our product. Tapestry seems like a perfect fit for the UI level but a couple of things are holding me back from serving up the Kool-Aid :). I'm not looking for technical handouts, just an assurance that tapestry will not bind me and maybe a point in the right direction. Our product runs as a SAAS but maintains the ability to feel different for different clients and so serves as a portal. We also need to keep costs down on things like SSL certs domain names. You can think of each client as being in a Silo. So the URL standard embeds the silo name as the first directory in the path: http://www.SaaS.com/ClientsName/TapestryStartsHere.html It's not apparent to me that tapestry will allow me to do this within it. I might be able to do it with a Apache mod but I would rather not do that. THe ClientName would need to exist for every request and would tie into just about everything. The other piece I need that's somewhat related is that I want to be able to expose RESTful web services as part of the same system. So while right now I can go to: http://www.SaaS.com/ClientsName/CreateUser/ to get a user form I also want http://www.SaaS.com/ClientsName/CreateUser/JSON/ to access the same service as a REST web service using JSON or XML or just GET and POST params. Would this just require some custom components? and can I access and manipulate HTTP state and return codes from within Tapestry? As i can see it the only thing (you can read also the main thing) that can irk you is the hidden field T5 needs in the POST to process the form correctly. Thats it! Thank you all so much for your time I really like tapestry so far and would love to put my mind at ease and get to coding. I don't know the whole complexity of your project but T5 can adapt well to this job. -- Massimo http://meridio.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Different behavior of Palette Component in FireFox, Safari and IE
Hi Yunhua, really good news! We're using 5.0.11... Thanx for the hint, cheers, Martin On Thu, 2008-07-10 at 07:37 -0400, Yunhua Sang wrote: What version of T5 are you guys using? I think there was a jira about it and it has been fixed already. see. https://issues.apache.org/jira/browse/TAPESTRY-2507 - Palette component forces an unwanted form submit under FireFox 3 Yunhua On Thu, Jul 10, 2008 at 5:44 AM, Martin Grotzke [EMAIL PROTECTED] wrote: Hi, we experience exactly the same issue: with FF3 the palette submits the form, with FF2 this is not the case. Max, when you submit the issue in jira please send a ping here, so that I can vote :) Cheers, Martin On Wed, 2008-07-09 at 18:23 +0200, Maximilian Weißböck wrote: Palette Component behaves different in FireFox then it does in Safari and IE If palette item is moved in FireFox the following events are triggered onSuccess() onSubmit() If palette item is moved in Safari or IE none of the above events is triggered. Is this suggested to be a bug? Then I would file a Jira Issue. Tested with FF 3.0, Safari 3.1 and IE 6 (all on Windows) Regards, Max - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] signature.asc Description: This is a digitally signed message part
[T5] Fixed param on PageLink
Hello again! Is there a way to do fixed parameters with a PageLink component? t:pagelink page=dynamic_content/dynamic context=testingVisualise test/t:pagelink I don't want it to look for a getTesting method, I want that testing is passed as the parameter itself. How can I do it? -- Fabio Kreusch [EMAIL PROTECTED]
[T5Components] multiple palettes on page
Hi, I am trying to put multiple palette components on a page to edit multiple lists at the same time. It seems that only the last palette actually writes its data correctly in the list. Is there a known issue when using multiple palettes on a page? Regards Moritz -- Dipl.-Inform. Moritz Gmelin avetana GmbH Geschäftsführer Brändströmstr. 8 76275 Ettlingen Tel: 07000-AVETANA (07000-2838262) eMail: [EMAIL PROTECTED] Internet: www.avetana-gmbh.de Geschäftsführer: Moritz Gmelin Sitz der Gesellschaft: Ettlingen Amtsgericht Mannheim HRB 362834 UST-ID DE211535427 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Fixed param on PageLink
Hi Fabio, just use the literal binding: t:pagelink page=dynamic_content/dynamic context=literal:testingVisualise test/t:pagelink (See http://tapestry.apache.org/tapestry5/tapestry-core/guide/parameters.html Binding Expressions for further reference. Standard for context is prop, as you can see here: http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/PageLink.html - Tobias Fabio Kreusch schrieb: Hello again! Is there a way to do fixed parameters with a PageLink component? t:pagelink page=dynamic_content/dynamic context=testingVisualise test/t:pagelink I don't want it to look for a getTesting method, I want that testing is passed as the parameter itself. How can I do it? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Fixed param on PageLink
Hi, t:pagelink page=dynamic_content/dynamic context='testing'Visualise test/t:pagelink or t:pagelink page=dynamic_content/dynamic context=literal:testingVisualise test/t:pagelink It's all in the docs. :) -Filip Fabio Kreusch skrev: Hello again! Is there a way to do fixed parameters with a PageLink component? t:pagelink page=dynamic_content/dynamic context=testingVisualise test/t:pagelink I don't want it to look for a getTesting method, I want that testing is passed as the parameter itself. How can I do it? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[T5] Semi static content
Hello all again! I'm trying to do a simple content management system. The point is, the system I'm working on has many semi-static pages. The designers do the contents, and a little bit is dynamic, something like: h1Sample Page/h1 Blablabla blabla ${currentTime} blablabla And there are many of this pages. As dynamic content is minimum, I don't think it's necessary to make all of this .tml pages with their own classes. So I'm trying to do only one .tml page (Dynamic.tml with Dynamic.java). This class will receive a parameter, so on onActivate method he will know wich page to render. void onActivate(String page) {} The problems start here. How can I mix the Dynamic.tml with another .html contents page? AND in way that ${tags} in .html files are properly rendered (it will look for getTags(), not print ${tags} as it is). Any ideas? -- Fabio Kreusch [EMAIL PROTECTED]
T5: what part of tapestry adds Jsessionid
partially related to a post I send a couple of days ago, but perhaps this explains better what I'm trying to do. I'm trying to strip the jSessionId from displaying in the url if: 1. user doesn't have cookies (otherwise it won't display anyway) 2. user is not logged in. I wanted to implement this as a filter, but I have to go with a dispather since to see if a user is logged in I need to have access to the ASM, which I can't get to in a filter. Now somewhere in between all the HttpSevletRequest to tapestry.request comversion, etc. tapestry decides to take over the JSessionId provided by the HttpServletRequest. I want to intercept this call somehow and strip the JSessionId from the request. I implemented a Dispatcher (the last in the line before onActivate is called) and basically wrapped (subclassed) HttpServletRequest and HttpServletResponse to return null for the sessionid and have redirecturl return url. My own HttpServlet get's called in the app (and returns null for getrequestedSessionId()) This request is added as a constructor param to a newly created tapestry.requestImpl which are both saved to RequestGlobals. I though that should do the trick not... Apperantly somehow the jsessionid is picked up anyway although (when expecting requestglobals.getHttpServletRequest.getRequstedSessionId() in page.onactivate() this correctly returns null). Anyone? Thanks. my code: //SessionStripController public final class SessionStripController implements Dispatcher { private ApplicationStateManager asm; private RequestGlobals globals; public SessionStripController(ApplicationStateManager asm,RequestGlobals globals){ this.asm = asm; this.globals = globals; } public boolean dispatch(Request req, Response response) throws IOException { if (req.isRequestedSessionIdValid() globals.getHTTPServletRequest().getCookies()==null) { Session session = req.getSession(false); if (session != null) session.invalidate(); HttpServletRequestWrapper wrappednRequest = new HttpServletRequestWrapperOwn(globals.getHTTPServletRequest()); HttpServletResponseWrapper wrappedResponse = new HttpServletResponseWrapper(globals.getHTTPServletResponse()) { public String encodeRedirectUrl(String url) { return url; } public String encodeRedirectURL(String url) { return url; } public String encodeUrl(String url) { return url; } public String encodeURL(String url) { return url; } }; globals.storeServletRequestResponse(wrappednRequest, wrappedResponse); globals.storeRequestResponse(new RequestImpl(wrappednRequest), new ResponseImpl(wrappedResponse)); } return false; } } //HttpServletRequestWrapperOwn public class HttpServletRequestWrapperOwn extends HttpServletRequestWrapper { public HttpServletRequestWrapperOwn(HttpServletRequest request) { super(request); } public String getRequestedSessionId(){ return null; } } -- View this message in context: http://www.nabble.com/T5%3A-what-part-of-tapestry-adds-Jsessionid-tp18385573p18385573.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]
[T5] is there any way to use actionlink to call submit from outside of FORM?
hi, i have an actionlink outside the form. like below t:actionlink t:id=toolbarSave t:zone=zoneFormView img src=images/saveRecord16.png //t:actionlink form ... input type=submit t:type=submit value=submit /form and, is there any way to call from actionlink to call submit from the FORM? thank you. Regards, Cyber - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Routing and REST
On Thu, Jul 10, 2008 at 6:10 PM, [EMAIL PROTECTED] wrote: Is there a routing class in tapestry that can be manipulated? like routs.rb in RoR? Which would allow me to manipulate the URL-tapestry bindings? Not at all. You have other paths to reach the same (maybe similar) goal. -- Massimo http://meridio.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Routing and REST
Currently the logic necessary to do what you want is part of Tapestry internals (non public, subject to change). I would approach this problem using an override of the LinkFactory service (internal) combined with an in-Tapestry filter to extract the client name from the URL and perhaps a little extra work to replace the default component action and page render dispatchers. I would call that journeyman to master level work, not something a total beginner should try to attempt. There are other options, such as bringing in a Tapestry expert to help out on this aspect. On Thu, Jul 10, 2008 at 9:17 AM, Massimo Lusetti [EMAIL PROTECTED] wrote: On Thu, Jul 10, 2008 at 6:10 PM, [EMAIL PROTECTED] wrote: Is there a routing class in tapestry that can be manipulated? like routs.rb in RoR? Which would allow me to manipulate the URL-tapestry bindings? Not at all. You have other paths to reach the same (maybe similar) goal. -- Massimo http://meridio.blogspot.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]
Re: Routing and REST
This request sounds a little open ended, and I think you can do everything you need with Webapp Filters and Tapestry Filters/Services, you just have to spend the time to learn them and think outside the box a little bit. Our project is using T5 for Facebook and OpenSocial applications so there are lots of weird customizations we have to do, and we serve up a semi-unique application per sports team ( all from the single webapp ). So in one way or another, I bet we employ the techniques you would want to employ. - not sure what you mean by multiple clients but: 1) We map the webapp to the root (/) context. 2) We use a normal Webapp Filter to pull out the first directory path from the url and make that the new context (request.getContextPath().. etc etc ), and capture that to determine which sports team we're going to be serving up. - as for the JSON casting, you're saying that any url would have a normal html representation and a json representation, but how different are they? 1) You can easily create a Tapestry Dispatcher that matches and handles any url ending with /JSON/. You can implement all json as unique services that the primary dispatcher would call depending on the incoming url ( you could configure it using some sort of map).. Or you can even copy what the PageDispatcher does and render another unique page (maybe /json/PAGENAME), if you want to use tapestry pages to generate the json. This page could then return a JSON object back to the dispatcher somehow ( maybe setting a request attribute ), which the dispatcher can pickup and spit out to the client... Ryan.Bergman wrote: Greetings, I am new to tapestry and I have a few questions about what is and is not possible within the Tapestry framework. Im helping to spearhead a new project for my company to determine the feasability and cost of a new platform for our product. Tapestry seems like a perfect fit for the UI level but a couple of things are holding me back from serving up the Kool-Aid :). I'm not looking for technical handouts, just an assurance that tapestry will not bind me and maybe a point in the right direction. Our product runs as a SAAS but maintains the ability to feel different for different clients and so serves as a portal. We also need to keep costs down on things like SSL certs domain names. You can think of each client as being in a Silo. So the URL standard embeds the silo name as the first directory in the path: http://www.SaaS.com/ClientsName/TapestryStartsHere.html It's not apparent to me that tapestry will allow me to do this within it. I might be able to do it with a Apache mod but I would rather not do that. THe ClientName would need to exist for every request and would tie into just about everything. The other piece I need that's somewhat related is that I want to be able to expose RESTful web services as part of the same system. So while right now I can go to: http://www.SaaS.com/ClientsName/CreateUser/ to get a user form I also want http://www.SaaS.com/ClientsName/CreateUser/JSON/ to access the same service as a REST web service using JSON or XML or just GET and POST params. Would this just require some custom components? and can I access and manipulate HTTP state and return codes from within Tapestry? Thats it! Thank you all so much for your time I really like tapestry so far and would love to put my mind at ease and get to coding. Ryan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: what part of tapestry adds Jsessionid
All the jsessionid functionality is provided by the servlet container, not by Tapestry. And it does exactly what you are suggesting ... except that its not about the user being logged in, its about the user have a session. On Thu, Jul 10, 2008 at 8:52 AM, Britske [EMAIL PROTECTED] wrote: partially related to a post I send a couple of days ago, but perhaps this explains better what I'm trying to do. I'm trying to strip the jSessionId from displaying in the url if: 1. user doesn't have cookies (otherwise it won't display anyway) 2. user is not logged in. I wanted to implement this as a filter, but I have to go with a dispather since to see if a user is logged in I need to have access to the ASM, which I can't get to in a filter. Now somewhere in between all the HttpSevletRequest to tapestry.request comversion, etc. tapestry decides to take over the JSessionId provided by the HttpServletRequest. I want to intercept this call somehow and strip the JSessionId from the request. I implemented a Dispatcher (the last in the line before onActivate is called) and basically wrapped (subclassed) HttpServletRequest and HttpServletResponse to return null for the sessionid and have redirecturl return url. My own HttpServlet get's called in the app (and returns null for getrequestedSessionId()) This request is added as a constructor param to a newly created tapestry.requestImpl which are both saved to RequestGlobals. I though that should do the trick not... Apperantly somehow the jsessionid is picked up anyway although (when expecting requestglobals.getHttpServletRequest.getRequstedSessionId() in page.onactivate() this correctly returns null). Anyone? Thanks. my code: //SessionStripController public final class SessionStripController implements Dispatcher { private ApplicationStateManager asm; private RequestGlobals globals; public SessionStripController(ApplicationStateManager asm,RequestGlobals globals){ this.asm = asm; this.globals = globals; } public boolean dispatch(Request req, Response response) throws IOException { if (req.isRequestedSessionIdValid() globals.getHTTPServletRequest().getCookies()==null) { Session session = req.getSession(false); if (session != null) session.invalidate(); HttpServletRequestWrapper wrappednRequest = new HttpServletRequestWrapperOwn(globals.getHTTPServletRequest()); HttpServletResponseWrapper wrappedResponse = new HttpServletResponseWrapper(globals.getHTTPServletResponse()) { public String encodeRedirectUrl(String url) { return url; } public String encodeRedirectURL(String url) { return url; } public String encodeUrl(String url) { return url; } public String encodeURL(String url) { return url; } }; globals.storeServletRequestResponse(wrappednRequest, wrappedResponse); globals.storeRequestResponse(new RequestImpl(wrappednRequest), new ResponseImpl(wrappedResponse)); } return false; } } //HttpServletRequestWrapperOwn public class HttpServletRequestWrapperOwn extends HttpServletRequestWrapper { public HttpServletRequestWrapperOwn(HttpServletRequest request) { super(request); } public String getRequestedSessionId(){ return null; } } -- View this message in context: http://www.nabble.com/T5%3A-what-part-of-tapestry-adds-Jsessionid-tp18385573p18385573.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]
Re: T5: FileUpload and time out
Hey Angelo, It'd be helpful to see the exception that you're talking about. Josh On Thu, Jul 10, 2008 at 12:11 AM, Angelo Chen [EMAIL PROTECTED] wrote: Hi, probably I did not make my original question clear, the UploadExample works, however, there are situations that we got a time out exception, how to track this exception in the following example? thanks for the help, Angelo Angelo Chen wrote: Hi, following sample works, but how to determine if timeout error occurs? thanks. public class UploadExample { private UploadedFile file; public UploadedFile getFile() { return file; } public void setFile(UploadedFile file) { this.file = file; } public void onSuccess() { File copied = new File(/my/file/location/ + file.getFileName()); file.write(copied); } } -- View this message in context: http://www.nabble.com/T5%3A-FileUpload-and-time-out-tp18355064p18377198.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] -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox.
Re: T5: what part of tapestry adds Jsessionid
yeah I realize that JSessionId is there for the session, but I want to build functionality into a dispatcher that strips this jsessionid from the request if a user is not logged in (logged in in my app means that a User-instance exists in the ASM) and if the user has cookies disabled. The rationale is that I don't want search-engines to see the JSessionid, but I want to enable users without cookies to login and track their settings using JSessionID in the url. Since search-engines don't login these 2 groups are nice mutually exclusive and so it's a clean cut when to strip the JSessionid and when not. Except that I'm still not sure how to do it. Wrapping the request and response in a handler (before Tapestry comes in action) and stripping it like that works, but doing it almost exactly the same in a dispather doesn't . That's why I think it has to do with some internal tapestry processing. Do you have an idea where to look? Howard Lewis Ship wrote: All the jsessionid functionality is provided by the servlet container, not by Tapestry. And it does exactly what you are suggesting ... except that its not about the user being logged in, its about the user have a session. On Thu, Jul 10, 2008 at 8:52 AM, Britske [EMAIL PROTECTED] wrote: partially related to a post I send a couple of days ago, but perhaps this explains better what I'm trying to do. I'm trying to strip the jSessionId from displaying in the url if: 1. user doesn't have cookies (otherwise it won't display anyway) 2. user is not logged in. I wanted to implement this as a filter, but I have to go with a dispather since to see if a user is logged in I need to have access to the ASM, which I can't get to in a filter. Now somewhere in between all the HttpSevletRequest to tapestry.request comversion, etc. tapestry decides to take over the JSessionId provided by the HttpServletRequest. I want to intercept this call somehow and strip the JSessionId from the request. I implemented a Dispatcher (the last in the line before onActivate is called) and basically wrapped (subclassed) HttpServletRequest and HttpServletResponse to return null for the sessionid and have redirecturl return url. My own HttpServlet get's called in the app (and returns null for getrequestedSessionId()) This request is added as a constructor param to a newly created tapestry.requestImpl which are both saved to RequestGlobals. I though that should do the trick not... Apperantly somehow the jsessionid is picked up anyway although (when expecting requestglobals.getHttpServletRequest.getRequstedSessionId() in page.onactivate() this correctly returns null). Anyone? Thanks. my code: //SessionStripController public final class SessionStripController implements Dispatcher { private ApplicationStateManager asm; private RequestGlobals globals; public SessionStripController(ApplicationStateManager asm,RequestGlobals globals){ this.asm = asm; this.globals = globals; } public boolean dispatch(Request req, Response response) throws IOException { if (req.isRequestedSessionIdValid() globals.getHTTPServletRequest().getCookies()==null) { Session session = req.getSession(false); if (session != null) session.invalidate(); HttpServletRequestWrapper wrappednRequest = new HttpServletRequestWrapperOwn(globals.getHTTPServletRequest()); HttpServletResponseWrapper wrappedResponse = new HttpServletResponseWrapper(globals.getHTTPServletResponse()) { public String encodeRedirectUrl(String url) { return url; } public String encodeRedirectURL(String url) { return url; } public String encodeUrl(String url) { return url; } public String encodeURL(String url) { return url; } }; globals.storeServletRequestResponse(wrappednRequest, wrappedResponse); globals.storeRequestResponse(new RequestImpl(wrappednRequest), new ResponseImpl(wrappedResponse)); } return false; } } //HttpServletRequestWrapperOwn public class HttpServletRequestWrapperOwn extends HttpServletRequestWrapper { public HttpServletRequestWrapperOwn(HttpServletRequest request) { super(request); } public String getRequestedSessionId(){ return null; } } -- View this message in context: http://www.nabble.com/T5%3A-what-part-of-tapestry-adds-Jsessionid-tp18385573p18385573.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL
Re: [T5] is there any way to use actionlink to call submit from outside of FORM?
is there any way to call from actionlink to call submit from the FORM? thank you. You can either submit the form, or follow the actionlink. If you want the action to be performed when the form is submitted then add the functionality/method call to one of the form event handlers. Then you can use prototype's Event to watch for a click on the link and submit the form. a href=# id=toolbarSave img src=images/saveRecord16.png //a t:form t:id=YOUR_FORM_ID t:zone=zoneFormView ... input type=submit t:type=submit value=submit /t:form script Event.observe('toolbarSave', 'click', function() {$('YOUR_FORM_ID').submit(); return false;}); /script I didn't run this, so you might need to play with it to make it work. Josh On Thu, Jul 10, 2008 at 8:55 AM, Tan [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: hi, i have an actionlink outside the form. like below t:actionlink t:id=toolbarSave t:zone=zoneFormView img src=images/saveRecord16.png //t:actionlink form ... input type=submit t:type=submit value=submit /form and, is there any way to call from actionlink to call submit from the FORM? thank you. Regards, Cyber - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox.
Re: T5: what part of tapestry adds Jsessionid
What most people do is to use a normal Webapp Filter to strip jsessionid from ever being added to the urls.. If you override the HttpServletResponse.encode*Url methods to simply return the url and not let the container add the jsession id to it. This means that sessions will only work for users with cookies, but then again who has cookies turned off these days? Britske wrote: yeah I realize that JSessionId is there for the session, but I want to build functionality into a dispatcher that strips this jsessionid from the request if a user is not logged in (logged in in my app means that a User-instance exists in the ASM) and if the user has cookies disabled. The rationale is that I don't want search-engines to see the JSessionid, but I want to enable users without cookies to login and track their settings using JSessionID in the url. Since search-engines don't login these 2 groups are nice mutually exclusive and so it's a clean cut when to strip the JSessionid and when not. Except that I'm still not sure how to do it. Wrapping the request and response in a handler (before Tapestry comes in action) and stripping it like that works, but doing it almost exactly the same in a dispather doesn't . That's why I think it has to do with some internal tapestry processing. Do you have an idea where to look? Howard Lewis Ship wrote: All the jsessionid functionality is provided by the servlet container, not by Tapestry. And it does exactly what you are suggesting ... except that its not about the user being logged in, its about the user have a session. On Thu, Jul 10, 2008 at 8:52 AM, Britske [EMAIL PROTECTED] wrote: partially related to a post I send a couple of days ago, but perhaps this explains better what I'm trying to do. I'm trying to strip the jSessionId from displaying in the url if: 1. user doesn't have cookies (otherwise it won't display anyway) 2. user is not logged in. I wanted to implement this as a filter, but I have to go with a dispather since to see if a user is logged in I need to have access to the ASM, which I can't get to in a filter. Now somewhere in between all the HttpSevletRequest to tapestry.request comversion, etc. tapestry decides to take over the JSessionId provided by the HttpServletRequest. I want to intercept this call somehow and strip the JSessionId from the request. I implemented a Dispatcher (the last in the line before onActivate is called) and basically wrapped (subclassed) HttpServletRequest and HttpServletResponse to return null for the sessionid and have redirecturl return url. My own HttpServlet get's called in the app (and returns null for getrequestedSessionId()) This request is added as a constructor param to a newly created tapestry.requestImpl which are both saved to RequestGlobals. I though that should do the trick not... Apperantly somehow the jsessionid is picked up anyway although (when expecting requestglobals.getHttpServletRequest.getRequstedSessionId() in page.onactivate() this correctly returns null). Anyone? Thanks. my code: //SessionStripController public final class SessionStripController implements Dispatcher { private ApplicationStateManager asm; private RequestGlobals globals; public SessionStripController(ApplicationStateManager asm,RequestGlobals globals){ this.asm = asm; this.globals = globals; } public boolean dispatch(Request req, Response response) throws IOException { if (req.isRequestedSessionIdValid() globals.getHTTPServletRequest().getCookies()==null) { Session session = req.getSession(false); if (session != null) session.invalidate(); HttpServletRequestWrapper wrappednRequest = new HttpServletRequestWrapperOwn(globals.getHTTPServletRequest()); HttpServletResponseWrapper wrappedResponse = new HttpServletResponseWrapper(globals.getHTTPServletResponse()) { public String encodeRedirectUrl(String url) { return url; } public String encodeRedirectURL(String url) { return url; } public String encodeUrl(String url) { return url; } public String encodeURL(String url) { return url; } }; globals.storeServletRequestResponse(wrappednRequest, wrappedResponse); globals.storeRequestResponse(new RequestImpl(wrappednRequest), new ResponseImpl(wrappedResponse)); } return false; } } //HttpServletRequestWrapperOwn public class HttpServletRequestWrapperOwn extends HttpServletRequestWrapper { public HttpServletRequestWrapperOwn(HttpServletRequest request) { super(request); } public String getRequestedSessionId(){ return null; } }
Re: T5: what part of tapestry adds Jsessionid
I had a similar issue with my site and instead took the route of not creating the session for users that don't need it. I had to override the tapestry Form component so it only stored the validation tracker when there were errors and implement a session persistence that didn't create a session if the value stored was null. I believe the last part has been fixed in the standard session persistence. I'm in 5.0.11. here's my extended Form if you're interested. public class Form extends org.apache.tapestry.corelib.components.Form { @Persist private ValidationTracker _tracker; private ValidationTracker _nonPersistedTracker; public ValidationTracker getDefaultTracker() { if (_nonPersistedTracker == null) { if (_tracker != null) { // _tracker is loaded via injection magic when it's in the session _nonPersistedTracker = _tracker; } else { _nonPersistedTracker = new ValidationTrackerImpl(); } } return _nonPersistedTracker; } public void setDefaultTracker(ValidationTracker defaultTracker) { _nonPersistedTracker = defaultTracker; } protected void onAction() { if (_nonPersistedTracker.getHasErrors()) { _tracker = _nonPersistedTracker; } else { _tracker = null; } } } Josh On Thu, Jul 10, 2008 at 10:30 AM, Britske [EMAIL PROTECTED] wrote: yeah I realize that JSessionId is there for the session, but I want to build functionality into a dispatcher that strips this jsessionid from the request if a user is not logged in (logged in in my app means that a User-instance exists in the ASM) and if the user has cookies disabled. The rationale is that I don't want search-engines to see the JSessionid, but I want to enable users without cookies to login and track their settings using JSessionID in the url. Since search-engines don't login these 2 groups are nice mutually exclusive and so it's a clean cut when to strip the JSessionid and when not. Except that I'm still not sure how to do it. Wrapping the request and response in a handler (before Tapestry comes in action) and stripping it like that works, but doing it almost exactly the same in a dispather doesn't . That's why I think it has to do with some internal tapestry processing. Do you have an idea where to look? Howard Lewis Ship wrote: All the jsessionid functionality is provided by the servlet container, not by Tapestry. And it does exactly what you are suggesting ... except that its not about the user being logged in, its about the user have a session. On Thu, Jul 10, 2008 at 8:52 AM, Britske [EMAIL PROTECTED] wrote: partially related to a post I send a couple of days ago, but perhaps this explains better what I'm trying to do. I'm trying to strip the jSessionId from displaying in the url if: 1. user doesn't have cookies (otherwise it won't display anyway) 2. user is not logged in. I wanted to implement this as a filter, but I have to go with a dispather since to see if a user is logged in I need to have access to the ASM, which I can't get to in a filter. Now somewhere in between all the HttpSevletRequest to tapestry.request comversion, etc. tapestry decides to take over the JSessionId provided by the HttpServletRequest. I want to intercept this call somehow and strip the JSessionId from the request. I implemented a Dispatcher (the last in the line before onActivate is called) and basically wrapped (subclassed) HttpServletRequest and HttpServletResponse to return null for the sessionid and have redirecturl return url. My own HttpServlet get's called in the app (and returns null for getrequestedSessionId()) This request is added as a constructor param to a newly created tapestry.requestImpl which are both saved to RequestGlobals. I though that should do the trick not... Apperantly somehow the jsessionid is picked up anyway although (when expecting requestglobals.getHttpServletRequest.getRequstedSessionId() in page.onactivate() this correctly returns null). Anyone? Thanks. my code: //SessionStripController public final class SessionStripController implements Dispatcher { private ApplicationStateManager asm; private RequestGlobals globals; public SessionStripController(ApplicationStateManager asm,RequestGlobals globals){ this.asm = asm; this.globals = globals; } public boolean dispatch(Request req, Response response) throws IOException { if (req.isRequestedSessionIdValid() globals.getHTTPServletRequest().getCookies()==null) { Session session = req.getSession(false); if (session != null) session.invalidate(); HttpServletRequestWrapper
Re: Displaying image on T5 page
Hi Yeeswar, I recently had exactly the same requirement, and solved it in the same way referenced in the wiki page. So then I rewrote my solution as a DisplayChart component, which takes a chart as a parameter and handles the rest of the work for you. A few notes/comments, though: 1) In my case, the chart wasn't generated from parameters in the url, per se. So I initially had problems with the browser caching the chart image because even though the chart had changed, the url was the same. I solved that issue by generating an identifier key for the chart that ensures that different charts get different urls. 2) I create the byte array outside of the StreamResponse. That way I can set the content length (and any other properties I want) in prepareResponse 3) The Wiki article uses jpeg compression. PNG is better for charts, and just as easy to do with the JFreeChart API. If you're interested in my DisplayChart code, write me off list and I'll send it along. Robert On Jul 10, 2008, at 7/107:43 AM , Lance Java wrote: This should help http://wiki.apache.org/tapestry/Tapestry5HowToCreatePieChartsInAPage 2008/7/10 Yeeswara Nadapana (HCL Financial Services) [EMAIL PROTECTED]: Hi, I am new to Tapestry. Using Tapestry 5.0.10 with my application. I need to display a chart image on my application using dynamic data. I am using JFreeChart for that. But, I couldn't get the way to display the image on my page. I have to display the image while rendering the page, not as an ActionLink. Can anyone help with this? Regards, Yeeswar DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: what part of tapestry adds Jsessionid
Just turn your ServletFilter into a RequestFilter. You can use ApplicationStateManager in RequestFilters now. (See, for example: http://code.google.com/p/tapestry5-cayenne/source/browse/trunk/tapestry5-cayenne-server/src/main/java/com/googlecode/tapestry5cayenne/services/CayenneRequestFilter.java) Robert On Jul 10, 2008, at 7/1012:30 PM , Britske wrote: yeah I realize that JSessionId is there for the session, but I want to build functionality into a dispatcher that strips this jsessionid from the request if a user is not logged in (logged in in my app means that a User- instance exists in the ASM) and if the user has cookies disabled. The rationale is that I don't want search-engines to see the JSessionid, but I want to enable users without cookies to login and track their settings using JSessionID in the url. Since search-engines don't login these 2 groups are nice mutually exclusive and so it's a clean cut when to strip the JSessionid and when not. Except that I'm still not sure how to do it. Wrapping the request and response in a handler (before Tapestry comes in action) and stripping it like that works, but doing it almost exactly the same in a dispather doesn't . That's why I think it has to do with some internal tapestry processing. Do you have an idea where to look? Howard Lewis Ship wrote: All the jsessionid functionality is provided by the servlet container, not by Tapestry. And it does exactly what you are suggesting ... except that its not about the user being logged in, its about the user have a session. On Thu, Jul 10, 2008 at 8:52 AM, Britske [EMAIL PROTECTED] wrote: partially related to a post I send a couple of days ago, but perhaps this explains better what I'm trying to do. I'm trying to strip the jSessionId from displaying in the url if: 1. user doesn't have cookies (otherwise it won't display anyway) 2. user is not logged in. I wanted to implement this as a filter, but I have to go with a dispather since to see if a user is logged in I need to have access to the ASM, which I can't get to in a filter. Now somewhere in between all the HttpSevletRequest to tapestry.request comversion, etc. tapestry decides to take over the JSessionId provided by the HttpServletRequest. I want to intercept this call somehow and strip the JSessionId from the request. I implemented a Dispatcher (the last in the line before onActivate is called) and basically wrapped (subclassed) HttpServletRequest and HttpServletResponse to return null for the sessionid and have redirecturl return url. My own HttpServlet get's called in the app (and returns null for getrequestedSessionId()) This request is added as a constructor param to a newly created tapestry.requestImpl which are both saved to RequestGlobals. I though that should do the trick not... Apperantly somehow the jsessionid is picked up anyway although (when expecting requestglobals.getHttpServletRequest.getRequstedSessionId() in page.onactivate() this correctly returns null). Anyone? Thanks. my code: //SessionStripController public final class SessionStripController implements Dispatcher { private ApplicationStateManager asm; private RequestGlobals globals; public SessionStripController(ApplicationStateManager asm,RequestGlobals globals){ this.asm = asm; this.globals = globals; } public boolean dispatch(Request req, Response response) throws IOException { if (req.isRequestedSessionIdValid() globals.getHTTPServletRequest().getCookies()==null) { Session session = req.getSession(false); if (session != null) session.invalidate(); HttpServletRequestWrapper wrappednRequest = new HttpServletRequestWrapperOwn(globals.getHTTPServletRequest()); HttpServletResponseWrapper wrappedResponse = new HttpServletResponseWrapper(globals.getHTTPServletResponse()) { public String encodeRedirectUrl(String url) { return url; } public String encodeRedirectURL(String url) { return url; } public String encodeUrl(String url) { return url; } public String encodeURL(String url) { return url; } }; globals.storeServletRequestResponse(wrappednRequest, wrappedResponse); globals.storeRequestResponse(new RequestImpl(wrappednRequest), new ResponseImpl(wrappedResponse)); } return false; } } //HttpServletRequestWrapperOwn public class HttpServletRequestWrapperOwn extends HttpServletRequestWrapper { public HttpServletRequestWrapperOwn(HttpServletRequest request) { super(request); } public String getRequestedSessionId(){ return null; } } -- View this
T5: RequestDispatcher to include Tapestry5 Pages
Trying to include Tap5 pages from another J2EE War Servlet/JSP. Using RequestDispatcher to include the tapestry5 page. It keeps complaining that the tap5 page does not exist. If I try the same URL in browser, it works fine. There were some threads in the forum about this. But nothing worked. (tried dispatcherINCLUDE/dispatcherdispatcherFORWARD/dispatcher in the t5 filter mappings in web.xml) Any solutions would be greatly helpful in moving to Tapestry 5. -- View this message in context: http://n2.nabble.com/T5%3A-RequestDispatcher-to-include-Tapestry5-Pages-tp472602p472602.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: what part of tapestry adds Jsessionid
Tha's an interesting route, ill have a look at it, Thanks. joshcanfield wrote: I had a similar issue with my site and instead took the route of not creating the session for users that don't need it. I had to override the tapestry Form component so it only stored the validation tracker when there were errors and implement a session persistence that didn't create a session if the value stored was null. I believe the last part has been fixed in the standard session persistence. I'm in 5.0.11. here's my extended Form if you're interested. public class Form extends org.apache.tapestry.corelib.components.Form { @Persist private ValidationTracker _tracker; private ValidationTracker _nonPersistedTracker; public ValidationTracker getDefaultTracker() { if (_nonPersistedTracker == null) { if (_tracker != null) { // _tracker is loaded via injection magic when it's in the session _nonPersistedTracker = _tracker; } else { _nonPersistedTracker = new ValidationTrackerImpl(); } } return _nonPersistedTracker; } public void setDefaultTracker(ValidationTracker defaultTracker) { _nonPersistedTracker = defaultTracker; } protected void onAction() { if (_nonPersistedTracker.getHasErrors()) { _tracker = _nonPersistedTracker; } else { _tracker = null; } } } Josh On Thu, Jul 10, 2008 at 10:30 AM, Britske [EMAIL PROTECTED] wrote: yeah I realize that JSessionId is there for the session, but I want to build functionality into a dispatcher that strips this jsessionid from the request if a user is not logged in (logged in in my app means that a User-instance exists in the ASM) and if the user has cookies disabled. The rationale is that I don't want search-engines to see the JSessionid, but I want to enable users without cookies to login and track their settings using JSessionID in the url. Since search-engines don't login these 2 groups are nice mutually exclusive and so it's a clean cut when to strip the JSessionid and when not. Except that I'm still not sure how to do it. Wrapping the request and response in a handler (before Tapestry comes in action) and stripping it like that works, but doing it almost exactly the same in a dispather doesn't . That's why I think it has to do with some internal tapestry processing. Do you have an idea where to look? Howard Lewis Ship wrote: All the jsessionid functionality is provided by the servlet container, not by Tapestry. And it does exactly what you are suggesting ... except that its not about the user being logged in, its about the user have a session. On Thu, Jul 10, 2008 at 8:52 AM, Britske [EMAIL PROTECTED] wrote: partially related to a post I send a couple of days ago, but perhaps this explains better what I'm trying to do. I'm trying to strip the jSessionId from displaying in the url if: 1. user doesn't have cookies (otherwise it won't display anyway) 2. user is not logged in. I wanted to implement this as a filter, but I have to go with a dispather since to see if a user is logged in I need to have access to the ASM, which I can't get to in a filter. Now somewhere in between all the HttpSevletRequest to tapestry.request comversion, etc. tapestry decides to take over the JSessionId provided by the HttpServletRequest. I want to intercept this call somehow and strip the JSessionId from the request. I implemented a Dispatcher (the last in the line before onActivate is called) and basically wrapped (subclassed) HttpServletRequest and HttpServletResponse to return null for the sessionid and have redirecturl return url. My own HttpServlet get's called in the app (and returns null for getrequestedSessionId()) This request is added as a constructor param to a newly created tapestry.requestImpl which are both saved to RequestGlobals. I though that should do the trick not... Apperantly somehow the jsessionid is picked up anyway although (when expecting requestglobals.getHttpServletRequest.getRequstedSessionId() in page.onactivate() this correctly returns null). Anyone? Thanks. my code: //SessionStripController public final class SessionStripController implements Dispatcher { private ApplicationStateManager asm; private RequestGlobals globals; public SessionStripController(ApplicationStateManager asm,RequestGlobals globals){ this.asm = asm; this.globals = globals; } public boolean dispatch(Request req, Response response) throws IOException { if (req.isRequestedSessionIdValid() globals.getHTTPServletRequest().getCookies()==null) { Session session =
Re: [T5] is there any way to use actionlink to call submit from outside of FORM?
thanks for your reply. I will try it out :) On Fri, Jul 11, 2008 at 1:41 AM, Josh Canfield [EMAIL PROTECTED] wrote: is there any way to call from actionlink to call submit from the FORM? thank you. You can either submit the form, or follow the actionlink. If you want the action to be performed when the form is submitted then add the functionality/method call to one of the form event handlers. Then you can use prototype's Event to watch for a click on the link and submit the form. a href=# id=toolbarSave img src=images/saveRecord16.png //a t:form t:id=YOUR_FORM_ID t:zone=zoneFormView ... input type=submit t:type=submit value=submit /t:form script Event.observe('toolbarSave', 'click', function() {$('YOUR_FORM_ID').submit(); return false;}); /script I didn't run this, so you might need to play with it to make it work. Josh On Thu, Jul 10, 2008 at 8:55 AM, Tan [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: hi, i have an actionlink outside the form. like below t:actionlink t:id=toolbarSave t:zone=zoneFormView img src=images/saveRecord16.png //t:actionlink form ... input type=submit t:type=submit value=submit /form and, is there any way to call from actionlink to call submit from the FORM? thank you. Regards, Cyber - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5 - Javascript libraries on ajax requests
Hello, I have a zone that is updated with an ajax request. Inside this zone, I use an InPlaceEditor components (from t5components) many times (one for each row in a table). The InplaceEditor component include a javascript library, controls.js, with the IncludeJavascruptLibrary annotation. On the first request, this works ok, because even when the InPlaceEditor is used many times, control.js is included just once. But when I update this zone element and many other InPlaceEditor's arrived, this request comes with many requests for including control.js. The JSON response when I update the zone is something like this: {scripts:[/assets/scriptaculous/5.0.14-SNAPSHOT/controls.js,/assets/scriptaculous/5.0.14-SNAPSHOT/controls.js,/assets/scriptaculous/5.0.14-SNAPSHOT/controls.js,/assets/scriptaculous/5.0.14-SNAPSHOT/controls.js], I'm doing something wrong? Or T5 doesn't check that a library is included more than once in ajax requests?? Regards. -- View this message in context: http://www.nabble.com/T5---Javascript-libraries-on-ajax-requests-tp18395682p18395682.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]