Super Basic Spring Question

J

John

Hello all.

Now I learn Spring. I have the question of the ultimate beginner. In
what container does Spring exist/run? Web Container? EJB Container?
Otherwards?

Phrased in other words: Can I use Spring with Tomcat alone to enhance
my Servlet/JSP applications? Or would I need additionally something
like JBoss with an EJB container to be necessary? Or is Spring in its
own container?

I swear I swear I tried to find the answer mysefl before disturbing
you.

Much,
John
 
J

Jan Thomä

Hi John
Now I learn Spring. I have the question of the ultimate beginner. In
what container does Spring exist/run? Web Container? EJB Container?
Otherwards?

In fact Spring doesn't need any container to be run. Its a Java
framework so you can even use Spring classes in plain standalone Java
applications. Of course it works equally well in all kinds of
containers. Spring provides special support for some things that you
usually have to do with when working inside containers like JBoss or
Tomcat but that does not limit the area of usage for Spring. I
personally use parts of it in nearly every application I code.
Phrased in other words: Can I use Spring with Tomcat alone to enhance
my Servlet/JSP applications?

Yes by all means.
Or is Spring in its
own container?

Not really. Spring provides a Dependency Injection Container (the
ApplicationContext class), which you can use to wire beans together,
but the framework is so much more than just an Implementation of the
Dependency Injection pattern. I very often use their BeanWrapper
implementation as it helps me a lot when dealing with beans and saves
me all that reflection code. And there are dozens of other useful
classes beyond that DI thingy. Have a look around their documentation,
it is very very good for an open source framework and it's also very
extensive.


Hope that helps.

Best regards,
Jan
 
D

Daniel Pitts

John said:
Hello all.

Now I learn Spring. I have the question of the ultimate beginner. In
what container does Spring exist/run? Web Container? EJB Container?
Otherwards?

Phrased in other words: Can I use Spring with Tomcat alone to enhance
my Servlet/JSP applications? Or would I need additionally something
like JBoss with an EJB container to be necessary? Or is Spring in its
own container?

I swear I swear I tried to find the answer mysefl before disturbing
you.

Much,
John

In a way, Spring Beans is a container, but not a J2EE container per-se.

All you need in order to use Spring is the Spring jar files. Spring has
some nice integration points for Servlets and several other types of apps.

As for EJB, I haven't used them enough to give you information about
that. I think that an EJB container is separate from a Spring container.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,238
Latest member
Top CryptoPodcasts

Latest Threads

Top