Re: Annotations and ComponentRequestFilter Problem
Hi Taha, Hi Thiago, Thanks a lot for your reply, it's working perfectly! And besides, this surely gave me some more basic understanding on how tapestry works. Have a nice day, cheers, Sascha -- View this message in context: http://tapestry.1045711.n5.nabble.com/Annotations-and-ComponentRequestFilter-Problem-tp3232159p3235337.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Annotations and ComponentRequestFilter Problem
Hi Thiago, thanks for your reply. I will certainly give that a try, but i won't be in the office until monday. I'm not sure, if i stated my problem right (as i'm quite new to tapestry). I am not dynamically adding the annotation to the class, as far as i can see, so getting it from the component source should work, shouldn't it? There is a test project that desscribes the problem, it can be found at http://satansoft.de/tapestry/annotationtest.zip. In the TestFilter class you can see how i try to get the annotation from the page. Btw, i'm using Tapestry 5.2... Regards, Sascha -- View this message in context: http://tapestry.1045711.n5.nabble.com/Annotations-and-ComponentRequestFilter-Problem-tp3232159p3232277.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Annotations and ComponentRequestFilter Problem
Hi taha, you can find an example project here: http://satansoft.de/tapestry/annotationtest.zip It uses a very simple setup to show the problem. In TestFilter.java in the annotationTest() method you can see that the upper test case is not working, but the lower case is working well. Regards, Sascha -- View this message in context: http://tapestry.1045711.n5.nabble.com/Annotations-and-ComponentRequestFilter-Problem-tp3232159p3232236.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
Annotations and ComponentRequestFilter Problem
Hi, i'm having a problem using custom annotations and a ComponentRequestFilter. I am defining my own class annotation (TestAnnotation) and a test class (Index) that uses this annotation. In my ComponentRequestFilter however, when i am checking the page class (via componentSource.getPage().getClass(), it doesn't have the annotation. However, When i try to read the annotation on the class itself (using Index.class), it's working. Therefore i assume this has something to do with class transformation in tapestry, it seems like the class annotation isn't present in the transformed class anymore. I have of course read the article at http://tapestryjava.blogspot.com/2009/12/securing-tapestry-pages-with.html, and i can't see any difference: Component page = componentSource.getPage(pageName); if (! page.getClass().isAnnotationPresent(RequiresLogin.class)) { return false; } is exactly what I'm using (except for the different variable names...), it just doesn't work. When i try Index.class.isAnnotationPresent(TestAnnotation.class) it returns true, just as expected. If anyone got a good idea, i'd be very thankful. Regards, Sascha -- View this message in context: http://tapestry.1045711.n5.nabble.com/Annotations-and-ComponentRequestFilter-Problem-tp3232159p3232159.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