Skip to content

shryhus/Product-Spring-MVC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Product MVC app

  1. V Create new maven project with all required dependencies, plugins and configs
  2. V Create a Product model with the following fields
    1. id
    2. name
    3. price
  3. V Create a ProductService backed by HashMap. Implement the following methods
    1. save - receives a new Product, assigns an id to it and stores it in the map by id
    2. getById - receives an id, and returns a Product found in map by id
  4. V Configure Spring MVC application, including servlet initializer, view resolver and other required beans
  5. V Create ProductController that has the following methods:
    1. getProduct - handles GET request to “/products” with id parameters, uses ProductService to find a Product and passes it to the view account.jsp
    2. getProductForm - handles GET request to “/products/add” and forwards it to the productForm.jsp
    3. saveProduct - handles POST request to “/products” that contains form parameters, receives a Product created from form parameters and stores new product using ProductService
  6. V Create JSP pages product.jsp and productForm.jsp


V * Implement additional functionality that allows to see the whole list of existing products (one more jsp view, one more controller method, one more service method)


V ** Implement navigation between pages. E.g. page that show one account should contain a button(or link) that allows to see all products, and another button that allows to add new product. A page that shows the list should provide some navigation to each product. E.g. a product name can be clickable. When you click on product name it goes to its page (using get by id). A product form should have two buttons. E.g. “Save” and “See all”


V *** Implement validation and notification. When new product is stored, a message “Product has been stored successfully” should be printed below the button “Save”. If the product with a current name already exists, an error message should be displayed

About

Bobocode exercise project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages