a href="xn--fiqr16adi7bgnc.xn--dqr445bdw4a.xn--j6w193g">隆鎮,Hacker News,Network Security,Hacker News,1N4148
Parsing JSON from external File in Java - Java Rhino,JavaScript Rhino Tutorial
Tutorials‎ > ‎

Parsing JSON from external File in Java

Parsing JSON from external File in Java
 
JSON is an easy to construct and easy to test format which can be edited in every text editor and test by any web browsers.  It is a good option for software developer to consider JSON as a format for storing configuration information.

If you are a Java Development and you wish to use an external file for keeping the configuration of your application, you may consider storing it in JSON.  If you don't know what JSON look like you can search a lot of resources form Google.  Here I will introduces Rhino as a tools for Java Developers to obtain (parse) the value in JSON format.
 
Steps in Creating Java Class for Parsing JSON from external File
In this tutorial, please ensure you've installed the Rhino properly before starting the following steps:
  1. Let's prepare a folder for files in this example. Actually there should be two files: JSONtest.js and RhinoJSONReader.java
  2. Use an text editor to create a javascript file for our JSON and save it as JSONtest.js
  3. Use the text editor to create the essential Java file as following and save it as RhinoJSONReader.java
  4. Compile the RhinoJSONReader.java and run the RhinoJSONReader class


Subpages (1): RhinoJSONReader