Why is using Tapestry a Filter instead of a Servlet
Hi, i was just curious about why Tapestry is using a Filter instead of a Servlet. Does anyone know? Regards garz - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Why is using Tapestry a Filter instead of a Servlet
A filter is passed a reference to the FilterChain which can ultimately pass through to the servlet container's own url resolution (ie a resource in the war). A servlet is an endpoint and must resolve the URL itself.
Re: Why is using Tapestry a Filter instead of a Servlet
yes i know that, but it does not answer my question. :) On 26.02.2014, at 11:09, Lance Java lance.j...@googlemail.com wrote: A filter is passed a reference to the FilterChain which can ultimately pass through to the servlet container's own url resolution (ie a resource in the war). A servlet is an endpoint and must resolve the URL itself. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Why is using Tapestry a Filter instead of a Servlet
Well... You can have the Tapestry filter mapped to /* and it can play nicely with other servlets. http://tapestry.apache.org/configuration#Configuration-ConfiguringIgnoredPaths
Re: Why is using Tapestry a Filter instead of a Servlet
thank you, thats it :) On 26.02.2014, at 11:22, Lance Java lance.j...@googlemail.com wrote: Well... You can have the Tapestry filter mapped to /* and it can play nicely with other servlets. http://tapestry.apache.org/configuration#Configuration-ConfiguringIgnoredPaths - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
beaneditor for complex object
Hi I'm trying to create edit form for my hibernate entities. For example: @Entity @Table(name = SOME_OBJECT) public class SomeObject implements Serializable { ... @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = SUB_OBJECT_ID, nullable = false) private SubObject subObject; ... } How could I create edit form for this entity, I tried this way: div class=t-beaneditor div t:beaneditor t:object=someOBject t:exclude=id / /div div t:beaneditor t:object=someOBject.subObject t:exclude=id / /div div class=t-beaneditor-row input t:type=submit value=Save / /div /div someOBject is marked as persisted, but the inner object bean edit form is not there Any ideas? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to pass a javascript function in tapestry mixin
On Tue, 25 Feb 2014 21:30:39 -0300, Boris Horvat horvat.z.bo...@gmail.com wrote: Sorry Thaigo, but I am not sure what you had in mind. If you think about That's something to avoid as much as possible. What are you talking about? Well first I am not sure why is this the case. If tapestry supports passing configurations in this way then it should support passing functions when those configurations are expecting them. However I would be open to avoid doing this but I dont see a way to do it, other then overwriting javascript files and putting my code directly there. I was able to identify the scenario that leads to this problem. The ajaxUpload component needs to be surrounded by the zone, if that is not the case then a function can be passed without any issues. Sadly in my code the zone is necessary. I will try to reach to the tapestry5-jquery developer to see if he thinks this is a bug and can it be fixed. Thanks for the help and please if you have any idea how to avoid passing the function (that doesn't involve overwriting existing files) I will be happy to try it out. Cheers On Tue, Feb 25, 2014 at 3:10 AM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Mon, 24 Feb 2014 19:53:59 -0300, Boris Horvat horvat.z.bo...@gmail.com wrote: Anyone has any idea about this? :) I already gave you my suggestion. -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to pass a javascript function in tapestry mixin
https://github.com/got5/tapestry5-jquery/issues/244#issuecomment-36102130 On Wed, Feb 26, 2014 at 3:50 PM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Tue, 25 Feb 2014 21:30:39 -0300, Boris Horvat horvat.z.bo...@gmail.com wrote: Sorry Thaigo, but I am not sure what you had in mind. If you think about That's something to avoid as much as possible. What are you talking about? Well first I am not sure why is this the case. If tapestry supports passing configurations in this way then it should support passing functions when those configurations are expecting them. However I would be open to avoid doing this but I dont see a way to do it, other then overwriting javascript files and putting my code directly there. I was able to identify the scenario that leads to this problem. The ajaxUpload component needs to be surrounded by the zone, if that is not the case then a function can be passed without any issues. Sadly in my code the zone is necessary. I will try to reach to the tapestry5-jquery developer to see if he thinks this is a bug and can it be fixed. Thanks for the help and please if you have any idea how to avoid passing the function (that doesn't involve overwriting existing files) I will be happy to try it out. Cheers On Tue, Feb 25, 2014 at 3:10 AM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Mon, 24 Feb 2014 19:53:59 -0300, Boris Horvat horvat.z.bo...@gmail.com wrote: Anyone has any idea about this? :) I already gave you my suggestion. -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Dmitry Gusev AnjLab Team http://anjlab.com
Re: How to pass a javascript function in tapestry mixin
On Tue, 25 Feb 2014 21:30:39 -0300, Boris Horvat horvat.z.bo...@gmail.com wrote: Sorry Thaigo, but I am not sure what you had in mind. If you think about That's something to avoid as much as possible. I wasn't clear. I meant to say you should avoid passing a whole function definition. Just passing a function value (in JavaScript, functions are objects as any other) is something trivial. Just declare the function in some .js file included by your component, mixin or page and pass its reference (its name) to the parameter. Well first I am not sure why is this the case. If tapestry supports passing configurations in this way then it should support passing functions when those configurations are expecting them. Tapestry already does. That's JSONLiteral. In your case, params.put(onSubmit, new JSONLiteral(showUploadProgress));. Notice there's no parenthesis, so you're passing the function itself, not the result of calling it. I was able to identify the scenario that leads to this problem. The ajaxUpload component needs to be surrounded by the zone, if that is not the case then a function can be passed without any issues. Sadly in my code the zone is necessary. So you're blaming Tapestry when the culprit isn't actually Tapestry, but a third-party component which expects a Zone event handler return and you may be trying to use it in a way it wasn't supposed. The error you posted earlier in this thread means something wrong went on the server side. -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Why is using Tapestry a Filter instead of a Servlet
On Wed, 26 Feb 2014 06:57:27 -0300, garz g...@gmx.net wrote: Hi, Hi! i was just curious about why Tapestry is using a Filter instead of a Servlet. Does anyone know? As Lance said, a servlet is and endpoint and it must send a response to a request. This causes servlets to be useless when you're trying to handle more than one URL pattern but not all. A servlet filter is way more flexible. You can have Tapestry code, specifically HttpServletRequestFilter, which has a chance to run some logic for every request, being it actually handled by Tapestry or not. One nice example would be to control access to images (or any other URL) located in the webapp context. You can do that in Tapestry even if the files are served by the servlet container itself. -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: beaneditor for complex object
You should either explicitly persist the inner object itself or add a cascading option to the relationship mapping. This isn't related to Tapestry at all, just to the way you're using Hibernate. On Wed, 26 Feb 2014 07:59:37 -0300, nn kk inv...@abv.bg wrote: Hi I'm trying to create edit form for my hibernate entities. For example: @Entity @Table(name = SOME_OBJECT) public class SomeObject implements Serializable { ... @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = SUB_OBJECT_ID, nullable = false) private SubObject subObject; ... } How could I create edit form for this entity, I tried this way: div class=t-beaneditor div t:beaneditor t:object=someOBject t:exclude=id / /div div t:beaneditor t:object=someOBject.subObject t:exclude=id / /div div class=t-beaneditor-row input t:type=submit value=Save / /div /div someOBject is marked as persisted, but the inner object bean edit form is not there Any ideas? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Reading messages for a different Locale than default locale
On Tue, 25 Feb 2014 21:46:17 -0300, java qns qns.j...@gmail.com wrote: Hi Hi! I am a beginner with tapestry and have a question about messages. Is it possible to read messages from a different locate other than the default locale that is set in tapestry web application. You need to set the Tapestry locale configuration (tapestry.supported-locales) to include all the languages you want. Or just not set it and it'll get all the ones supported by Tapestry. I need this because in the web application I am working on, no matter what the locale is, some messages in some contexts always need english values. What messages and what languages? Maybe not all the languages have all the messages, so it defaults to English. -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Autocomplete exception blank query parameter.
Hi guys, I'm using tapestry 5.4-beta 3 and I have a keyword search on my website using the auto complete mixin. I'm seeing the following exception appear in my logs 100's of times. I have been unable to reproduce it, so im assuming it is happening as a result of bot activity, but I can not confirm. Does anybody know the cause or how to repair it? org.apache.tapestry5.runtime.ComponentEventException: Unable process query parameter 't:input' as parameter #1 of event handler method org.apache.tapestry5.corelib.mixins.Autocomplete.onAutocomplete(java.lang.String): The value for query parameter 't:input' was blank, but a non-blank value is needed. [at classpath:com/cardaddy/auto/components/search/KeywordSearch.tml, line 3] at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.processEventTriggering(ComponentPageElementImpl.java:1151) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$3100(ComponentPageElementImpl.java:62) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl$5.invoke(ComponentPageElementImpl.java:1072) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl$5.invoke(ComponentPageElementImpl.java:1069) at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:80) at org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:89) at org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1112) at org.apache.tapestry5.internal.structure.ComponentPageElementResourcesImpl.invoke(ComponentPageElementResourcesImpl.java:145) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1068) at org.apache.tapestry5.internal.services.ComponentEventRequestHandlerImpl.handle(ComponentEventRequestHandlerImpl.java:75) at org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42) at $ComponentEventRequestHandler_7591aa242fc1.handle(Unknown Source) at org.apache.tapestry5.upload.internal.services.UploadExceptionFilter.handle(UploadExceptionFilter.java:75) at $ComponentEventRequestHandler_7591aa242fc1.handle(Unknown Source) at org.apache.tapestry5.modules.TapestryModule$37.handle(TapestryModule.java:2192) at $ComponentEventRequestHandler_7591aa242fc1.handle(Unknown Source) at $ComponentEventRequestHandler_7591aa242e4a.handle(Unknown Source) at org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handleComponentEvent(ComponentRequestHandlerTerminator.java:43) at org.apache.tapestry5.services.InitializeActivePageName.handleComponentEvent(InitializeActivePageName.java:39) at $ComponentRequestHandler_7591aa242e4c.handleComponentEvent(Unknown Source) at org.apache.tapestry5.internal.services.RequestOperationTracker$1.perform(RequestOperationTracker.java:55) at org.apache.tapestry5.internal.services.RequestOperationTracker$1.perform(RequestOperationTracker.java:52) at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.perform(OperationTrackerImpl.java:107) at org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.perform(PerThreadOperationTracker.java:100) at org.apache.tapestry5.ioc.internal.RegistryImpl.perform(RegistryImpl.java:1117) at org.apache.tapestry5.internal.services.RequestOperationTracker.handleComponentEvent(RequestOperationTracker.java:47) at $ComponentRequestHandler_7591aa242e4c.handleComponentEvent(Unknown Source) at org.tynamo.security.SecurityComponentRequestFilter.handleComponentEvent(SecurityComponentRequestFilter.java:41) at $ComponentRequestFilter_7591aa242e49.handleComponentEvent(Unknown Source) at $ComponentRequestHandler_7591aa242e4c.handleComponentEvent(Unknown Source) at org.lazan.t5.cometd.services.internal.PageGlobalsComponentRequestFilter.handleComponentEvent(PageGlobalsComponentRequestFilter.java:22) at $ComponentRequestHandler_7591aa242e4c.handleComponentEvent(Unknown Source) at $ComponentRequestHandler_7591aa242e00.handleComponentEvent(Unknown Source) at org.apache.tapestry5.internal.services.ComponentEventDispatcher.dispatch(ComponentEventDispatcher.java:46) at $Dispatcher_7591aa242e06.dispatch(Unknown Source) at $Dispatcher_7591aa242dfd.dispatch(Unknown Source) at org.apache.tapestry5.modules.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:300) at com.cardaddy.auto.services.AppModule$1.service(AppModule.java:202) at $RequestFilter_7591aa242dfc.service(Unknown Source) at $RequestHandler_7591aa242dfe.service(Unknown Source) at org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26) at $RequestHandler_7591aa242dfe.service(Unknown Source) at org.apache.tapestry5.modules.TapestryModule$3.service(TapestryModule.java:846) at $RequestHandler_7591aa242dfe.service(Unknown Source) at org.apache.tapestry5.modules.TapestryModule$2.service(TapestryModule.java:836) at $RequestHandler_7591aa242dfe.service(Unknown Source) at
Re: Autocomplete exception blank query parameter.
Sounds like a webcrawler / bot to me. Do you have the apache logs? You could check the user agent header. As a fix, Google for the list of known bots and their user agent headers and customised tapestry's exception reporting so that exceptions are not logged for crawler user agents.
Re: Autocomplete exception blank query parameter.
Thanks for the reply lance. What does the actual exception mean? Does is it mean a request is being set with a missing parameter to the autocomplete component? I vaguely remember seeing this a long time ago while writing a custom autocomplete component. As far as the logs, I'm hosting the app on Amazons Elastic Bean Stalk, so finding the logs has proven to be a little difficult. They have a way to return the logs to you through the EBS interface, however they seem pretty useless since they do not appear to include my exception logs. I tried logging into the EC2 instance and directly access the logs, however amazon moved them out of the tomcat logs directory and I have yet to find them. The exception your seeing is what's being email to me and my phone is blowing up lol. In my custom exception page, how do I go about determine it's user agent? I really want to get these things on the ignore list. This one also appears to be a popular one. Input string 'w00tw00t.at.blackhats.romanian.anti-sec:)' is not valid; the character Thanks On Wed, Feb 26, 2014 at 8:22 AM, Lance Java lance.j...@googlemail.comwrote: Sounds like a webcrawler / bot to me. Do you have the apache logs? You could check the user agent header. As a fix, Google for the list of known bots and their user agent headers and customised tapestry's exception reporting so that exceptions are not logged for crawler user agents. -- George Christman www.CarDaddy.com P.O. Box 735 Johnstown, New York
Re: Autocomplete exception blank query parameter.
Some serverside actions (eg autocomplete) expect a well formed request which may require some request parameters to be present. As you can imagine, a bot can run regular expressions and hit anything the looks like a URL. I think it's fine to ignore crawlers from error logging. It's difficult to do much else. You could override / decorate the RequestExceptionHandler and check the User-Agent request header before logging https://tapestry.apache.org/overriding-exception-reporting.html http://user-agent-string.info/list-of-ua/bots
Re: beaneditor for complex object
Beaneditor doesn't handle nested entities. Beaneditor (or the underlying BeanEditForm) renders an html form and nested forms are not allowed. One of the simplest things you could do is to render just those field you actually need to edit from the child object. Or, if you want a complete solution, take a look at Tynamo's tapestry-model ( http://tynamo.org/tapestry-model+guide). @Thiago - your answer is for a different question. Kalle On Wed, Feb 26, 2014 at 2:59 AM, nn kk inv...@abv.bg wrote: Hi I'm trying to create edit form for my hibernate entities. For example: @Entity @Table(name = SOME_OBJECT) public class SomeObject implements Serializable { ... @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = SUB_OBJECT_ID, nullable = false) private SubObject subObject; ... } How could I create edit form for this entity, I tried this way: div class=t-beaneditor div t:beaneditor t:object=someOBject t:exclude=id / /div div t:beaneditor t:object=someOBject.subObject t:exclude=id / /div div class=t-beaneditor-row input t:type=submit value=Save / /div /div someOBject is marked as persisted, but the inner object bean edit form is not there Any ideas? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: beaneditor for complex object
On Wed, 26 Feb 2014 14:09:53 -0300, Kalle Korhonen kalle.o.korho...@gmail.com wrote: Beaneditor doesn't handle nested entities. Beaneditor (or the underlying BeanEditForm) renders an html form and nested forms are not allowed. BeanEditor does *not* render a form element, so you can nest a BeanEditor inside another or inside a BeanEditForm. And BeanEditForm is the one who uses a BeanEditor, not the opposite. @Thiago - your answer is for a different question. I disagree. :) Actually, the original question is vague. What does marked as persistent mean? -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to pass a javascript function in tapestry mixin
On Wed, Feb 26, 2014 at 1:02 PM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Tue, 25 Feb 2014 21:30:39 -0300, Boris Horvat horvat.z.bo...@gmail.com wrote: Sorry Thaigo, but I am not sure what you had in mind. If you think about That's something to avoid as much as possible. I wasn't clear. I meant to say you should avoid passing a whole function definition. Just passing a function value (in JavaScript, functions are objects as any other) is something trivial. Just declare the function in some .js file included by your component, mixin or page and pass its reference (its name) to the parameter. Ok, now this (with comments and code samples from Dmitry makes much more sens to me Well first I am not sure why is this the case. If tapestry supports passing configurations in this way then it should support passing functions when those configurations are expecting them. Tapestry already does. That's JSONLiteral. In your case, params.put(onSubmit, new JSONLiteral(showUploadProgress));. Notice there's no parenthesis, so you're passing the function itself, not the result of calling it. For me the code wasn't working without parentheses but that was due to missing few this as Dmitry pointed out I was able to identify the scenario that leads to this problem. The ajaxUpload component needs to be surrounded by the zone, if that is not the case then a function can be passed without any issues. Sadly in my code the zone is necessary. So you're blaming Tapestry when the culprit isn't actually Tapestry, but a third-party component which expects a Zone event handler return and you may be trying to use it in a way it wasn't supposed. The error you posted earlier in this thread means something wrong went on the server side. I would say blaming is such a strong word to be used here. I really never meant to pass the blame to anyone (or anything for that matter) as I was merely searching for help to resolve my issue. Also I wouldn't say that it is nice to pass the *blame *to the third party component as I have experienced the same issue (long time ago) with autocomplete (solution then was a bit different then, but probably not that different for someone with better understanding). If anyone is to take the blame it is probably me and my lack of true understanding of how things are working in Tapestry. Anyway I appreciated the help you provided here. Dmitry thank you very much on the code sample of the initialization that I was missing for the ajax request. I have created a mixin that is now able to inject code properly so I dont have to do manual insertion every time :) Thanks everyone again, Cheers -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Sincerely *Boris Horvat*