Springified Servlets, Listeners and Filters
Here are some short, but fully functional, templates for when you have a need for HttpServlet, ContextListener or Filter implementations, that also need spring bean dependencies. You use them by subclassing them and calling the getBean method when a dependency is needed, like this: Okay, here they come.. SpringHttpServlet SpringContextListener SpringFilter
March 5, 2011
·
polesen ·
2 Comments
Tags: Java, listener, servlet, spring, webapp · Posted in: Programming
Testing CXF with Autowiring using Spring
Here is how to create a test for a CXF web service implementation class. The test use spring-mock base classes and hereby support stuff like transactions and autowiring through annotations. Neat. I have a base class like this: One thing here: cxf.xml is loaded from classpath by the test code, but it resides in src/main/webapp/WEB-INF [...]
June 20, 2010
·
polesen ·
No Comments
Tags: cxf, Java, maven, spring, test · Posted in: Programming
CXF Method Not Found When Further Annotated
When using CXF and the JAXWS annotations to publish web services, like this: you can experience problems if you annotate the web service methods with something that spring-aop needs to process. Like when using perf4js nice @Profiled aspect, like this: This is due to the fact, that spring will produce a proxy of the @Profiled [...]
December 3, 2009
·
polesen ·
No Comments
Tags: aspect, cxf, spring, spring-aop, ws · Posted in: Programming
How To Acess Target Object Behind a Spring Proxy
When annotating spring managed beans with stuff like @Transactional, spring will behind the scenes produce code, that ensures that transaction logic is applied before and after your code. Depending on the configuration, this is often done using a JDK proxy, which is a dynamically generated class implementing the bean interfaces. This dynamically generated code will [...]
June 5, 2009
·
polesen ·
10 Comments
Tags: Java, spring · Posted in: Programming
SpringSource Application Platform
So, Spring Source has been able to keep a secret from us Secretly, they have been developing what looks a lot like a new application server, not like the JEE market, but with the springframework at its core. A well kept secret, which I did not see coming, even though we might have been able [...]
May 5, 2008
·
polesen ·
2 Comments
Tags: Java, JSR-277, JSR-294, OSGi, spring · Posted in: Tools
