Win a copy of TDD for a Shopping Website LiveProject this week in the Testing 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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?
 
Every snowflake is perfect and unique. And every snowflake contains a very tiny ad.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic