This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Error: spring-servlet.xml

 
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to spring. using spring 2.0. I am trying a simple example using spring MVC. I get the following error:



I have spring.jar in my WEB-INF/lib.
My web.xml looks like -



My springapp-servlet.xml looks like -



What could be the reason for this error?
Also, I have not specified the path of springapp-servlet.xml. How does the application know where to look for mappings of a specific type.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Replace springapp-servlet.xml's header with this :



Also, I have not specified the path of springapp-servlet.xml. How does the application know where to look for mappings of a specific type.


Spring looks for [servletname]-servlet.xml under WEB-INF, where [servletname] is the name you give to the DispatcherServlet. You named the DispatcherServlet "springapp", Spring will look for springapp-servlet.xml under WEB-INF.
 
He got surgery to replace his foot with a pig. He said it was because of this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic