PatternValidator with regular expression
Dear all I have some problem on Pattern Validator. Similar code work fine in Tapestry 3 but have problem on Tapestry 4. Keep saying that Error initializing property patternString of bean 'emailValidator' and I cannot figure out what's the problem. Coding as below bean name=emailValidator class=org.apache.tapestry.valid.PatternValidator lifecycle=page set name=patternString value=[EMAIL PROTECTED],6}$/ set name=patternNotMatchedMessage value=invalid-email-format/ set name=requiredMessage value=field-required/ /bean component id=_textField_email type=TextField binding name=value value=email/ binding name=validators value=beans.emailValidator/ binding name=displayName value=literal:label_email/ /component Any hints would be appreciated. One more question on i18n, does the error message support different languages? Thanks a lot. regards wayne Get your own web address. Have a HUGE year through Yahoo! Small Business. http://smallbusiness.yahoo.com/domains/?p=BESTDEAL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PatternValidator with regular expression
Try to put literal in front of your pattern. Thus : value=literal:[EMAIL PROTECTED] {2,6}$ Numa Le 26 févr. 07 à 10:02, wong wayne a écrit : Dear all I have some problem on Pattern Validator. Similar code work fine in Tapestry 3 but have problem on Tapestry 4. Keep saying that Error initializing property patternString of bean 'emailValidator' and I cannot figure out what's the problem. Coding as below bean name=emailValidator class=org.apache.tapestry.valid.PatternValidator lifecycle=page set name=patternString value=[EMAIL PROTECTED],6}$/ set name=patternNotMatchedMessage value=invalid-email-format/ set name=requiredMessage value=field-required/ /bean component id=_textField_email type=TextField binding name=value value=email/ binding name=validators value=beans.emailValidator/ binding name=displayName value=literal:label_email/ /component Any hints would be appreciated. One more question on i18n, does the error message support different languages? Thanks a lot. regards wayne __ __ Get your own web address. Have a HUGE year through Yahoo! Small Business. http://smallbusiness.yahoo.com/domains/?p=BESTDEAL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message has been 'sanitized'. This means that potentially dangerous content has been rewritten or removed. The following log describes which actions were taken. Sanitizer (start=1172481891): Split unusually long Date: header. SanitizeFile (filename=unnamed.txt, mimetype=text/plain): Match (names=unnamed.txt, rule=2): Enforced policy: accept Total modifications so far: 1 Anomy 0.0.0 : Sanitizer.pm $Id: Sanitizer.pm,v 1.90 2005/01/04 20:30:13 bre Exp $ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PatternValidator with regular expression
Thanks for your reply. Sorry to tell you that the method suggested seems not work, same error message resulted. Finally solved by using validators but I still willing to know whats the root cause and the expression posted previous cannot apply to validators. I need to changes as follows, any thought? Thanks. component id=_textField_email type=TextField binding name=value value=ognl:email/ binding name=validators value=validators:[EMAIL PROTECTED]/ binding name=displayName value=message:label_email/ /component One more thing, is it possible to customize the error message by our own when using validators? Thanks in advaned regards wayne --- Numa Schmeder [EMAIL PROTECTED] wrote: Try to put literal in front of your pattern. Thus : value=literal:[EMAIL PROTECTED] {2,6}$ Numa Le 26 févr. 07 à 10:02, wong wayne a écrit : Dear all I have some problem on Pattern Validator. Similar code work fine in Tapestry 3 but have problem on Tapestry 4. Keep saying that Error initializing property patternString of bean 'emailValidator' and I cannot figure out what's the problem. Coding as below bean name=emailValidator class=org.apache.tapestry.valid.PatternValidator lifecycle=page set name=patternString value=[EMAIL PROTECTED],6}$/ set name=patternNotMatchedMessage value=invalid-email-format/ set name=requiredMessage value=field-required/ /bean component id=_textField_email type=TextField binding name=value value=email/ binding name=validators value=beans.emailValidator/ binding name=displayName value=literal:label_email/ /component Any hints would be appreciated. One more question on i18n, does the error message support different languages? Thanks a lot. regards wayne __ __ Get your own web address. Have a HUGE year through Yahoo! Small Business. http://smallbusiness.yahoo.com/domains/?p=BESTDEAL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message has been 'sanitized'. This means that potentially dangerous content has been rewritten or removed. The following log describes which actions were taken. Sanitizer (start=1172481891): Split unusually long Date: header. SanitizeFile (filename=unnamed.txt, mimetype=text/plain): Match (names=unnamed.txt, rule=2): Enforced policy: accept Total modifications so far: 1 Anomy 0.0.0 : Sanitizer.pm $Id: Sanitizer.pm,v 1.90 2005/01/04 20:30:13 bre Exp $ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] We won't tell. Get more on shows you hate to love (and love to hate): Yahoo! TV's Guilty Pleasures list. http://tv.yahoo.com/collections/265 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PatternValidator with regular expression
Oups sorry, I haven't seen something in your previous mail, It didn't work for the following reason: the validators binding only accept a collection of Validators that are new to tap4. Thus you can only use the validators prefix (validators=validators:required, pattern=myPattern) etc... The approach you were taking is only available for ValidField (which was for tap3, and is still available for backward compatibility). As from tap4, you souldn't be using ValidField and Validator, But the new validation mechanism TextField validators=validators:required, min=0. With this new system every field is valid-able now. If you want to provide a validator configuration in the page spec (.page) you can do the following: bean name=emailValidator class=org.apache.tapestry.form.validator.Pattern -- New type of validators as of Tap4 set name=pattern value=[A-z]+ /bean and the use binding name=validators value=validators:required, $emailValidator/ -- Look at the dollar sign Numa Le 26 févr. 07 à 11:26, wong wayne a écrit : Thanks for your reply. Sorry to tell you that the method suggested seems not work, same error message resulted. Finally solved by using validators but I still willing to know what’s the root cause and the expression posted previous cannot apply to validators. I need to changes as follows, any thought? Thanks. component id=_textField_email type=TextField binding name=value value=ognl:email/ binding name=validators value=validators:[EMAIL PROTECTED]/ binding name=displayName value=message:label_email/ /component One more thing, is it possible to customize the error message by our own when using validators? Thanks in advaned regards wayne --- Numa Schmeder [EMAIL PROTECTED] wrote: Try to put literal in front of your pattern. Thus : value=literal:[EMAIL PROTECTED] {2,6}$ Numa Le 26 févr. 07 à 10:02, wong wayne a écrit : Dear all I have some problem on Pattern Validator. Similar code work fine in Tapestry 3 but have problem on Tapestry 4. Keep saying that Error initializing property patternString of bean 'emailValidator' and I cannot figure out what's the problem. Coding as below bean name=emailValidator class=org.apache.tapestry.valid.PatternValidator lifecycle=page set name=patternString value=[EMAIL PROTECTED],6}$/ set name=patternNotMatchedMessage value=invalid-email-format/ set name=requiredMessage value=field-required/ /bean component id=_textField_email type=TextField binding name=value value=email/ binding name=validators value=beans.emailValidator/ binding name=displayName value=literal:label_email/ /component Any hints would be appreciated. One more question on i18n, does the error message support different languages? Thanks a lot. regards wayne __ __ Get your own web address. Have a HUGE year through Yahoo! Small Business. http://smallbusiness.yahoo.com/domains/?p=BESTDEAL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message has been 'sanitized'. This means that potentially dangerous content has been rewritten or removed. The following log describes which actions were taken. Sanitizer (start=1172481891): Split unusually long Date: header. SanitizeFile (filename=unnamed.txt, mimetype=text/plain): Match (names=unnamed.txt, rule=2): Enforced policy: accept Total modifications so far: 1 Anomy 0.0.0 : Sanitizer.pm $Id: Sanitizer.pm,v 1.90 2005/01/04 20:30:13 bre Exp $ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ __ We won't tell. Get more on shows you hate to love (and love to hate): Yahoo! TV's Guilty Pleasures list. http://tv.yahoo.com/collections/265 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message has been 'sanitized'. This means that potentially dangerous content has been rewritten or removed. The following log describes which actions were taken. Sanitizer (start=1172486894): Split unusually long Date: header. SanitizeFile (filename=unnamed.txt, mimetype=text/plain): Match (names=unnamed.txt, rule=2): Enforced policy: accept Total modifications so far: 1 Anomy 0.0.0 : Sanitizer.pm $Id: Sanitizer.pm,v 1.90 2005/01/04 20:30:13 bre Exp $ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 + Jetty + Hibernate
On 2/25/07, Olivier Jacquet [EMAIL PROTECTED] wrote: Hi, Does anyone has an example of how to get tapestry, jetty and hibernate running together? Having an hibernate Session injected into T5 pages is fairly easy: public final static SessionFactory buildSessionFactory() { URL res = AppModule.class.getResource(/hibernate.cfg.xml); SessionFactory sf = new AnnotationConfiguration() .configure(res) .buildSessionFactory(); return sf; } @Lifecycle(perthread) public Session buildSession(@InjectService(SessionFactory) SessionFactory factory) { return factory.getCurrentSession(); //return factory.openSession(); } Then in you page just: @Inject private Session _session; I think all of these is explained in the online doc. If you need/wish more integration (like having your hibernate object directly into your pages) you have to do some more work, this is just a starting point. -- Massimo http://meridio.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 + Jetty + Hibernate
That's not exactly a good separation of concerns, though. Your view layer shouldn't be talking directly to your ORM layer. I'd put a DAO layer in between for some encapsulation (and to help with unit testing). On 2/26/07, Massimo Lusetti [EMAIL PROTECTED] wrote: On 2/25/07, Olivier Jacquet [EMAIL PROTECTED] wrote: Hi, Does anyone has an example of how to get tapestry, jetty and hibernate running together? Having an hibernate Session injected into T5 pages is fairly easy: public final static SessionFactory buildSessionFactory() { URL res = AppModule.class.getResource(/hibernate.cfg.xml); SessionFactory sf = new AnnotationConfiguration() .configure(res) .buildSessionFactory(); return sf; } @Lifecycle(perthread) public Session buildSession(@InjectService(SessionFactory) SessionFactory factory) { return factory.getCurrentSession(); //return factory.openSession(); } Then in you page just: @Inject private Session _session; I think all of these is explained in the online doc. If you need/wish more integration (like having your hibernate object directly into your pages) you have to do some more work, this is just a starting point. -- Massimo http://meridio.blogspot.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 + Jetty + Hibernate
don't send email to me again and again! I unsubscribe from tapestry.org ,but I remain receive onehundred emailseven more from tapestry! 离人网 From: "James Carman" [EMAIL PROTECTED]Reply-To: "Tapestry users" users@tapestry.apache.orgTo: "Tapestry users" users@tapestry.apache.orgSubject: Re: T5 + Jetty + HibernateDate: Mon, 26 Feb 2007 06:32:57 -0500That's not exactly a good separation of concerns, though. Your viewlayer shouldn't be talking directly to your ORM layer. I'd put a DAOlayer in between for some encapsulation (and to help with unittesting).On 2/26/07, Massimo Lusetti [EMAIL PROTECTED] wrote:On 2/25/07, Olivier Jacquet [EMAIL PROTECTED] wrote: Hi, Does anyone has an example of how to get tapestry, jetty and hibernate running together?Having an hibernate Session injected into T5 pages is fairly easy:public final static SessionFactory buildSessionFactory() { URL res = AppModule.class.getResource("/hibernate.cfg.xml"); SessionFactory sf = new AnnotationConfiguration() .configure(res) .buildSessionFactory(); return sf; } @Lifecycle("perthread") public Session buildSession(@InjectService("SessionFactory") SessionFactory factory) { return factory.getCurrentSession();// return factory.openSession(); }Then in you page just: @Inject private Session _session;I think all of these is explained in the online doc.If you need/wish more integration (like having your hibernate objectdirectly into your pages) you have to do some more work, this is justa starting point.--Massimohttp://meridio.blogspot.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]请使用 MSN Messenger 与联机的朋友进行交流 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PatternValidator with regular expression
Thanks a lot for your clear explanation. It seems is a long route for upgrading from v3 to v4. regards wayne --- Numa Schmeder [EMAIL PROTECTED] wrote: Oups sorry, I haven't seen something in your previous mail, It didn't work for the following reason: the validators binding only accept a collection of Validators that are new to tap4. Thus you can only use the validators prefix (validators=validators:required, pattern=myPattern) etc... The approach you were taking is only available for ValidField (which was for tap3, and is still available for backward compatibility). As from tap4, you souldn't be using ValidField and Validator, But the new validation mechanism TextField validators=validators:required, min=0. With this new system every field is valid-able now. If you want to provide a validator configuration in the page spec (.page) you can do the following: bean name=emailValidator class=org.apache.tapestry.form.validator.Pattern -- New type of validators as of Tap4 set name=pattern value=[A-z]+ /bean and the use binding name=validators value=validators:required, $emailValidator/ -- Look at the dollar sign Numa Le 26 févr. 07 à 11:26, wong wayne a écrit : Thanks for your reply. Sorry to tell you that the method suggested seems not work, same error message resulted. Finally solved by using validators but I still willing to know whats the root cause and the expression posted previous cannot apply to validators. I need to changes as follows, any thought? Thanks. component id=_textField_email type=TextField binding name=value value=ognl:email/ binding name=validators value=validators:[EMAIL PROTECTED]/ binding name=displayName value=message:label_email/ /component One more thing, is it possible to customize the error message by our own when using validators? Thanks in advaned regards wayne --- Numa Schmeder [EMAIL PROTECTED] wrote: Try to put literal in front of your pattern. Thus : value=literal:[EMAIL PROTECTED] {2,6}$ Numa Le 26 févr. 07 à 10:02, wong wayne a écrit : Dear all I have some problem on Pattern Validator. Similar code work fine in Tapestry 3 but have problem on Tapestry 4. Keep saying that Error initializing property patternString of bean 'emailValidator' and I cannot figure out what's the problem. Coding as below bean name=emailValidator class=org.apache.tapestry.valid.PatternValidator lifecycle=page set name=patternString value=[EMAIL PROTECTED],6}$/ set name=patternNotMatchedMessage value=invalid-email-format/ set name=requiredMessage value=field-required/ /bean component id=_textField_email type=TextField binding name=value value=email/ binding name=validators value=beans.emailValidator/ binding name=displayName value=literal:label_email/ /component Any hints would be appreciated. One more question on i18n, does the error message support different languages? Thanks a lot. regards wayne __ __ Get your own web address. Have a HUGE year through Yahoo! Small Business. http://smallbusiness.yahoo.com/domains/?p=BESTDEAL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message has been 'sanitized'. This means that potentially dangerous content has been rewritten or removed. The following log describes which actions were taken. Sanitizer (start=1172481891): Split unusually long Date: header. SanitizeFile (filename=unnamed.txt, mimetype=text/plain): Match (names=unnamed.txt, rule=2): Enforced policy: accept Total modifications so far: 1 Anomy 0.0.0 : Sanitizer.pm $Id: Sanitizer.pm,v 1.90 2005/01/04 20:30:13 bre Exp $ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ __ We won't tell. Get more on shows you hate to love (and love to hate): Yahoo! TV's Guilty Pleasures list. http://tv.yahoo.com/collections/265 === message truncated === Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail beta. http://new.mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: New to Tapestry
snip Drop downs to other objects will come with the Hibernate integration (since we need a way to identify the other objects that can be linked to). /snip Does this mean that you're planning to integrate hibernate directly into the framework, ala trails? Or are you going for a broader JPA integration? I hope you're not going to tie tap5 too tightly to hibernate, as there are those of us who prefer other ORMs... Robert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: New to Tapestry
Like T4, T5 is totally pluggable (maybe even more so). So there will be a tapestry-hibernate integration module that extends the framework in a number of ways, including adding editors and viewers for Hibernate relationships inside the BeanEditForm and Grid components. It's possible that a more generic tapestry-jpa3 library will do the job, or that one will be layered on the other. I expect to start some work along these lines sooner rather than later. On 2/26/07, Robert Zeigler [EMAIL PROTECTED] wrote: snip Drop downs to other objects will come with the Hibernate integration (since we need a way to identify the other objects that can be linked to). /snip Does this mean that you're planning to integrate hibernate directly into the framework, ala trails? Or are you going for a broader JPA integration? I hope you're not going to tie tap5 too tightly to hibernate, as there are those of us who prefer other ORMs... Robert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship TWD Consulting, Inc. Independent J2EE / Open-Source Java Consultant Creator and PMC Chair, Apache Tapestry Creator, Apache HiveMind Professional Tapestry training, mentoring, support and project work. http://howardlewisship.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OutOfMemoryError after serving N pages
May the sone property abstract. You are clearing it inside finishLoad() which means, even with caching enabled, the song (and the presumably Hibernate session that it was obtained from) is retained needlessly between requests. Most likely culprit is caching disabled, which leaks some memory related to the series of Classes / ClassLoaders it builds. On 2/22/07, Arjan Verstoep [EMAIL PROTECTED] wrote: Hi, I'm building an application with the Tapestry 4.0.2 framework, which manages my music-collection. I'm getting OutOfMemoryErrors since I've created a small ajax-ish component that refreshes every 10 seconds to show the song that is currently playing. A piece of javascript gets the Tapestry-page with the currently-playing song on it, and puts the generated html into a div. After 24 hours or so making these page-requests, an out of memory error occurs. I have the feeling that this new auto-refreshing component of mine only quickens the OutOfMemoryError, since I did get these errors before, but only after much longer uptimes. What am I doing wrong here? Is it the Spring OpenSessionInView-filter that I use that is wasting memory, am I not cleaning-up everything myself? Should I use Tapestry 4.1.1? Can anybody help? The code of the page follows: (You can also have a look at http://musicontroller.cvs.sourceforge.net/musicontroller/ for more sourcecode) Thanks, ~Arjan Verstoep public abstract class CurrentlyPlaying extends BasePage { public abstract SessionUserState getSessionUserState(); public abstract Dao getDao(); private Song _song = null; public Song getCurrentSong() { if (_song==null) { _song = getDao().getSongById(getSessionUserState().getDJ().getCurrentSongId()); } return _song; } public void finishLoad() { super.finishLoad(); _song = null; } } ?xml version=1.0 encoding=UTF-8? !DOCTYPE page-specification PUBLIC -//Apache Software Foundation//Tapestry Specification 4.0//EN http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd; page-specification class=org.musicontroller.gui.dynamic.CurrentlyPlaying inject property=sessionUserState type=state object=sessionUserState/ inject property=dao object=spring:dao/ component id=ifPlaying type=If binding name=condition value=getCurrentSong()!=null/ /component component id=songName type=Insert binding name=value value=ognl:currentSong.name/ /component component id=band type=components/BandLink binding name=band value=ognl:currentSong.getBand()/ !-- Why doesn't currentSong.band work?? -- /component /page-specification body jwcid=@Body span jwcid=$content$ span jwcid=ifPlaying span jwcid=band/nbsp;-nbsp;span jwcid=songName/ /span /span /body - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship TWD Consulting, Inc. Independent J2EE / Open-Source Java Consultant Creator and PMC Chair, Apache Tapestry Creator, Apache HiveMind Professional Tapestry training, mentoring, support and project work. http://howardlewisship.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Page initialization
Hi!, where do I have to put page initialization code in tapestry 4.1.1? I need that the init method is called only when I render the page, but not when I call a form submit. Thx, kiuma
Re: Page initialization
What I need is that when I access or refresh the page a parameter bound to session must be reset On 2/26/07, Andrea Chiumenti [EMAIL PROTECTED] wrote: Hi!, where do I have to put page initialization code in tapestry 4.1.1? I need that the init method is called only when I render the page, but not when I call a form submit. Thx, kiuma
T5 Roadmap - support for Portlet development?
Hi, Will T5 continue to support JSR-168? I couldn't find it on the roadmap. If JSR-168 still is supported, are there plans to support JSR-268? Thanks, -J. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Page Validation
Hello, I tried implementing it exactly as you suggested but I still get to see the first page. Once I refresh or try to go somewhere it sends me to the login page. The funny thing is, the PageRedirectException IS being thrown, its just not going to the login page. Any ideas? --James - Original Message - From: Nikla Ratinen [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Friday, February 23, 2007 1:02 PM Subject: Re: Page Validation Hi, As an alternate approach you may override the default page source with an implementation that checks security constraints just before giving out the page instance - this basically has the added benefit that secured page instances may not be obtained even through (accidental) malicious code in non-secure pages or services. -- Overridden engine public class MyEngine extends BaseEngine { protected IPageSource createPageSource(RequestContext context) { return new ProtectedPageSource(this); } } -- Overridden page source public class ProtectedPageSource extends PageSource { public ProtectedPageSource(IEngine engine) { super(engine); } public IPage getPage(IRequestCycle cycle, String pageName, IMonitor monitor) { IPage page = super.getPage(cycle, pageName, monitor); if (page != null page instanceof ProtectedPage) { Visit visit = (Visit) cycle.getEngine().getVisit(); if (visit == null || visit.getUser() == null) throw new PageRedirectException(Login); } return page; } } -- A protected page public class ProtectedPage extends BasePage { } Something along those lines ;) Cheers, -- Nikla Mark Stang wrote: Hi, This seems to work for us. public class ValidatePage extends BasePage implements PageValidateListener { public void pageValidate(PageEvent event) { Mediator mediator = MgmtFactory.getMediator(); if (!mediator.isConsole()) { IPage messagePage = getRequestCycle().getPage(nonAdminConsole); throw new PageRedirectException(messagePage); } else { // If there is no visit object or the user isn't auth'd ship // them off to the login page Visit visit = (Visit)getVisit(); if (visit == null || !visit.isUserAuthenticated()) { Login login = (Login)getRequestCycle().getPage(login); throw new PageRedirectException(login); } } } } I tried a couple of different experiments. The first was to log in and copy a link then close the browser. I wasn't able to get to the page via the direct link. If I logout and try and access the page via a direct link, I don't get access. If I log in and copy a link and then surf off to another page, then I can come back via the direct link. All of this is based on my use of a session and the visit object. So, reviewing you code, I would think you need to have to check more than if the visit exists. You need to store a flag saying they they have been authenticated. regards, Mark Mark J. Stang Senior Engineer/Architect office: +1 303.468.2900 mobile: +1 303.507.2833 Ping Identity -Original Message- From: James Sherwood [mailto:[EMAIL PROTECTED] Sent: Fri 2/23/2007 6:34 AM To: Tapestry users Subject: Page Validation Hello, We use Tapestry 3.2 I have security (login) using PageValidateListener. The secure page in the site is called ISOPage which extends BasePage. I add the page validation using: public ISOPage(){ super(); addPageValidateListener(new PageValidationListener()); } The PageValidationListener class implements PageValidateListener and does security like this: if(visit.getUser() == null){ throw new PageRedirectException(UserLogin); } This all works fine it seems unless a direct is involved. If I copy a directlink then try to access it without loggin in it shows me the page the directlink java code is on. The PageRedirectException does happen and if I refresh or try to go anywhere it sends me to the login but it still shows that page first. Any ideas? Thanks, James - 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] __ NOD32 2077 (20070223) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 Roadmap - support for Portlet development?
As I said on the blog, my/our hands are full with servlet Tapestry. It'll be much easier to implement the portlet support in T5 than in T4 because there's already an abstraction above the Servlet API, and because we're embracing the Portlet API's concept of differentiating action requests from render requests. On 2/26/07, Jan Vissers [EMAIL PROTECTED] wrote: Hi, Will T5 continue to support JSR-168? I couldn't find it on the roadmap. If JSR-168 still is supported, are there plans to support JSR-268? Thanks, -J. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship TWD Consulting, Inc. Independent J2EE / Open-Source Java Consultant Creator and PMC Chair, Apache Tapestry Creator, Apache HiveMind Professional Tapestry training, mentoring, support and project work. http://howardlewisship.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Page Validation
James, You said, I tried implementing it exactly as you suggested, which method there were two? It would help to post your code. regards, Mark Mark J. Stang Senior Engineer/Architect office: +1 303.468.2900 mobile: +1 303.507.2833 Ping Identity -Original Message- From: James Sherwood [mailto:[EMAIL PROTECTED] Sent: Mon 2/26/2007 12:21 PM To: Tapestry users Subject: Re: Page Validation Hello, I tried implementing it exactly as you suggested but I still get to see the first page. Once I refresh or try to go somewhere it sends me to the login page. The funny thing is, the PageRedirectException IS being thrown, its just not going to the login page. Any ideas? --James - Original Message - From: Nikla Ratinen [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Friday, February 23, 2007 1:02 PM Subject: Re: Page Validation Hi, As an alternate approach you may override the default page source with an implementation that checks security constraints just before giving out the page instance - this basically has the added benefit that secured page instances may not be obtained even through (accidental) malicious code in non-secure pages or services. -- Overridden engine public class MyEngine extends BaseEngine { protected IPageSource createPageSource(RequestContext context) { return new ProtectedPageSource(this); } } -- Overridden page source public class ProtectedPageSource extends PageSource { public ProtectedPageSource(IEngine engine) { super(engine); } public IPage getPage(IRequestCycle cycle, String pageName, IMonitor monitor) { IPage page = super.getPage(cycle, pageName, monitor); if (page != null page instanceof ProtectedPage) { Visit visit = (Visit) cycle.getEngine().getVisit(); if (visit == null || visit.getUser() == null) throw new PageRedirectException(Login); } return page; } } -- A protected page public class ProtectedPage extends BasePage { } Something along those lines ;) Cheers, -- Nikla Mark Stang wrote: Hi, This seems to work for us. public class ValidatePage extends BasePage implements PageValidateListener { public void pageValidate(PageEvent event) { Mediator mediator = MgmtFactory.getMediator(); if (!mediator.isConsole()) { IPage messagePage = getRequestCycle().getPage(nonAdminConsole); throw new PageRedirectException(messagePage); } else { // If there is no visit object or the user isn't auth'd ship // them off to the login page Visit visit = (Visit)getVisit(); if (visit == null || !visit.isUserAuthenticated()) { Login login = (Login)getRequestCycle().getPage(login); throw new PageRedirectException(login); } } } } I tried a couple of different experiments. The first was to log in and copy a link then close the browser. I wasn't able to get to the page via the direct link. If I logout and try and access the page via a direct link, I don't get access. If I log in and copy a link and then surf off to another page, then I can come back via the direct link. All of this is based on my use of a session and the visit object. So, reviewing you code, I would think you need to have to check more than if the visit exists. You need to store a flag saying they they have been authenticated. regards, Mark Mark J. Stang Senior Engineer/Architect office: +1 303.468.2900 mobile: +1 303.507.2833 Ping Identity -Original Message- From: James Sherwood [mailto:[EMAIL PROTECTED] Sent: Fri 2/23/2007 6:34 AM To: Tapestry users Subject: Page Validation Hello, We use Tapestry 3.2 I have security (login) using PageValidateListener. The secure page in the site is called ISOPage which extends BasePage. I add the page validation using: public ISOPage(){ super(); addPageValidateListener(new PageValidationListener()); } The PageValidationListener class implements PageValidateListener and does security like this: if(visit.getUser() == null){ throw new PageRedirectException(UserLogin); } This all works fine it seems unless a direct is involved. If I copy a directlink then try to access it without loggin in it shows me the page the directlink java code is on. The PageRedirectException does happen and if I refresh or try to go anywhere it sends me to the login but it still shows that page first. Any ideas? Thanks, James - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL
Re: Page Validation
is on. The PageRedirectException does happen and if I refresh or try to go anywhere it sends me to the login but it still shows that page first. Any ideas? Thanks, James - 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] __ NOD32 2077 (20070223) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ NOD32 2082 (20070226) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 + Jetty + Hibernate
On 2/26/07, James Carman [EMAIL PROTECTED] wrote: That's not exactly a good separation of concerns, though. Your view layer shouldn't be talking directly to your ORM layer. I'd put a DAO layer in between for some encapsulation (and to help with unit testing). Well as i said this is a starting point a complete solution, this show how fine is to develop with T5 IoC. You're welcome to elaborate and improve. -- Massimo http://meridio.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5:How to use Select component's model
Hi, I am converting my app to T5, in T4, I use IPropertySelectionModel to create the dropdown for select, what model can I use in T5. -- View this message in context: http://www.nabble.com/T5%3AHow-to-use-Select-component%27s-model-tf3298500.html#a9175667 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]