• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Spring aware servlets

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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

Thanks & Regards,
Anuj
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes I did.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Mark!
 
So I left, I came home, and I ate some pie. And then I read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic