• 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

getting properties form harddisk and use those in jsp's

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

I am using some properties in jsp page. I want that properties to be loaded from .property file which is in hard disk (not in classpath).
ResourceBundleMessageSource not allowing me to refer .property files from hard disk.
Is there any other class which can do that work for me... (loading .property file from hard disk and allows me to use those in .jsp's using <fmt:message.../>)

Its urgent guys, please reply...

Thanks in advance,
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
use the file: prefix.

see the resource documentation.

http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/resources.html#resources-resourceloader
 
Rakesh Basani
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for you quick reply Bill..

I tried with it, but its not working at all...





 
Bill Gorder
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah you can't use ResourceBundleMessageSource. It uses the JDK's ResourceBundle API, which supports classpath resources only. You need to use ReloadableResourceBundleMessageSource instead, which does support any Spring resource location for its basename (including plain file paths and explicit "file:..." URLs.
 
Rakesh Basani
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Bill..

But still have a problem. I want to use sytem property in value tag of ReloadableResourceBundleMessageSource. How can I use that..
When I give direct path like "file:E:/users/iuct", its working fine..
But when I use "file:${xyz}/iuct",its not working properly..

Here xyz is a system property.. configured in pom..


Thanks in advance..
 
Bill Gorder
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have a PropertyPlaceholderConfigurer configured that is reading in your pom.properties file?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic