File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Resource Bundle access through JSP. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Resource Bundle access through JSP." Watch "Resource Bundle access through JSP." New topic
Author

Resource Bundle access through JSP.

Phillipe Rodrigues
Ranch Hand

Joined: Oct 30, 2007
Posts: 165
Hi,
i'm trying the the locale specific data entry in a jsp page through use of PropertyResourcebundle class.
i create a .properties file(Login_en_US.properties) which would be accessed through the PropertyResourcebundle class



I get exception "MissingResourceException" on execution of the code.Please let me kow where should the properties file be placed for the proper execution.

I'm trying it using MYEclipse6.0 IDE,Jdk1.5.


Thanks,
karthikeyan Chockalingam
Ranch Hand

Joined: Sep 06, 2003
Posts: 259
Please do not append properties in the end. For more details please refer

http://theasolutions.com/tutorials/java_rbundle.jsp
[ May 30, 2008: Message edited by: karthi keyan ]

http://www.skillassert.com


Phillipe Rodrigues
Ranch Hand

Joined: Oct 30, 2007
Posts: 165
The .properties file reside in the lib directory of the web-application.So how to specify it in code.

Tomcat5->webapp->wapp->WEB-INF->classes->lib->Login.properties
karthikeyan Chockalingam
Ranch Hand

Joined: Sep 06, 2003
Posts: 259
I suggest moving the Login.properties under classes

Tomcat5->webapp->wapp->WEB-INF->classes->Login.properties

In that case we can use



If we place it under com.xyz package it should be "com.xyz.Login"
Phillipe Rodrigues
Ranch Hand

Joined: Oct 30, 2007
Posts: 165
Can we create a .jar file containing the .properties file and place it in
the lib folder. If yes then how can we access it in our code.

I'm asking the above since i have around 15-17 .properties file.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Resource Bundle access through JSP.
 
Similar Threads
JSP and PropertyResourceBundle
properties file in websphere
PropertyResourceBundle
Loading properties from a static class
How to use PropertyResourceBundle