views:

23

answers:

1

Hi ...,

I want to create Factory Class. for example is FooFactory. before Foo instanced, FooFacoty must be injected ServletContext to the constructor. I have snippet as follows:

public class FooFactory() {
    public static Foo getFoo() {
        ctx = //getservlet context
        Foo foo = new Foo(ctx);

            return foo;
    }
}
+2  A: 
mdma
Note: `ServletContextFactoryBean` is deprecated in Spring 3
skaffman
Oh, that's a pitty? Is there an alternative?
mdma