This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Basic question on ApplicationResources

 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • 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: 7257
44
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic