Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Here is my Code if necessary: HelloRestApiApplication.java package com.example.demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @SpringBootApplication public class HelloRestApiApplication { public static void
Here is my Code if necessary:
HelloRestApiApplication.java
package com.example.demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @SpringBootApplication public class HelloRestApiApplication { public static void main(String[] args) { SpringApplication.run(HelloRestApiApplication.class, args); } }
Greeting.java
package com.example.demo; public class Greeting { private final long id; private final String content; public Greeting() { this.id = 0; this.content = ""; } public Greeting(long id, String content) { this.id = id; this.content = content; } public long getId() {return id;} public String getContent() {return content;} }
HelloController.java
package com.example.demo; import org.springframework.web.bind.annotation.*; @RestController public class HelloController {
CODE FROM THE TOP (@RequestMapping...)
}
Part 1) Implement the following: createGreeting() method that accepts a string parameter and uses POST method Simply create a Greeting instance and return itStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started