On Wed, Aug 6, 2014 at 7:37 AM, Najeeb Shah <snajeebullahs...@gmail.com>
 wrote:

> I am new to GWT, I want to read property file on Server side. I have
> DBConfig.java, useDBConfig.java and DBConfig.properties all placed in
> server package. I can't read the values from property file on Server Side.
> Your help is highly appreciated.
> There could be a solution of JSON etc. I don't know about that stuff.
> Could someone please help me out.


Where in the folder hierarchy is the properties file placed?

You have a few options here: you can use App Engine's own service to store
system properties or you can use your current design of loading a file. If
you want to use App Engine's system properties, see this documentation for
setting it up:
https://developers.google.com/appengine/docs/java/configyaml/appconfig_yaml#Java_app_yaml_System_properties_environment_variables_and_context_parameters

If you still want to read from a properties file, you can use the below
sample code which will load in a properties file and store the info inside
a Properties object (you need to run this code within a servlet since it
needs access to a ServletContext):



*InputStream properties_stream =
this.getServletContext().getResourceAsStream("/WEB-INF/prop.properties");Properties
app_properties = new Properties();app_properties.load(properties_stream);*


-----------------
-Vinny P
Technology & Media Consultant
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.

Reply via email to