Physical Address
Physical Address
The following demonstrates how to create a controller package
The following shows how to create a controller class inside the controller package.
The BookController.java
file contains the following implementation.
BookController.java
package com.codersstash.book_details.controller;
import com.codersstash.book_details.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@Controller
public class BookController {
@Autowired
private BookService bookService;
public BookController(BookService bookService) {
this.bookService = bookService;
}
}
You can find the related GitHub repository branch here : book-details-controller