Re: "The user must supply a JDBC connection" thrown by GridSource
Solved in the meantime, by removing tapestry-hibernate*.jar from the deployed libraries. http://www.archivum.info/users@tapestry.apache.org/2008-06/msg00408.html On Sun, Dec 21, 2008 at 5:27 PM, Jean Luc wrote: > Tapestry 5.0.18/Spring 2.5 > > Start.tml has > Start.java has > > public List getAllItems() { > return itemService.getAllItems(); > } > > where itemService is an injected Spring service. Item is a > Hibernate-persisted entity, but fetched eagerly (so all attributes, like > Owner, are already loaded - I verified with a debugger). > > I'm confused why T5 is asking for a JDBC connection, there's nothing more > to load and I expected the beans to be rendered. > > Am I missing something? Do I really have to convert the entities into value > objects so they are not persisted? Or is there more to set up? > > Thanks very much, > JL > > > 17:20:13,815 ERROR [RequestExceptionHandler] Processing of request failed > with uncaught exception: Render queue error in > BeginRender[Start:grid.pager]: Exception constructing service > 'ValueEncoderSource': Error invoking service builder method > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map) > (at TapestryModule.java:1745) (for service 'ValueEncoderSource'): Error > invoking service contribution method > org.apache.tapestry5.hibernate.HibernateModule.contributeValueEncoderSource(MappedConfiguration, > boolean, HibernateSessionSource, Session, TypeCoercer, PropertyAccess, > LoggerSource): Exception constructing service 'HibernateSessionSource': > Error invoking service builder method > org.apache.tapestry5.hibernate.HibernateModule.buildHibernateSessionSource(Logger, > List, RegistryShutdownHub) (at HibernateModule.java:120) (for service > 'HibernateSessionSource'): The user must supply a JDBC connection > org.apache.tapestry5.internal.services.RenderQueueException: Render queue > error in BeginRender[Start:grid.pager]: Exception constructing service > 'ValueEncoderSource': Error invoking service builder method > org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map) > (at TapestryModule.java:1745) (for service 'ValueEncoderSource'): Error > invoking service contribution method > org.apache.tapestry5.hibernate.HibernateModule.contributeValueEncoderSource(MappedConfiguration, > boolean, HibernateSessionSource, Session, TypeCoercer, PropertyAccess, > LoggerSource): Exception constructing service 'HibernateSessionSource': > Error invoking service builder method > org.apache.tapestry5.hibernate.HibernateModule.buildHibernateSessionSource(Logger, > List, RegistryShutdownHub) (at HibernateModule.java:120) (for service > 'HibernateSessionSource'): The user must supply a JDBC connection [at > classpath:org/apache/tapestry5/corelib/components/Grid.tml, line 15, column > 28] > at > org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:84) > at > org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121) > at > $PageRenderQueue_11e5b9a8e42.render($PageRenderQueue_11e5b9a8e42.java) > at > $PageRenderQueue_11e5b9a8e3a.render($PageRenderQueue_11e5b9a8e3a.java) > at > org.apache.tapestry5.services.TapestryModule$19.renderMarkup(TapestryModule.java:1200) > at > org.apache.tapestry5.services.TapestryModule$29.renderMarkup(TapestryModule.java:1580) > at > $MarkupRenderer_11e5b9a8e44.renderMarkup($MarkupRenderer_11e5b9a8e44.java) > at > org.apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryModule.java:1561) > at > $MarkupRenderer_11e5b9a8e44.renderMarkup($MarkupRenderer_11e5b9a8e44.java) > at > org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1543) > at > $MarkupRenderer_11e5b9a8e44.renderMarkup($MarkupRenderer_11e5b9a8e44.java) > at > org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1525) > at > $MarkupRenderer_11e5b9a8e44.renderMarkup($MarkupRenderer_11e5b9a8e44.java) > at > org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.java:1495) > at > $MarkupRenderer_11e5b9a8e44.renderMarkup($MarkupRenderer_11e5b9a8e44.java) > at > $MarkupRenderer_11e5b9a8e40.renderMarkup($MarkupRenderer_11e5b9a8e40.java) > at > org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64) > at > $PageMarkupRenderer_11e5b9a8e3e.renderPageMarkup($PageMarkupRenderer_11e5b9a8e3e.java) > at > org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(Pa
"The user must supply a JDBC connection" thrown by GridSource
Tapestry 5.0.18/Spring 2.5 Start.tml has Start.java has public List getAllItems() { return itemService.getAllItems(); } where itemService is an injected Spring service. Item is a Hibernate-persisted entity, but fetched eagerly (so all attributes, like Owner, are already loaded - I verified with a debugger). I'm confused why T5 is asking for a JDBC connection, there's nothing more to load and I expected the beans to be rendered. Am I missing something? Do I really have to convert the entities into value objects so they are not persisted? Or is there more to set up? Thanks very much, JL 17:20:13,815 ERROR [RequestExceptionHandler] Processing of request failed with uncaught exception: Render queue error in BeginRender[Start:grid.pager]: Exception constructing service 'ValueEncoderSource': Error invoking service builder method org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map) (at TapestryModule.java:1745) (for service 'ValueEncoderSource'): Error invoking service contribution method org.apache.tapestry5.hibernate.HibernateModule.contributeValueEncoderSource(MappedConfiguration, boolean, HibernateSessionSource, Session, TypeCoercer, PropertyAccess, LoggerSource): Exception constructing service 'HibernateSessionSource': Error invoking service builder method org.apache.tapestry5.hibernate.HibernateModule.buildHibernateSessionSource(Logger, List, RegistryShutdownHub) (at HibernateModule.java:120) (for service 'HibernateSessionSource'): The user must supply a JDBC connection org.apache.tapestry5.internal.services.RenderQueueException: Render queue error in BeginRender[Start:grid.pager]: Exception constructing service 'ValueEncoderSource': Error invoking service builder method org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map) (at TapestryModule.java:1745) (for service 'ValueEncoderSource'): Error invoking service contribution method org.apache.tapestry5.hibernate.HibernateModule.contributeValueEncoderSource(MappedConfiguration, boolean, HibernateSessionSource, Session, TypeCoercer, PropertyAccess, LoggerSource): Exception constructing service 'HibernateSessionSource': Error invoking service builder method org.apache.tapestry5.hibernate.HibernateModule.buildHibernateSessionSource(Logger, List, RegistryShutdownHub) (at HibernateModule.java:120) (for service 'HibernateSessionSource'): The user must supply a JDBC connection [at classpath:org/apache/tapestry5/corelib/components/Grid.tml, line 15, column 28] at org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:84) at org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121) at $PageRenderQueue_11e5b9a8e42.render($PageRenderQueue_11e5b9a8e42.java) at $PageRenderQueue_11e5b9a8e3a.render($PageRenderQueue_11e5b9a8e3a.java) at org.apache.tapestry5.services.TapestryModule$19.renderMarkup(TapestryModule.java:1200) at org.apache.tapestry5.services.TapestryModule$29.renderMarkup(TapestryModule.java:1580) at $MarkupRenderer_11e5b9a8e44.renderMarkup($MarkupRenderer_11e5b9a8e44.java) at org.apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryModule.java:1561) at $MarkupRenderer_11e5b9a8e44.renderMarkup($MarkupRenderer_11e5b9a8e44.java) at org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1543) at $MarkupRenderer_11e5b9a8e44.renderMarkup($MarkupRenderer_11e5b9a8e44.java) at org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1525) at $MarkupRenderer_11e5b9a8e44.renderMarkup($MarkupRenderer_11e5b9a8e44.java) at org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.java:1495) at $MarkupRenderer_11e5b9a8e44.renderMarkup($MarkupRenderer_11e5b9a8e44.java) at $MarkupRenderer_11e5b9a8e40.renderMarkup($MarkupRenderer_11e5b9a8e40.java) at org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64) at $PageMarkupRenderer_11e5b9a8e3e.renderPageMarkup($PageMarkupRenderer_11e5b9a8e3e.java) at org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:57) at $PageResponseRenderer_11e5b9a8dc7.renderPageResponse($PageResponseRenderer_11e5b9a8dc7.java) at org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:59) at org.apache.tapestry5.services.TapestryModule$35.handle(TapestryModule.java:1779) at $PageRenderRequestHandler_11e5b9a8dc8.handle($PageRenderRequestHandler_11e5b9a8dc8.java) at $PageRenderRequestHandler_11e5b9a8dbb.handle($PageRenderRequestHandler_11e5b9a8dbb.java) at org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:92) at org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:71) at $Dispatcher_11e5b9a8dc1.dispa
Re: AppModule not loaded?? (No ClassLoaders found for: org.apache.tapestry5.services.FormSupport)
Aaaarg... solved. I missed the second part of "Tapestry looks for a module builder class in the services package (under the root package). It capitalizes the and appends "Module" and I recently renamed the default app to something else. I still had to do the workaround with javassist.runtime.Desc.useContextClassLoader = true; On Thu, Dec 18, 2008 at 10:04 PM, Jean Luc wrote: > Tapestry 5.0.18/JBoss 4.2.3GA/Spring 2.5/Hibernate 3.2.4sp1 (coming with > JBoss)JDK1.6.0_10/S > > The following exception is thrown when hitting the Login page > (interestingly, the Start page is fine) - there is additional information > following it. The (emerging) application used to work before adding the > Hibernate integration. > > > No ClassLoaders found for: org.apache.tapestry5.services.FormSupport [at > classpath:org/apache/tapestry5/corelib/components/ExceptionDisplay.tml, line > 3, column 45] > at > org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:84) > at > org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121) > at > $PageRenderQueue_11e4d1d2736.render($PageRenderQueue_11e4d1d2736.java) > at > $PageRenderQueue_11e4d1d2734.render($PageRenderQueue_11e4d1d2734.java) > at > org.apache.tapestry5.services.TapestryModule$19.renderMarkup(TapestryModule.java:1200) > at > org.apache.tapestry5.services.TapestryModule$29.renderMarkup(TapestryModule.java:1580) > at > $MarkupRenderer_11e4d1d273a.renderMarkup($MarkupRenderer_11e4d1d273a.java) > at > org.apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryModule.java:1561) > at > $MarkupRenderer_11e4d1d273a.renderMarkup($MarkupRenderer_11e4d1d273a.java) > at > org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1543) > at > $MarkupRenderer_11e4d1d273a.renderMarkup($MarkupRenderer_11e4d1d273a.java) > at > org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1525) > at > $MarkupRenderer_11e4d1d273a.renderMarkup($MarkupRenderer_11e4d1d273a.java) > at > org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.java:1495) > at > $MarkupRenderer_11e4d1d273a.renderMarkup($MarkupRenderer_11e4d1d273a.java) > at > $MarkupRenderer_11e4d1d2733.renderMarkup($MarkupRenderer_11e4d1d2733.java) > at > org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64) > at > $PageMarkupRenderer_11e4d1d2731.renderPageMarkup($PageMarkupRenderer_11e4d1d2731.java) > at > org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:57) > at > $PageResponseRenderer_11e4d1d2701.renderPageResponse($PageResponseRenderer_11e4d1d2701.java) > at > org.apache.tapestry5.internal.services.DefaultRequestExceptionHandler.handleRequestException(DefaultRequestExceptionHandler.java:77) > at > $RequestExceptionHandler_11e4d1d26ef.handleRequestException($RequestExceptionHandler_11e4d1d26ef.java) > at > org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:42) > at > $RequestHandler_11e4d1d26f1.service($RequestHandler_11e4d1d26f1.java) > at > org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:621) > at > $RequestHandler_11e4d1d26f1.service($RequestHandler_11e4d1d26f1.java) > at > org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:611) > at > $RequestHandler_11e4d1d26f1.service($RequestHandler_11e4d1d26f1.java) > at > org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85) > at > $RequestHandler_11e4d1d26f1.service($RequestHandler_11e4d1d26f1.java) > at > org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:93) > at > org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:84) > at > org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:83) > at > org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106) > at > $RequestHandler_11e4d1d26f1.service($RequestHandler_11e4d1d26f1.java) > at > $RequestHandler_11e4d1d26e8.service($RequestHandler_11e4d1d26e8.java) > at > org.apache.tapestry5.services.TapestryModule$16.service(TapestryModule.java:1007) > at > org.apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:44) > at > $HttpServletRequestHandler_11e4d1d26e9.service($HttpServletRequestHand
AppModule not loaded?? (No ClassLoaders found for: org.apache.tapestry5.services.FormSupport)
Tapestry 5.0.18/JBoss 4.2.3GA/Spring 2.5/Hibernate 3.2.4sp1 (coming with JBoss)JDK1.6.0_10/S The following exception is thrown when hitting the Login page (interestingly, the Start page is fine) - there is additional information following it. The (emerging) application used to work before adding the Hibernate integration. No ClassLoaders found for: org.apache.tapestry5.services.FormSupport [at classpath:org/apache/tapestry5/corelib/components/ExceptionDisplay.tml, line 3, column 45] at org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:84) at org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121) at $PageRenderQueue_11e4d1d2736.render($PageRenderQueue_11e4d1d2736.java) at $PageRenderQueue_11e4d1d2734.render($PageRenderQueue_11e4d1d2734.java) at org.apache.tapestry5.services.TapestryModule$19.renderMarkup(TapestryModule.java:1200) at org.apache.tapestry5.services.TapestryModule$29.renderMarkup(TapestryModule.java:1580) at $MarkupRenderer_11e4d1d273a.renderMarkup($MarkupRenderer_11e4d1d273a.java) at org.apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryModule.java:1561) at $MarkupRenderer_11e4d1d273a.renderMarkup($MarkupRenderer_11e4d1d273a.java) at org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1543) at $MarkupRenderer_11e4d1d273a.renderMarkup($MarkupRenderer_11e4d1d273a.java) at org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1525) at $MarkupRenderer_11e4d1d273a.renderMarkup($MarkupRenderer_11e4d1d273a.java) at org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.java:1495) at $MarkupRenderer_11e4d1d273a.renderMarkup($MarkupRenderer_11e4d1d273a.java) at $MarkupRenderer_11e4d1d2733.renderMarkup($MarkupRenderer_11e4d1d2733.java) at org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64) at $PageMarkupRenderer_11e4d1d2731.renderPageMarkup($PageMarkupRenderer_11e4d1d2731.java) at org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:57) at $PageResponseRenderer_11e4d1d2701.renderPageResponse($PageResponseRenderer_11e4d1d2701.java) at org.apache.tapestry5.internal.services.DefaultRequestExceptionHandler.handleRequestException(DefaultRequestExceptionHandler.java:77) at $RequestExceptionHandler_11e4d1d26ef.handleRequestException($RequestExceptionHandler_11e4d1d26ef.java) at org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:42) at $RequestHandler_11e4d1d26f1.service($RequestHandler_11e4d1d26f1.java) at org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:621) at $RequestHandler_11e4d1d26f1.service($RequestHandler_11e4d1d26f1.java) at org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:611) at $RequestHandler_11e4d1d26f1.service($RequestHandler_11e4d1d26f1.java) at org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85) at $RequestHandler_11e4d1d26f1.service($RequestHandler_11e4d1d26f1.java) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:93) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:84) at org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:83) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106) at $RequestHandler_11e4d1d26f1.service($RequestHandler_11e4d1d26f1.java) at $RequestHandler_11e4d1d26e8.service($RequestHandler_11e4d1d26e8.java) at org.apache.tapestry5.services.TapestryModule$16.service(TapestryModule.java:1007) at org.apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:44) at $HttpServletRequestHandler_11e4d1d26e9.service($HttpServletRequestHandler_11e4d1d26e9.java) at org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62) at $HttpServletRequestFilter_11e4d1d26e6.service($HttpServletRequestFilter_11e4d1d26e6.java) at $HttpServletRequestHandler_11e4d1d26e9.service($HttpServletRequestHandler_11e4d1d26e9.java) at $HttpServletRequestHandler_11e4d1d26e5.service($HttpServletRequestHandler_11e4d1d26e5.java) at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:179) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
specifying a non-Tapestry form submission URL ?
Hello, Is it possible to specify an explicit URL as the action for a form submission? What and why I need it: - I need a login form to post directly to j_spring_security_check (because I still see problems integrating T5 and Spring Security 2.0.4, see below) - I cannot use a forward from the page's onSubmit() because SS somehow messes up URL resolution in a forward. If I hit /myApp/j_spring_security_check from a browser, the URL is valid. When I forward to "/j_spring_security_check" (also tried "j_spring_security_check") from onSubmit(), it's not resolved. That's not a T5 issue most likely. So what I'd like to do is to define Login.tml to have the submission target to "/j_spring_security_check", thus sending the POST directly to its final destination. I read http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Form.htmland http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Submit.html but didn't see how. Also, I cannot use the approach suggested in http://wiki.apache.org/tapestry/Tapestry5HowToUseForms for multiple forms, since again it relies on a server-side forward from Tapestry to SS. I've also tried to use but the action attribute in the template was ignored and the real form still has action="login.loginform" Any suggestions are highly appreciated. Thanks, JL
Re: integrating T5 a login form with Spring Security?
Update: I can get the response with: @Inject private RequestGlobals requestGlobals; and using requestGlobals.getHTTPServletResponse(); I'll need to change the redirect into a forward (to save a trip and to prevent the username/pwd appear in the URL) but that's standard servlet stuff. Thanks. On Sun, Dec 14, 2008 at 8:05 PM, Jean Luc wrote: > Thanks Hugo, > > I've [tried to] inject the request and the response as mentioned (for > the request) at: > http://wiki.apache.org/tapestry/Tapestry5ObtainingHttpServletRequest > >@Inject >private HttpServletRequest request; > >@Inject >private HttpServletResponse response; > > It works for the request, but not for the response (exception below). > I've googled for ways to inject the response (I thought it would be > similar) but no luck. > > exception >org.apache.tapestry5.internal.services.TransformationException: > Error obtaining injected value for field > com.foo.tapestry.pages.Login.response: No service implements the > interface javax.servlet.http.HttpServletResponse. > > # org.apache.tapestry5.internal.services.TransformationException > Error obtaining injected value for field > com.foo.tapestry.pages.Login.response: No service implements the > interface javax.servlet.http.HttpServletResponse. > > > In case it matters, I'm using T 5.0.18 and JBoss 4.2.2GA > Thanks in advance, > JL > > On Sun, Dec 14, 2008 at 7:44 PM, Hugo Palma wrote: >> In your page class inject the check url like this: >> >> @Inject >> @Value("${spring-security.check.url}") >> private String checkUrl; >> >> then on your onSuccessMethod: >> >> response.sendRedirect(request.getContextPath() + checkUrl + "?j_username=" + >> username + "&j_password=" + password); >> >> where username and password are the bound variables for your username and >> password text fields on the form. >> >> Jean Luc wrote: >>> >>> Hello, >>> >>> I've been trying to integrate T5 and Spring Security (2.0.4, not the older >>> Acegi) but haven't succeeded in making the two work together. >>> >>> The standard way to specify a form login with Spring 2.5 is like below. >>> See >>> the element which specified the login page (Login) and what >>> URL >>> Spring will intercept (the standard j_security_check). >>> >>> http://www.springframework.org/schema/security"; >>> >>>>>default-target-url="/Start" >>>authentication-failure-url="/Login?login_error=1" >>>login-processing-url="j_security_check" /> >>> >>> >>> I have a typical Login.tml (labels and cosmetic stuff removed for brevity) >>> >>> >>>>> t:value="j_username"/> >>>>> t:value="j_password"/> >>> >>> >>> >>> >>> What happens is that the POST that occurs when submitting the form goes to >>> the Login.onSubmit() instead of j_security_check. While it is possible to >>> add code there to call Spring's AuthenticationManager, I would end up >>> duplicating what Spring Security does (the logic to redirect to different >>> pages if the login succeeded or not and so on). I'd like to use Spring >>> since >>> it already implements this. >>> >>> Is it possible to submit the login info to j_security_check instead? Or to >>> forward the request from within Login.onSubmit() to /j_security_check? >>> >>> I went through the "Tapestry 5" book by Alexander Kolesnikov, but didn't >>> find this info. Also, I am aware of the tapestry5-acegi extension ( >>> http://www.localhost.nu/java/tapestry5-acegi/) but this one seems under >>> development and for such a simple thing I didn't want to add a dependency >>> on >>> another jar. >>> >>> As you can tell, I'm new to T5. I've had some exposure to T4 and an older >>> version of Spring (2.0) but there things were quite different, both in >>> Tapestry itself and in how Acegi is configured in Spring. >>> >>> Advice is appreciated, >>> JL >>> >>> >> >> - >> 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: integrating T5 a login form with Spring Security?
Thanks Hugo, I've [tried to] inject the request and the response as mentioned (for the request) at: http://wiki.apache.org/tapestry/Tapestry5ObtainingHttpServletRequest @Inject private HttpServletRequest request; @Inject private HttpServletResponse response; It works for the request, but not for the response (exception below). I've googled for ways to inject the response (I thought it would be similar) but no luck. exception org.apache.tapestry5.internal.services.TransformationException: Error obtaining injected value for field com.foo.tapestry.pages.Login.response: No service implements the interface javax.servlet.http.HttpServletResponse. # org.apache.tapestry5.internal.services.TransformationException Error obtaining injected value for field com.foo.tapestry.pages.Login.response: No service implements the interface javax.servlet.http.HttpServletResponse. In case it matters, I'm using T 5.0.18 and JBoss 4.2.2GA Thanks in advance, JL On Sun, Dec 14, 2008 at 7:44 PM, Hugo Palma wrote: > In your page class inject the check url like this: > > @Inject > @Value("${spring-security.check.url}") > private String checkUrl; > > then on your onSuccessMethod: > > response.sendRedirect(request.getContextPath() + checkUrl + "?j_username=" + > username + "&j_password=" + password); > > where username and password are the bound variables for your username and > password text fields on the form. > > Jean Luc wrote: >> >> Hello, >> >> I've been trying to integrate T5 and Spring Security (2.0.4, not the older >> Acegi) but haven't succeeded in making the two work together. >> >> The standard way to specify a form login with Spring 2.5 is like below. >> See >> the element which specified the login page (Login) and what >> URL >> Spring will intercept (the standard j_security_check). >> >> http://www.springframework.org/schema/security"; >> >>>default-target-url="/Start" >>authentication-failure-url="/Login?login_error=1" >>login-processing-url="j_security_check" /> >> >> >> I have a typical Login.tml (labels and cosmetic stuff removed for brevity) >> >> >>> t:value="j_username"/> >>> t:value="j_password"/> >> >> >> >> >> What happens is that the POST that occurs when submitting the form goes to >> the Login.onSubmit() instead of j_security_check. While it is possible to >> add code there to call Spring's AuthenticationManager, I would end up >> duplicating what Spring Security does (the logic to redirect to different >> pages if the login succeeded or not and so on). I'd like to use Spring >> since >> it already implements this. >> >> Is it possible to submit the login info to j_security_check instead? Or to >> forward the request from within Login.onSubmit() to /j_security_check? >> >> I went through the "Tapestry 5" book by Alexander Kolesnikov, but didn't >> find this info. Also, I am aware of the tapestry5-acegi extension ( >> http://www.localhost.nu/java/tapestry5-acegi/) but this one seems under >> development and for such a simple thing I didn't want to add a dependency >> on >> another jar. >> >> As you can tell, I'm new to T5. I've had some exposure to T4 and an older >> version of Spring (2.0) but there things were quite different, both in >> Tapestry itself and in how Acegi is configured in Spring. >> >> Advice is appreciated, >> JL >> >> > > - > 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
integrating T5 a login form with Spring Security?
Hello, I've been trying to integrate T5 and Spring Security (2.0.4, not the older Acegi) but haven't succeeded in making the two work together. The standard way to specify a form login with Spring 2.5 is like below. See the element which specified the login page (Login) and what URL Spring will intercept (the standard j_security_check). http://www.springframework.org/schema/security"; I have a typical Login.tml (labels and cosmetic stuff removed for brevity) What happens is that the POST that occurs when submitting the form goes to the Login.onSubmit() instead of j_security_check. While it is possible to add code there to call Spring's AuthenticationManager, I would end up duplicating what Spring Security does (the logic to redirect to different pages if the login succeeded or not and so on). I'd like to use Spring since it already implements this. Is it possible to submit the login info to j_security_check instead? Or to forward the request from within Login.onSubmit() to /j_security_check? I went through the "Tapestry 5" book by Alexander Kolesnikov, but didn't find this info. Also, I am aware of the tapestry5-acegi extension ( http://www.localhost.nu/java/tapestry5-acegi/) but this one seems under development and for such a simple thing I didn't want to add a dependency on another jar. As you can tell, I'm new to T5. I've had some exposure to T4 and an older version of Spring (2.0) but there things were quite different, both in Tapestry itself and in how Acegi is configured in Spring. Advice is appreciated, JL