Re: Re: T5, tapestry-spring-security, slf4j MDC
Hello, I simplified the code so it does not use RequestGlobals which was giving me NULL for this.requestGlobals.getHTTPServletRequest() AppModule.java = ... binder.bind(HttpServletRequestFilter.class, RequestLoggingFilter.class).withId(RequestLoggingFilter); ... public static void contributeHttpServletRequestHandler( OrderedConfigurationHttpServletRequestFilter configuration, @InjectService(RequestLoggingFilter) HttpServletRequestFilter myfilter) { configuration.add(myfilter, myfilter, before:*); } RequestLoggingFilter.java = public class RequestLoggingFilter implements HttpServletRequestFilter { @Override public boolean service(HttpServletRequest request, HttpServletResponse response, HttpServletRequestHandler handler) throws IOException { MDC.put(remoteIP, request.getRemoteAddr()); HttpSession se = request.getSession(false); if (se != null) { String id = se.getId(); if (id == null) { id = ; } MDC.put(sessionID, id); } try { return handler.service(request, response); } finally { MDC.remove(remoteIP); MDC.remove(sessionID); } } } Thanks for hints. 2009/10/9 Olle Hallin olle.hal...@hit.se Do like this: MDC.put(xxx, ...); MDC.put(yyy, ...); try { return handler.service(request, response); } finally { MDC.remove(xxx) MDC.remove(yyy) } or else you will have problems when your request throws an exception Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se 2009/10/9 dirk.latterm...@bgs-ag.de Hi! Borut Bolčina borut.bolc...@gmail.com schrieb am 09.10.2009 14:55:32: this is what I did: public class RequestLoggingFilter implements HttpServletRequestFilter { public final RequestGlobals requestGlobals; public RequestLoggingFilter(final RequestGlobals requestGlobalss) { this.requestGlobals = requestGlobalss; } @Override public boolean service(HttpServletRequest request, HttpServletResponse response, HttpServletRequestHandler handler) throws IOException { MDC.put(remoteIP, this.requestGlobals.getHTTPServletRequest().getRemoteAddr()); String s = this.requestGlobals.getHTTPServletRequest().getRequestedSessionId(); if (s == null) { s = ; } MDC.put(sessionID, s); return handler.service(request, response); } } but I feel I am missing something. Where do I put the code: MDC.remove(remoteIP); MDC.remove(sessionID); In a similar situation, I used something like @Override public boolean service(HttpServletRequest request, HttpServletResponse response, HttpServletRequestHandler handler) throws IOException { MDC.put(remoteIP, this.requestGlobals.getHTTPServletRequest().getRemoteAddr()); String s = this.requestGlobals.getHTTPServletRequest().getRequestedSessionId(); if (s == null) { s = ; } MDC.put(sessionID, s); boolean result = handler.service(request, response); MDC.remove(remoteIP); MDC.remove(sessionID); return result; } } but I'm not sure if it does the right thing in all situations. Dirk BGS Beratungsgesellschaft Software Systemplanung AG Niederlassung Köln/Bonn Grantham-Allee 2-8 53757 Sankt Augustin Fon: +49 (0) 2241 / 166-500 Fax: +49 (0) 2241 / 166-680 www.bgs-ag.de Geschäftssitz Mainz Registergericht Amtsgericht Mainz HRB 62 50 Aufsichtsratsvorsitzender Klaus Hellwig Vorstand Hermann Kiefer Nils Manegold Thomas Reitz
Re: T5, tapestry-spring-security, slf4j MDC
We do something similar. We have implemented a RequestFilter that pushes the HttpSession ID (if any) onto the Log4j Nested Diagnostics Context (NDC) before the request, and pops it afterwards. I guess that the same approach could be used for pushing usernames in the SLF4J MDC, provided that you can get hold of them from a RequestFilter. Good to know: Tapestry 5.1 stores @SessionStateObjects in the session under the key sso: + MySessionStateObject.class.getName(). (aso: in 5.0.*) HTH, Olle Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se 2009/10/9 Borut Bolčina borut.bolc...@gmail.com Hello, has anybody implemented logging with MDC %X{username}? I would like to track users in my logs by their username and/or IP address. Before I dive in, I just wanna ask if someone has already done it? Thanks, Borut
Re: T5, tapestry-spring-security, slf4j MDC
Olle thanks, this is what I did: public class RequestLoggingFilter implements HttpServletRequestFilter { public final RequestGlobals requestGlobals; public RequestLoggingFilter(final RequestGlobals requestGlobalss) { this.requestGlobals = requestGlobalss; } @Override public boolean service(HttpServletRequest request, HttpServletResponse response, HttpServletRequestHandler handler) throws IOException { MDC.put(remoteIP, this.requestGlobals.getHTTPServletRequest().getRemoteAddr()); String s = this.requestGlobals.getHTTPServletRequest().getRequestedSessionId(); if (s == null) { s = ; } MDC.put(sessionID, s); return handler.service(request, response); } } and in my AppModule.java public RequestLoggingFilter buildRequestLoggingFilter(final RequestGlobals requestGlobals) { return new RequestLoggingFilter(requestGlobals); } public static void contributeHttpServletRequestHandler( OrderedConfigurationHttpServletRequestFilter configuration, @InjectService(RequestLoggingFilter) HttpServletRequestFilter myfilter) { configuration.add(myfilter, myfilter, before:*); } but I feel I am missing something. Where do I put the code: MDC.remove(remoteIP); MDC.remove(sessionID); Thanks, Borut 2009/10/9 Olle Hallin olle.hal...@hit.se We do something similar. We have implemented a RequestFilter that pushes the HttpSession ID (if any) onto the Log4j Nested Diagnostics Context (NDC) before the request, and pops it afterwards. I guess that the same approach could be used for pushing usernames in the SLF4J MDC, provided that you can get hold of them from a RequestFilter. Good to know: Tapestry 5.1 stores @SessionStateObjects in the session under the key sso: + MySessionStateObject.class.getName(). (aso: in 5.0.*) HTH, Olle Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se 2009/10/9 Borut Bolčina borut.bolc...@gmail.com Hello, has anybody implemented logging with MDC %X{username}? I would like to track users in my logs by their username and/or IP address. Before I dive in, I just wanna ask if someone has already done it? Thanks, Borut
Antwort: Re: T5, tapestry-spring-security, slf4j MDC
Hi! Borut Bolčina borut.bolc...@gmail.com schrieb am 09.10.2009 14:55:32: this is what I did: public class RequestLoggingFilter implements HttpServletRequestFilter { public final RequestGlobals requestGlobals; public RequestLoggingFilter(final RequestGlobals requestGlobalss) { this.requestGlobals = requestGlobalss; } @Override public boolean service(HttpServletRequest request, HttpServletResponse response, HttpServletRequestHandler handler) throws IOException { MDC.put(remoteIP, this.requestGlobals.getHTTPServletRequest().getRemoteAddr()); String s = this.requestGlobals.getHTTPServletRequest().getRequestedSessionId(); if (s == null) { s = ; } MDC.put(sessionID, s); return handler.service(request, response); } } but I feel I am missing something. Where do I put the code: MDC.remove(remoteIP); MDC.remove(sessionID); In a similar situation, I used something like @Override public boolean service(HttpServletRequest request, HttpServletResponse response, HttpServletRequestHandler handler) throws IOException { MDC.put(remoteIP, this.requestGlobals.getHTTPServletRequest().getRemoteAddr()); String s = this.requestGlobals.getHTTPServletRequest().getRequestedSessionId(); if (s == null) { s = ; } MDC.put(sessionID, s); boolean result = handler.service(request, response); MDC.remove(remoteIP); MDC.remove(sessionID); return result; } } but I'm not sure if it does the right thing in all situations. Dirk BGS Beratungsgesellschaft Software Systemplanung AG Niederlassung Köln/Bonn Grantham-Allee 2-8 53757 Sankt Augustin Fon: +49 (0) 2241 / 166-500 Fax: +49 (0) 2241 / 166-680 www.bgs-ag.de Geschäftssitz Mainz Registergericht Amtsgericht Mainz HRB 62 50 Aufsichtsratsvorsitzender Klaus Hellwig Vorstand Hermann Kiefer Nils Manegold Thomas Reitz
Re: Re: T5, tapestry-spring-security, slf4j MDC
Do like this: MDC.put(xxx, ...); MDC.put(yyy, ...); try { return handler.service(request, response); } finally { MDC.remove(xxx) MDC.remove(yyy) } or else you will have problems when your request throws an exception Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se 2009/10/9 dirk.latterm...@bgs-ag.de Hi! Borut Bolčina borut.bolc...@gmail.com schrieb am 09.10.2009 14:55:32: this is what I did: public class RequestLoggingFilter implements HttpServletRequestFilter { public final RequestGlobals requestGlobals; public RequestLoggingFilter(final RequestGlobals requestGlobalss) { this.requestGlobals = requestGlobalss; } @Override public boolean service(HttpServletRequest request, HttpServletResponse response, HttpServletRequestHandler handler) throws IOException { MDC.put(remoteIP, this.requestGlobals.getHTTPServletRequest().getRemoteAddr()); String s = this.requestGlobals.getHTTPServletRequest().getRequestedSessionId(); if (s == null) { s = ; } MDC.put(sessionID, s); return handler.service(request, response); } } but I feel I am missing something. Where do I put the code: MDC.remove(remoteIP); MDC.remove(sessionID); In a similar situation, I used something like @Override public boolean service(HttpServletRequest request, HttpServletResponse response, HttpServletRequestHandler handler) throws IOException { MDC.put(remoteIP, this.requestGlobals.getHTTPServletRequest().getRemoteAddr()); String s = this.requestGlobals.getHTTPServletRequest().getRequestedSessionId(); if (s == null) { s = ; } MDC.put(sessionID, s); boolean result = handler.service(request, response); MDC.remove(remoteIP); MDC.remove(sessionID); return result; } } but I'm not sure if it does the right thing in all situations. Dirk BGS Beratungsgesellschaft Software Systemplanung AG Niederlassung Köln/Bonn Grantham-Allee 2-8 53757 Sankt Augustin Fon: +49 (0) 2241 / 166-500 Fax: +49 (0) 2241 / 166-680 www.bgs-ag.de Geschäftssitz Mainz Registergericht Amtsgericht Mainz HRB 62 50 Aufsichtsratsvorsitzender Klaus Hellwig Vorstand Hermann Kiefer Nils Manegold Thomas Reitz
Re: T5 tapestry spring
I had a similar problem. Maybe this thread helps you: http://www.nabble.com/T-5.1-How-to-inject-Spring-beans-by-name--td22934788.html 2009/6/17 haipeng du haipen...@gmail.com I try to inject spring beans to page class with @Inject @Id(baseDAO) private BaseDAO baseDAO It still gave me that Spring context contains 14 beans assignable to type xx.BaseDAO what should I do for this. -- Haipeng Du Salt Lake City
Re: T5 tapestry spring
I found one way to fix this problem. But I am not sure if that is good one. (1) create one class to implement ObjectProvider public class TapestrySpringBeanProvider implements ObjectProvider { @Override public T T provide(ClassT clazz, AnnotationProvider ap, ObjectLocator locator) { // you can use any annotation you like Id id = ap.getAnnotation(Id.class); if ( id == null ) return null; String beanName = id.value(); ApplicationContext context = locator.getService(ApplicationContext.class); return (T) context.getBean(beanName); } } (2) from your module class, add following method: public static void contributeMasterObjectProvider(OrderedConfigurationObjectProvider config){ config.override(SpringBean,new TapestrySpringBeanProvider()); } (3) inject your spring bean like @Inject @Id(beanId) private BaseDAO baseDAO It works for me now. On Wed, Jun 17, 2009 at 1:40 AM, Otho taa...@googlemail.com wrote: I had a similar problem. Maybe this thread helps you: http://www.nabble.com/T-5.1-How-to-inject-Spring-beans-by-name--td22934788.html 2009/6/17 haipeng du haipen...@gmail.com I try to inject spring beans to page class with @Inject @Id(baseDAO) private BaseDAO baseDAO It still gave me that Spring context contains 14 beans assignable to type xx.BaseDAO what should I do for this. -- Haipeng Du Salt Lake City -- Haipeng Du Salt Lake City
Re: [T5] : tapestry + spring
I personally think T5 + spring + ibatis is very good. I'm using this combination on our company's projects now! 2007/12/24, Mohammad Shamsi [EMAIL PROTECTED]: Hi All, i want to start new Java EE projecct, Formerly we used Spring + Struts in our projects. after about 4 month testing and reading about Tapestry 5, i decide to use Tapestry 5 instead of Struts. i read some limitations of tapestry-spring module in its home page and i have no problem with them. is it any other limitation in using T5 + Spring ? does anyone have experience in T5 + Spring ? -- sincerely yours M. H. Shamsi
Re: [T5] : tapestry + spring
Hi Yuan, what version of Spring ? my you give me some info about your projects scale ? and do you have any problem with integrating spring and tapestry ? On Dec 26, 2007 12:50 PM, yuan gogo [EMAIL PROTECTED] wrote: I personally think T5 + spring + ibatis is very good. I'm using this combination on our company's projects now! 2007/12/24, Mohammad Shamsi [EMAIL PROTECTED]: Hi All, i want to start new Java EE projecct, Formerly we used Spring + Struts in our projects. after about 4 month testing and reading about Tapestry 5, i decide to use Tapestry 5 instead of Struts. i read some limitations of tapestry-spring module in its home page and i have no problem with them. is it any other limitation in using T5 + Spring ? does anyone have experience in T5 + Spring ? -- sincerely yours M. H. Shamsi -- sincerely yours M. H. Shamsi
Re: [T5] : tapestry + spring
T5 + Spring is in my opinion a very good choose. I let Spring integrate ORM (Hibernate, JDBC, TopLink, etc). sincerely, Arve Klev 2007/12/24, Mohammad Shamsi [EMAIL PROTECTED]: Hi All, i want to start new Java EE projecct, Formerly we used Spring + Struts in our projects. after about 4 month testing and reading about Tapestry 5, i decide to use Tapestry 5 instead of Struts. i read some limitations of tapestry-spring module in its home page and i have no problem with them. is it any other limitation in using T5 + Spring ? does anyone have experience in T5 + Spring ? -- sincerely yours M. H. Shamsi
Re: [T5] : tapestry + spring
Dear Friends, With this abilities that all we know about Frameworks like Spring, is there any need to Tapestry Focus on providing Hibernate Integration Tools or Tapestry IOC ? i read Howards Documents about need for new Ioc for Tapestry, but i still think that using Spring Ioc and Spring XML files is much easier than coding it with Java Code On Dec 26, 2007 1:35 PM, Arve Klev [EMAIL PROTECTED] wrote: T5 + Spring is in my opinion a very good choose. I let Spring integrate ORM (Hibernate, JDBC, TopLink, etc). sincerely, Arve Klev 2007/12/24, Mohammad Shamsi [EMAIL PROTECTED]: Hi All, i want to start new Java EE projecct, Formerly we used Spring + Struts in our projects. after about 4 month testing and reading about Tapestry 5, i decide to use Tapestry 5 instead of Struts. i read some limitations of tapestry-spring module in its home page and i have no problem with them. is it any other limitation in using T5 + Spring ? does anyone have experience in T5 + Spring ? -- sincerely yours M. H. Shamsi -- sincerely yours M. H. Shamsi
Re: [T5] : tapestry + spring
I couldn't disagree with you more. For people like you who are familiar with spring, you may think the ioc part of T5 is a waste of time. That makes sense if you use and are happy with spring. For people like me it's a completely different story. I have been working with java for years - on the desktop. I've been doing web work for almost as long and have specifically avoided java because its approach has always seemed far too heavy, restrictive, and ungraceful for web development. I briefly looked at a framework here and there over the years because I enjoyed java as a language, but each time I resorted to another technology because each one I looked at made me laugh. Granted I was a bit naive at the time, but still I had to wonder if those framework developers actually developed web sites/applications with their frameworks, or instead thought it would be funny to see how many poor suckers would fall into the tangle of complications they created. Recently a project I stepped into reached a point of critical mass, and using java made sense even if complicated. I resolved to find a framework that, while maybe more complicated than I prefer, would prevent me from succumbing to my urges to hang myself in the shower. This is getting long so I'll cut it short. Getting started with T5 was easy, as I am familiar with maven and eclipse. The docs are still a little lacking, but I'm not afraid of source code or contributing code and/or articles. As I'm not familiar with spring I don't share your perspective. I loath the (ab/mis)use of xml that has been happening for years, especially in 'enterprise' environments, so I never got into spring. I am not bashing it as I can't rightfully judge something I haven't used, but I can say that starting w/ T5 was cake, and I see no hole that needs filling by something like spring. Again this is my perspective - use what works best for you. chris Mohammad Shamsi wrote: Dear Friends, With this abilities that all we know about Frameworks like Spring, is there any need to Tapestry Focus on providing Hibernate Integration Tools or Tapestry IOC ? i read Howards Documents about need for new Ioc for Tapestry, but i still think that using Spring Ioc and Spring XML files is much easier than coding it with Java Code On Dec 26, 2007 1:35 PM, Arve Klev [EMAIL PROTECTED] wrote: T5 + Spring is in my opinion a very good choose. I let Spring integrate ORM (Hibernate, JDBC, TopLink, etc). sincerely, Arve Klev 2007/12/24, Mohammad Shamsi [EMAIL PROTECTED]: Hi All, i want to start new Java EE projecct, Formerly we used Spring + Struts in our projects. after about 4 month testing and reading about Tapestry 5, i decide to use Tapestry 5 instead of Struts. i read some limitations of tapestry-spring module in its home page and i have no problem with them. is it any other limitation in using T5 + Spring ? does anyone have experience in T5 + Spring ? -- sincerely yours M. H. Shamsi
Re: [T5] : tapestry + spring
I Agree with you on this but i have my own problems too. I have about 6 years experience on working with Java Web Frameworks. such as Struts, JSF , WebWorks... I found that Tapestry (especially T5) is Much Better than others, but its development process is so slow and unpredictable. I think that is because of focusing varies things instead of just a little but efficient web framework. if you take a look at Spring, you will find that it is very simple and efficient in service layer. it has very nice and simple integration with Hibernate, JPA and other ORMs. just in presentation layer, there is no good tools or framework here. I think tapestry could be a great Framework here. if it focus on this layer and increase its development speed. lack of documents, tutorials and IDE support is Tapestry problems too. On Dec 26, 2007 3:12 PM, Chris Lewis [EMAIL PROTECTED] wrote: I couldn't disagree with you more. For people like you who are familiar with spring, you may think the ioc part of T5 is a waste of time. That makes sense if you use and are happy with spring. For people like me it's a completely different story. I have been working with java for years - on the desktop. I've been doing web work for almost as long and have specifically avoided java because its approach has always seemed far too heavy, restrictive, and ungraceful for web development. I briefly looked at a framework here and there over the years because I enjoyed java as a language, but each time I resorted to another technology because each one I looked at made me laugh. Granted I was a bit naive at the time, but still I had to wonder if those framework developers actually developed web sites/applications with their frameworks, or instead thought it would be funny to see how many poor suckers would fall into the tangle of complications they created. Recently a project I stepped into reached a point of critical mass, and using java made sense even if complicated. I resolved to find a framework that, while maybe more complicated than I prefer, would prevent me from succumbing to my urges to hang myself in the shower. This is getting long so I'll cut it short. Getting started with T5 was easy, as I am familiar with maven and eclipse. The docs are still a little lacking, but I'm not afraid of source code or contributing code and/or articles. As I'm not familiar with spring I don't share your perspective. I loath the (ab/mis)use of xml that has been happening for years, especially in 'enterprise' environments, so I never got into spring. I am not bashing it as I can't rightfully judge something I haven't used, but I can say that starting w/ T5 was cake, and I see no hole that needs filling by something like spring. Again this is my perspective - use what works best for you. chris Mohammad Shamsi wrote: Dear Friends, With this abilities that all we know about Frameworks like Spring, is there any need to Tapestry Focus on providing Hibernate Integration Tools or Tapestry IOC ? i read Howards Documents about need for new Ioc for Tapestry, but i still think that using Spring Ioc and Spring XML files is much easier than coding it with Java Code On Dec 26, 2007 1:35 PM, Arve Klev [EMAIL PROTECTED] wrote: T5 + Spring is in my opinion a very good choose. I let Spring integrate ORM (Hibernate, JDBC, TopLink, etc). sincerely, Arve Klev 2007/12/24, Mohammad Shamsi [EMAIL PROTECTED]: Hi All, i want to start new Java EE projecct, Formerly we used Spring + Struts in our projects. after about 4 month testing and reading about Tapestry 5, i decide to use Tapestry 5 instead of Struts. i read some limitations of tapestry-spring module in its home page and i have no problem with them. is it any other limitation in using T5 + Spring ? does anyone have experience in T5 + Spring ? -- sincerely yours M. H. Shamsi -- sincerely yours M. H. Shamsi
Re: [T5] : tapestry + spring
Personally I attribute many of the T5 issues you mentioned to that fact that it is largely a one man show. For the most part I agree with the issues you are raising, I simply draw different conclusions. It comes down to deciding which issue is heavier, and this of course is in the hands of developers faced with real work. I do hope some determinism finds its way into T5... Mohammad Shamsi wrote: I Agree with you on this but i have my own problems too. I have about 6 years experience on working with Java Web Frameworks. such as Struts, JSF , WebWorks... I found that Tapestry (especially T5) is Much Better than others, but its development process is so slow and unpredictable. I think that is because of focusing varies things instead of just a little but efficient web framework. if you take a look at Spring, you will find that it is very simple and efficient in service layer. it has very nice and simple integration with Hibernate, JPA and other ORMs. just in presentation layer, there is no good tools or framework here. I think tapestry could be a great Framework here. if it focus on this layer and increase its development speed. lack of documents, tutorials and IDE support is Tapestry problems too. On Dec 26, 2007 3:12 PM, Chris Lewis [EMAIL PROTECTED] wrote: I couldn't disagree with you more. For people like you who are familiar with spring, you may think the ioc part of T5 is a waste of time. That makes sense if you use and are happy with spring. For people like me it's a completely different story. I have been working with java for years - on the desktop. I've been doing web work for almost as long and have specifically avoided java because its approach has always seemed far too heavy, restrictive, and ungraceful for web development. I briefly looked at a framework here and there over the years because I enjoyed java as a language, but each time I resorted to another technology because each one I looked at made me laugh. Granted I was a bit naive at the time, but still I had to wonder if those framework developers actually developed web sites/applications with their frameworks, or instead thought it would be funny to see how many poor suckers would fall into the tangle of complications they created. Recently a project I stepped into reached a point of critical mass, and using java made sense even if complicated. I resolved to find a framework that, while maybe more complicated than I prefer, would prevent me from succumbing to my urges to hang myself in the shower. This is getting long so I'll cut it short. Getting started with T5 was easy, as I am familiar with maven and eclipse. The docs are still a little lacking, but I'm not afraid of source code or contributing code and/or articles. As I'm not familiar with spring I don't share your perspective. I loath the (ab/mis)use of xml that has been happening for years, especially in 'enterprise' environments, so I never got into spring. I am not bashing it as I can't rightfully judge something I haven't used, but I can say that starting w/ T5 was cake, and I see no hole that needs filling by something like spring. Again this is my perspective - use what works best for you. chris Mohammad Shamsi wrote: Dear Friends, With this abilities that all we know about Frameworks like Spring, is there any need to Tapestry Focus on providing Hibernate Integration Tools or Tapestry IOC ? i read Howards Documents about need for new Ioc for Tapestry, but i still think that using Spring Ioc and Spring XML files is much easier than coding it with Java Code On Dec 26, 2007 1:35 PM, Arve Klev [EMAIL PROTECTED] wrote: T5 + Spring is in my opinion a very good choose. I let Spring integrate ORM (Hibernate, JDBC, TopLink, etc). sincerely, Arve Klev 2007/12/24, Mohammad Shamsi [EMAIL PROTECTED]: Hi All, i want to start new Java EE projecct, Formerly we used Spring + Struts in our projects. after about 4 month testing and reading about Tapestry 5, i decide to use Tapestry 5 instead of Struts. i read some limitations of tapestry-spring module in its home page and i have no problem with them. is it any other limitation in using T5 + Spring ? does anyone have experience in T5 + Spring ? -- sincerely yours M. H. Shamsi
Re: [T5] : tapestry + spring
I think we all agree that tapestry is generally amazing. And these threads are really just nit-picks :) So I'll go ahead and say that I kinda side with trying to use spring instead of reinventing the wheel. Though it's more important to get Tapestry to work, and part of that is to make sure that it comes to life as Howard envisions it (since it is strongly tied to his visions and efforts). And when spring doesn't have all of the magic that Howard envisions. But I kinda wish that spring was up to the part (and looking more and more at the docs, it seems to be getting closer, adding more and more support for less and less xml, and more module/hot loading). But my guess is that using a different IoC system is really hurting adoption of tapestry. If tapestry could really integrate well with spring, then it could be more easily understood/picked up/recommended by A LOT more people. And the path to adoption from other frameworks could be smaller.. but then again, maybe it's just a flawed prediction :) happy holidays everyone! Mohammad Shamsi wrote: I Agree with you on this but i have my own problems too. I have about 6 years experience on working with Java Web Frameworks. such as Struts, JSF , WebWorks... I found that Tapestry (especially T5) is Much Better than others, but its development process is so slow and unpredictable. I think that is because of focusing varies things instead of just a little but efficient web framework. if you take a look at Spring, you will find that it is very simple and efficient in service layer. it has very nice and simple integration with Hibernate, JPA and other ORMs. just in presentation layer, there is no good tools or framework here. I think tapestry could be a great Framework here. if it focus on this layer and increase its development speed. lack of documents, tutorials and IDE support is Tapestry problems too. On Dec 26, 2007 3:12 PM, Chris Lewis [EMAIL PROTECTED] wrote: I couldn't disagree with you more. For people like you who are familiar with spring, you may think the ioc part of T5 is a waste of time. That makes sense if you use and are happy with spring. For people like me it's a completely different story. I have been working with java for years - on the desktop. I've been doing web work for almost as long and have specifically avoided java because its approach has always seemed far too heavy, restrictive, and ungraceful for web development. I briefly looked at a framework here and there over the years because I enjoyed java as a language, but each time I resorted to another technology because each one I looked at made me laugh. Granted I was a bit naive at the time, but still I had to wonder if those framework developers actually developed web sites/applications with their frameworks, or instead thought it would be funny to see how many poor suckers would fall into the tangle of complications they created. Recently a project I stepped into reached a point of critical mass, and using java made sense even if complicated. I resolved to find a framework that, while maybe more complicated than I prefer, would prevent me from succumbing to my urges to hang myself in the shower. This is getting long so I'll cut it short. Getting started with T5 was easy, as I am familiar with maven and eclipse. The docs are still a little lacking, but I'm not afraid of source code or contributing code and/or articles. As I'm not familiar with spring I don't share your perspective. I loath the (ab/mis)use of xml that has been happening for years, especially in 'enterprise' environments, so I never got into spring. I am not bashing it as I can't rightfully judge something I haven't used, but I can say that starting w/ T5 was cake, and I see no hole that needs filling by something like spring. Again this is my perspective - use what works best for you. chris Mohammad Shamsi wrote: Dear Friends, With this abilities that all we know about Frameworks like Spring, is there any need to Tapestry Focus on providing Hibernate Integration Tools or Tapestry IOC ? i read Howards Documents about need for new Ioc for Tapestry, but i still think that using Spring Ioc and Spring XML files is much easier than coding it with Java Code On Dec 26, 2007 1:35 PM, Arve Klev [EMAIL PROTECTED] wrote: T5 + Spring is in my opinion a very good choose. I let Spring integrate ORM (Hibernate, JDBC, TopLink, etc). sincerely, Arve Klev 2007/12/24, Mohammad Shamsi [EMAIL PROTECTED]: Hi All, i want to start new Java EE projecct, Formerly we used Spring + Struts in our projects. after about 4 month testing and reading about Tapestry 5, i decide to use Tapestry 5 instead of Struts. i read some limitations of tapestry-spring module in its home page and i have no problem with them. is it any other limitation in using T5 + Spring ? does anyone have experience in T5 + Spring ? -- sincerely yours M. H. Shamsi
Re: [T5] : tapestry + spring
On Wed, 26 Dec 2007 13:07:49 -0200, Fernando Padilla [EMAIL PROTECTED] wrote: But my guess is that using a different IoC system is really hurting adoption of tapestry. If tapestry could really integrate well with spring, then it could be more easily understood/picked up/recommended by A LOT more people. Sorry, I do not get it. Tapestry-IoC (and Tapestry the Web framework too) integrate very easily and seamlessly with Spring. Your page classes do not even know where the beans are coming from. What's your problems with the Tapestry5-Spring integration? -- Thiago H. de Paula Figueiredo Desenvolvedor, Instrutor e Consultor de Tecnologia Eteg Tecnologia da Informação Ltda. http://www.eteg.com.br - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] : tapestry + spring
I apologize. I didn't mean to infer that it doesn't integrate nicely, nor that it's not good. So don't take offense, I was just doing some uneducated guesstimates on tapestry adoption. The IoC is actually quite good once you get used to it (except for the Aliases mechanism which I haven't looked into enough). But I came from the point of view of, I like Tapestry, and I'm using Tapestry. Then I learned what I needed to do to get tapestry to work, and to work with my spring configuration (quite easy). But for many people that come in with a mind of will I like Tapestry? should I use this or that?. Saying that you have to learn Tapestry-Core, and Tapestry-IoC, and though it integrates with Spring, you have to learn a whole new IoC system (to understand and debug, etc).. well, it could, and probably does, turn a few people away; even subconsciously. We're already asking people to try out and trust this new fangled way of coding up their websites, why ask them to also learn, understand and trust a new fangled way for IoC. Spring 1.x of course was not up to the job, but it's getting closer and closer to having all the features of Tapestry-IoC. Tapestry could win over a few more people by saying that it's built on top of Spring. But like I said, I love Tapestry and will stick with it, and support the developers decisions to get it done. Though I do wish that there was more adoption.. Thiago H de Paula Figueiredo wrote: On Wed, 26 Dec 2007 13:07:49 -0200, Fernando Padilla [EMAIL PROTECTED] wrote: But my guess is that using a different IoC system is really hurting adoption of tapestry. If tapestry could really integrate well with spring, then it could be more easily understood/picked up/recommended by A LOT more people. Sorry, I do not get it. Tapestry-IoC (and Tapestry the Web framework too) integrate very easily and seamlessly with Spring. Your page classes do not even know where the beans are coming from. What's your problems with the Tapestry5-Spring integration? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] : tapestry + spring
an advantage to NOT having tapestry built on spring is that we can drop in our legacy spring contexts where we don't want to upgrade from 1.x I really think tapestry-ioc was designed in such a way to allow maximum refactorability and ease of testing from the developer's standpoint. In a way, I kindof see what you mean. I was a little put off by T4 when I heard of this hivemind(the predecessor to tapestry-ioc) thing when I had already studied up on spring. I suppose it would really take some time to see how Spring evolves, whether or not it would be up to the job for driving tapestry. I believe tapestry-ioc and -core have made such a great leap forward in terms of pulling it all together for streamlining web-development with java that it wouldn't have been possible to do with Spring. spring was ubiquitous already, but couldn't mature as fast because they had to hold up the legacy support. Tapestry is often critized for having too many releases with too little compatibility. This is the price you pay for having such an excellent framework. I believe tapestry-ioc to be very mature already and by the time it comes 'round that Spring can do what tapestry-ioc can do, tapestry-ioc (and tapestry-core) will probably have a big following. Those people may/ may not want to go through the hassle of switching to spring. That depends on how appealing Spring is or becomes. maybe by that point Spring might be considered stale. Anyway, the tapestry-spring link is exactly what this project needs. I think the site should do a little more to distinguish between the two and drive new tapestry-lookers to a path which makes tapestry and spring look like best pals. -Mike Lake On Dec 26, 2007, at 3:50 PM, Fernando Padilla wrote: I apologize. I didn't mean to infer that it doesn't integrate nicely, nor that it's not good. So don't take offense, I was just doing some uneducated guesstimates on tapestry adoption. The IoC is actually quite good once you get used to it (except for the Aliases mechanism which I haven't looked into enough). But I came from the point of view of, I like Tapestry, and I'm using Tapestry. Then I learned what I needed to do to get tapestry to work, and to work with my spring configuration (quite easy). But for many people that come in with a mind of will I like Tapestry? should I use this or that?. Saying that you have to learn Tapestry-Core, and Tapestry-IoC, and though it integrates with Spring, you have to learn a whole new IoC system (to understand and debug, etc).. well, it could, and probably does, turn a few people away; even subconsciously. We're already asking people to try out and trust this new fangled way of coding up their websites, why ask them to also learn, understand and trust a new fangled way for IoC. Spring 1.x of course was not up to the job, but it's getting closer and closer to having all the features of Tapestry-IoC. Tapestry could win over a few more people by saying that it's built on top of Spring. But like I said, I love Tapestry and will stick with it, and support the developers decisions to get it done. Though I do wish that there was more adoption.. Thiago H de Paula Figueiredo wrote: On Wed, 26 Dec 2007 13:07:49 -0200, Fernando Padilla [EMAIL PROTECTED] wrote: But my guess is that using a different IoC system is really hurting adoption of tapestry. If tapestry could really integrate well with spring, then it could be more easily understood/picked up/recommended by A LOT more people. Sorry, I do not get it. Tapestry-IoC (and Tapestry the Web framework too) integrate very easily and seamlessly with Spring. Your page classes do not even know where the beans are coming from. What's your problems with the Tapestry5-Spring integration? - 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] tapestry-spring and WebApplicationContext
Yes, i've set this configuration. But my injection of the WebApplicationContext is not in a page but in another class. Is it a problem ? Stephane Ezra Epstein a écrit : And your web.xml file has: listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener And if the application context .xml files aren't in the standard place and named the standard way you've also included: context-param param-namecontextConfigLocation/param-name param-value!-- path to your applicationContext.xml --/param-value /context-param ? Steph [EMAIL PROTECTED] wrote: I've tried this but my WebApplicationContext is null ... Stephane SergeEby a �crit : Hi, Just import and inject the WAC in your page: import org.springframework.web.context.WebApplicationContext; class Foo { ... @Inject private WebApplicationContext wac; ... } /Serge cyrille37 wrote: Fidel Chavarria a �crit : Hi I think this willhelp you, http://tapestry.apache.org/tapestry5/tapestry-spring/ Thanks, but if you had read my mail, I should see that I'm talked about this page. In this page in Limitations chapter it is writte that we can't inject Spring session bean but we have to retreive the WebApplicationContext and use it. But I don't know howto retreive this so famous WebApplicationContext when I'm in a tapestry code page or component. cyrille. cyrille37 wrote: Hi, In the T5 tapestry-spring documentation it is writed to don't use other Spring beans than Singleton ones. Inject the WebApplicationContext instead. http://tapestry.apache.org/tapestry5/tapestry-spring/ But howto inject the WebApplicationContext ? thanks cyrille - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] tapestry-spring and WebApplicationContext
But my injection of the WebApplicationContext is not in a page but in another class. Is it a problem ? I think it will be a problem. I believe Tapestry will only handle those classes in the package you defined in tapestry.app-package in web.xml. You could try to move it to see how things going. Cheers, Jeffrey Ai Stephane Decleire wrote: Yes, i've set this configuration. But my injection of the WebApplicationContext is not in a page but in another class. Is it a problem ? Stephane Ezra Epstein a écrit : And your web.xml file has: listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener And if the application context .xml files aren't in the standard place and named the standard way you've also included: context-param param-namecontextConfigLocation/param-name param-value!-- path to your applicationContext.xml --/param-value /context-param ? Steph [EMAIL PROTECTED] wrote: I've tried this but my WebApplicationContext is null ... Stephane SergeEby a �crit : Hi, Just import and inject the WAC in your page: import org.springframework.web.context.WebApplicationContext; class Foo { ... @Inject private WebApplicationContext wac; ... } /Serge cyrille37 wrote: Fidel Chavarria a �crit : Hi I think this willhelp you, http://tapestry.apache.org/tapestry5/tapestry-spring/ Thanks, but if you had read my mail, I should see that I'm talked about this page. In this page in Limitations chapter it is writte that we can't inject Spring session bean but we have to retreive the WebApplicationContext and use it. But I don't know howto retreive this so famous WebApplicationContext when I'm in a tapestry code page or component. cyrille. cyrille37 wrote: Hi, In the T5 tapestry-spring documentation it is writed to don't use other Spring beans than Singleton ones. Inject the WebApplicationContext instead. http://tapestry.apache.org/tapestry5/tapestry-spring/ But howto inject the WebApplicationContext ? thanks cyrille - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/-T5--tapestry-spring-and-WebApplicationContext-tf3996411.html#a13861313 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] tapestry-spring and WebApplicationContext
I've tried this but my WebApplicationContext is null ... Stephane SergeEby a écrit : Hi, Just import and inject the WAC in your page: import org.springframework.web.context.WebApplicationContext; class Foo { ... @Inject private WebApplicationContext wac; ... } /Serge cyrille37 wrote: Fidel Chavarria a écrit : Hi I think this willhelp you, http://tapestry.apache.org/tapestry5/tapestry-spring/ Thanks, but if you had read my mail, I should see that I'm talked about this page. In this page in Limitations chapter it is writte that we can't inject Spring session bean but we have to retreive the WebApplicationContext and use it. But I don't know howto retreive this so famous WebApplicationContext when I'm in a tapestry code page or component. cyrille. cyrille37 wrote: Hi, In the T5 tapestry-spring documentation it is writed to don't use other Spring beans than Singleton ones. Inject the WebApplicationContext instead. http://tapestry.apache.org/tapestry5/tapestry-spring/ But howto inject the WebApplicationContext ? thanks cyrille - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] tapestry-spring and WebApplicationContext
And your web.xml file has: listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener And if the application context .xml files aren't in the standard place and named the standard way you've also included: context-param param-namecontextConfigLocation/param-name param-value!-- path to your applicationContext.xml --/param-value /context-param ? Steph [EMAIL PROTECTED] wrote: I've tried this but my WebApplicationContext is null ... Stephane SergeEby a �crit : Hi, Just import and inject the WAC in your page: import org.springframework.web.context.WebApplicationContext; class Foo { ... @Inject private WebApplicationContext wac; ... } /Serge cyrille37 wrote: Fidel Chavarria a �crit : Hi I think this willhelp you, http://tapestry.apache.org/tapestry5/tapestry-spring/ Thanks, but if you had read my mail, I should see that I'm talked about this page. In this page in Limitations chapter it is writte that we can't inject Spring session bean but we have to retreive the WebApplicationContext and use it. But I don't know howto retreive this so famous WebApplicationContext when I'm in a tapestry code page or component. cyrille. cyrille37 wrote: Hi, In the T5 tapestry-spring documentation it is writed to don't use other Spring beans than Singleton ones. Inject the WebApplicationContext instead. http://tapestry.apache.org/tapestry5/tapestry-spring/ But howto inject the WebApplicationContext ? thanks cyrille - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] tapestry-spring and WebApplicationContext
Hi, Just import and inject the WAC in your page: import org.springframework.web.context.WebApplicationContext; class Foo { ... @Inject private WebApplicationContext wac; ... } /Serge cyrille37 wrote: Fidel Chavarria a écrit : Hi I think this willhelp you, http://tapestry.apache.org/tapestry5/tapestry-spring/ Thanks, but if you had read my mail, I should see that I'm talked about this page. In this page in Limitations chapter it is writte that we can't inject Spring session bean but we have to retreive the WebApplicationContext and use it. But I don't know howto retreive this so famous WebApplicationContext when I'm in a tapestry code page or component. cyrille. cyrille37 wrote: Hi, In the T5 tapestry-spring documentation it is writed to don't use other Spring beans than Singleton ones. Inject the WebApplicationContext instead. http://tapestry.apache.org/tapestry5/tapestry-spring/ But howto inject the WebApplicationContext ? thanks cyrille - 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] -- View this message in context: http://www.nabble.com/-T5--tapestry-spring-and-WebApplicationContext-tf3996411.html#a11359690 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] tapestry-spring and WebApplicationContext
Hi I think this willhelp you, http://tapestry.apache.org/tapestry5/tapestry-spring/ cyrille37 wrote: Hi, In the T5 tapestry-spring documentation it is writed to don't use other Spring beans than Singleton ones. Inject the WebApplicationContext instead. http://tapestry.apache.org/tapestry5/tapestry-spring/ But howto inject the WebApplicationContext ? thanks cyrille - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/-T5--tapestry-spring-and-WebApplicationContext-tf3996411.html#a11352177 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 tapestry-spring: have to interface all HibernateDaoSupport methods
On 6/26/07, Bill Holloway [EMAIL PROTECTED] wrote: I have the following DAO pattern: public class FooDaoImpl extends HibernateDaoSupport implements FooDao { // some custom Foo dao methods. } However, tapestry-ioc spring bean injection injects via interface. So, none of the HibernateDaoSupport or HibernateTemplate methods like saveOrUpdate or merge or get are visible from my injected DAO unless they're explicitly written into the FooDao interface or some higher level interface that FooDao extends. Pain. What are you gaining from HibernateDaoSupport? Why not using this pattern without HibernateDaoSupport and HibernateTemplate and let the spring framework handle transaction? -- Massimo http://meridio.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 tapestry-spring: have to interface all HibernateDaoSupport methods
I.e., public class FooDaoImpl extends HibernateTemplate implements FooDao // which extends HibernateOperations { // some custom Foo dao methods. } Perfecto and parsimonious. bill On 6/25/07, Massimo Lusetti [EMAIL PROTECTED] wrote: On 6/26/07, Bill Holloway [EMAIL PROTECTED] wrote: I have the following DAO pattern: public class FooDaoImpl extends HibernateDaoSupport implements FooDao { // some custom Foo dao methods. } However, tapestry-ioc spring bean injection injects via interface. So, none of the HibernateDaoSupport or HibernateTemplate methods like saveOrUpdate or merge or get are visible from my injected DAO unless they're explicitly written into the FooDao interface or some higher level interface that FooDao extends. Pain. What are you gaining from HibernateDaoSupport? Why not using this pattern without HibernateDaoSupport and HibernateTemplate and let the spring framework handle transaction? -- 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]