• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Spring Property file configuration Problem

 
Ranch Hand
Posts: 120
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello I am building spring web application,
in that i want to add some field in JSP file,
Which can be populated by Property file.

My property file is,
employee.properties

I have crerated beans as,
in application-context,



And i have bean,
EmployeeDetails.java



And TestReadProperty Class as,


Ana Error i get is,
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'employeeDetails' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Could not resolve placeholder 'employee.empno'

So could not deploy project.

Please help me out,
Thank you in advance.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
(Caveat: I could be remembering this incorrectly.)

I thought property files had to be on the classpath.
 
sandeep lokhande
Ranch Hand
Posts: 120
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I dont know,
This is what i learned from some tutorials.
Where should i add Classpath? :(
 
Ranch Hand
Posts: 85
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try using the classpath in the location, something like :



The files under directory WEB-INF should be added, If not try the whole path as "classpath:/WEB-INF/employee.properties"
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
WEB-INF isn't on the classpath, though.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic