plopezgit / Sprint4_T1_Spring_Introduction_Maven

Spring introduction

Home Page:https://spring.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sprint4_T1_Spring_Introduction_Maven

Description:

This exercise introduces the SPRING framework. You'll start using the HTTP protocol, using Postman, and discovering how to manage dependencies with Maven.

Level 1:

  • Spring and Maven exercise:

This exercise is a first contact with Spring and Maven. Access the page: https://start.spring.io/, and generate a Spring boot project with the following characteristics:

  • Import it into Eclipse using the option File > Import > Existing Maven Project.
  • In the application.properties file, set the server.port variable to the value 9000.

We will turn this application into a REST API:

  • Depending on the main package, create another subpackage called Controllers, and inside it, add the HelloWorldController class. It must have two methods:

  • String hi

  • String hi2

  • These two methods will receive a String parameter called name, and will return the phrase:

  • “Hello, “ + name + “. You are running a Maven project”.

  • The first method will respond to a GET request, and must be configured to receive the parameter as a RequestParam. The "name" parameter will have the default value "UNKNOWN". You will have to answer to:

  • http://localhost:9000/HelloWorld

  • http://localhost:9000/HelloWorld?name=My name

  • The second method will respond to a GET request, and must be configured to receive the parameter as a PathVariable. The "name" parameter will be optional. You will have to answer to:

  • http://localhost:9000/HelloWorld2

  • http://localhost:9000/HelloWorld2/myname

Very important:

In addition to the Git link for the solved assignment, you will need to include at least two different links to the resources we have provided you with on campus that have helped or could have helped you solve the entire assignment or some parts.