Restful API Server

Before working on Ionic UI, let’s setup the restful API server first, you can follow “Spring Restful + Hibernate with AngularJS” to setup the restful server.

Or, you can download SpringRestfulExample for Tomcat server and Spring4Restful_v01_schema.sql for MySQL database. Then, you can follow the below procedures:

  1. Install JDK from Oracle (using JDK 1.7 for our example), you can download from http://www.oracle.com/technetwork/java/javase/downloads/index.html
  2. Setup JAVA_HOME path

a. Right-click on “Computer”, and click on “Properties”.

b. Click on “Change Settings”

c. Click on “Environment Variables”

d. Under “User variables for XXXX”, click on “New” button to create a new user variable

Input “JAVA_HOME” as variable name and C:\{your_java_installed_path}\jdk1.7.0_55 as your variable value. If you are using different version of JDK, please update the path value.

  1. Download and Install MySQL (using 5.7 for our example) from http://dev.mysql.com/downloads/mysql/
  2. Import Spring4Restful_v01_schema.sql into MySQL
  3. Download and install Tomcat (prefer Tomcat 8 or upper) from http://tomcat.apache.org/download-80.cgi
  4. Place the SpringRestfulExample folder under C:\{tomcat_installed_path}\webapps\
  5. Start the Tomcat server by running C:\{tomcat_installed_path}\bin\bat
  6. Tomcat will extract the war file and install
  7. Done, you can try this URL: http://localhost:8080/SpringRestfulExample/shop/
  8. If you see the below screen:
  9. Please stop the Tomcat, and update the connection.username and connection.password of C:\ {tomcat_installed_path}\webapps\SpringRestfulExample\WEB-INF\classes\application.properties . Then, you should be able to see the JSON data when startup the Tomcat again.

 

Right now, everything is ready. Please see the next blog for Ionic UI examples.

Please rate this