File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Basic question on ApplicationResources

 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Was wondering where you can use the keywords that are defined in your .properties file? Might sound like a silly question, but I've seen them used both in JSP tags as well parameters for ActionError. Is there any other way to use the keywords defined in there?
For example, if I define services.path=/WEB-INF/services.properties in my ApplicationResource bundle, in my extended ActionServlet I want to be able to do the following:
ServiceFactory factory = ServiceFactory.getFactory( context.getResourceAsStream( "services.path" ) );
Originally I had this as an init parameter and got the info using config.getInitParameter("services");, but was curious if there is a way to use the ApplicationResource.properties file for this instead.
Thanks!
Jason
[ December 16, 2002: Message edited by: jason adam ]
 
Junilu Lacar
Bartender
Pie
Posts: 6529
21
Java Linux Mac Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can try this in an ActionForm or Action:

I think the initParameter approach is better though because putting it in the ApplicationResources could be confusing later: if you want to do I18N, are you going to translate the path as well?
[ December 17, 2002: Message edited by: Junilu Lacar ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic