Web programming learning 7: Using JPA + RESTful Web Service + SAPUI5 to create Web Applications

Source: Internet
Author: User

In the previous example, I learned how to use JPA and how to use Apache olingo to automatically convert a JPA database to a RESTful Web Service.

I learned how to use SAPUI5. Now I want to integrate them.


Development Environment:

The development environment is: Eclipse Juno, MySQL 5.5, olingo 1.2, EclipseLink 2.4, Tomcat 7, SAPUI5 1.18


Here, the data layer directly uses the jpa2 project completed in the previous exercise, which implements a RESTful Web Service for the background database table employee operation,

Url: http: // localhost: 8080/jpa2/Employee. svc/


1. Install the Eclipse SAPUI5 plug-in provided by SAP.

Https://tools.hana.ondemand.com


2. Create a SAPUI5 Web Project named sapui5

3. Because my service is local, you need to use proxy to access it. modify web. xml.

Add:

<servlet><servlet-name>SimpleProxyServlet</servlet-name><servlet-class>com.sap.ui5.proxy.SimpleProxyServlet</servlet-class></servlet><servlet-mapping><servlet-name>SimpleProxyServlet</servlet-name><url-pattern>/proxy/*</url-pattern></servlet-mapping><context-param><param-name>com.sap.ui5.proxy.REMOTE_LOCATION</param-name><param-value>http://localhost:8080</param-value></context-param>

4.modify the index.html file:

<!DOCTYPE HTML>

Here we will mainly create a table component, create an odata model, and then bind them to it.


5. Deploy the project on Tomcat and run:

6. conclusion: After the RESTful service is obtained, web and mobile development will be very convenient, while SAPUI5 will become more convenient, not only beautiful interface, it can also greatly improve the development efficiency.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.