• 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 MVC

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am referring the following tutorial

http://www.tutorialspoint.com/spring/spring_web_mvc_framework.htm

Quoting from above link:

After receiving an HTTP request, DispatcherServlet consults the HandlerMapping to call the appropriate Controller.



By HandlerMapping I am assuming they are talking about web.xml. If I use the link mentioned above I see no connection how the controller is called, as in web.xml the org.springframework.web.servlet.DispatcherServlet class is mapped to HelloWeb and the name of the controller is HelloController. I am unable to understand how the controller gets called. What am I missing?
 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
THe HandlerMapping gets constructed during load time by Spring. It does that by looking at the annottations. SO, when you do



You are basically adding an entry into the Handler mapping that tells it that /hello is mapped to HelloController
 
J Mohandos
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The servlet name in web.xml is given as HelloWeb. To what does it link?Or in other words where is it used?
 
Ranch Hand
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The configuration file has to be <servletname>-servlet.xml
 
This tiny ad is suggesting that maybe she should go play in traffic.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic