Re: T5: Restarting a service
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Angelo, How about moving the logic performed at service start into a method - if it isn't already - and just call it again to restart the service? /Filip On 2009-06-07 07:16, Angelo Chen wrote: Hi, I got a service, MyService, which when loaded will read a parameter from file, as I understand service in T5 will remain loaded until the application is restarted, is there a way to programmatically restart a loaded service? Thanks, A.C. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQEcBAEBAgAGBQJKK4tYAAoJEEfiH7PpjaMnCLUIAJsad/7W4VCrlnKphbqfc2Fq XU1fPD/ZxMo/pE8HX2a5xidk7PyagcZr8yXBKi6hXiEWmXPRqh8L41CcC/5E7GSw +6WvQDlnxDjtCEcHxg7gZRNaS4JFv+gFEimWJM9Xev6R2cmoDO9zRX0szSk1R2V8 vC4EikV1tE2rkBGepvn3JgzjLJRwum7AD6kHbYwsd1y3JP+juCcOnxk7dqjqlOS0 fBhFqOuqKHz6qc/6fU5HvVgwq0tOevxAD6jXlEdh0VetR0w1dlWIiz0sca6Qf3BK lRkKQZLr6oRA3k0OsI5EE90Uhy8touKf0YBiRRS4C6npsHyWd8irzRTdtSK+Qhw= =eupP -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: xsd for 5.1 is not available(needed for upgrading)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, The documentation has been updated to reflect most, if not all, of the changes. Template inheritance etc. is described here, at the bottom: http://tapestry.apache.org/tapestry5.1/guide/templates.html /Filip On 2009-05-14 08:04, Peter Stavrinides wrote: Basically, you can still merrily use tapestry_5_0_0.xsd, but you'll miss out on some of the new templating features in 5.1 (t:remove, for example). There appear to be some great new features, are there any examples to follow? especially interested in template inheritance! Peter - Original Message - From: Robert Zeigler robe...@scazdl.org To: Tapestry users users@tapestry.apache.org Sent: Thursday, 14 May, 2009 04:33:02 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: xsd for 5.1 is not available(needed for upgrading) Yes and no. :) See: http://tapestry.apache.org/tapestry5.1/guide/templates.html Specifically the section under Tapestry Namespace. Basically, you can still merrily use tapestry_5_0_0.xsd, but you'll miss out on some of the new templating features in 5.1 (t:remove, for example). This is to ensure backwards compatibility (ie, avoids naming conflicts in the upgrade). Robert On May 13, 2009, at 5/138:11 PM , Angelo Chen wrote: Hi, when upgrading from 5.0.18, do we have to change from tapestry_5_0_0.xsd to tapestry_5_1_0.xsd in the template? and what's the reason tapestry_5_1_0.xsd not exist here: http://tapestry.apache.org/schema/tapestry_5_1_0.xsd Thanks, Yiqun Shi wrote: This file is not available. http://tapestry.apache.org/schema/tapestry_5_1_0.xsd It is useful for tapestry 5.1. Only tapestry_5_0_0.xsd is there. Any clue? Steven -- View this message in context: http://www.nabble.com/xsd-for-5.1-is-not-available-tp22744305p23532668.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQEcBAEBAgAGBQJKC8QFAAoJEEfiH7PpjaMnOfAIAIlGeSbCFP67+sZ34QgG6W1K f9lFpwZXISv0ZrcQ0nwY/tKqwbvzB0EWg6++YVuPA+Y7hn4j8SA1hi1oM0D9+B0t Kw5bHohejhs+O/AeaTw9O2AJDk82r9BH47XXC6KeB7PcO0rk3eE5doVkEl2uMAfW 40PYXsg0hszKf0ilajZ3oDJl3k0S0qRwc9UAZg5ERsYRXykzwv2lv5heJWvuuOAm qeJGJICRGz7ERLF6oBF8xrMu2C94kFyrQozROGDehtwOOCPismSoC6/QJ4kelCMK oKbNXobCucnPyh8tyPJdhpjKNnCJTHlUI5W9I+heMeTE5r9Uw/r9zswmcMQD0GM= =B/8+ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: page components activation contexts
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 You should use an EventLink instead - that's what they're for. :) /Filip Yury Luneff skrev: Hello, users. Is there a way to separate activation contexts for page and its components? I wrote a component that uses AJAX to interact from client side. Render part of the component creates links for callbacks using ComponentResources. And callbacks are method with fixed number of arguments (2 for ex.). When the page that contains that component tries to introduce its own activation context, callback url will have page's context embedded. So now AJAX calls to component with 3 context elements - 1 from page and 2 from component. And as the component knows nothing about this, it must be treated in a special way (for now I retained only onActivate part of the page so it's not a fully pages context that is saved). Is there a way to clearly separate contexts of the page and component events so that component could be unaware of any page it is embedded to? -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQEcBAEBAgAGBQJKC9YoAAoJEEfiH7PpjaMnMeYH/3DxibIPmP0c1mVrDqoo0Nob swgq+Fuw8oxjH7ck8exjEwHrkbune93AButw0RLn/VyE4HpUEV+kr0zeJT85gqOj D86O1Uf7x/vxyLyhPgiTIVkjmjsI6cDGjlTJmcI/z5Cq0pWlP/ojb10Flkn1mTMM Yy9SzFSrsGhOammXHI4JyjkVV64FAcgeqMydcdE65fnKLtNBURMGzhLqHDq8Bc8G +RlQHGqEzesoJbF0Ln2gVTT9TdSZ5OnQpMy/aIR87kklPbavTQpQ0rE6ZA88NsvG UQp8S7nv3Vx7uewX1iT8FLSqQB2CmFyrekFQeIj4lZklyeFLgz5sBFG01376rDE= =ncaC -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.1 - List Parameters
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Geoffrey, The documentation for Tapestry 5.1 is at http://tapestry.apache.org/tapestry5.1, not http://tapestry.apache.org/tapestry5. I believe this is what you're looking for: http://tapestry.apache.org/tapestry5.1/guide/propexp.html /Filip On 2009-05-14 16:56, Geoffrey Wiseman wrote: I seem to recall hearing somewhere that T5.1 has support for easily binding parameter values to a List in a component. I can't find anything about it in the release notes or documentation, so I'm starting to think I imagined it. Is this ringing a bell for anyone? - Geoffrey -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQEcBAEBAgAGBQJKDDIPAAoJEEfiH7PpjaMne7gH/0WQeGkudc40xQg1+7SnJ/ag +uAxm0WbwzjrI//8perS7iK6dWuszXhCKfIw1DQeuYrf+LnGTLiWBcZEiEM6XALb YlQdcYr/BI6uq+ySdco5uprq6pAJyfqLj94eN/BniFMooPRRgogPrqdKcl6RV66E 6+F9rKjt99QgXBEa1Ae/2VnfvGAVLebhxrPG2ZjOzzq861UYJ9FEw2vYH0ZyCHKM I2Htnft781RBE+TD/WTRLVfSHgEbdpBFbU/RuCHB3zH/CJesiZFxnrz8OoPdvwoF SriFBF74x9ZA2z5lPb7MV9Ts3XCMoWw0GUciHFGr9WasjwtDCBaVcFj+1OW7sjc= =lRbU -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: Passing named/structured-type params in URLs?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I wanted something like this maybe nine months ago and ended up creating my own @RequestParameter annotation, overriding Form, ActionLink, EventLink, and PageLink, and modifying the way Tapestry generates URLs. It works, but it ain't pretty. Anyway, back then, it looked like something like this would be easy enough to implement using a persistence strategy, it would just require some changes to many aspects of URL handling in Tapestry - for one, I remember needing access to the name of the page a Link was for. I think that it would be worthwhile, though - the activation context is great for a lot of things, but as you can tell from this thread, you sometimes need the flexibility offered by request parameters - and that is currently way too hard (compared to how easy most things are) in Tapestry. /Filip On 2009-05-09 00:29, Robert Zeigler wrote: That should work. I think it could be interesting, though, if tapestry provided an additional persistence mechanism, ala: @Persist(PersistenceConstants.QUERY_PARAMETER) private String p; @Persist(PersistenceConstants.QUERY_PARAMETR) private Integer irn; which would then take the values in p and irn and stash them in the url, like: p=valueEncodedValueirn=valueEncodedValue Obviously this wouldn't be appropriate to use everywhere; if you're concerned about users tampering with URLs, you'd want to avoid it. But in cases like that presented below, where you expressly want users to be able to muck about with parameters, it would be useful. Note that this is similar to the current client-side persistence mechanism, except that mechanism a) rolls all persisted values into a single parameter and b) base64 encodes the parameter. As long as you've got the basic mechanism for doing the above, you could translate it into a pretty url via url rewriting without too much trouble. Thoughts? Robert -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQEcBAEBAgAGBQJKCsjVAAoJEEfiH7PpjaMnWbIIAJdAPuQo5jngCCZt2DSXV5e3 dGG+0wOOnxrmC2jFTDrxVRvWx7dfA4hGuAFPQgz/USP+NviNkEvFz2iGfZTAgmzA 19BFLfx1AdWYu2ft1tPULkBGmxaLa/Rjt0qosHn3+kKo+Kgl0yhDjcZSbx29+Ic6 8eBRn0krOha5o6GU6OU/iIqMEjRvErAOutB63nlRr7oIfuttffucPXDGE0UutQ9v llwzlQoGfk5ywHr0AqJlclA0AH44ePOtxiP4xg3OwgVh9Wge/vHMVGxYURzbp/lf wvqTP3iASZHOYEYpji6/J31awC/3T8gcP+Rm/53VLrDtsU2dHnfzJ+B7hJpjYAk= =SYe3 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: 301 moved permanently
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hey there, I have a similar need on one of my sites. Here's how I solved it: http://markmail.org/message/53xyz7hxzpxyrn5d The code is more than a year old, but it should still work. /Filip On 2009-04-17 11:10, Davor Miku wrote: Hi guys! I have this old struts site, rewritten in T5. Problem are links (with Google). For example old links are : www.example/content/populateContent.do?contentId=xxx and new are: www.example/content/xxx What I want is to set 301 redirect for old links, redirecting to new one, in same class (content/Index.java) Index.java : public void onActivate(String article) { try{ int id = Integer.parseInt(article); // new urls Content content = contentDAO.getContent(id); } catch(Exception e){ article = article.substring(19); // remove populateContent.do?contentId= int id = Integer.parseInt(article); /* Here should be something like this. You get the picture */ response.setStatus(301); response.setHeader( Location, http://www.example.com/content/; + id); } } How can I do this? Every help is appreciated. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQEcBAEBAgAGBQJJ75nOAAoJEEfiH7PpjaMn0LoH/RHe+0DCbxwHhSNflQm1DgyX MlNtQLbFWOaTgoJOfJz1ykHELrJAfFyCuzg2e6NRGOkJpJIG5wVKpPQl8/zzJzCq IbRMDbBFLjSObZG1fbYaUWx4hZIwDMLfXwwY7D+DDiTDafOnWOqnrz16x7ZJrHlC MjGklJBc/KR/OLfRVqR4dnweBnJ7nD+sN8kszTtZg8SS6UJsd53MGbWHtOi1GTmS PgL3VXOkb3YeqCrO7QBXxLLG0nA+dNfyXHA64OK2g6e2kM1PchGadr9FFsuvCQPO 1WH07VVmvxbbHh47lrFenbDXNz5NoVIaaA7S4NC/OC7n7vu04uvUESSKne7R8/c= =eK2d -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [ANNOUNCE] Tapestry 5.1.0.2
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Andy, Javassist is in the JBoss Maven 2 repository: http://repository.jboss.com/maven2/javassist/javassist/ At least that's where I get it from. :) /Filip On 2009-04-03 11:38, Blower, Andy wrote: Regarding the dependencies, I also have an issue that I'd not spotted before. Ivy can't find javassist-3.9.0.GA.jar in the maven2 repositories. I can't find it with a browser either. (e.g. http://repo1.maven.org/maven2/javassist/javassist/) So, that's breaking my build too. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQEcBAEBAgAGBQJJ1eogAAoJEEfiH7PpjaMnJO0IAJTUZknrTokFBroyv+TqLRc4 lbK/I8rKV+Qt9/Rn/yYHNoUEmc0ZDidoPizC7Kw0PAJ3psmlIQKWUDeehXsN6c4X yfiSeddSjZwxteg73Uq0KfSDhdLK+esb4ReuAGpAV+iUdKhs6Mnw5zX06BHE81d7 5VxBMBtyFnzLW0cetdKwhDSrMTphg+kEGfH2pRlqVQxOZE/Erm45ENDs8NKITITT FvAvPKtPG+62OQdcN06reS8resdzLIp87Y9pRyuqNBK0bPM6nBvjXuJ93tgAA4gJ 6rlkbgedwMSQq/+EfTPmER7Qc6p6AJANurR4XlX0oTdj35CJcoXYhSDdgzEWZ7k= =Mpj7 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: multiple context values
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 What about contributing a ValueEncoder that converts between a ProductId and a String? I haven't needed to work with composite primary keys, so I can't say if it'd work, but it's worth a shot. /Filip On 2009-04-02 00:33, Thiago H. de Paula Figueiredo wrote: Em Wed, 01 Apr 2009 18:35:53 -0300, Fernanda C. Carmo fernanda.ca...@gmail.com escreveu: I have an object Product and it has a composite primary key (ProductId). How can I put this object Product in actionlink's context value? Hi! Create a method that return a List containig the values thatt comprise the composite primary key. ;) This works in any Tapestry version. Use EventContext as the only parameter of onActivate or any other event handler method. By the way, in new code, avoid composite primary keys. It's not worth the trouble. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQEcBAEBAgAGBQJJ0+6AAAoJEEfiH7PpjaMngogH/jK+fjLs1Q01kukoVAA/V/rb A2FW5oB8T9sik+OL/gRueSF8eV0z00j/lYaZ8F/p+sbIetSy16CCn0XnPUOYagx6 JBBWplsSDgHG62NnpO5+RzYBPmF4gLh4gOYrGo+WIaZcT/ZK9ohWrcLfF9V0IQrw ciBcdxb1VToJF51qmtHnG4EcMORNkyd0gzElX1FpBVLiiJUOb4+CWRhLdEasF0nu muKNA0zuZd85C3w2K7yWt15NBR8HRg3jJ/Xa54vHAq8OQ+1hFhkJLFck9PGIYrt3 HCQHqKbJxPYOgd3JVamrTSszqjnhVriVNHKfD8H8LfUb0/dBxDaclx88KTY0Oy8= =EgqM -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: t5: create a page link inside a service
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Angelo, Inject the ComponentSource service, get a page from it, then get its ComponentResources. /Filip On 2009-03-31 11:54, Angelo Chen wrote: Hi, I'd like to createPageLink inside a services, but ComponentResource can't be injected into a service, any other way around? Thanks, Angelo -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQEcBAEBAgAGBQJJ0ejpAAoJEEfiH7PpjaMnnS0H/2h9BG8wI6ZuE7+qKa5mVrpg R2MsDTXUlS3qAYabGxmgCK1EIB+ROrOCkP6iHLfHPNm1bpbcuDudZUtgBrs1GX2h Q0bo6azcWn5ZqkFpqVmZaRbdgaeM7wx1poNI99gH4mwwNl8ITi3NPRpIne6pJCFd gXsPMz9TEHy2+ii+R1E5OFRCfGBJV3CvU5bAbyNGq3qGtMAsqCvwvVsiMCfvLK2E 8XghA7L8bgV4qysiI+2LMN+Ov7rpsyqnry+wUmrGk7b+0fDNYQTTl9RQjrYTeF0v ofvY/DoEtrOVwq3sYaE+o1SqR+P7bFyXmhsHJh/ymyHqWlWKxHonke0g40Bapzs= =Krzu -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: t5: create a page link inside a service
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Did my e-mail from almost 15 hours ago not get through to everyone on the list? :P To quote myself, Inject the ComponentSource service, get a page from it, then get its ComponentResources. I've got a dedicated service for this, it gets the ComponentResources of the page you want to link to from the ComponentSource, which has the added benefit of ensuring that you're linking to a valid page. Here's the relevant code (for 5.0.18): private final ComponentClassResolver componentClassResolver; private final ComponentSource componentSource; public RedirectServiceImpl(ComponentClassResolver componentClassResolver, ComponentSource componentSource) { this.componentClassResolver = componentClassResolver; this.componentSource = componentSource; } public Link createPageLink(Class? pageClass, boolean override, Object... context) { String pageName = componentClassResolver.resolvePageClassNameToPageName(pageClass.getCanonicalName()); return componentSource.getPage(pageName).getComponentResources().createPageLink(pageName, override, context); } You can, of course, do the same for events etc. /Filip On 2009-03-31 23:21, Angelo Chen wrote: Thanks, but that works for 5.1.x, not for 5.0.18. I'm eagerly expecting the release of 5.1.x stable version. Howard Lewis Ship wrote: http://tapestry.formos.com/nightly/tapestry5/faq/general.html#create-page-link-from-service On Tue, Mar 31, 2009 at 2:54 AM, Angelo Chen angelochen...@yahoo.com.hk wrote: Hi, I'd like to createPageLink inside a services, but ComponentResource can't be injected into a service, any other way around? Thanks, Angelo -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQEcBAEBAgAGBQJJ0rqJAAoJEEfiH7PpjaMnKqYIAKoto5n15bm73SjdEKYewlZZ F8sgeoHyj1mAIP8xOLH0d5g9PVffYMlMWTWPyJ+JnDS06dy86/mfgDXOEvBaVuBG 8HHtEiVSwTaNZeE8Z2GOljSH4pMYH2KXsOkWwiI/r7mQWD0IDznNEpDkNx250x2q fkpRGtFWqAchdEj7yRNIGBt9QjgSCstjrXjIJ24IXD+xleHRL3vdJ+4ua2K46/Cc sykyzmr5eZd53eszXtw3kl6occq2Gg5SPGpBOh2WzG3++KjDu3ncohe0bT312BdW frMC8hqv+DTQOWauvVC8PQempEglao13Dd97AgnRtrfffw0lPFRvL8iS9jqNCEA= =BxpZ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: make Start page default for page subfolder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 It used to be Start, but that was changed *quite* a while ago. /Filip On 2009-03-29 16:50, manuel aldana wrote: Thiago H. de Paula Figueiredo schrieb: Em Sun, 29 Mar 2009 07:42:26 -0300, manuel aldana ald...@gmx.de escreveu: is there a way to tell tapestry to have the Start page for subpage folders as default also? Why don't you use Index instead of Start? Sorry, this works of course. I mixed something up (thought the tapestry 5 default page would be */start and not */index). -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQEcBAEBAgAGBQJJ0AmsAAoJEEfiH7PpjaMnL1wH/1V7PrVTSv7PaU0meBkNajeJ hhxtEEEox8RzcKTHScLqwSK+7KsY8uTVCHPp6K0elWzpz0rOqECXViBawsK8P+0A KIbuDz7icdyKTNhl2T0UuYvgGydDMtZ+8ems2r2ZlmcguYbsY1jwPN+MRUldu5jd F2S2a2Bp6BidYw0lnSz6hBFW5vptIhMCj7g1rk4iuyQYvkWM2d8XitAp/msa0DfJ 0lJAwdmrRTvZjln6FrPptfLT0QVYEnShw5M4ogIDZJqMeU79CnOLQbBcc4NArP2a hG8O9qsUgysOB9s2DAhEaFy3KaVhsNE7gbKjkaBYwvD3tr7aeytQGPrvYb5hhuU= =FrTM -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Hibernate ID
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 There's actually no way - at least according to the documentation, my own experience, and Google - to specify an unsaved-value using just annotations. You'd have to use a mapping file for this. But apart from that, Jonathan is spot on. :) /Filip On 2009-02-10 12:16, Jonathan O'Connor wrote: Uli, Using Object for key fields is a standard micro pattern in JPA and Hibernate. Of course, the DB does not want to save null as a key field value, but the most people get the entity manager to auto-generate keys for their objects. By leaving the key as null, the entity manager knows that it needs to persist the object, generating a key for it. This is a handy pattern, when you want to create a parent object with several children, and then persist the whole object tree in one call (otherwise, you would have to persist the tree, one object at a time, from the bottom up - Yikes!). JPA/Hibernate can only do this if it knows what a null key value is, and in Java that is of course, null. I think (from memory) you can define a specific value as a null, so you could use an int or a long as a key field type, and then specify, for example, -999, as the null value. Then, you have to set the key field to -999 somewhere, and this is all too much work for most people, therefore, they use Object key field values! Ciao, Jonathan -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQEcBAEBAgAGBQJJkd4/AAoJEEfiH7PpjaMnoDwH/1SdtbIjF0uqxbqe8GJONrty cYM5Y9Nyh7KTVrNCHaFd0me6TgTYUpjvZnwzIufIZmIA/pp05PcmhpoN2DLXbT/o 6Ixx+yFDQdO0RX2D7fUEk+Gtpl55pvZ63UMWNPbGZcqU1FOLaie6s1Qm9p0NYCmN BcrXRtKDfkaJUN/ayKflukK3UAtkdpW25R183JsEOzncBkBB3XynTYQk0oWXcTEF kmVz8+Ki9y+ZBPPDp/M+P+IkTK+DNw979uAUiaxHtPb0eueew9D365ewUpstKuxt 95K28mlpkKxwbQYXUHAC5buNJzMdro4bspGZ+UPwbUAg3vJ1WagLKuJYhCEytv8= =jyxQ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5 service per request
Perhaps Tapestry should throw an exception when one tries to do this instead of failing silently? :) -Filip On 2009-02-08 18:03, Howard Lewis Ship wrote: You need to define an interface for the service; only services with interfaces can be proxied, and only proxied interfaces can have non-default scope. On Sun, Feb 8, 2009 at 4:48 AM, Jack Nuzbit fnuz...@googlemail.com wrote: I'm trying to use the tapestry IoC to inject a per thread service into my other services. @Scope(ScopeConstants.PERTHREAD) public class PerThreadService { private MyObject myObject; public PerThreadService(Cookies cookies) { myObject = new MyObject(cookies.readCookieValue(userData))) System.out.println(Constructing new per thread service.); } } I want this PerThreadService to get constructed at least once per request but I can see it gets created the first time it's required and then the constructor never gets called again. Does anyone know I can do this? Thanks Jack - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to style a button
Oww, I had no idea... *edits some of his code* :) Thanks for the tip from here as well! -Filip On 2009-02-09 15:31, Michael Gentry wrote: This is slightly OT, but you do not want to use the BUTTON tag. IE (at least IE 6) does not handle multiple BUTTONs in a FORM correctly. It will cause you massive pain. Use CSS on the INPUT, instead (and I see someone else already pointed you to some articles for that). mrg PS. Safari and Firefox do handle multiple BUTTONs correctly, but if IE is even a remote target browser, better to avoid BUTTON altogether. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] URL Manipulation
Whoa, that's some amazing stuff! Thanks Andreas. :) -Filip On 2009-02-06 00:24, Andreas Andreou wrote: Hi, see http://tuckey.org/urlrewrite/manual/2.6/ (i see they also have a 3.2 version) Just define some outbound-rules (instead of rules) for the cases you're interested, i.e. outbound-rule from^/app/category/product/([0-9]+)?venue=([a-z]+)locale=([a-z]+)$/from to/app/$2/$3/category/product/$1/to /outbound-rule On Fri, Feb 6, 2009 at 12:14 AM, xfile80303 l...@grokers.net wrote: Hi Andreas, Oh, please don't mistake me for an expert on T5 by any means. :) I just don't see how the filter you mention would help with links generated by T5. For instance, let's say I put the filter in place, and I give a user the URL to access the site: /app/venue_name/en_US/category/product/UUID (fill in with imaginary actual values, if you will) The filter could strip out the venue_name, locale, whatever and put them as actual parameters to the URL... something like: /app/category/product/UUID?venue=venue_namelocale=en_US And the URL would get passed in this way to T5 and the page would render, no problem. However, once on the page, let's say there's a link to another product. That link URL would be generated by T5 and look something like: /app/category/product/UUID2?venue=venue_namelocale=en_US and thus, a user will see this, bookmark it, send it in email to friends, etc. instead of the nicely formatted URL that we started with. So the filter only makes it possible to map published URLS to something T5 can understand, and does not allow us to filter outgoing URLs to change them back to nice ones. Does it? Cheers, Levi Andreas Andreou-2 wrote: I'm really a T5 novice - what i was saying is that if you do find a way to have that info in the url (nomatter how, even as query params + i'm sure it's possible), you can use that filter to completely transform the look of the urls ... On Thu, Feb 5, 2009 at 10:56 PM, xfile80303 l...@grokers.net wrote: Thank you Andreas. I'm not sure I understand how this would help me with issue #2 (as defined in my original posting). Can you enlighten me? Cheers, Levi Andreas Andreou-2 wrote: An alternative is http://tuckey.org/urlrewrite/ And since Tapestry always calls the servlet container to encode the url, urlrewrite will work for both generating urls (to output in html) and parsing them (incoming) On Thu, Feb 5, 2009 at 10:31 PM, xfile80303 l...@grokers.net wrote: Hi Thiago, Thanks for taking the time. I believe I need to do some clarification however. The example URL I mentioned is order specific. Meaning it would not make sense to have the venu_name (or others of these URL parameters) to be at the end of the URL. They need to go into the URL before the page name structure in order to be purposeful. Cheers, Levi Thiago H. de Paula Figueiredo wrote: Em Thu, 05 Feb 2009 14:17:32 -0300, xfile80303 l...@grokers.net escreveu: Greetings all, Hello! :) Specifically, I would like to manipulate the URLs such that I can have nice RESTful style URLs which feed information into the page ultimately being rendered. Tapestry is incredibly RESTful, so I guess you don't have to do much to accomplish what you want. :) For example: /app/venue_name/en_US/category/product/UUID where product would be the rendering page, UUID could be the activation context (which, if I understand correctly T5 will handle already). However, the venue_name and locale are not actual pages and are simply information which is to be gleaned from the URL and passed to the page so it can render as specified. All you need to do is to ignore the venue_name and locale parameters. thedailytube.com, a website created by some guy in this list I always forget the name (I'm sorry . . .), does what you need in the video pages. Look at this URL: http://www.thedailytube.com/video/15794/christian-bales-freak-out-remix The video page uses the first parameter (15794) as the id of the video to be shown. The second parameter is there just for search engine purposes. Try http://www.thedailytube.com/video/15794/tapestry5rules. It gives you exactly the same page as the original URL. ;) As other posts have suggested, it would seem to me that any manipulation of the URL would have to happen in such a way that Tapestry would properly 1) parse these URL parameters and pass them into the system for use by the page, One advice is to use EventContext. It is a little hard to find in the documentation (EventContext section in http://tapestry.apache.org/tapestry5/guide/event.html), but any event handler method, including onActivate(), can have a single EventContext parameter. It provides you two methods: one with the parameter count, other that returns the value of the n-th parameter. Having an onActivate(EventContext context) method makes it really easy to deal with different parameters in the activation context, even optional parameters. and 2) understand these parameters would need to
Re: How to style a button
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Yeah, well, asking for IE to do things right is like asking for peace in the world... it's a beautiful thought, but it ain't gonna happen. Sadly. - -Filip On 2009-02-09 23:48, Michael Gentry wrote: I don't remember the exact issue (that was a few brain cells ago), but I think it only did the first button's action and ignored the others. My application was working just fine until I tried it in IE. (How many people have said that before?) I'm sure you could ask the Google Brain for more details. mrg On Mon, Feb 9, 2009 at 1:22 PM, Filip S. Adamsen f...@fsadev.com wrote: Oww, I had no idea... *edits some of his code* :) Thanks for the tip from here as well! -Filip On 2009-02-09 15:31, Michael Gentry wrote: This is slightly OT, but you do not want to use the BUTTON tag. IE (at least IE 6) does not handle multiple BUTTONs in a FORM correctly. It will cause you massive pain. Use CSS on the INPUT, instead (and I see someone else already pointed you to some articles for that). mrg PS. Safari and Firefox do handle multiple BUTTONs correctly, but if IE is even a remote target browser, better to avoid BUTTON altogether. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQEcBAEBAgAGBQJJkMDnAAoJEEfiH7PpjaMnbuIH/3Ex85xXDvV0/uCTeop7q5gL wcGTU8+b7gYRrrhTDFmzzw9xcVFi0gOZe591mtbDiTOotyMpB7IT1lHNhBMSDMRE G3sy1Ml7yQM717G4XbRYjFq+NQHYKXifvvcXIlYv+7GThSi4btCBjCBFuK9sbC7m PzAuQzD74+WSoSnXYD7+uraisGE067BsnXkUY6VQULDFEyVedwmEp+LtLh9b1L3z kFFqw23LJun1vHjDKbefTD0uBRkPvGLpTFxl9xQB7Nq/cqbCrC0fljwRP+SKmpvD mfF2PpO9fpIiu2cU3SHkhWfgNgx7wWNqBms5ASqqFL+9Q/Nj6Yq6Kc3vWOde3tg= =sicA -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: css validation
It's not valid at all AFAIK. I've changed it to use an RGB-value in my own version of T5. -Filip On 2008-10-05 20:12, Luther Baker wrote: Ah ... I guess the t-palette-controls are something specific to IE: I guess the color brown is not valid for a border? -Luther On Sun, Oct 5, 2008 at 1:07 PM, Luther Baker [EMAIL PROTECTED] wrote: Were these CSS errors by chance fixed in 5.0.15? http://jigsaw.w3.org/css-validator/validator?uri=http://www.effectiveprogramming.com/ http://www.effectiveprogramming.com/assets/tapestry/5.0.14/default.css 133DIV.t-beaneditorValue Error : border http://www.w3.org/TR/CSS21/box.html#propdef-border brown is not a color value : 2px outset brown 330 DIV.t-palette-controls BUTTON[disabled] IMG Parse Error = 25 ) 331 DIV.t-palette-controls BUTTON[disabled] IMGProperty -moz-opacity doesn't exist : 0.25 Thanks, -Luther - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: contributeMetaDataLocator ordering....
Hi, Defaults for Symbols are easy. Just contribute your defaults to FactoryDefaults, and let the user override them in ApplicationDefaults: http://tapestry.apache.org/tapestry5/tapestry-ioc/symbols.html Configurations are different, and have caused quite a few people problems. There's been talk of adding an override method MappedConfiguration to allow this, see Howard's comment: https://issues.apache.org/jira/browse/TAP5-45 You can easily code around this anyhow, it's just a matter of having an extra service to hold the default configuration. -Filip On 2008-10-03 20:20, Fernando Padilla wrote: can you tell me why you want to change the contribution? why not set it only once? Alright, so maybe my response below is a little rant/flame. But really, are you truly saying that Tapestry doesn't allow libraries to properly set defaults, then allow users of the library to override those defaults?? rant This is a library! A library needs to be able to set defaults, that users of the library can override for their particular purposes. Else, every setting becomes required for every user to set! How does tapestry deal with Symbols? Do we have to always set tapestry.production-mode, or page pooling configuration? Or with the default mime-type of a page? Would you want to force everyone to set the mime-type of every page to be text/html??? Tapestry MUST support a way to set defaults reliably for Symbols and configurations reliably, and yet allow users of those to override them! I really can't see any other way. Are you truly saying that this basic use case can't be supported? /rant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] How to get to ApplocationGlobals and ServletContext
Hi, Sounds like you tried using @Inject and friends to inject the services? This won't work.* You'll need to use constructor injection instead: public class ServiceImpl implements Service { private final AnotherService anotherService; public ServiceImpl(AnotherService anotherService) { this.anotherService = anotherService; } } * Except in the unreleased Tapestry 5.0.16, where this has been added. See https://issues.apache.org/jira/browse/TAP5-231 for more information. -Filip On 2008-10-04 23:11, Eric Ma wrote: Thanks for your reply. Actually, I found I cannot inject anything into RequestFilter, not even Logger or any of my custom services. Looks like injection can only happen to components and pages. Eric kranga wrote: ApplicationGlobals cannot be injected into RequestFilter. Inject RequestGlobals into it instead or inject ApplicationStateManager (?) into it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: spring T5 integration on acegi security considerations
Hi, Maybe you could use Tapestry-Acegi? http://www.localhost.nu/java/tapestry5-acegi/ -Filip On 2008-10-03 16:59, wesley wrote: hi all, i've been implementing a project by using T5 mostly as front end, spring framework for back(eg Dao and db operations). after few search on it regarding the acegi implementation, i'm a little bit confused as whether or not to implement this security framework on T5 or spring. any recommendations or advise on this topic? should i just apply this security layer on T5 alone? or Spring 2 for securing the backend or both?? please advise, thanks wesley - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: template dynamics
Hi, Define Blocks containing the different states you need and use a Delegate to render the block you need based on an expression. This way you can do the whole if-then-else/switch stuff in your page class. Template: t:block t:name=block1.../t:block t:block t:name=block2.../t:block t:delegate t:to=activeblock Class: @Inject private ComponentResources resources; public Block getActiveBlock() { String blockId = ...; return resources.getBlock(blockId); } It's also possible to have the blocks on another page, in that case you can get the page through ComponentSource#getPage, get its ComponentResources, and go from there. http://tapestry.apache.org/tapestry5/guide/templates.html (see block) http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/Block.html http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Delegate.html http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/ComponentResourcesCommon.html#getBlock(java.lang.String) http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/services/ComponentSource.html#getPage(java.lang.Class) -Filip On 2008-10-02 14:39, János Jarecsni wrote: Hi Uli, thanks, I did not know about these. However, what if I have to switch between more states? If seems to be awkward in that case (if embedding is possible at all). Thanks Janos 2008/10/1 Ulrich Stärk [EMAIL PROTECTED] Have a look at the If ( http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/If.html ) and Zone ( http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Zone.html ) components. Uli Am Mi, 1.10.2008, 17:06, schrieb János Jarecsni: Hi guys, is there a way to change the template (piece of the template) which gets generated, depending on state? Here is what I mean: Given a component C, its C.tml looks like the following: htmlblabla... //if (loggedIn) Logged in //else Not Logged in /html Of course I know this concrete problem can be solved using expansion. But I'm now after replacing large chunks of the template depending on state. It is easy to do so in a JSP page for example. Thanks in advance, janos - 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: My Tapestry5 suggestion list
Hi, On 2008-10-02 18:10, Alex Kotchnev wrote: 4. Allow the use of templates without having to have a corresponding Java class for it. This would certainly be nice, as on a small project that I do (that for now only has little functionality) I already have a whole bunch of dumb java classes. I'll file feature requests for these in a couple of days if there are no objections from the list members. I believe there's already an issue for this. -Filip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: need help with template components
Hi, Using a layout component is a good way to start: http://tapestry.apache.org/tapestry5/guide/layout.html -Filip On 2008-09-29 21:46, Gabriel Rodriguez wrote: For a while now I've been trying to apply a common template to several Tapestry 5 pages with no success. How is this achieved? Very thankful! Gabriel F. Rodríguez Associate Software Engineer, Engineering 400 West Dynix Drive Provo, Utah 84604-5650 Phone: (801) 223-5307 Fax: (801) 223-5202 [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Anchor problem: other components being affected
Hi, For what you're trying to do, it's a lot easier to put an id on the h3 and just refer to that as your anchor. -Filip On 2008-09-26 11:11, Daniel_ Alonso Sanchez wrote: Sorry for the previous post, I hope this will be ok :(. Well, i must confess i really didn't know how to title this post, so... my apologizes for the name. The thing is that I have an anchor that looks like this: a name=family1/ h3Subtitle3/h3 A first glance to this code made me think that everthing will we ok, but my surprise after the rendering of the tml was that the previous code finally looks in this way: a name=family1 shape=rect/ah3a name=family1 shape=rectSubtitle3/a/h3 Despite of the shape=rect that i don't know yet how to hide, the thing is that i really don't know why the h3 element is surrounded with the a element... Is there anyway to change this behavior? Thanks a lot in advance - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Select component: howto create a SelectModel out of ListString
Hi, Just implement org.apache.tapestry5.SelectModel. You can extend org.apache.tapestry5.util.AbstractSelectModel when you do. -Filip On 2008-09-26 12:20, Andy Pahne wrote: I have a simple list of Strings that should be the source of a SelectModel. How do I create one? I had a look at http://wiki.apache.org/tapestry/Tapestry5SelectObject but it's outdated (before the T5 package name refactoring) and just looks to complicated for my simple purpose. Also I am not a great fan of forking core lib components and keeping them in touch with the current development. There must be an easier way, I think. Andy - 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: return Index.class problem
Hi, This was changed between 5.0.14 and 5.0.15 and subsequently reverted in 5.0.16. See https://issues.apache.org/jira/browse/TAPESTRY-2675. -Filip On 2008-09-26 13:05, [EMAIL PROTECTED] wrote: Hi, I am implementing an access controller as specified in the Wiki HOW-TOs http://wiki.apache.org/tapestry/Tapestry5HowToControlAccess On a logout ActionLink I do: return Index.class; In the past this has been working fine. Today I tried using the link and I get an exception: [ERROR] TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: Parameter pageName was null or contained only whitespace. java.lang.IllegalArgumentException: Parameter pageName was null or contained only whitespace. It appears that returning Index.class is now giving the URL / rather than /Index and the code in AccessController.checkAccess() effectively calls Component page = componentSource.getPage(/); Any ideas on why this behaviour might have changed (the only thing I've been working on has been adding Spring bean injection and changes to web.xml as specified in the Wiki HOW-TO. Thanks! - 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: Tags not being closed by t5. W3C Accesibility Fails :(
Hi, You don't need to have the ?xml version=1.0 encoding=UTF-8? bit at the beginning of your pages - UTF-8 is the default encoding for XML files, so it should - and does - work without it. Besides, (older versions of) Internet Explorer tends to trip on it. -Filip On 2008-09-25 12:44, Daniel Alonso Sanchez wrote: Wow, it works! Thanks so much, i didn't know anything about that but, there is another problem. That solution is great for closing the tags, but it introduce this piece of code at the begining of the page ?xml version=1.0 encoding=UTF-8? this ?xml version=1.0 encoding=UTF-8? is causing a wrong placing of our divs. On the other hand, placing ?xml version=1.0 encoding=UTF-8? into the head section makes everything ok. Is there any solution for this misplacing? Something like a meta charset tag? Thank you so much again - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Questions about T5 html markup generated
Weird. I just noticed that. I can't find either shape or rect anywhere in the Tapestry source, though. Oh, and the shape attribute is defined alright, so it shouldn't be a problem, really. -Filip On 2008-09-25 14:01, Daniel Alonso Sanchez wrote: Same to me. I have the same problem with the ActionLink's: tapestry generate shape=rect property :( - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: UploadedFile causes JVM to Terminate
Hi, I use UploadFile extensively with Java 6 version 1.6.0_07 on Windows and Linux. Never had any problems. -Filip On 2008-09-25 16:31, Keith Bottner wrote: Apple updated their Java VM today to 1.5.0_16 so I went through this again and it crashed out the entire VM once again. So it appears NOT to be limited to a specific version of the Java Virtual Machine. Does anybody have anything else to try? Is anybody using the UploadFile functionality successfully? If so on on VM and on what system? Thanks in advance, Keith On Sep 24, 2008, at 4:31 AM, Jason Courcoux wrote: Hi Keith, Not sure if it is the same issue, but have had a very similar problem in the past where certain images have caused the JVM to crash, which was related to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4712349. Have you tried uploading different images? If this is the case, the solution we found was to upgrade java to 1.6.0_06 (I think 1.5.0_15 also works), which instead of killing the JVM, just threw a CMMException. Hope this helps, Jason Keith Bottner wrote: I don't have one available to me at the moment. I thought I would try to see if anyone else was having the problem to try to determine my next direction. Keith On Sep 23, 2008, at 3:45 PM, Filip S. Adamsen wrote: Ouch... well, I've got no idea what that could be to be honest. Have you tried running the code on another system? -Filip On 2008-09-23 22:16, Keith Bottner wrote: Don't know that it will help but here is the OS Report Process: java [2673] Path:/System/Library/Frameworks/JavaVM.framework/ Versions/1.5.0/Home/bin/java Identifier: java Version: ??? (???) Code Type: X86 (Native) Parent Process: eclipse [341] Date/Time: 2008-09-23 15:13:38.682 -0500 OS Version: Mac OS X 10.5.5 (9F33) Report Version: 6 Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x Crashed Thread: 3 snip/ - 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] -- Jason Courcoux Developer, ts.com Limited Network House, Langford Locks, Kidlington, Oxon. OX5 1GA Company registered in England and Wales number 3830932 e: [EMAIL PROTECTED]w: www.ts.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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: UploadedFile causes JVM to Terminate
Hi Keith, That sounds weird. Do you have a stack trace? -Filip On 2008-09-23 20:00, Keith Bottner wrote: Using Tapestry 5.0.14 Using Tomcat 6.0.13 Using Mac OS X 10.5.5, with JVM 1.5.0_13 I want to upload an image so I am using the UploadFile support that comes with Tapestry 5; however, after the file has been selected and the form submitted, and after the onValidateForm event occurs a severe exception occurs that craters the JVM that Tomcat is running within. The onSuccess event never occurs. Has anyone else seen this problem? Does anybody know of a solution? tml file has input type=file t:type=upload t:id=logofile size=50 style=height:auto/ java class @Property private UploadedFile logofile; I never get a chance to use logofile in onSuccess because the JVM has crashed by that time. Anyone Thanks in advance, Keith - 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: UploadedFile causes JVM to Terminate
Oops, forgot about that... well, any information you have would be useful. It's just weird. I can't see why this would crash the JVM... -Filip On 2008-09-23 20:57, Keith Bottner wrote: I do not get a Java stack dump since it exits the JVM it kills Tomcat and all logging so nothing is recorded. I do get a window on Mac OS X with low level information if that is what you are looking for? Keith On Sep 23, 2008, at 1:33 PM, Filip S. Adamsen wrote: Hi Keith, That sounds weird. Do you have a stack trace? -Filip On 2008-09-23 20:00, Keith Bottner wrote: Using Tapestry 5.0.14 Using Tomcat 6.0.13 Using Mac OS X 10.5.5, with JVM 1.5.0_13 I want to upload an image so I am using the UploadFile support that comes with Tapestry 5; however, after the file has been selected and the form submitted, and after the onValidateForm event occurs a severe exception occurs that craters the JVM that Tomcat is running within. The onSuccess event never occurs. Has anyone else seen this problem? Does anybody know of a solution? tml file has input type=file t:type=upload t:id=logofile size=50 style=height:auto/ java class @Property private UploadedFile logofile; I never get a chance to use logofile in onSuccess because the JVM has crashed by that time. Anyone Thanks in advance, Keith - 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]
Re: Overriding a render phase method
Hi Andy, I totally agree on first and last parameters. As it is now, I'm using if-else components pretty much everywhere. =/ You'd have my vote on a JIRA issue. -Filip On 2008-09-23 21:12, Blower, Andy wrote: snip/ To be honest I think the standard loop component would benefit from first last Boolean parameters that are set to true for first and last iterations repectively. Anyone else agree, or is this an unusual need? Thanks, Andy. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Overriding a render phase method
Well... You could try this: t:loop t:source=source t:value=value t:index=var:index t:if t:test=var:index; /t:if ${value} /t:loop That's what I use. -Filip On 2008-09-23 21:58, Blower, Andy wrote: Thanks Filip, I'll try and raise an enhancement request when I get a spare 10 mins. I've just been trying to do this using composition. I keep getting errors with render variables, and I really don't have time to track this down. It's pretty silly that I've spent probably two hours trying to use the T5 loop component to display a list of values separated by semicolons without having one at the end. This shouldn't be hard, or require a custom component. Maybe I'm missing some easy solution to this problem or something? -Original Message- From: Filip S. Adamsen [mailto:[EMAIL PROTECTED] Sent: 23 September 2008 20:34 To: Tapestry users Subject: Re: Overriding a render phase method Hi Andy, I totally agree on first and last parameters. As it is now, I'm using if-else components pretty much everywhere. =/ You'd have my vote on a JIRA issue. -Filip On 2008-09-23 21:12, Blower, Andy wrote: snip/ To be honest I think the standard loop component would benefit from first last Boolean parameters that are set to true for first and last iterations repectively. Anyone else agree, or is this an unusual need? Thanks, Andy. - 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]
Re: UploadedFile causes JVM to Terminate
Ouch... well, I've got no idea what that could be to be honest. Have you tried running the code on another system? -Filip On 2008-09-23 22:16, Keith Bottner wrote: Don't know that it will help but here is the OS Report Process: java [2673] Path: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/java Identifier: java Version: ??? (???) Code Type: X86 (Native) Parent Process: eclipse [341] Date/Time: 2008-09-23 15:13:38.682 -0500 OS Version: Mac OS X 10.5.5 (9F33) Report Version: 6 Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x Crashed Thread: 3 snip/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Upgrade pains 5.0.15
Hi, I'm surprised @Environmental + @Persist worked in the first place. Environmentals are not regular services, they're pushed onto a stack at the right time during rendering, often with specific configuration, so it doesn't make sense to persist them. -Filip On 2008-09-22 16:34, Peter Stavrinides wrote: I am upgrading from 5.0.14 to 5.0.15, and have come across this error several times: Caused by: org.apache.tapestry5.internal.services.TransformationException: Field _tabList of class pages.hf.Fund is already claimed by @org.apache.tapestry5.annotations.Persist and can not be claimed by @org.apache.tapestry5.annotations.Environmental Probably some foul coding on my part, but I am having trouble understanding exactly what I have botched up, obviously the field is in conflict, Persist and Environmental don't play nice together anymore, why though? and what is the correct approach? Thanks for your help! Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Component library common I18N file
Hi, You want to use an Application Message Catalog: http://tapestry.apache.org/tapestry5/guide/localization.html -Filip Neeme Praks wrote .. I'm not sure if it is the same, but I'm also interested if there is a way to centralize ALL i18n strings into a single messages file. By ALL i18n strings I mean all texts from components, pages and layouts combined. So when I need to add a new language to my T5-based webapp, I can take that one file, give it to translators, add translated file to my webapp and - voila, it works! Maybe that is already now possible and I have just overlooked something? Rgds, Neeme - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: T5: ApplicationStateObject is misleading
@Scope does, indeed, make more sense than @Persist and @ApplicationStateObject. I wouldn't mind that change, but is it feasible at this point in Tapestry 5's development cycle? -Filip On 2008-09-17 17:36, Geoff Callender wrote: Exactly. To everyone who thinks @ApplicationState is not a misleading term, I would ask you to think back to when you started with T5. Are you sure you didn't think @ApplicationState meant application-wide scope? When I see @ApplicationState today I still do a momentary double-take before I remind myself that only services have application-wide scope. Of course, it would be possible to persist an ASO in a way that achieves application-wide scope, but who has ever done it and why would you? Lubor's suggestion in an earlier thread is compelling - remove all confusion by replacing @Persist and @ApplicationState with @Scope: @Scope(FLASH) @Scope(PAGE) @Scope(CONVERSATION) @Scope(SESSION) @Scope(APPLICATION) I think it deserves serious consideration, don't you? Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Localized translators
Hi, Yes, you can just inject Request and PersistentLocale. -Filip Ulrich Stärk skrev: In order to have localized Translators, Howard suggested to override the default TranslatorSource service and add my own Translators to it. If I want to have localized Translators I have to take into account the Request's current locale and the locale that might have been set in the PersistentLocale Service which can be different for different users. But the TranslatorSource is a singleton object so I'd either have to construct a new Translator for every incoming request or construct a set of Translators for every supported locale at startup, in both cases provided I can inject Request and PersistentLocale into my service. My two questions are: Is the way I outlined the only way to get localized Translators or do you have a better idea? Can I just inject Request and PersistentLocale into my overriding TranslatorSource service and have access to the Request's respectively PersistentLocale's locale? TIA, 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: AW: T5: ApplicationStateObject is misleading
There are still dozens of Tapestry services that will need to be changed/rewritten, though. I'm not against this, just saying it's a huge change at this point - the way I see it, anyway. -Filip On 2008-09-17 18:12, Hilco Wijbenga wrote: On Wed, Sep 17, 2008 at 09:03, Filip S. Adamsen [EMAIL PROTECTED] wrote: @Scope does, indeed, make more sense than @Persist and @ApplicationStateObject. I wouldn't mind that change, but is it feasible at this point in Tapestry 5's development cycle? Sure, just deprecate @Persist and @ApplicationStateObject and introduce @Scope as their replacement. All old code will still work and new code can use @Scope. (It's even relatively easy to automate [i.e. script] the move from the old code to the new.) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tacos @Cached in t4
I'm sorry, but what do you expect Tapestry to do about that? You're explicity setting the property each time the page is loaded. @Persist doesn't change that. You'll need to check whether or not persistThisOne is not null before assigning to it for this to work. -Filip On 2008-09-07 08:39, michael lim wrote: i tried this. whenever i press f5, pagebeginrender will still be called and db will be hit @Persist(session) public abstract Collection getPersistThisOne(); public abstract void setPersistThisOne(Collection persistThisOne); public void pageBeginRender(PageEvent event) { System.out.println(pageBeginRender..); setPersistThisOne( dao.getFromDB()); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to create simple wizard with tapestry
Shouldn't that be @InjectPage? -Filip On 2008-09-05 15:15, Thiago H. de Paula Figueiredo wrote: Em Fri, 05 Sep 2008 09:17:09 -0300, Alex Florentino [EMAIL PROTECTED] escreveu: public Object onSuccess() { my.package.tranc.pages.User userPage = new my.package.tranc.pages.User(); userPage.setAluno(classmate); return userPage; } @Inject private User userPage; public Object onSuccess() { userPage.setAluno(classmate); return userPage; } } One common pitfall for anyone learning Tapestry 5 is that you cannot instatiate pages and components objects by yourself. 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: AJAX ActionLink exception if clicked as page loads
Hi Geoff, Tapestry doesn't hook up zones etc. until the DOM is loaded, so the link isn't an AJAX link at the time you click it. You can check Request#isXhr in your event handler to see if it's an AJAX request - if it's not you can't return a Block, so you'll have to figure out another way to do what needs to be done. -Filip On 2008-09-06 14:48, Geoff Callender wrote: Is this a known problem? Is there a known solution? I have a page with 2 ActionLinks - the first link updates the whole page; the second link specifies a zone. If you click on the two links in quick succession then an exception is thrown. Alternatively, just Reload the page and click on the second link before the page has finished reloading and you'll get the same exception. Here's the page, with source: http://202.177.217.122:8080/jumpstart/examples/javascript/ajax Here's 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. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie question about T5 urls
Nope, that's not possible anymore. The reason it worked in T4 is that friendly URLs were just aliases for the real Tapestry URLs. That's not how it is in T5. -Filip On 2008-09-03 14:33, nick shaw wrote: Hi I am new to Tapestry5 and I have a question about page urls: I have a page called admin/ManageContent which I access with http://server/context-root/admin/manageContent. I have now secured the page using Acegi so only admin users can access pages that match /admin/*, so typing the above url into my browser redirects me to the login page which is great. But is there any way a malicious user could could bypass the acegi filter to access the page? I know it was possible to do something like this with T4's friendlyUrls feature. Nick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: @PageActivationContext and @CommitAfter
Hi Angelo, Put this.person.view_count = this.person.view_count + 1; in setupRender (@SetupRender) and put @CommitAfter on that. -Filip On 2008-09-03 15:36, Angelo Chen wrote: Hi, I have code like this, I updated the view_count in the onActivate public class Page { private Person person; @CommitAfter void onActivate(Person person) { this.person = person; this.person.view_count = this.person.view_count + 1; } Object onPassivate() { return this.person; } } Now I have this, very neat, but where can I place the @CommitAfter? public class Page { @PageActivationContext @Prperty private Person person; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: page loses context after form submit ?
Hi, public Long onPassicate() should probably be public Long onPassivate(). -Filip On 2008-09-02 15:47, Gegenteil wrote: Hi, Maybes some one can tell me why the following does not work ? After you submit the form the redirect is without the page context... Since I return a configured page in the onSubmit event listener method, I would expect tapestry to send a redirect url with the page context... Cheers, Ron template: html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; body t:form t:textfield value=ctx/ t:submit/ /t:form h1${ctx}/h1 /body /html class : public class Try { @Property private Long ctx; public void onActivate( Long c ) { this.ctx = c; } public Long onPassicate() { return this.ctx; } @OnEvent(submit) public Object onSubmit() { return this; } } - 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: editing a bean with a required password field
Hi Ulrich, Just guessing here, but how about setting t:validate=minlength=1 on the field? This will pass if the field is empty, afaik. Of course, you can set it to the real minimum length of the password and add a maxlength as well. That should do the trick. -Filip On 2008-09-02 16:17, Ulrich Stärk wrote: Hi all, I want to create and edit entities which have a required password field using the beaneditor component. In order to have the password obscured while being typed in (later it gets encrypted and stored in a database) I overrode the corresponding field whith t:beaneditform t:id=form t:object=account t:parameter name=password t:label for=password / t:passwordfield t:id=password value=account.password / /t:parameter /t:beaneditform My entity class has a @Validate(required) annotation applied to the getter of the password field. This all works well when I create a new instance of this entity type. But when I want to edit the entity, whithout modifying the password fields, this fails because the output value of a passwordfield is always blank per definition and thus validation fails. I am forced to re-enter some password even if I don't want to change it. How would you solve this? Cheers, 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: LinkedIn and Facebook
Yup, it was indeed the .gif from the Tapestry 5 homepage. I've created a resized version of the logo on a white background that should look better on Facebook: http://fsadev.com/tmp/tapestry-facebook-logo.jpg -Filip On 2008-09-01 11:24, Davor Hrg wrote: it seems like it wa a png/gif with transparency and server resized it or converted to jpg using black as bg On Mon, Sep 1, 2008 at 12:09 AM, Filip S. Adamsen [EMAIL PROTECTED] wrote: Hi, It's nice to have a Tapestry group on Facebook. Is there any reason I'm only seeing 10 members? Also, the current logo looks kind of weird on my end. Is that just me? -Filip On 2008-08-31 21:18, Thiago H. de Paula Figueiredo wrote: Hi! I'm sorry for not approving everyone's request to join the LinkedIn Tapestry group more quickly. Strangely, it doesn't warn me about membership request. At this moment, there are 48 members, including almost everyone in this list. Sweet! Dariusz Dwornikowski suggested a Tapestry Facebook group, and it is here: http://www.facebook.com/group.php?gid=32765389972 Howard: you asked me to rename it to Apache Tapestry web framework, and I had just did it. Is there any issue about using the Tapestry logo in the above groups? 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I'd like to generate valid XHTML
Hi, That page is not quite going to get you there. I'm actually working on converting my site to XHTML, and so far I've had to modify a few things here and there to make it work. But it's possible. I'll post my findings to the wiki when I get the time. -Filip On 2008-09-01 15:28, Luther Baker wrote: I have not! If that's what I think it is - that is great! That's just what I was looking for. -Luther On Mon, Sep 1, 2008 at 1:03 AM, Carl Crowder [EMAIL PROTECTED] wrote: Have you already looked at http://wiki.apache.org/tapestry/Tapestry5HowToXhtml ? (apologies if you have :) ) Luther Baker wrote: Is there a way to adjust the html that is generated - especially in the header? Specifically, the generated head section does not appear to be xhtml compliant. Here is what I'm including in my own custom wrapping component: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; lang=en head meta http-equiv=Content-Type content=text/html; charset=UTF-8/ title${pageTitle}/title link rel=stylesheet href=css/styles.css type=text/css/ /head *A few points: * a) The xhtml strict DOCTYPE should be pretty straightforward b) I want the Content-Type first in the head tag c) The meta tag *MUST* have a closing slash - otherwise the document is not well formed. d) The same goes for the two link tags. XHTML dictates that all tags must be well formed. *Unfortunately, my application ends up generating * !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html lang=en xmlns=http://www.w3.org/1999/xhtml; head link href=assets/tapestry/5.0.14/default.css rel=stylesheet type=text/css meta content=text/html; charset=UTF-8 http-equiv=Content-Type titleHome/title link href=css/styles.css rel=stylesheet type=text/css /head For the most part - this is fine ... but in the details, I believe my problem is two fold: 1) I would really like the Content-Type to be the first tag in head. 2) The link and meta tags are not properly closed. Unfortunately, this code-gen is just not valid xhtml. I do have one last (not so terrible) issue with the EXTRA link tag (tapestry specific css) that is showing up in the head as well. I'm sure it is nice for exceptions (which the final user should never see) but it has a few more problems: 1) It tells everyone what version of a particular library I am using. I'd rather not do that. 2) The tag appears before my Content-Type tag - which as I mentioned, I'd prefer FIRST in the hierarchy. 3) Finally, the tapestry stylesheet is not well formed. Again, proper xhtml demands that tags be balanced/closed. I know Code Gen is hard -- but I generally pay extra attention to ensure I produce valid, well formed xhtml documents and the codegen going on behind the scenes here is making that a bit hard. Thoughts? I'm not sure how to close the tags - maybe I can set a flag or pass something else in as an xml attribute of the root tag of my templates? Regarding the extra tapestry css file inserted ... maybe the Tapestry library has a DEBUG and a RELEASE mode? Maybe there a flag to turn off the DEBUG mode and put this library into RELEASE mode? I really don't want that tapestry specfiic css page requested everytime I serve up a page. I understand the filter takes care of it ... but it still shows up in my request logs, on user pages, in proxies, etc ... Is it even wise to consider opening up the tapestry JARs and see if the components implementeing this section of code can simply be tweaked to have proper xhtml balance. On a positive note, the library is working well and I enjoy the general programming model. I think convention is great - but it needs to be valid in this case. Thanks again in advance for any thoughts. -Luther - 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: I'd like to generate valid XHTML
That's not all. Tapestry doesn't include a space before closing an empty element, so br becomes br/ instead of br /. It's valid XHTML but some browsers choke on it. It's easy to fix, though - just add a space in org.apache.tapestry.dom.Element. Also, Form emits a name attribute that isn't valid in XHTML 1.0 Strict. Pretty easy to change as well. And then it's just a question of going through everything and making sure it's alright. The Html Validator Firefox add-on is great for this: https://addons.mozilla.org/da/firefox/addon/249 One more thing. The wiki page's ImprovedXmlMarkupModel (or whatever it's named, I'm pretty tired) needs to have textarea added to the list of non-abbreviated elements. That's pretty much what I had to do, my app is now 100% XHTML 1.0 Strict and CSS 2.1 compliant, hurray. -Filip On 2008-09-01 16:19, Christian Gorbach wrote: yep - the description was written for 5.0.13. for 5.0.14 the approach is the same, but needs some adaption i'll also update the page when i get the time. c)hristian Hi, That page is not quite going to get you there. I'm actually working on converting my site to XHTML, and so far I've had to modify a few things here and there to make it work. But it's possible. I'll post my findings to the wiki when I get the time. -Filip On 2008-09-01 15:28, Luther Baker wrote: I have not! If that's what I think it is - that is great! That's just what I was looking for. -Luther On Mon, Sep 1, 2008 at 1:03 AM, Carl Crowder [EMAIL PROTECTED] wrote: Have you already looked at http://wiki.apache.org/tapestry/Tapestry5HowToXhtml ? (apologies if you have :) ) Luther Baker wrote: Is there a way to adjust the html that is generated - especially in the header? Specifically, the generated head section does not appear to be xhtml compliant. Here is what I'm including in my own custom wrapping component: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; lang=en head meta http-equiv=Content-Type content=text/html; charset=UTF-8/ title${pageTitle}/title link rel=stylesheet href=css/styles.css type=text/css/ /head *A few points: * a) The xhtml strict DOCTYPE should be pretty straightforward b) I want the Content-Type first in the head tag c) The meta tag *MUST* have a closing slash - otherwise the document is not well formed. d) The same goes for the two link tags. XHTML dictates that all tags must be well formed. *Unfortunately, my application ends up generating * !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html lang=en xmlns=http://www.w3.org/1999/xhtml; head link href=assets/tapestry/5.0.14/default.css rel=stylesheet type=text/css meta content=text/html; charset=UTF-8 http-equiv=Content-Type titleHome/title link href=css/styles.css rel=stylesheet type=text/css /head For the most part - this is fine ... but in the details, I believe my problem is two fold: 1) I would really like the Content-Type to be the first tag in head. 2) The link and meta tags are not properly closed. Unfortunately, this code-gen is just not valid xhtml. I do have one last (not so terrible) issue with the EXTRA link tag (tapestry specific css) that is showing up in the head as well. I'm sure it is nice for exceptions (which the final user should never see) but it has a few more problems: 1) It tells everyone what version of a particular library I am using. I'd rather not do that. 2) The tag appears before my Content-Type tag - which as I mentioned, I'd prefer FIRST in the hierarchy. 3) Finally, the tapestry stylesheet is not well formed. Again, proper xhtml demands that tags be balanced/closed. I know Code Gen is hard -- but I generally pay extra attention to ensure I produce valid, well formed xhtml documents and the codegen going on behind the scenes here is making that a bit hard. Thoughts? I'm not sure how to close the tags - maybe I can set a flag or pass something else in as an xml attribute of the root tag of my templates? Regarding the extra tapestry css file inserted ... maybe the Tapestry library has a DEBUG and a RELEASE mode? Maybe there a flag to turn off the DEBUG mode and put this library into RELEASE mode? I really don't want that tapestry specfiic css page requested everytime I serve up a page. I understand the filter takes care of it ... but it still shows up in my request logs, on user pages, in proxies, etc ... Is it even wise to consider opening up the tapestry JARs and see if the components implementeing this section of code can simply be tweaked to have proper xhtml balance. On a positive note, the library is working well and I enjoy the general programming model. I think convention is great - but it needs to be valid in this case. Thanks again in advance for any thoughts.
Re: I'd like to generate valid XHTML
That is actually XML compliant - oXygen is wrong if it says otherwise. -Filip On 2008-09-01 18:01, Craig St. Jean wrote: Similarly, does anyone know a way to get the original to be even XML compliant? The way we have to do it (shown below) is not valid due to the Tapestry namespace. oXygen gives me this: E [Xerces] Attribute xmlns:t must be declared for element type html. Thanks! On Sun, Aug 31, 2008 at 7:32 PM, Luther Baker [EMAIL PROTECTED] wrote: Is there a way to adjust the html that is generated - especially in the header? Specifically, the generated head section does not appear to be xhtml compliant. Here is what I'm including in my own custom wrapping component: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; lang=en head meta http-equiv=Content-Type content=text/html; charset=UTF-8/ title${pageTitle}/title link rel=stylesheet href=css/styles.css type=text/css/ /head ... -Luther - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LinkedIn and Facebook
Hi, It's nice to have a Tapestry group on Facebook. Is there any reason I'm only seeing 10 members? Also, the current logo looks kind of weird on my end. Is that just me? -Filip On 2008-08-31 21:18, Thiago H. de Paula Figueiredo wrote: Hi! I'm sorry for not approving everyone's request to join the LinkedIn Tapestry group more quickly. Strangely, it doesn't warn me about membership request. At this moment, there are 48 members, including almost everyone in this list. Sweet! Dariusz Dwornikowski suggested a Tapestry Facebook group, and it is here: http://www.facebook.com/group.php?gid=32765389972 Howard: you asked me to rename it to Apache Tapestry web framework, and I had just did it. Is there any issue about using the Tapestry logo in the above groups? 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: how to caught those exceptions uncaught by T5?
Hi, This is just off the top of my head, but perhaps you can get the page through ComponentSource, set the property (it'll need to have a public setter, of course), get the page's ComponentResources and create a PageLink to the page, and send a redirect using that. That *might* work. -Filip On 2008-08-28 04:52, Angelo Chen wrote: Hi Filip, Thanks for the digging, and it's really a good idea, works very well to catch those exceptions. here is a sample code of my filter: public boolean service(HttpServletRequest request, HttpServletResponse response, HttpServletRequestHandler handler) throws IOException { boolean result = true; try { result = handler.service(request, response); } catch (RuntimeException e) { // how to send this exception to the calling page? } return result; } if there a way to send the exception back to the calling page's onException method? Thanks, Angelo Filip S. Adamsen- 2 wrote: Hi Angelo, Having digged through the tapestry-upload source code, I think I may have found a solution. Or at least something to get you started. The upload stuff is handled, it seems, in MultipartServletRequestFilter, part of the HttpServletRequestHandler pipeline. If you contribute a HttpServletRequestFilter to the HttpServletRequestHandler pipeline and order it before the MultipartFilter (before:MultipartFilter) you should be able to catch the exception in the service method and do whatever you want from there. Hope this helps. http://tapestry.apache.org/tapestry5/apidocs/src-html/org/apache/tapestry5/upload/services/UploadModule.html#line.73 http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/upload/internal/services/MultipartServletRequestFilter.html http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/services/HttpServletRequestFilter.html http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/services/HttpServletRequestHandler.html -Filip On 2008-08-28 01:20, Angelo Chen wrote: Hi Filip, That make sense. now how to deal these kinds of exceptions? Filip S. Adamsen-2 wrote: Hi Angelo, I think the upload processing happens before the request gets to where exceptions are caught på RequestExceptionHandler, if that makes sense. Perhaps that's why? -Filip On 2008-08-27 16:37, Angelo Chen wrote: hi, Thanks for the reply. I copied the code from the cookbook, i deleted the other part, i just want to be sure if the method will be called when an exception occurs, it does with all those normal exceptions, but the 505 status dumped coming somewhere from Apache's file upload routine was not caught. any idea HugoPalma wrote: That's not how decoration works. You have to return your RequestExceptionHandler implementation that will decorate the default one. Take a look at the example at the bottom of the page here http://tapestry.apache.org/tapestry5/cookbook/exceptions.html Angelo Chen wrote: Hi, I would like to catch the exception of FileSizeLimitExceededException, I tried the decorator method like this: public RequestExceptionHandler decorateRequestExceptionHandler( final Logger logger, final ResponseRenderer renderer, final ComponentSource componentSource, @Symbol(SymbolConstants.PRODUCTION_MODE) boolean productionMode, Object service) { System.out.println(exception!); return null; } but this method will not be called if the exception is FileSizeLimitExceededException, the error simply dumps to the browser screen, any idea why those errors can not be caught? // limit the size of uploading file public static void contributeApplicationDefaults( MappedConfigurationString, String configuration) { configuration.add(UploadSymbols.REQUESTSIZE_MAX, 100); configuration.add(UploadSymbols.FILESIZE_MAX, 50); } - 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]
Re: SVG, servlet filters and interception
Hi, Yes, it's possible to do this with regular pages. Simply return a StreamResponse with the right headers from onActivate. You'll have to handle caching etc. yourself, but it's not hard. -Filip On 2008-08-28 19:46, Atle Prange wrote: Hi, i want to use svg in my webapp, since it makes it easy to create images on the fly. My plan is to make t5 pages that output svg instead of html, which should be easy. But alas svg is not as straigh forward as it should. Little browser support might force me to convert the svg to images on the server before they are streamed to the client. That also means that the image is fetched in a different request than the request for the page. I also have to convert the response (using batik) to a png. Any ideas where i put the interceptor to achieve this? Is it possible to use normal pages in request for i.e. images this way? (That way i could also define svg images as background in css) any help is greatly appreciated. - 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: how to caught those exceptions uncaught by T5?
Hi Angelo, I think the upload processing happens before the request gets to where exceptions are caught på RequestExceptionHandler, if that makes sense. Perhaps that's why? -Filip On 2008-08-27 16:37, Angelo Chen wrote: hi, Thanks for the reply. I copied the code from the cookbook, i deleted the other part, i just want to be sure if the method will be called when an exception occurs, it does with all those normal exceptions, but the 505 status dumped coming somewhere from Apache's file upload routine was not caught. any idea HugoPalma wrote: That's not how decoration works. You have to return your RequestExceptionHandler implementation that will decorate the default one. Take a look at the example at the bottom of the page here http://tapestry.apache.org/tapestry5/cookbook/exceptions.html Angelo Chen wrote: Hi, I would like to catch the exception of FileSizeLimitExceededException, I tried the decorator method like this: public RequestExceptionHandler decorateRequestExceptionHandler( final Logger logger, final ResponseRenderer renderer, final ComponentSource componentSource, @Symbol(SymbolConstants.PRODUCTION_MODE) boolean productionMode, Object service) { System.out.println(exception!); return null; } but this method will not be called if the exception is FileSizeLimitExceededException, the error simply dumps to the browser screen, any idea why those errors can not be caught? // limit the size of uploading file public static void contributeApplicationDefaults( MappedConfigurationString, String configuration) { configuration.add(UploadSymbols.REQUESTSIZE_MAX, 100); configuration.add(UploadSymbols.FILESIZE_MAX, 50); } - 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: Best action/event to setup a model?
Hi Markus, Is the BeanDisplay component inside a form? In that case, @OnEvent(prepare) void setupModel() { ... } should be called whenever the form is preparing to be rendered or submitted. Is there any reason you can't setup your model once and just reference it from there? Just curious. -Filip On 2008-08-27 22:53, Markus Joschko wrote: Hi, I am currently struggling to find the best way to setup a model for a beandisplay from within a component. As I have an ajax call included, the method should not only be called during the render phase, but also during the action phase. I looked at the form component (which fires a prepare event at renderaction requests) and it fires the event during beginRender() and onAction(EventContext ctx). I can mimic this behavior in my page but it feels somehow wrong to have these both methods just to setup the model. I tried @BeginRender @OnEvent(value=action) void setupModel() however this method is never called during the action phase. I also tried to put the EventContext parameter in the signature but that doesn't help. Can't I put two annotations on the same method? Is there any difference between the naming convention and the annotation? But hopefully there is an easier way to do this which I haven't found so far. Thanks, Markus - 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: how to caught those exceptions uncaught by T5?
Hi Angelo, Having digged through the tapestry-upload source code, I think I may have found a solution. Or at least something to get you started. The upload stuff is handled, it seems, in MultipartServletRequestFilter, part of the HttpServletRequestHandler pipeline. If you contribute a HttpServletRequestFilter to the HttpServletRequestHandler pipeline and order it before the MultipartFilter (before:MultipartFilter) you should be able to catch the exception in the service method and do whatever you want from there. Hope this helps. http://tapestry.apache.org/tapestry5/apidocs/src-html/org/apache/tapestry5/upload/services/UploadModule.html#line.73 http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/upload/internal/services/MultipartServletRequestFilter.html http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/services/HttpServletRequestFilter.html http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/services/HttpServletRequestHandler.html -Filip On 2008-08-28 01:20, Angelo Chen wrote: Hi Filip, That make sense. now how to deal these kinds of exceptions? Filip S. Adamsen-2 wrote: Hi Angelo, I think the upload processing happens before the request gets to where exceptions are caught på RequestExceptionHandler, if that makes sense. Perhaps that's why? -Filip On 2008-08-27 16:37, Angelo Chen wrote: hi, Thanks for the reply. I copied the code from the cookbook, i deleted the other part, i just want to be sure if the method will be called when an exception occurs, it does with all those normal exceptions, but the 505 status dumped coming somewhere from Apache's file upload routine was not caught. any idea HugoPalma wrote: That's not how decoration works. You have to return your RequestExceptionHandler implementation that will decorate the default one. Take a look at the example at the bottom of the page here http://tapestry.apache.org/tapestry5/cookbook/exceptions.html Angelo Chen wrote: Hi, I would like to catch the exception of FileSizeLimitExceededException, I tried the decorator method like this: public RequestExceptionHandler decorateRequestExceptionHandler( final Logger logger, final ResponseRenderer renderer, final ComponentSource componentSource, @Symbol(SymbolConstants.PRODUCTION_MODE) boolean productionMode, Object service) { System.out.println(exception!); return null; } but this method will not be called if the exception is FileSizeLimitExceededException, the error simply dumps to the browser screen, any idea why those errors can not be caught? // limit the size of uploading file public static void contributeApplicationDefaults( MappedConfigurationString, String configuration) { configuration.add(UploadSymbols.REQUESTSIZE_MAX, 100); configuration.add(UploadSymbols.FILESIZE_MAX, 50); } - 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]
Re: [T5] syntax of list in t:context
Hi, You can also grab the list: binding prefix from the wiki: http://wiki.apache.org/tapestry/Tapestry5HowToAddBindingPrefix -Filip On 2008-08-22 14:41, Andy Pahne wrote: found the workaround: see Notes onm page http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/ActionLink.html Andy Pahne schrieb: What's the correct syntax (in a tml template) to pass more than one object in an ActionLink's t:context parameter? t:context=someObject.id, otherObject does not work, as the error message states that someObject is searched for a property called id, otherObject Andy - 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]
Re: Possible Bug in T5.0.14
Hi, DocumentLinkerImpl#updateDocument sets the JavaScript variable Tapestry.DEBUG_ENABLED in development mode. Maybe that's what you're seeing? I find it very annoying, so I added renderSupport.addScript(Tapestry.DEBUG_ENABLED = false;); to my layout's afterRender. I really don't think it should be enabled, even in development mode. Perhaps a JIRA issue is in order... -Filip On 2008-08-22 16:19, Peter Stavrinides wrote: Hi All, We have a component that generates a navigation tree of actionlinks that in-turn triggers some zone updates, this worked perfectly in 5.0.13, but since we upgraded we get some strange debug output at the top of the page when clicking one of the linksit looks something like this: Checking previously loaded for:http://localhost:8081/castle/assets/com/albourne/web/static/scripts/ajaxredirect.js Previously loaded: http://localhost:8081/castle/assets/com/albourne/web/static/scripts/window-size.js Previously loaded: http://localhost:8081/castle/assets/scriptaculous/5.0.14/scriptaculous.js Previously loaded: http://localhost:8081/castle/assets/scriptaculous/5.0.14/effects.js Previously loaded: http://localhost:8081/castle/assets/tapestry/5.0.14/tapestry.js Am I missing something, is there some way to turn it off? Thanks Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: t5: debugging with jetty
I use IntelliJ IDEA as well. But I simply create a Maven configuration that runs mvn jetty:run and launch it as a debugging session. -Filip On 2008-08-22 17:32, César Lesc wrote: I set MAVEN_OPTS, launch jetty with maven and just attach the debugger's IDE, in IntelliJ IDEA is called Remote Debug my debug script es like this: export MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n mvn jetty:run César. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: applicationStateObject strage behaviour
Hi Argo, Tapestry is trying to invoke the constructor in your ASO class that has the most parameters. While doing, it is looking for services. It can't find a service matching Long, so it fails. You'll need to put @Inject on the constructor Tapestry should use to instantiate your ASO class with, that should solve it. http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/ioc/annotations/Inject.html -Filip On 2008-08-22 23:51, Argo Vilberg wrote: I use application State object in one java file @ApplicationState private Role appCurrentRole; I fill this class with data. And now i want access some Role class in other java class. I add also @ApplicationState private Role appCurrentRole; But if i first time access this class i got following error!!! Why? Here ise the error log. An unexpected application exception has occurred. - org.apache.tapestry5.runtime.ComponentEventExceptionError invoking constructor ee.softpro.data.Role(long, String, String, boolean, String, String, String) (at Role.java:20) (for service 'ApplicationStateManager'): No service implements the interface long. context eventTypeactivate - java.lang.RuntimeExceptionNo service implements the interface long. Stack trace - org.apache.tapestry5.ioc.internal.RegistryImpl.getService(RegistryImpl.java:518) - org.apache.tapestry5.ioc.internal.services.MasterObjectProviderImpl.provide(MasterObjectProviderImpl.java:46) - org.apache.tapestry5.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:622) - org.apache.tapestry5.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:676) - org.apache.tapestry5.ioc.internal.ObjectLocatorImpl.getObject(ObjectLocatorImpl.java:49) - org.apache.tapestry5.ioc.internal.util.InternalUtils.calculateParameterValue(InternalUtils.java:209) - org.apache.tapestry5.ioc.internal.util.InternalUtils.calculateParameters(InternalUtils.java:239) - org.apache.tapestry5.ioc.internal.util.InternalUtils.calculateParametersForConstructor(InternalUtils.java:227) - org.apache.tapestry5.ioc.internal.ConstructorServiceCreator.createObject(ConstructorServiceCreator.java:47) - org.apache.tapestry5.ioc.internal.ServiceResourcesImpl.autobuild(ServiceResourcesImpl.java:122) - org.apache.tapestry5.internal.services.ApplicationStateManagerImpl$1.create(ApplicationStateManagerImpl.java:98) - org.apache.tapestry5.internal.services.SessionApplicationStatePersistenceStrategy.get(SessionApplicationStatePersistenceStrategy.java:56) - org.apache.tapestry5.internal.services.ApplicationStateManagerImpl$ApplicationStateAdapter.getOrCreate(ApplicationStateManagerImpl.java:45) - org.apache.tapestry5.internal.services.ApplicationStateManagerImpl.get(ApplicationStateManagerImpl.java:126) - ee.softpro.pages.Kontaktisikud._$read_appCurrentRole(Kontaktisikud.java) - ee.softpro.pages.Kontaktisikud.onActivate(Kontaktisikud.java:66) - ee.softpro.pages.DigiBasePage.dispatchComponentEvent(DigiBasePage.java) - ee.softpro.pages.Kontaktisikud.dispatchComponentEvent(Kontaktisikud.java) - org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:868) - org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1037) - org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:52) - org.apache.tapestry5.services.TapestryModule$29.handle(TapestryModule.java:1653) - org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:97) - org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:73) - org.apache.tapestry5.services.TapestryModule$13.service(TapestryModule.java:953) - org.apache.tapestry5.internal.services.LocalizationFilter.service(LocalizationFilter.java:42) - org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:586) - org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26) - org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:79) - org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:93) - org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:84) - org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:83) - org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106) -
Re: tomcat error filterStart
Hi, Have you tried packing everyting from ${app.root}/WEB-INF/classes/ into a JAR and put it in ${app.root}/WEB-INF/lib? That might help. -Filip On 2008-08-23 01:06, Mike Saavedra wrote: I just want a basic webapp to run in tomcat 5.5.26. I install tomcat and drop in my file structure which looks like this: ${app.root}/ ${app.root}/favicon.ico ${app.root}/Index.tml ${app.root}/WEB-INF ${app.root}/WEB-INF/web.xml ${app.root}/WEB-INF/classes ${app.root}/WEB-INF/classes/com ${app.root}/WEB-INF/classes/com/mycompany ${app.root}/WEB-INF/classes/com/mycompany/mypackage ${app.root}/WEB-INF/classes/com/mycompany/mypackage/pages ${app.root}/WEB-INF/classes/com/mycompany/mypackage/pages/Index.class ${app.root}/WEB-INF/classes/com/mycompany/mypackage/services ${app.root}/WEB-INF/classes/com/mycompany/mypackage/services/AppModule$1.class ${app.root}/WEB-INF/classes/com/mycompany/mypackage/services/AppModule.class ${app.root}/WEB-INF/classes/com/mycompany/mypackage/entities ${app.root}/WEB-INF/classes/com/mycompany/mypackage/entities/Room.class ${app.root}/WEB-INF/lib/*.jar Because it's tomcat I have ${app.root}/WEB-INF/lib/mycomponents.jar for the Index.class along with the other jars. When I start up tomcat it starts, but my context fails to load with the following error: Aug 22, 2008 4:10:52 PM org.apache.catalina.core.StandardContext start SEVERE: Error filterStart Aug 22, 2008 4:10:52 PM org.apache.catalina.core.StandardContext start SEVERE: Context [/myapp] startup failed due to previous errors My web.xml: web-app display-nameTapestry 5 Application/display-name context-param param-nametapestry.app-package/param-name param-valuecom.mycompany.mypackage/param-value /context-param filter filter-nameapp/filter-name filter-classorg.apache.tapestry5.TapestryFilter/filter-class /filter filter-mapping filter-nameapp/filter-name url-pattern/*/url-pattern /filter-mapping /web-app From what I've googled so far, it seems it could be having trouble locating TapestryFilter, so I put tapestry jars in ${tomcat}/common/lib. Same thing. I at a loss here because this is very basic and should work. Can anyone see what I'm missing, or what might be the problem? Many thanks, Mike Saavedra - 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.0.14] Problem with ANSI codification in .properties files
Hi, Tapestry 5.0.14 changes the way .properties files are read so they are read in a way that works with UTF-8 encoded files, at least on Java 6. Now, my guess is that they were being read correctly before because Java read the .properties files using the default encoding, which would probably be ANSI. That explains why it doesn't work now, because ANSI and UTF-8 don't (AFAIK) match up. The UTF-8 patch only changes the encoding on form submissions, so that doesn't really have anything to do with the .properties files. Anyway, that's just my more or less informed guess. -Filip On 2008-08-21 22:05, Marcelo Lotif wrote: No one is having this kind of problem? I tested in other situations and this is still happening... I'll try to change my eclipse's default configuration, maybe will help for now... On Wed, Aug 20, 2008 at 9:42 AM, Marcelo Lotif [EMAIL PROTECTED] wrote: Hi all, I'm experiencing a little problem with special characters (áãéõó... and so on) after I switched to T 5.0.14: some files, mainly properties files, are not displayed properly when they are loaded to my pages. Since I'm running on a windows machine, all my files are saved in ANSI by default. If I change it to UTF-8, the special characters are loaded as expected. If I downgrade to T 5.0.13 (with the UTF-8 patch), the problem also disappears. I tested with an Ubuntu machine, that saves as UTF-8 by default, but the problem is still occurring, don't know why. I also tested with T 5.0.15-SNAPSHOT, same problem. This could be related with TAPESTRY-2525? Most of my team is using Eclipse 3.3.2, Jetty 5.1.12 and Windows XP. Is this the expected behavior? Is there something I'm doing wrong? Should I fire a JIRA issue? Thanks a lot for your help. -- Atenciosamente, Marcelo Lotif Programador Java e Tapestry FIEC - Federação das Indústrias do Estado do Ceará (85) 3477-5910 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Trying to Implement RedirectException in Tapestry 5
Hi, I'm using request filters for this right now. It's a pretty good approach imo, and it's easy to get the security configuration from wherever you want. My applications aren't that complex so I get by with annotations on my page classes, but you could easily get this from somewhere else, like a database. I'm seriously looking at moving my authentication to an annotation-driven ComponentClassTransformWorker. When I do that, I'll try and post about it on the wiki. -Filip On 2008-08-20 17:14, Ben Wong wrote: I decided against the dispatcher approach for the reasons ville.virtanen brought up. The dispatcher will have to know what pages are secured and which aren't. I am using Acegi with Tapestry. I know not everyone uses Acegi, but my approach (just to share) is to have Acegi handles authorization and authentication. Very simple and very clean and you can easily modify how it authenticate (e.g. via database, LDAP, or whatever). Having said that, I like to have a preventive measure to prevent secured pages falling through the cracks - so I have two Page classes all pages inherit from (SecuredBasePage and BasePage). The SecuredBasePage checks if the user is logged in. If not, it redirects to the LoginPage. Also, I need a way for all pages to access the user information from the session after they logged in since Acegi doesn't handle that. This is where it happens. I think it would be a great help to others if there are more detailed samples on the wiki on how to implement security in Tapestry 5 - giving readers different ways to implement. Otherwise, everyone just reinvent the wheel and asks the same questions over and over again. Ben -Original Message- From: Peter Stavrinides [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 20, 2008 9:30 AM To: Tapestry users Subject: Re: Trying to Implement RedirectException in Tapestry 5 I love the dispatcher approach for this, I like it simply because it removes security concerns from pages and is lightweight and customizable. - Original Message - From: 9902468 [EMAIL PROTECTED] To: users@tapestry.apache.org Sent: Wednesday, 20 August, 2008 4:30:05 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: Trying to Implement RedirectException in Tapestry 5 On a side note, it's a bad thing to hard code allowed roles to page, we use a service that is queried if this role is allowed to access this page (Or execute this action.). That way we can have role - rights matrix that can be administrated by the super user of the system. (Info can be on a file or db + we can make the customer to fill out the matrix initially..) - 99 Thiago H. de Paula Figueiredo wrote: Em Wed, 20 Aug 2008 09:38:36 -0300, 9902468 [EMAIL PROTECTED] escreveu: One possibility yes, but that approach requires to keep a list of secured pages to allow un-authorized users access non-secure pages. (Pages could of course be annotated to be secure or use marker interface.) That's what tapestry5-acegi (and its sister project tapestry5-spring-security) does: @Secured({ROLE_1, {ROLE_2}) public class YourPage { ... } There's a little difference: instead of using a RequestHandler or a Dispatcher, they transform the page classes at runtime. ;) And your approach occurs earlier in the request cycle... Thanks for the pointer! (Always nice to do things right and to learn :)) :) 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] Injecting page into nested layouts
Hi, You're right - casting componentResources#getPage works fine. ComponentResources is your friend. :) @InjectContainer does indeed inject the parent of the component. For InnerLayout this is the page alright, but for Layout it's actually the InnerLayout because Layout is contained in InnerLayout. Could you clarify the meaning of 'contained'? I think ComponentResources#getContainer has the best explanation: Returns the component which contains this component, or null for the root component. For mixins, this returns the componet to which the mixin is attached. I probably shouldn't have used the word parent, it's a bit confusing in this context. From an html point of view (and I assume a component tree point of view), the hierarchy of my page is: Page +-- Layout +-- InnerLayout That is correct. However, if Layout is contained in InnerLayout means InnerLayout.tml references Layout.tml then the 'reference' hierarchy is: Page +-- InnerLayout +-- Layout Also correct. Should I be reading InjectContainer as InjectTheComponentWhoseTemplateContainsTheContentsToBeInsertedAsBody? If so, perhaps @InjectContentProvider would be more intuitive? No, just InjectTheComponentWhoseTemplateContainsThisComponent. Is there any documentation on @InjectContainer? I've searched the Tapestry site and Wiki but found nothing. Here are the relevant docs: http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/annotations/InjectContainer.html http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/ComponentResources.html#getContainer() InjectContainer should probably have its description updated to match ComponentResources#getContainer. I'll file a JIRA issue. Hope this helps. If not, you know what to do. ;) -Filip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: url localization
Hi, This isn't directly supported by Tapestry. And I can't see how you would make it possible without rewriting a lot of Tapestry services. -Filip On 2008-08-19 08:41, Leon Derks wrote: I know that localization support is well integrated into Tapestry 5, but is it also possible to get localized urls? Example: english: http://www.someserver.com/cars/15 german: http://www.someserver.com/autos/15 If so, how can I do that? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: UTF-8 in tapestry 5.0.13
Hi, Uli is correct in that regard, at least for Tapestry 5.0.13. Tapestry 5.0.14 simplifies things *considerably* by using a single, configurable character set across the entire application, that just so happens to default to UTF-8. https://issues.apache.org/jira/browse/TAPESTRY-2543 -Filip On 2008-08-19 12:04, Ulrich Stärk wrote: I believe http://wiki.apache.org/tapestry/Tapestry5Utf8Encoding is still needed to convert form submissions from/to UTF-8. Uli Argo Vilberg schrieb: Hello! I have postgreSQL 8.1 with utf-8 charset and also web application with meta http-equiv=Content-Type content=text/html; charset=utf-8 / tags. But all estonian letters õüäöÕÜÄÖ are going to crazy. If i use simple text edit field to save value and then query some value from database then i got strange symbols. Why so? Argo - 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] Is there anyway of passing parameters to expressions?
Hi, I assume the URL you set on window2 is for a page. In that case you can get the base URL from componentResources.createPageLink(pagename, true) and attach the form and field ids in your JavaScript: ${window2.componentResources.id}.setURL(${basehelpurl}/ + formId + / + fieldId); You can then get the form and fields ids from onActivate(int, int) on your help page. That's the quick and dirty way, anyhow. -Filip On 2008-08-19 11:59, Daniel Alonso Sanchez wrote: Sorry for the strange subject :D, but i don't know the correct way to name it. I have something that looks like this: script type=text/javascript function showWindow2() { ${window2.componentResources.id}.setTitle(Ayuda) ${window2.componentResources.id}.setURL(${generarEnlace}); ${window2.componentResources.id}.showCenter() } /script But I would like to do something like adding two params to ShowWindow2 function and pass them to generarEnlace. The thing is that... it could be possible? My final goal is to develop the functionality of helping links with modal windows, where un link looks like this: javascript:showWindow2(12,35) javascript:showWindow2(12,37) Each number are id's of form and field, respectively. Thanks in advance for the support ;D - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to control column sorting in GRID?
Hi, BeanModel#add returns a PropertyModel that has a sortable method to set whether or not the column representing the property is sortable. For properties you don't add explicity, you can use BeanModel#get or BeanModel#getById to get the PropertyModel. -Filip On 2008-08-19 16:12, tiptip wrote: Hi I am working on my first Tapestry application with T5. I am using Grid for reports pages and I found that it provide few columns as sortable but not all (those that are added in bean model with add are not seen as sortable column). My question is how do I enable all columns as sortable column? And How do I NOT make any column sortable? Thanks -Tiptip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionLink, PageTester and ElementID
Hi, As far as I can tell from the issue you linked to, you need to bind the id (not t:id) parameter of the link. -Filip On 2008-08-19 17:11, Mark Horn wrote: I just updated to Tapestry 5.0.14 from 5.0.11 and have run into an issue with using PageTester to test ActionLinks as shown here http://tapestry.apache.org/tapestry5/guide/unit-testing-pages.html It looks like this change in 5.0.12, https://issues.apache.org/jira/browse/TAPESTRY-2294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel is causing the trouble I'm running into. My ActionLinks no longer have an id therefore the call Element link = doc.getElementById(link1); is now returning an null, causing the line doc = tester.clickLink(link); to throw a NullPointException. Any suggestions on how to get around this? example of from tml file where id was set using t:id table t:type=grid source=list row=type reorder=name,description t:parameter name=nameCell t:pagelink t:id=new page=prop:createPage ${type.name} /t:pagelink /t:parameter /table Thanks, Mark - 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: Osgi trouble - the next level- solved
Hi, Application reloading sounds very nice! I'm not really familiar with OSGi, though. Is it hard to setup? If you could share what you did to make this work that'd be awesome. -Filip On 2008-08-19 17:44, Atle Prange wrote: As usual, a closer look reveals the errors... anyway, my application is up and running... -atle Atle Prange wrote: Okay, i have figured out the simple way of changing the resource url so the tapestry framework is able to scan the pages , componenents and mixins. Now i get a load of exceptions that *BeanInfo classes can't be found, and that the '' (empty) package is not imported or exported... Any suggestions? (And where do i put the .tml files?) Any hints are greatly appreciated The osgi path seems to be hard but rewarding, reloading the complete application takes a second, no need to restart the webserver at all, and i cant wait to add functionality to my app at runtime -? - 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]
Re: ActionLink, PageTester and ElementID
Weird. According to TAPESTRY-2294 the value should be uniqued via RenderSupport... -Filip On 2008-08-19 17:42, Mark Horn wrote: hhmm... that is a problem as my links are in a loop. so they used to be remove, remove_0, etc. if I set id=remove then all links have the id of 'remove' which does not work for my tests ether. Any other ideas? On Tue, Aug 19, 2008 at 11:32 AM, Mark Horn [EMAIL PROTECTED] wrote: right.. how did I miss that. thanks! On Tue, Aug 19, 2008 at 11:27 AM, Filip S. Adamsen [EMAIL PROTECTED] wrote: Hi, As far as I can tell from the issue you linked to, you need to bind the id (not t:id) parameter of the link. -Filip On 2008-08-19 17:11, Mark Horn wrote: I just updated to Tapestry 5.0.14 from 5.0.11 and have run into an issue with using PageTester to test ActionLinks as shown here http://tapestry.apache.org/tapestry5/guide/unit-testing-pages.html It looks like this change in 5.0.12, https://issues.apache.org/jira/browse/TAPESTRY-2294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel is causing the trouble I'm running into. My ActionLinks no longer have an id therefore the call Element link = doc.getElementById(link1); is now returning an null, causing the line doc = tester.clickLink(link); to throw a NullPointException. Any suggestions on how to get around this? example of from tml file where id was set using t:id table t:type=grid source=list row=type reorder=name,description t:parameter name=nameCell t:pagelink t:id=new page=prop:createPage ${type.name} /t:pagelink /t:parameter /table Thanks, Mark - 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]
Re: How to control column sorting in GRID?
Hi, See Providing the BeanModel in the docs: http://tapestry.apache.org/tapestry5/guide/beaneditform.html -Filip On 2008-08-19 17:36, tiptip wrote: Thanks for the Reply. But I dont know how to implement your suggestion. Can u please provide some example? Here is code snippet from my tml file: t:grid t:source=regionPools row=pool rowsPerPage=20 pagerPosition=both rowClass=${rowClass} exclude=updatedBy, updatedOn, createdBy, createdOn add=programYear,regionCode, regionName reorder=programYear, regionCode, regionName, baseAllocation, adjustmentAmount, balance, numberOfAdjustments t:parameter name=programYearCell ${pool.programYear.prgYear} /t:parameter t:parameter name=regionCodeCell ${pool.region.code} /t:parameter t:parameter name=regionNameCell ${pool.region.name} /t:parameter /t:grid Here is my bean: public class RegionPool extends Pool implements Serializable { private static final long serialVersionUID = 4923140826612380850L; private Region _region; private long _adjustmentAmount; private long _numberOfAdjustments; public RegionPool(Region region, ProgramYear programYear, long baseAllocation) { super(programYear, baseAllocation, 0); _region = region; } // other getter and setter method } Thanks, tiptip Filip S. Adamsen-2 wrote: Hi, BeanModel#add returns a PropertyModel that has a sortable method to set whether or not the column representing the property is sortable. For properties you don't add explicity, you can use BeanModel#get or BeanModel#getById to get the PropertyModel. -Filip On 2008-08-19 16:12, tiptip wrote: Hi I am working on my first Tapestry application with T5. I am using Grid for reports pages and I found that it provide few columns as sortable but not all (those that are added in bean model with add are not seen as sortable column). My question is how do I enable all columns as sortable column? And How do I NOT make any column sortable? Thanks -Tiptip - 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]How to make indentical validation on the client side.
Well, he could. But then he wouldn't get all the advantages of using the proper validation system. -Filip On 2008-08-19 22:19, zack.manning wrote: Maybe I'm missing something but why cant you just create a mixin with this functionality instead of using a validator? Zack Filip S. Adamsen wrote: Looking further into this, it doesn't even seem to be possible... Not as far as I can tell, anyhow. But then it's late here. Anyone else? -Filip On 2008-08-19 04:36, luna_guo wrote: Filip S. Adamsen-2 wrote: Hi, This should get you started: http://wiki.apache.org/tapestry/Tapestry5HowToAddValidators -Filip I want make a validator named confirm,just used to confirm the retype password. Using like this: t:type=passwordfield t:id=retypePasword validate=confirm=idOfPassword ……/ Now i have a problem: public void validate(Field field, String constraintValue, MessageFormatter formatter, String value) throws ValidationException { //do what here? } } the constraintValue is just the id of the password field,how can i get the password field's real value in a validator? /luna - 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]How to make indentical validation on the client side.
Hi, This should get you started: http://wiki.apache.org/tapestry/Tapestry5HowToAddValidators -Filip On 2008-08-18 09:39, luna_guo wrote: Confirm password checking is so common. It should happen on the client side,right? So,what should i do ? /luna - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Injecting page into nested layouts
Hi, Your BasePage should be in the base subpackage, that's test.base in your case. What happens is that Tapestry tries to cast BasePage to Component, which fails because it hasn't been enhanced by Tapestry - this only happens for components in the base, components, and page subpackages. That's my (more or less informed) guess having checked the source of InjectContainerWorker, anyhow. -Filip On 2008-08-18 12:14, Richard Hoberman wrote: Hi I'm getting the following exception: Component TestPage:innerlayout is not assignable to field test.components.Layout.page (of type test.BasePage). The skeletons for my components are below. Essentially, my page has an (inner) layout, which in turn has an (outer) layout. I try to inject the page into both (inner and outer) layouts. The page is successfully injected into the inner layout, but the outer fails. @InjectContainer seems to be selecting the wrong component in this case. It makes no difference if I remove the injection for the inner layout (so it doesn't seem to be a conflict). Should this work? Richard Hoberman Page template: - html t:type=InnerLayout ... //page contents /html Inner layout template: -- html t:type=Layout ... //inner layout markup including t:body / /html Layout template: html ... //layout markup including t:body / /html Inner Layout class: -- public class InnerLayout extends BaseComponent { @InjectContainer @Property private BasePage page; //etc } Layout class: --- public class InnerLayout extends BaseComponent { @InjectContainer @Property private BasePage page; //etc } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Injecting page into nested layouts
Hi, Looking over your code again I just noticed something's amiss. Where's the Java code for the Layout class? You seem to have posted the InnerLayout class twice. Anyhow, I think I've figured out what's really going on. Your using InjectContainer in Layout, but that doesn't inject the page, it injects the InnerLayout. This, of course, fails. A potential solution would be to use ComponentResources#getPage to get your page in a getter and just use that in your layout. -Filip On 2008-08-18 15:30, Filip S. Adamsen wrote: Hi, Your BasePage should be in the base subpackage, that's test.base in your case. What happens is that Tapestry tries to cast BasePage to Component, which fails because it hasn't been enhanced by Tapestry - this only happens for components in the base, components, and page subpackages. That's my (more or less informed) guess having checked the source of InjectContainerWorker, anyhow. -Filip On 2008-08-18 12:14, Richard Hoberman wrote: Hi I'm getting the following exception: Component TestPage:innerlayout is not assignable to field test.components.Layout.page (of type test.BasePage). The skeletons for my components are below. Essentially, my page has an (inner) layout, which in turn has an (outer) layout. I try to inject the page into both (inner and outer) layouts. The page is successfully injected into the inner layout, but the outer fails. @InjectContainer seems to be selecting the wrong component in this case. It makes no difference if I remove the injection for the inner layout (so it doesn't seem to be a conflict). Should this work? Richard Hoberman Page template: - html t:type=InnerLayout ... //page contents /html Inner layout template: -- html t:type=Layout ... //inner layout markup including t:body / /html Layout template: html ... //layout markup including t:body / /html Inner Layout class: -- public class InnerLayout extends BaseComponent { @InjectContainer @Property private BasePage page; //etc } Layout class: --- public class InnerLayout extends BaseComponent { @InjectContainer @Property private BasePage page; //etc } - 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]How to make indentical validation on the client side.
There really should be a configuration point to add validation scripts to - or a way for each individual validator to include a script... -Filip On 2008-08-18 22:43, Geoff Callender wrote: So in other words there isn't a better way yet. Are there any thoughts on how this may be improved in future? On 18/08/2008, at 11:49 PM, Davor Hrg wrote: you can use @IncludeJavaScriptLibrary annotation in your page or in a component Davor Hrg On Mon, Aug 18, 2008 at 3:44 PM, Geoff Callender [EMAIL PROTECTED] wrote: The problem with that How To is this line: This javascript file needs to be included in all pages/components where the new validator is to be used (Is there a better way?) So, is there a better way? Can we contribute javascript to the app? Geoff On 18/08/2008, at 10:50 PM, Filip S. Adamsen wrote: Hi, This should get you started: http://wiki.apache.org/tapestry/Tapestry5HowToAddValidators -Filip On 2008-08-18 09:39, luna_guo wrote: Confirm password checking is so common. It should happen on the client side,right? So,what should i do ? /luna - 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]
Re: [T5] Injecting page into nested layouts
Hi again, That's a typo. The Layout class name should read 'Layout' and not 'InnerLayout' but the relevant code is the same. Ah, okay. A potential solution would be to use ComponentResources#getPage to get your page in a getter and just use that in your layout. Unfortunately, that won't work. CompontResources#getPage returns (org.apache.tapestry5.runtime.)Component, which doesn't expose the page's properties. (See Howard's post at: http://www.nabble.com/Re%3A--T5--Expansions---calling-page-methods-via-componentResources-p19006392.html) It works if you cast it: @Inject private ComponentResources resources; public BasePage getPage() { return (BasePage) resources.getPage(); } It just doesn't work directly with property expressions like ${resources.page}. I'm a bit confused by the terminology. I can't seem to find the docs on @InjectContainer, but I assumed it injected the 'parent' of the component, because the page is the root of the component tree. Now now it seems that it injects the contents of the layout? @InjectContainer does indeed inject the parent of the component. For InnerLayout this is the page alright, but for Layout it's actually the InnerLayout because Layout is contained in InnerLayout. The exception states this as well, this is what I missed the first time through: Component TestPage:innerlayout is not assignable to field test.components.Layout.page (of type test.BasePage). So the component innerlayout in the page TestPage is not assignable to the field page in Layout - because Layout expects page to be of type BasePage. There must be a way to do this... See above. Just use ComponentResources and cast it, simple as that. Richard -Filip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Form Field from an embedded component
Hi Chris, Get contactinfo through getEmbeddedComponent, get its ComponentResources, and finally get the component you need through getEmbeddedComponent and cast it to Field. That's the quick and dirty way, anyhow. -Filip On 2008-08-18 00:13, Chris Lewis wrote: Hello list, I have a page that has a form component, and in the form is another component contactinfo. This component is basically a custom editor for a contact bean. In the page I must do some custom validation on the server side, and in at least one instance I want to record an error on a field within the contactinfo. However I run into the issue that I can't use @Component in my page class, because the Field (component) is within an embedded component. How can I get at the Field? ComponentResources has getEmbeddedComponent, it returns type Component. Any ideas? Thanks in advance, Chris Lewis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5]How to make indentical validation on the client side.
Looking further into this, it doesn't even seem to be possible... Not as far as I can tell, anyhow. But then it's late here. Anyone else? -Filip On 2008-08-19 04:36, luna_guo wrote: Filip S. Adamsen-2 wrote: Hi, This should get you started: http://wiki.apache.org/tapestry/Tapestry5HowToAddValidators -Filip I want make a validator named confirm,just used to confirm the retype password. Using like this: t:type=passwordfield t:id=retypePasword validate=confirm=idOfPassword ……/ Now i have a problem: public void validate(Field field, String constraintValue, MessageFormatter formatter, String value) throws ValidationException { //do what here? } } the constraintValue is just the id of the password field,how can i get the password field's real value in a validator? /luna - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tapestry5HowTos: List binding prefix updated, map binding prefix added
Hi all, I've updated the list: binding prefix and added a map: binding prefix to Tapestry5HowTos. See them here: http://wiki.apache.org/tapestry/Tapestry5HowToAddBindingPrefix http://wiki.apache.org/tapestry/Tapestry5HowToAddMapBindingPrefix Also check out the format: binding prefix here: http://wiki.apache.org/tapestry/Tapestry5HowToAddMessageFormatBindingPrefix -Filip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Form Field from an embedded component
Hi, Glad it helped. :) Another possible way to do this would be triggering a custom event through ComponentResources#triggerEvent in ContactInfo and pass along whatever you need. Your page could then handle this event and do whatever it needs to do. It's a little cleaner API-wise, and not a lot of work, really. -Filip On 2008-08-19 05:17, Chris Lewis wrote: Filip, I had actually thought about that, but the explicit cast to Field prompted me ask the list. I hadn't tried that method until you mentioned it, and it does indeed work. If anyone can suggest a cleaner method I'd love to hear it, but for now this will do. Thanks again Filip! chris Filip S. Adamsen wrote: Hi Chris, Get contactinfo through getEmbeddedComponent, get its ComponentResources, and finally get the component you need through getEmbeddedComponent and cast it to Field. That's the quick and dirty way, anyhow. -Filip On 2008-08-18 00:13, Chris Lewis wrote: Hello list, I have a page that has a form component, and in the form is another component contactinfo. This component is basically a custom editor for a contact bean. In the page I must do some custom validation on the server side, and in at least one instance I want to record an error on a field within the contactinfo. However I run into the issue that I can't use @Component in my page class, because the Field (component) is within an embedded component. How can I get at the Field? ComponentResources has getEmbeddedComponent, it returns type Component. Any ideas? Thanks in advance, Chris Lewis - 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: forwarding page but no change in the url?
That is, as far as I know, not possible. But if you really need to have URLs that look like that, why not use the Index page for it? That should do exactly what you want... -Filip On 2008-08-15 10:12, Angelo Chen wrote: Hi, I'm trying to some url rewriting in the Index.java: I have this: http://mydomain.com/item/123 which displays item 123, now if user type url:http://mydomain.com/123, I'll forward it in onActivate to /item/123 as follows: Object onActivate(Object[] obj) { if (obj.length 0) { String code = (String) obj[0]; return resources.createPageLink(Utils.getClassBaseName(Item.class.getName()), true, code); } else return Home.class; } This works well, however, a little problem: when user type: http://mydomain.com/123 url displayed in the browser is http://mydomain.com/item/123 is there a way to just keep it like http://mydomain.com/123 in the browser? Thanks, Angelo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: t5: forwarding page but no change in the url?
But instead of redirecting in onActivate, why don't you get the item id and do what your ItemIndex page does on the Index page? -Filip On 2008-08-15 17:09, Angelo Chen wrote: Hi Filip, yes, I'm using Index page, the only issue is, when you return the correct page in the onActivate, the URL in the browser got changed. how to do this in index page? something like a servlet forward? Filip S. Adamsen-2 wrote: That is, as far as I know, not possible. But if you really need to have URLs that look like that, why not use the Index page for it? That should do exactly what you want... -Filip On 2008-08-15 10:12, Angelo Chen wrote: Hi, I'm trying to some url rewriting in the Index.java: I have this: http://mydomain.com/item/123 which displays item 123, now if user type url:http://mydomain.com/123, I'll forward it in onActivate to /item/123 as follows: Object onActivate(Object[] obj) { if (obj.length 0) { String code = (String) obj[0]; return resources.createPageLink(Utils.getClassBaseName(Item.class.getName()), true, code); } else return Home.class; } This works well, however, a little problem: when user type: http://mydomain.com/123 url displayed in the browser is http://mydomain.com/item/123 is there a way to just keep it like http://mydomain.com/123 in the browser? Thanks, Angelo - 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] validation bubbles css
I have the same problem. Generated code is: div class=t-error-popup style=position: absolute; top: 148px; left: -10px; width: auto; height: 39px; spanDu skal udfylde feltet Titel./span /div -Filip On 2008-08-16 00:09, Howard Lewis Ship wrote: It would be useful to see your rendered markup; this only occurs in a fraction of pages (certainly none I've created). There's an outstanding JIRA issue about this as well. On Fri, Aug 15, 2008 at 1:48 PM, kace [EMAIL PROTECTED] wrote: The validation bubbles are appearing top left of the screen while the form is at the centre. I extracted the default.css and the graphics for the bubbles into my own directory but not sure what I should change to make the positions relevant to the form. Ive tried a number of changes, nothing so far...anyone know? Thanks, ..kace -- View this message in context: http://www.nabble.com/-T5--validation-bubbles-css-tp19004961p19004961.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: forwarding page but no change in the url?
But it's still a page that you could use instead of your current Index page... -Filip On 2008-08-16 01:42, Angelo Chen wrote: hi, the Item page is quite complicated, one idea might be: render the page in the Index page and return it as StreamResponse, then the question is, is it possible to render a page in code and return that as Stream? Angelo But instead of redirecting in onActivate, why don't you get the item id and do what your ItemIndex page does on the Index page? -Filip On 2008-08-15 17:09, Angelo Chen wrote: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: t5: forwarding page but no change in the url?
Pretty much. Of course that might not work for you, it was merely a suggestion. -Filip On 2008-08-16 02:28, Angelo Chen wrote: you meant the Item page should be merged into the Index page? Filip S. Adamsen-2 wrote: But it's still a page that you could use instead of your current Index page... -Filip On 2008-08-16 01:42, Angelo Chen wrote: hi, the Item page is quite complicated, one idea might be: render the page in the Index page and return it as StreamResponse, then the question is, is it possible to render a page in code and return that as Stream? Angelo But instead of redirecting in onActivate, why don't you get the item id and do what your ItemIndex page does on the Index page? -Filip On 2008-08-15 17:09, Angelo Chen wrote: - 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] shouldn't MarkupWriter close the img-tag?
Hi, Have a look at http://wiki.apache.org/tapestry/Tapestry5HowToXhtml. -Filip On 2008-08-14 14:11, Andy Pahne wrote: I have a component, that's renders an img tag. @BeginRender public void renderIcon(MarkupWriter writer) { Asset icon = getSrc(); writer.element(img, src, icon.toClientURL(), alt, getAlt()); resources.renderInformalParameters(writer); writer.end(); } The result is: img alt=Hello border=0 src=/x/y/z/image.gif (border is an informal parameter!) Shouldn't it render more like: img alt=Hello border=0 src=/x/y/z/image.gif / Andy - 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] Two RequestFilters in application module possible?
Hi, Glad it worked. I have something similar in my application, but instead of using a RequestFilter I use a PageRenderRequestFilter. This is only called for pages and has the added benefit of giving you easy access to the page name, parameters, etc. There's something similar for component events, ComponentEventRequestFilter, in case you'll ever need that, by the way. -Filip On 2008-08-14 10:05, Otho wrote: Thank you very much for the answer. Works perfectly! But this brought up a new question. The UserActivityFilter is used to track a users last activity to check for active users at the moment. The simplistic approach I use at the moment updates a database table with a reference to user and a timestamp. Using a requestfilter then obviously leads to a lot of database roundtrips per user-activity, since every asset triggers the filter. How would you track useractivity in a real world application? A resolution of about 1 minute would suffice, but it shouldn't be much above that. Regards, Otho - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Two RequestFilters in application module possible?
Hi, Glad it worked. I have something similar in my application, but instead of using a RequestFilter I use a PageRenderRequestFilter. This is only called for pages and has the added benefit of giving you easy access to the page name, parameters, etc. There's something similar for component events, ComponentEventRequestFilter, in case you'll ever need that, by the way. -Filip On 2008-08-14 10:05, Otho wrote: Thank you very much for the answer. Works perfectly! But this brought up a new question. The UserActivityFilter is used to track a users last activity to check for active users at the moment. The simplistic approach I use at the moment updates a database table with a reference to user and a timestamp. Using a requestfilter then obviously leads to a lot of database roundtrips per user-activity, since every asset triggers the filter. How would you track useractivity in a real world application? A resolution of about 1 minute would suffice, but it shouldn't be much above that. Regards, Otho - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: t5: a default page for non exist path
Yeah, there is. At least I do that... I use onActivate on my Index page like this: Object onActivate(Object obj) { return ErrorNotFound.class; } Then, in my ErrorNotFound page, I set the HTTP Status Code to 404 to make the search engines happy: @Inject private RequestGlobals requestGlobals; public void setupRender() { requestGlobals.getHTTPServletResponse().setStatus(HttpServletResponse.SC_NOT_FOUND); } Works like a charm. -Filip On 2008-08-14 14:41, Angelo Chen wrote: hi, how to define a default page that will be shown to the browser if a non existing path is entered? example: www.mydomain.com/page1, page1 does not exist, tomcat will display a HTTP Status 404 - /page1, any way to re-direct this in t5 app to a t5 page? thanks. angelo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: t5: a default page for non exist path
Yes, it will. If the path isn't valid, Tapestry will pass it as the activation context to onActivate on your Index page. -Filip On 2008-08-14 15:16, Angelo Chen wrote: Thanks for the fast response, but I can not quite understand, my setup is like this: I have a Start.tmp which in turn call the /Home page, based on what you said, the Start's onActive(Object obj) will be called if a invalid path is supplied? Filip S. Adamsen-2 wrote: Yeah, there is. At least I do that... I use onActivate on my Index page like this: Object onActivate(Object obj) { return ErrorNotFound.class; } Then, in my ErrorNotFound page, I set the HTTP Status Code to 404 to make the search engines happy: @Inject private RequestGlobals requestGlobals; public void setupRender() { requestGlobals.getHTTPServletResponse().setStatus(HttpServletResponse.SC_NOT_FOUND); } Works like a charm. -Filip On 2008-08-14 14:41, Angelo Chen wrote: hi, how to define a default page that will be shown to the browser if a non existing path is entered? example: www.mydomain.com/page1, page1 does not exist, tomcat will display a HTTP Status 404 - /page1, any way to re-direct this in t5 app to a t5 page? thanks. angelo - 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: Page Loading and OSGI
Hi, I have no experience with OSGi, but perhaps this issue can help: https://issues.apache.org/jira/browse/TAPESTRY-2519 -Filip On 2008-08-14 15:09, Atle Prange wrote: Hi, i am currrently trying to integrate tapestry into an OSGI container using apache felix and the ops4j pax web service. (For many interesting reasons, one of them is the possibility to add services to the webapp at runtime...) I have managed to register the Tapestry filter, and load my app module, the builtin modules are also loaded at startup. But i am not able to load my pages, the request just falls through and ends up with my registered default servlet. I have tried to locate the code that bootstraps the pages and components to see if there is some error in locating or loading the page classes in the .pages package, but i have not been able to find the code that initializes the pages. Could someone with intimate knowledge of tapestry give me a hint to where the loading of pages is performed initially, so i can check for myself? - 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: a default page for non exist path
Hi, Try renaming Start to Index and see if that helps. -Filip On 2008-08-14 16:30, Angelo Chen wrote: hi, This is my Start.tml, i assume it's the same as Index.tml, but the first onActivate is not called, any idea? public class Start { Object onActivate(Object obj) { System.out.println(index a); return PageNotFound.class; } // use Start to load the home page so that dispatchers can be called // if Home as the starting page, dispatchers will not be called at home page point public Class onActivate() { return Home.class; } } Filip S. Adamsen-2 wrote: Yes, it will. If the path isn't valid, Tapestry will pass it as the activation context to onActivate on your Index page. -Filip On 2008-08-14 15:16, Angelo Chen wrote: Thanks for the fast response, but I can not quite understand, my setup is like this: I have a Start.tmp which in turn call the /Home page, based on what you said, the Start's onActive(Object obj) will be called if a invalid path is supplied? Filip S. Adamsen-2 wrote: Yeah, there is. At least I do that... I use onActivate on my Index page like this: Object onActivate(Object obj) { return ErrorNotFound.class; } Then, in my ErrorNotFound page, I set the HTTP Status Code to 404 to make the search engines happy: @Inject private RequestGlobals requestGlobals; public void setupRender() { requestGlobals.getHTTPServletResponse().setStatus(HttpServletResponse.SC_NOT_FOUND); } Works like a charm. -Filip On 2008-08-14 14:41, Angelo Chen wrote: hi, how to define a default page that will be shown to the browser if a non existing path is entered? example: www.mydomain.com/page1, page1 does not exist, tomcat will display a HTTP Status 404 - /page1, any way to re-direct this in t5 app to a t5 page? thanks. angelo - 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]
Re: [T5] shouldn't MarkupWriter close the img-tag?
I suppose you meant @ContentType(text/xhtml). This doesn't work, though. At least not for me. I get a download prompt for the page, then. Same thing happens in Internet Explorer with @ContentType(application/xhtml+xml), so that doesn't work either. Ugh. -Filip On 2008-08-14 16:17, Howard Lewis Ship wrote: I need to update that wiki page. You can also just at @ContentType(text/html) to your page. On Thu, Aug 14, 2008 at 5:12 AM, Filip S. Adamsen [EMAIL PROTECTED] wrote: Hi, Have a look at http://wiki.apache.org/tapestry/Tapestry5HowToXhtml. -Filip On 2008-08-14 14:11, Andy Pahne wrote: I have a component, that's renders an img tag. @BeginRender public void renderIcon(MarkupWriter writer) { Asset icon = getSrc(); writer.element(img, src, icon.toClientURL(), alt, getAlt()); resources.renderInformalParameters(writer); writer.end(); } The result is: img alt=Hello border=0 src=/x/y/z/image.gif (border is an informal parameter!) Shouldn't it render more like: img alt=Hello border=0 src=/x/y/z/image.gif / Andy - 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]
Re: t5: a default page for non exist path
I'm not quite sure why Index works and Start doesn't. But it does. Regarding URL rewriting, I guess that's possible. I wouldn't rely on this feature, though. I'm not sure it's supposed to work like that. -Filip On 2008-08-14 16:52, Angelo Chen wrote: Hi Filip, renaming Start to Index works, don't know why? what's the difference between Start and Index? this means we can actually do some URL rewriting in the onActivate(Obj)? that will be easier then using a HttpServletRequestFilter, say if somebody type: www.mydomain.com/12345/profile then we can forward it to: www.mydomain.com/profile/12345 possible? Filip S. Adamsen-2 wrote: Hi, Try renaming Start to Index and see if that helps. -Filip On 2008-08-14 16:30, Angelo Chen wrote: hi, This is my Start.tml, i assume it's the same as Index.tml, but the first onActivate is not called, any idea? public class Start { Object onActivate(Object obj) { System.out.println(index a); return PageNotFound.class; } // use Start to load the home page so that dispatchers can be called // if Home as the starting page, dispatchers will not be called at home page point public Class onActivate() { return Home.class; } } Filip S. Adamsen-2 wrote: Yes, it will. If the path isn't valid, Tapestry will pass it as the activation context to onActivate on your Index page. -Filip On 2008-08-14 15:16, Angelo Chen wrote: Thanks for the fast response, but I can not quite understand, my setup is like this: I have a Start.tmp which in turn call the /Home page, based on what you said, the Start's onActive(Object obj) will be called if a invalid path is supplied? Filip S. Adamsen-2 wrote: Yeah, there is. At least I do that... I use onActivate on my Index page like this: Object onActivate(Object obj) { return ErrorNotFound.class; } Then, in my ErrorNotFound page, I set the HTTP Status Code to 404 to make the search engines happy: @Inject private RequestGlobals requestGlobals; public void setupRender() { requestGlobals.getHTTPServletResponse().setStatus(HttpServletResponse.SC_NOT_FOUND); } Works like a charm. -Filip On 2008-08-14 14:41, Angelo Chen wrote: hi, how to define a default page that will be shown to the browser if a non existing path is entered? example: www.mydomain.com/page1, page1 does not exist, tomcat will display a HTTP Status 404 - /page1, any way to re-direct this in t5 app to a t5 page? thanks. angelo - 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]
Re: T5 JBoss/Tomcat expires header
Hi, This is weird. I run Tapestry 5.0.14 in production on Tomcat 5.5 with no issues whatsoever wrt. the Expires header. Can you reproduce this on different systems? -Filip On 2008-08-14 23:12, Krishna Caldas wrote: Hi, The Expires header parameter (set after fix of https://issues.apache.org/jira/browse/TAPESTRY-2159) is not working as expected in JBoss/Tomcat. For tapestry.js these are the headers: === JBoss/Tomcat Response Headers Server Apache-Coyote/1.1 X-Powered-ByServlet 2.4; JBoss-4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)/Tomcat-5.5 Last-Modified Thu, 01 Jan 1970 00:00:00 GMT Expires Sun, 30 Dec 1979 00:00:00 GMT Content-Typetext/javascript Transfer-Encoding chunked Content-Encodinggzip VaryAccept-Encoding DateTue, 12 Aug 2008 14:42:50 GMT === === Jetty Response Headers Last-Modified Wed, 06 Aug 2008 13:21:22 GMT Expires Sat, 04 Aug 2018 13:21:22 GMT Content-Length 38282 Content-Typetext/javascript Server Jetty(7.0.0pre3) === The Tapestry code is implemented here: === public class ResourceStreamerImpl implements ResourceStreamer { private static final long TEN_YEARS = new TimeInterval(10y).milliseconds(); ... public void streamResource(Resource resource) throws IOException { ... long lastModified = connection.getLastModified(); response.setDateHeader(Last-Modified, lastModified); response.setDateHeader(Expires, lastModified + TEN_YEARS); ... === From URLConnection JavaDoc: Returns the value of the last-modified header field. The result is the number of milliseconds since January 1, 1970 GMT. Returns: the date the resource referenced by this URLConnection was last modified, or 0 if not known. It seams that connection.getLastModified() is returning 0 inside Tomcat and file last modification date inside Jetty. Am I missing something? Thanks, Krishna - 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 How to tell T5 to send 301 (moved permanently)
Hi, I actually extended HttpStatusCode to take care of this. Here's the code: HttpStatusCode.java: public class HttpStatusCode implements Serializable { private final int statusCode; private final String location; public HttpStatusCode(int statusCode) { this.statusCode = statusCode; this.location = ; } public HttpStatusCode(int statusCode, String location) { this.statusCode = statusCode; this.location = location; } public HttpStatusCode(int statusCode, Link link) { this(statusCode, link.toRedirectURI()); } public HttpStatusCode(int statusCode, URL url) { this(statusCode, url.toExternalForm()); } public int getStatusCode() { return statusCode; } public String getLocation() { return location; } } AppModule.java: public static void contributeComponentEventResultProcessor( MappedConfigurationClass, ComponentEventResultProcessor configuration, final Response response) { configuration.add(HttpStatusCode.class, new ComponentEventResultProcessorHttpStatusCode() { public void processResultValue(HttpStatusCode value) throws IOException { if (!value.getLocation().isEmpty()) response.setHeader(Location, value.getLocation()); response.sendError(value.getStatusCode(), ); } }); } Now all you need to do is: return new HttpStatusCode(HttpServletResponse.SC_MOVED_PERMANENTLY, link); Link can be a String, a Link or a URL. -Filip On 2008-08-13 19:35, Martin Grotzke wrote: Hi Lutz, this approach sounds really good, I'll give it a try. Thanx cheers, Martin On Sat, 2008-08-09 at 00:11 +0200, Lutz Hühnken wrote: I haven't tried it, but I think it should work with the approach described in http://www.nabble.com/Index-page-context-and-404-response-to16649174.html#a16649174 It works fine for 404, you might have to extend it to include the URL to the page you are redirecting to. Hth, Lutz On Thu, Aug 7, 2008 at 3:16 PM, Martin Grotzke [EMAIL PROTECTED] wrote: Hi, when I return a link in some method T5 send a 302. I want to send a 301 to the client. Is this possible with tapestry, without using the servlet stuff? Thanx cheers, Martn - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Two RequestFilters in application module possible?
Hi, Your problem is that Tapestry sees two RequestFilters, and that won't work. You'll need to properly identify each service and tell Tapestry that those are the services you want to contribute. public static void bind(ServiceBinder binder) { binder.bind(UserActivityFilterImpl.class).withId(UserActivityFilter); } public static RequestFilter buildTimingFilter(...) { ... } public static void contributeRequestHandler(OrderedConfigurationRequestFilter configuration, @InjectService(TimingFilter) RequestFilter timingFilter, @InjectService(UserActivityFilter) RequestFilter userActivityFilter) { ... } I haven't tested it, but it should work. -Filip On 2008-08-13 22:30, Otho wrote: Hi all! I want two contribute a second requestfilter alongside the timing filter in application module. But unfortunately this doesn't work with an anonymous definition (like the timing filter) and a contribution to RequestHandler nor does it work with a written out interface/class pair contributet via the bind mechanism. In the latter case the error message is like this: HTTP ERROR: 500 Exception constructing service 'RequestHandler': Error invoking service builder method org.apache.tapestry5.services.TapestryModule.buildRequestHandler(Logger, List, Dispatcher) (at TapestryModule.java:970) (for service 'RequestHandler'): Error invoking service contribution method org.example.animaltips.services.AtModule.contributeRequestHandler(OrderedConfiguration, RequestFilter): Unable to locate a single service assignable to type org.apache.tapestry5.services.RequestFilter with marker annotation(s) org.apache.tapestry5.ioc.annotations.Local. All of the following services match: org.example.animaltips.services.AtModule.buildTimingFilter(Logger) (at AtModule.java:63), org.example.animaltips.services.UserActivityFilterImpl() (at UserActivityFilterImpl.java:24). In the former case it also complains about 2 classes implementing the RequestFilter interface. My own filter works flawlessly when I comment out the timing filter contribution. But for the time being I want to have both. Is there any way to do this easily? Regards, Otho - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Specify List as Form's context?
Hi, Either assemble the list in a method of your page class or use the list binding prefix from the wiki. http://wiki.apache.org/tapestry/Tapestry5HowToAddBindingPrefix -Filip On 2008-08-14 02:00, Jim Tomlinson wrote: I'm vapor-locking on how to specify a List of values in a Form component's context parameter. In this form: form t:type=form t:id=updateForm t:context=${foo}, ${bar} Tapestry correctly calls my 'String getFoo()' and 'Long getBar()' methods when preparing to render (let's say they return fooString and 1L respectively), but my onPrepare... doesn't get called correctly with the resulting values as a List. If I declare onPrepareFromUpdateForm(String bothVals) I get the String: fooString, 1 If I declare it as onPrepareFromUpdateForm(String fooVal, long barVal) the onPrepare... method doesn't get called at all. What's the magic to correctly constructing the context parameter as a List (which the docs say is possible). Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]