Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring aware servlets

 
K Aditi
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have been developing jsps and servlets for past 7-8 months.That's how I got introduced to java.For the past 2 days I have started learning Spring...and I feel I am bogged down by terminologies like IoC and AOP. Could somebody explain me in layman's terms?My ultimate aim is to develop Web based Spring applications which employ Hibernate to interact with the database. To start with I tried to write Spring aware servlets. I wasn't successful.

I get the following exception:
message


I have put the interface file, implementation file, .xml file and the servlet file in the same package in WEB-INF
Is this the correct approach?
I am using JDK 6, Tomcat 6 and Spring 2.0
Thanks,
 
anuj patel
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

This document Spring Framework contains all details about spring(IoC,AOP.

Thanks & Regards,
Anuj
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you put the necessary JAR files in your WEB-INF/lib directory ?
 
K Aditi
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I did.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well most examples you will find on the web makes the use of SpringMVC and it's single DispatcherServlet to handle all requests, and not too much at all using your own Servlet. But Spring does have a Servlet class that you can extend and in the init method you would override and create/setup your ApplicationContext. I recommend using an ApplicationContext instead of a BeanFactory. An ApplicationContext is an extension of BeanFactory plus a bit more, and is how Spring apps are built today.

I don't remember the exact class name of the Spring Servlet class that you can extend. I think it might be this one

http://static.springframework.org/spring/docs/2.5.x/api/index.html

Anyway, I think it is much easier using SpringMVC instead of creating your own Servlets.

Mark
 
K Aditi
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mark!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic