Skip to content

kabragaurav/Simple-Customer-Login-Page-using-Spring-MVC

Repository files navigation

Customer Form

using JSP, H2 Database, Postman, Heroku and Spring Boot

Author : Gaurav Kabra

Set-up : Heroku (Optional), Postman (Optional) and Spring Boot in Eclipse Ide

About

  • http://localhost:{port_no}/
    Form page where customer enters info (Id, Name and Email).
    Constraits : Id is primary key (PK) and Email must be of valid structure.
    Note : You can set {port_no} in application.properties. In this repo, it is 8083.

  • http://localhost:{port_no}/getdetails
    Page where retrieve customer details with Id.
    Constraints : If customer with provided Id not found then instead of Whitelabel Error Page, must show appropriate message such as Invalid Id.

  • http://localhost:{port_no}/h2-console/
    In-memory database (H2-Db). Connect with your application by typing url provided in application.properties file.
    Type in SQL queries such as "SELECT * FROM Customers" and hit Run button to get all items in Database.

Postman GUI
> GET http://localhost:{port_no}/customers/
Equivalent to SELECT command in database console.

> DELETE http://localhost:{port_no}/customers/{cid}
Delete customer with Id={cid}.

Deploying App with Heroku

Install Heroku CLI (Heroku is a Salesforce Company) Type these commands:

> git init
> git add .
> git commit -m "initial commit"
> heroku login (Here browser will open, click LogIn)
> heroku create
> git push heroku master
> heroku open

Online demo using Heroku : https://still-temple-97030.herokuapp.com/