The constituent parts of this tutorial series cover the following:
- How to create a simple web application on HCP
- How to apply authentication and authorization
- How to expose business functionality as an external RESTful API
- How to add JPA-based persistence to your web app
- How to leverage the multi-tenancy features of SAP HANA Cloud Platform
- How to use the connectivity service to consume external services
- How to add a mobile-friendly UI5-based user interface to the web application
In Part 1, you will develop a basic Java app to ensure that both Eclipse IDE and the local SAP HANA Cloud Platform (HCP) tooling have been properly installed and configured.
Create a new dynamic web project by selecting the File > New > Dynamic Web Project menu entry and enter the following information:
- Target Runtime:
- Dynamic Web Module Version:
Click on Next
Remove the standard
src Source folder and add a new one called
src/main/java to create a project that adheres to the standard Maven Directory Layout.
Change the default output folder to
Click on Next.
Change the Content Directory from
src/main/webapp (again, to adhere to Maven conventions)
Click on Finish.
Make sure you have your
weatherapp project folder selected, and then create a new Servlet by selecting the File > New > Servlet menu entry and enter the following information:
- Package name:
- Class name:
Click on Next.
Change the URL Mapping from
/hello to make it a bit easier to memorize.
Click on Finish and the
HelloWorldServlet.java file will open in the editor.
Now we need to do our first bit of coding. Navigate to the servlet’s
doGet() method and replace the
TODO comment with the following line of code and save your changes:
Deploy the application to your local server by using the Run as > Run on Server context menu of the
HelloWorldServlet node in the Project Explorer view.
Choose the Manually define a new Server option and select the SAP / Java Web Server option from the server selection. Make sure to select Java Web as the server runtime environment.
Click on Finish. The internal browser is now started and displays the traditional message marking the first step into a new programmer’s journey.