Sample Apps: Spring data MongoDB and JSF Integration tutorial (PART 5)

Baby Steps to Pro
1 min readDec 9, 2021

--

In the last part of this tutorial, we will add create, edit and delete function to the MongoShop Product Catalog application.

The search page is modified. A modal confirm dialogue box is added before the product is physically deleted
updated search.xhtml

updated ProductSearchBean.java

A product detail page is added to view the produc details. Creation and edition of product is done in the product detail page.
detail.xhtml

ProductDetailsBean.java

updated ProductService.java

Conclusion:
1. Spring Data Mongo DB provides MongoTemplate which allow you to perform MongoDB operation easily.
2. MongoDB JSON-style document could mapped to POJO easily with the help of Spring Data MongoDB
3. Repository abstraction of spring data reduces the boilerplate code write for accessing MongoDB.
4. You add custom behaviour to spring data repository.

Source Code:

https://github.com/borislam/spring-data-mongodb-jsf

Originally published at https://www.borislam.com on December 9, 2021.

--

--

Baby Steps to Pro
Baby Steps to Pro

Written by Baby Steps to Pro

We are technology enthusiasts with more than 15 years of software development experience. Our current focus is framework development and architectural design.

No responses yet