Re: SaltSource Error with tapestry-spring-security
The error says it all: You already have a service implementing SaltSource (it gets contributed automatically by the tapestry-spring-security module). If you want to override it, contribute to the AliasOverrides service: public static void contributeAliasOverrides(ConfigurationAliasContribution? configuration) { SaltSourceService saltSource = new SaltSourceService() { public Object getSalt(UserDetails user) { return null; } }; configuration.add(AliasContribution.create(SaltSourceService.class, saltSource)); } cheers, Uli bongosdude schrieb: I Just got this error and I could not figure it out yet. java.lang.RuntimeException: Service id 'SaltSource' has already been defined by nu.localhost.tapestry5.springsecurity.services.SecurityModule.buildSaltSource(String) (at SecurityModule.java:121) and may not be redefined by nu.localhost.tapestry.acegi.services.SecurityModule.buildSaltSource(String) (at SecurityModule.java:115). You should rename one of the service builder methods. at org.apache.tapestry5.ioc.internal.RegistryImpl.init(RegistryImpl.java:170) at org.apache.tapestry5.ioc.RegistryBuilder.build(RegistryBuilder.java:168) here is my code in AppModule.java public static void bind(ServiceBinder binder) { binder.bind(SaltSourceService.class, PlaintextSaltSourceImpl.class).withId(PlaintextSaltSource); } public static void contributeProviderManager(OrderedConfigurationAuthenticationProvider configuration, @InjectService(DaoAuthenticationProvider) AuthenticationProvider daoAuthenticationProvider) { configuration.add(daoAuthenticationProvider, daoAuthenticationProvider); } and my PlaintextSaltSourceImpl.java import org.springframework.security.userdetails.UserDetails; import nu.localhost.tapestry5.springsecurity.services.SaltSourceService; public class PlaintextSaltSourceImpl implements SaltSourceService { public Object getSalt(UserDetails user) { return null; } } - B Amigo:super: - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] 5.1 Startup problem with TapestrySpringFilter
I added that of course to them pom.xml along with other dependencies I need. The problem is, that my Spring context is read in correctly but then Tapestry bails out with the classnotfoundexception for the TaperstrySpringFilter. 2009/2/7 Howard Lewis Ship hls...@gmail.com The new archetype doesn't have a dependency on tapestry-spring (it never did). On Fri, Feb 6, 2009 at 2:19 PM, Otho taa...@googlemail.com wrote: After generating the new archetype I get a java.lang.ClassNotFoundException: org.apache.tapestry5.spring.TapestrySpringFilter The same error occurs also when using a ContextLoaderListener. Tapestry-Spring and the TapestrySpringFilter are definitely in the classpath. The spring beans are created normally. Any idea what that could be? web.xml contents: ?xml version=1.0 encoding=UTF-8? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameTest51 Tapestry 5 Application/display-name !-- Context Parameters -- context-param param-nametapestry.app-package/param-name param-valuede.test.test51/param-value /context-param context-param param-namecontextConfigLocation/param-name param-value /WEB-INF/classes/appContext-main.xml /param-value /context-param !-- Filters -- filter filter-nameapp/filter-name !-- Special filter that adds in a T5 IoC module derived from the Spring WebApplicationContext. -- filter-classorg.apache.tapestry5.spring.TapestrySpringFilter/filter-class /filter filter-mapping filter-nameapp/filter-name url-pattern/*/url-pattern /filter-mapping /web-app -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Hard to track NPE
This might help: Joost Schouten (mailing lists) schrieb: Hi, I'm getting a NPE in tapestries reflected Request after I contributed a new RequestFilter (LocaleFilter below; see snippet). My pages appear as expected which leads me to assume it has something to do with the Request being completed when my code tries to access it (the stack hints that to). But since debugging is hard and the NPE non-descriptive I can't figure out what exactly is going on. Does anyone know why I get this NPE and if so, can we make it more descriptive than just this descriptionless NPE? --- my code public static void contributeRequestHandler( final OrderedConfigurationRequestFilter configuration, @InjectService(Utf8Filter) final RequestFilter utf8Filter, @InjectService(TransactionFilter) final RequestFilter transactionFilter, @InjectService(SecurityFilter) final RequestFilter securityFilter, @InjectService(LocaleFilter) final RequestFilter localeFilter) { configuration.add(LocaleFilter, localeFilter); configuration.add(Utf8Filter, utf8Filter); configuration.add(TransactionFilter, transactionFilter); configuration.add(SecurityFilter, securityFilter); } public RequestFilter buildLocaleFilter( @InjectService(PersistentLocale) final PersistentLocale persistantLocale, @InjectService(ThreadLocale) final ThreadLocale threadLocale) { return new RequestFilter() { public boolean service(Request request, Response response, RequestHandler handler) throws IOException { persistantLocale.set(threadLocale.getLocale()); return handler.service(request, response); } }; } - the exception --- java.lang.NullPointerException at $Request_11f4b87384f.getSession($Request_11f4b87384f.java) at $Request_11f4b87381c.getSession($Request_11f4b87381c.java) at org.apache.tapestry5.internal.services.RestoreDirtySessionObjects.requestDidComplete(RestoreDirtySessionObjects.java:35) at org.apache.tapestry5.internal.services.EndOfRequestEventHubImpl.fire(EndOfRequestEventHubImpl.java:40) at $EndOfRequestEventHub_11f4b873820.fire($EndOfRequestEventHub_11f4b873820.java) at org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:762) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:748) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at com.joostschouten.common.http.tapestrybase.services.SecurityFilter.service(SecurityFilter.java:151) at $RequestFilter_11f4b87383a.service($RequestFilter_11f4b87383a.java) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at com.joostschouten.common.http.tapestrybase.services.TransactionFilter.service(TransactionFilter.java:48) at $RequestFilter_11f4b873839.service($RequestFilter_11f4b873839.java) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at com.joostschouten.common.http.tapestrybase.services.BaseModule$2.service(BaseModule.java:171) at $RequestFilter_11f4b873838.service($RequestFilter_11f4b873838.java) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at com.joostschouten.common.http.tapestrybase.services.BaseModule$3.service(BaseModule.java:188) at $RequestFilter_11f4b87383b.service($RequestFilter_11f4b87383b.java) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:81) at org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at $RequestHandler_11f4b873831.service($RequestHandler_11f4b873831.java) at org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:193) at org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53) at
Re: Hard to track NPE
Damn, hit the wrong key! This might help: https://issues.apache.org/jira/browse/TAP5-456 Cheers, Uli Joost Schouten (mailing lists) schrieb: Hi, I'm getting a NPE in tapestries reflected Request after I contributed a new RequestFilter (LocaleFilter below; see snippet). My pages appear as expected which leads me to assume it has something to do with the Request being completed when my code tries to access it (the stack hints that to). But since debugging is hard and the NPE non-descriptive I can't figure out what exactly is going on. Does anyone know why I get this NPE and if so, can we make it more descriptive than just this descriptionless NPE? --- my code public static void contributeRequestHandler( final OrderedConfigurationRequestFilter configuration, @InjectService(Utf8Filter) final RequestFilter utf8Filter, @InjectService(TransactionFilter) final RequestFilter transactionFilter, @InjectService(SecurityFilter) final RequestFilter securityFilter, @InjectService(LocaleFilter) final RequestFilter localeFilter) { configuration.add(LocaleFilter, localeFilter); configuration.add(Utf8Filter, utf8Filter); configuration.add(TransactionFilter, transactionFilter); configuration.add(SecurityFilter, securityFilter); } public RequestFilter buildLocaleFilter( @InjectService(PersistentLocale) final PersistentLocale persistantLocale, @InjectService(ThreadLocale) final ThreadLocale threadLocale) { return new RequestFilter() { public boolean service(Request request, Response response, RequestHandler handler) throws IOException { persistantLocale.set(threadLocale.getLocale()); return handler.service(request, response); } }; } - the exception --- java.lang.NullPointerException at $Request_11f4b87384f.getSession($Request_11f4b87384f.java) at $Request_11f4b87381c.getSession($Request_11f4b87381c.java) at org.apache.tapestry5.internal.services.RestoreDirtySessionObjects.requestDidComplete(RestoreDirtySessionObjects.java:35) at org.apache.tapestry5.internal.services.EndOfRequestEventHubImpl.fire(EndOfRequestEventHubImpl.java:40) at $EndOfRequestEventHub_11f4b873820.fire($EndOfRequestEventHub_11f4b873820.java) at org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:762) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:748) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at com.joostschouten.common.http.tapestrybase.services.SecurityFilter.service(SecurityFilter.java:151) at $RequestFilter_11f4b87383a.service($RequestFilter_11f4b87383a.java) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at com.joostschouten.common.http.tapestrybase.services.TransactionFilter.service(TransactionFilter.java:48) at $RequestFilter_11f4b873839.service($RequestFilter_11f4b873839.java) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at com.joostschouten.common.http.tapestrybase.services.BaseModule$2.service(BaseModule.java:171) at $RequestFilter_11f4b873838.service($RequestFilter_11f4b873838.java) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at com.joostschouten.common.http.tapestrybase.services.BaseModule$3.service(BaseModule.java:188) at $RequestFilter_11f4b87383b.service($RequestFilter_11f4b87383b.java) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:81) at org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at $RequestHandler_11f4b873831.service($RequestHandler_11f4b873831.java) at org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:193)
Re: [T5] 5.1 Startup problem with TapestrySpringFilter
Solved. One shouldn't try to code that late and when tired. When copypasting I used the tapestry-test definition in the pom and of course forgot to delete the scopetest/scope for tapestry-spring sorry for the hassle. 2009/2/7 Otho taa...@googlemail.com I added that of course to them pom.xml along with other dependencies I need. The problem is, that my Spring context is read in correctly but then Tapestry bails out with the classnotfoundexception for the TaperstrySpringFilter. 2009/2/7 Howard Lewis Ship hls...@gmail.com The new archetype doesn't have a dependency on tapestry-spring (it never did). On Fri, Feb 6, 2009 at 2:19 PM, Otho taa...@googlemail.com wrote: After generating the new archetype I get a java.lang.ClassNotFoundException: org.apache.tapestry5.spring.TapestrySpringFilter The same error occurs also when using a ContextLoaderListener. Tapestry-Spring and the TapestrySpringFilter are definitely in the classpath. The spring beans are created normally. Any idea what that could be? web.xml contents: ?xml version=1.0 encoding=UTF-8? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameTest51 Tapestry 5 Application/display-name !-- Context Parameters -- context-param param-nametapestry.app-package/param-name param-valuede.test.test51/param-value /context-param context-param param-namecontextConfigLocation/param-name param-value /WEB-INF/classes/appContext-main.xml /param-value /context-param !-- Filters -- filter filter-nameapp/filter-name !-- Special filter that adds in a T5 IoC module derived from the Spring WebApplicationContext. -- filter-classorg.apache.tapestry5.spring.TapestrySpringFilter/filter-class /filter filter-mapping filter-nameapp/filter-name url-pattern/*/url-pattern /filter-mapping /web-app -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: SaltSource Error with tapestry-spring-security
I find out the cause of this error. in my POM, I forgot to remove tapestry-acegi and the class loader incorrectly loads a wrong class Thanks Ulrich Stärk wrote: The error says it all: You already have a service implementing SaltSource (it gets contributed automatically by the tapestry-spring-security module). If you want to override it, contribute to the AliasOverrides service: public static void contributeAliasOverrides(ConfigurationAliasContribution? configuration) { SaltSourceService saltSource = new SaltSourceService() { public Object getSalt(UserDetails user) { return null; } }; configuration.add(AliasContribution.create(SaltSourceService.class, saltSource)); } cheers, Uli bongosdude schrieb: I Just got this error and I could not figure it out yet. java.lang.RuntimeException: Service id 'SaltSource' has already been defined by nu.localhost.tapestry5.springsecurity.services.SecurityModule.buildSaltSource(String) (at SecurityModule.java:121) and may not be redefined by nu.localhost.tapestry.acegi.services.SecurityModule.buildSaltSource(String) (at SecurityModule.java:115). You should rename one of the service builder methods. at org.apache.tapestry5.ioc.internal.RegistryImpl.init(RegistryImpl.java:170) at org.apache.tapestry5.ioc.RegistryBuilder.build(RegistryBuilder.java:168) here is my code in AppModule.java public static void bind(ServiceBinder binder) { binder.bind(SaltSourceService.class, PlaintextSaltSourceImpl.class).withId(PlaintextSaltSource); } public static void contributeProviderManager(OrderedConfigurationAuthenticationProvider configuration, @InjectService(DaoAuthenticationProvider) AuthenticationProvider daoAuthenticationProvider) { configuration.add(daoAuthenticationProvider, daoAuthenticationProvider); } and my PlaintextSaltSourceImpl.java import org.springframework.security.userdetails.UserDetails; import nu.localhost.tapestry5.springsecurity.services.SaltSourceService; public class PlaintextSaltSourceImpl implements SaltSourceService { public Object getSalt(UserDetails user) { return null; } } - B Amigo:super: - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - B Amigo:super: -- View this message in context: http://www.nabble.com/SaltSource-Error-with-tapestry-spring-security-tp21882494p21889296.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: T5: Nice balloon error for 2 text fields possible?
Hello, Is there a quick way to manually produce those balloons?:) IE by just calling a JavaScript function with the component's id and message for instance? Thanks, --James -Original Message- From: Howard Lewis Ship [mailto:hls...@gmail.com] Sent: February-06-09 3:05 PM To: Tapestry users Subject: Re: T5: Nice balloon error for 2 text fields possible? Not with the built in stuff. I went to a lot of trouble so that entering one field fades out the bubbles on any other fields. It's surprisingly tricky to get right! On Thu, Feb 5, 2009 at 5:38 AM, James Sherwood jsherw...@rgisolutions.com wrote: Hello, Is it possible to have the nice balloon error run across 2 password fields? IE password and confirm password must equal, if not the balloon error shows(like a required error) instead of having to output a form error? Thanks, --James -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - 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
Re: Hard to track NPE
Thanks Uli, I'll have a play with this tomorrow. Looks very promising. Have a good weekend, Joost On Sat, Feb 7, 2009 at 6:58 PM, Ulrich Stärk u...@spielviel.de wrote: Damn, hit the wrong key! This might help: https://issues.apache.org/jira/browse/TAP5-456 Cheers, Uli Joost Schouten (mailing lists) schrieb: Hi, I'm getting a NPE in tapestries reflected Request after I contributed a new RequestFilter (LocaleFilter below; see snippet). My pages appear as expected which leads me to assume it has something to do with the Request being completed when my code tries to access it (the stack hints that to). But since debugging is hard and the NPE non-descriptive I can't figure out what exactly is going on. Does anyone know why I get this NPE and if so, can we make it more descriptive than just this descriptionless NPE? --- my code public static void contributeRequestHandler( final OrderedConfigurationRequestFilter configuration, @InjectService(Utf8Filter) final RequestFilter utf8Filter, @InjectService(TransactionFilter) final RequestFilter transactionFilter, @InjectService(SecurityFilter) final RequestFilter securityFilter, @InjectService(LocaleFilter) final RequestFilter localeFilter) { configuration.add(LocaleFilter, localeFilter); configuration.add(Utf8Filter, utf8Filter); configuration.add(TransactionFilter, transactionFilter); configuration.add(SecurityFilter, securityFilter); } public RequestFilter buildLocaleFilter( @InjectService(PersistentLocale) final PersistentLocale persistantLocale, @InjectService(ThreadLocale) final ThreadLocale threadLocale) { return new RequestFilter() { public boolean service(Request request, Response response, RequestHandler handler) throws IOException { persistantLocale.set(threadLocale.getLocale()); return handler.service(request, response); } }; } - the exception --- java.lang.NullPointerException at $Request_11f4b87384f.getSession($Request_11f4b87384f.java) at $Request_11f4b87381c.getSession($Request_11f4b87381c.java) at org.apache.tapestry5.internal.services.RestoreDirtySessionObjects.requestDidComplete(RestoreDirtySessionObjects.java:35) at org.apache.tapestry5.internal.services.EndOfRequestEventHubImpl.fire(EndOfRequestEventHubImpl.java:40) at $EndOfRequestEventHub_11f4b873820.fire($EndOfRequestEventHub_11f4b873820.java) at org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:762) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:748) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at com.joostschouten.common.http.tapestrybase.services.SecurityFilter.service(SecurityFilter.java:151) at $RequestFilter_11f4b87383a.service($RequestFilter_11f4b87383a.java) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at com.joostschouten.common.http.tapestrybase.services.TransactionFilter.service(TransactionFilter.java:48) at $RequestFilter_11f4b873839.service($RequestFilter_11f4b873839.java) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at com.joostschouten.common.http.tapestrybase.services.BaseModule$2.service(BaseModule.java:171) at $RequestFilter_11f4b873838.service($RequestFilter_11f4b873838.java) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at com.joostschouten.common.http.tapestrybase.services.BaseModule$3.service(BaseModule.java:188) at $RequestFilter_11f4b87383b.service($RequestFilter_11f4b87383b.java) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:81) at org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at
Re: Localization in Services
Possibly, that's a tack I take in a lot of the Tapestry code; passing the component (actually the ComponentResources) around to gain access to the component's identity and resources. I had a lot of trouble with the naming here because from some perspectives, the ComponentResources IS the component, and your code is just the icing on the top (something I initially called the peer). Of course, the CR is itself largely a facade around the very internal ComponentPageElementImpl which is where most of the actual component logic live ... and so it goes! On Fri, Feb 6, 2009 at 1:54 PM, Blower, Andy andrew.blo...@proquest.co.uk wrote: Not sure how generally useful that would be, but it would solve the problem in an easy way. Thinking some more about this, would it not be easier to simply pass the messages from the page/component event handler method into the service method that's called to send the email? -Original Message- From: Howard Lewis Ship [mailto:hls...@gmail.com] Sent: 06 February 2009 21:26 To: Tapestry users Subject: Re: Localization in Services Which Messages resource would it inject? I suppose we could add the application's Messages object as an injectable value. On Fri, Feb 6, 2009 at 1:04 PM, Blower, Andy andrew.blo...@proquest.co.uk wrote: I thought that it might be possible to use constructor injection to inject the Messages resource just like you can with Logger. I take it that this is not possible to provide in T5 because of lifecycle/reloading issues then Howard? -Original Message- From: Howard Lewis Ship [mailto:hls...@gmail.com] Sent: 06 February 2009 17:03 To: Tapestry users Subject: Re: Localization in Services I would go a different route. Using the ComponentSource service, you can get any page in the application as a Component instance. From that you can get the ComponentResources and from that, the Messages object. Just be aware of the lifecycle: once you boost a Messages instance out of the component layer and into the services tier, you are moving it out of Tapestry's ability to reload ... in other words, acquire the Messages and use it briefly, but don't retain it for longer than a single request. On Fri, Feb 6, 2009 at 7:24 AM, Nicolas Charles nchar...@linagora.com wrote: Thanks for the tip Roberto, but I didn't succeed into adding the app.properties (or just i can't get the key, i don't know) And it feels strange to use the ValidationMessage for a standart message Nick Tapestry Infodea wrote: I've forgetten a piece of code, you must contribute the ValidationMessagesSource in your AppModule: public void contributeValidationMessagesSource(OrderedConfigurationString configuration) { configuration.add(myprop, it/infodea/app/internal/myprop); } and define myprop.properties in it/infodea/app/internal/ Tapestry Infodea ha scritto: You can use the ValidationMessagesSource and ThreadLocale services: ValidationMessagesSource validationMessagesSource; ThreadLocale threadLocale; Messages messages = validationMessagesSource.getValidationMessages(threadLocale.getLocale() ); Roberto. Nicolas Charles ha scritto: Hello there, I'm currently struggling with a proper way to use localization in a service. My need is fairly simple : i'm using t5-restful- webservices from Bill Holloway (by the way great job Bill) to offer REST services. One of my service sends an email. The email is localized. Using the Asset for the body of the mail works great for its localization. However the mail's subject is stored in the app.properties... I cannot use the @Inject Messages to retrieve the oh-so- convenient Messages service ( Service id 'Messages' is not defined by any module. ) Thus my question is : - How can i access to the app.properties from a given service ? The best of the best would be to have a possibility to use Messages, but i'm open to any other solution Regards, Nick --- --- --- 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 -- --- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail:
Re: Hard to track NPE
Also have a look at the other issue I linked mine to. That concerns the RequestHandler directly. In the end I think your problem comes down to the Session not being available at the time you are trying to access it. HTH, Uli Joost Schouten (mailing lists) schrieb: Thanks Uli, I'll have a play with this tomorrow. Looks very promising. Have a good weekend, Joost On Sat, Feb 7, 2009 at 6:58 PM, Ulrich Stärk u...@spielviel.de wrote: Damn, hit the wrong key! This might help: https://issues.apache.org/jira/browse/TAP5-456 Cheers, Uli Joost Schouten (mailing lists) schrieb: Hi, I'm getting a NPE in tapestries reflected Request after I contributed a new RequestFilter (LocaleFilter below; see snippet). My pages appear as expected which leads me to assume it has something to do with the Request being completed when my code tries to access it (the stack hints that to). But since debugging is hard and the NPE non-descriptive I can't figure out what exactly is going on. Does anyone know why I get this NPE and if so, can we make it more descriptive than just this descriptionless NPE? --- my code public static void contributeRequestHandler( final OrderedConfigurationRequestFilter configuration, @InjectService(Utf8Filter) final RequestFilter utf8Filter, @InjectService(TransactionFilter) final RequestFilter transactionFilter, @InjectService(SecurityFilter) final RequestFilter securityFilter, @InjectService(LocaleFilter) final RequestFilter localeFilter) { configuration.add(LocaleFilter, localeFilter); configuration.add(Utf8Filter, utf8Filter); configuration.add(TransactionFilter, transactionFilter); configuration.add(SecurityFilter, securityFilter); } public RequestFilter buildLocaleFilter( @InjectService(PersistentLocale) final PersistentLocale persistantLocale, @InjectService(ThreadLocale) final ThreadLocale threadLocale) { return new RequestFilter() { public boolean service(Request request, Response response, RequestHandler handler) throws IOException { persistantLocale.set(threadLocale.getLocale()); return handler.service(request, response); } }; } - the exception --- java.lang.NullPointerException at $Request_11f4b87384f.getSession($Request_11f4b87384f.java) at $Request_11f4b87381c.getSession($Request_11f4b87381c.java) at org.apache.tapestry5.internal.services.RestoreDirtySessionObjects.requestDidComplete(RestoreDirtySessionObjects.java:35) at org.apache.tapestry5.internal.services.EndOfRequestEventHubImpl.fire(EndOfRequestEventHubImpl.java:40) at $EndOfRequestEventHub_11f4b873820.fire($EndOfRequestEventHub_11f4b873820.java) at org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:762) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:748) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at com.joostschouten.common.http.tapestrybase.services.SecurityFilter.service(SecurityFilter.java:151) at $RequestFilter_11f4b87383a.service($RequestFilter_11f4b87383a.java) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at com.joostschouten.common.http.tapestrybase.services.TransactionFilter.service(TransactionFilter.java:48) at $RequestFilter_11f4b873839.service($RequestFilter_11f4b873839.java) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at com.joostschouten.common.http.tapestrybase.services.BaseModule$2.service(BaseModule.java:171) at $RequestFilter_11f4b873838.service($RequestFilter_11f4b873838.java) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at com.joostschouten.common.http.tapestrybase.services.BaseModule$3.service(BaseModule.java:188) at $RequestFilter_11f4b87383b.service($RequestFilter_11f4b87383b.java) at $RequestHandler_11f4b87383f.service($RequestHandler_11f4b87383f.java) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:81) at org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85) at
span jwcid=@Insert value=ognl:something raw=true/ in T5?
How do you do: span jwcid=@Insert value=ognl:something raw=true/ in T5? Thanks! Toby - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: span jwcid=@Insert value=ognl:something raw=true/ in T5?
See the OutputRaw component Uli superoverdr...@gmx.de schrieb: How do you do: span jwcid=@Insert value=ognl:something raw=true/ in T5? Thanks! Toby - 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
How to style a button
Hi fellas, this isnt a T5 question but hoping someone can help out. I am looking to style buttons input type = submit value = save/ - how would i got about styling that one? if i change the above code to: button class=button positive type = submitsave/button and have the following css it works fine a.button, button {} button {} etc if i want to style my buttons do I have to convert all my input type = submit value = save/ to button class=button positive type = submitsave/button ? It doesnt work for the following code tho input t:type = submit t:id = addMe value = add me / How would i apply css to this button? Any help would be appreciated guys. Regards, ..kace -- View this message in context: http://www.nabble.com/How-to-style-a-button-tp21893032p21893032.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
Wishlist and survey for Tapestry 5 components
Hello, I just created a list of 36 UI components. Please take a survey so we (the community) can all get an impression of what is most needed and what not. http://bbwebcraft.blogspot.com. Of course, the debate is welcome! Cheers, Borut