Spring Boot Project Document
Spring Boot Project Document
22 Jan 2018
Spring Boot:-
1
Raghu Sir [Sathya technologies, Ameerpet]
Services:-
Micro-Services:-
A server which has common services for all projects is called “Micro-
Services Server”. [Cloud Server:- Every micro-Service is an
independentservice and small service (few lines of code)].
Every micro service will be used in our application, with the help of
“Web-Services”. Web-Service works like link between our project to
Micro-Service
Advantages:-
1. Every micro-serviceis “pre-developed” service so no code
required for development in our application only use/call using
Micro-service.
2. No testing is required to be done by programmer while doing
integration to our project.
3. Every micro-services run in different server (not in our server i.e.
production server) this can also called as “cloud Server”.
4. Micro Service can be integrated easily with our application [easy
link].If we do not required service then unlink can be done easily
without any high level changes in our application. It is also called
as “Plug-in Service”.
5. See the diagram below:-
2
Raghu Sir [Sathya technologies, Ameerpet]
3
Raghu Sir [Sathya technologies, Ameerpet]
Project Implementation:-
4
Raghu Sir [Sathya technologies, Ameerpet]
Spring Boot:-
application.properties file:-
This file is input to spring container. Here Spring Boot provides default
configurationfor all concept i.e. <bean> tags , so programmer is not
required to write any <bean> tag for common concept like email,
Database connection, JMS, Log4J,View Resolver etc.
Design: -
Write one interface that extends CrudRepository(I).
6
Raghu Sir [Sathya technologies, Ameerpet]
HAS-A Relation: -
Using child class as DataType in parent class and creating variable is called as
“HAS-A” Relation.
A ----------<> B
Class B{ }
Class A{
B ob; // HAS-A
7
Raghu Sir [Sathya technologies, Ameerpet]
Auto Conversion is given for JSON <=> Object formats by spring boot.
Just use @RequestBody before param type.
Use @RestController at class level. Then class behaves as Rest
WebService provider class.
Make HAS-A Relation with Repository interface (DAL) & apply
@Autowired.
Define one operation (method) that returns ResponseEntity after
execution.
@Valid will do model object validations and store then into Errors
object.
(Errors | BindingResult).
@PostMapping is equals to
@RequestMapping(value=”/url”,method=RequestMethod.POST)
**Design: -
8
Raghu Sir [Sathya technologies, Ameerpet]
Executing Application: -
1. Update Project
Right click on project
Maven
Update Project
2. Clean Project
Right Click on Project Run As Maven Clean
3. Install Project (Pack)
Right click on Project Run As Maven Install
4. Start server
Open Boot Starter class &Run as Main Method class
Run Menu -> Run Option (ctrl+F11).
9
Raghu Sir [Sathya technologies, Ameerpet]
URLs: -
1. (GET)
http://localhost:2018/emp/getAll
2. (POST)
http://localhost:2018/emp/save
Example: - Screen#1
10
Raghu Sir [Sathya technologies, Ameerpet]
https://devops.datenkollektiv.de/banner.txt/index.html
11
Raghu Sir [Sathya technologies, Ameerpet]
Ex: http://localhost:2018/get/25
Ex: /get/{sid} , Here /get = static path, {sid} = dynamic path using below
format:
@PathVariable(“{path}”)DataType variable
12
Raghu Sir [Sathya technologies, Ameerpet]
Ex: server.context-path=/provider
**** In spring Boot it has default configuration and mapped with URL “/”
13
Raghu Sir [Sathya technologies, Ameerpet]
**To see all default values for connection Pooling goto “PoolProperties” class.
14
Raghu Sir [Sathya technologies, Ameerpet]
#DataSource Details#
#spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/test
spring.datasource.username=root
spring.datasource.password=root
#Hibernate(JPA) Details #
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=create
spring.jpa.properties.hibernate.format_sql=true
spring.datasource.tomcat.initial-size=5
spring.datasource.tomcat.max-active=5
spring.datasource.tomcat.max-active=20
spring.datasource.tomcat.max-idle=10
spring.datasource.tomcat.min-idle=5
15
Raghu Sir [Sathya technologies, Ameerpet]
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
Import.sql (src/main/resources) >right click> new > other > search for “SQL”
> select “SQL File” > enter name ex: import.sql > finish
** This file can have SQL quieries which will be executed only one time, on
server startup.
16
Raghu Sir [Sathya technologies, Ameerpet]
SWAGGER 2.x: -
1. api’s base-package.
2. Common Path for all RestControllers in App.
3. API Information and Contact Details are called as metadata (optional).
Ex: http://localhost:2018/swagger-ui.html
17
Raghu Sir [Sathya technologies, Ameerpet]
PROJECT DESIGN: -
This design provides one module as one micro service which can be
deployed with project other module or indepdently.
It accept request from any kind of client i.e. Android App, Web Browser,
Installed UI with web services (like ATM), Bulk Input process as
Excel/XML/JSON etc..
** MaaS Generic design should support, Data Validation, Data Access using
Sorting and Paging with Specification, Multi Type Data Access
(XML/JSON/Excel outputs..), Multi-Language Process
(I18n=Internationalization), Security Configuration with Role based
Authentication (Spring Boot security)
18
Raghu Sir [Sathya technologies, Ameerpet]
19
Raghu Sir [Sathya technologies, Ameerpet]
Coding Order: -
1. Model/Entity (C)
2. Repository (I)
3. Service (I) and ServiceImpl (C)
4. UIController (C)
5. JSP Files (Register, Data, DataEdit)
6. Validator (C) UI and ReST
7. Pagination in Data Page
8. Searching and Sorting in Data Page
9. RestController (C)
10. MultipartController
11. Validator (Multipart)
12. Utils and Specification
For one module we should design model class with 3 basic layer: Those are
20
Raghu Sir [Sathya technologies, Ameerpet]
21
Raghu Sir [Sathya technologies, Ameerpet]
UML Notations: -
1. Class/interface design: -
22
Raghu Sir [Sathya technologies, Ameerpet]
Example: -
package com.app;
23
Raghu Sir [Sathya technologies, Ameerpet]
1) IS-A (Inheritance):
Use extends or implement keywordfor coding.
2) HAS-A (Composition):
Use child as DataType and create one reference variable in Parent. It is
called as HAS-A Relation.
Syntax:
24
Raghu Sir [Sathya technologies, Ameerpet]
25
Raghu Sir [Sathya technologies, Ameerpet]
Employee Example:-
Package com.app.model;
Package com.app.repo;
26
Raghu Sir [Sathya technologies, Ameerpet]
Package com.app.service;
Package com.app.service.impl;
Package com.app.controller;
27
Raghu Sir [Sathya technologies, Ameerpet]
Admin Example:
Package com.app.model;
Package com.app.repo;
Package com.app.service;
Package com.app.service.impl;
}
28
Raghu Sir [Sathya technologies, Ameerpet]
Package com.app.controller;
29
Raghu Sir [Sathya technologies, Ameerpet]
Code Is: -
1) Model Class: -
package com.app.model;
@Entity
@Table(name=”usertab”)
public class User{
@Id
@Column(name=”u_id”)
@GeneratedValue(generator=”user_gen”)
@GenericGenerator(name=”user_gen”,strategy=”increment”)
privateLong userId;
//defConst, set/get, toString
}
2) DAL: Repository
package com.app.repo;
@Repository
30
Raghu Sir [Sathya technologies, Ameerpet]
3) SL: IService
package com.app.service;
public interface IUserService{
}
4) SL: ServiceImpl
packagecom.app.service.impl;
@Service
public class UserServiceImpl implements IUserService{
@Autowired
privateUserRepository repo;
}
5) PL: Controller
packagecom.app.controller;
@Controller //@RestController
Public class UserController{
@Autowired
privateIUserService service; }
31
Raghu Sir [Sathya technologies, Ameerpet]
ShipmentType Example: -
Code Is: -
1) Model Class: -
package com.app.model;
@Entity
@Table(name=”shipmentTypetab”)
public class ShipmentType{
@Id
@Column(name=”shipment_id”)
@GeneratedValue(generator=”shipment_gen”)
@GenericGenerator(name=”shipment_gen”,strategy=”increment”)
private Long userId;
//defConst, set/get, toString
}
2) DAL: Repository
package com.app.repo;
@Repository
32
Raghu Sir [Sathya technologies, Ameerpet]
3) SL: IService
package com.app.service;
public interface IShipmentTypeService{
}
4) SL: ServiceImpl
package com.app.service.impl;
@Service
public class ShipmentTypeServiceImpl implements
IShipmentTypeService{
@Autowired
privateShipmentTypeRepository repo;
}
5) PL: Controller
package com.app.controller;
@Controller //@RestController
Public class ShimentTypeController{
@Autowired
privateIShipmentTypeService service;
}
33
Raghu Sir [Sathya technologies, Ameerpet]
Code Is: -
1) Model Class: -
package com.app.model;
@Entity
@Table(name=”uomtab”)
public class Uom{
@Id
@Column(name=”uom_id”)
@GeneratedValue(generator=”uom_gen”)
@GenericGenerator(name=”uom_gen”,strategy=”increment”)
private Long uomId;
//defConst, set/get, toString
}
2) DAL: Repository
package com.app.repo;
@Repository
34
Raghu Sir [Sathya technologies, Ameerpet]
3) SL: IService
package com.app.service;
public interface UomService{
}
4) SL: ServiceImpl
package com.app.service.impl;
@Service
public class UomServiceImpl implements IUomService{
@Autowired
privateUomRepository repo;
}
5) PL: Controller
package com.app.controller;
@Controller //@RestController
Public class UomController{
@Autowired
private IUomService service;
}
35
Raghu Sir [Sathya technologies, Ameerpet]
Code Is: -
1) Model Class: -
package com.app.model;
@Entity
@Table(name=”orderMethodtab”)
public class OrderMethod{
@Id
@Column(name=”order_id”)
@GeneratedValue(generator=”order_gen”)
@GenericGenerator(name=”order_gen”,strategy=”increment”)
privateInteger orderId;
//defConst, set/get, toString
}
2) DAL: Repository
package com.app.repo;
@Repository
36
Raghu Sir [Sathya technologies, Ameerpet]
3) SL: IService
package com.app.service;
public interface OrderMethodService{
}
4) SL: ServiceImpl
package com.app.service.impl;
@Service
public class OrderMethodServiceImpl implements
IOrderMethodService{
@Autowired
privateOrderMethodRepository repo;
}
5) PL: Controller
package com.app.controller;
@Controller //@RestController
Public class OrderMethodController{
@Autowired
privateIOrderMethodService service;
}
37
Raghu Sir [Sathya technologies, Ameerpet]
#UI Design: -
38
Raghu Sir [Sathya technologies, Ameerpet]
39
Raghu Sir [Sathya technologies, Ameerpet]
**In our application, we are using “increment” (max+1) generator and applied
with @GenericGenerator.
40
Raghu Sir [Sathya technologies, Ameerpet]
**If Given object primary key value exist in DB table then save() works like
“update table set column..” else works like “insert into…”
41
Raghu Sir [Sathya technologies, Ameerpet]
Design: - Presentatation-Layer
Example: - Design-
42
Raghu Sir [Sathya technologies, Ameerpet]
To design the form for input data reading, we can use HTMLform or Spring
Form Tag Library (SFTL).
If we use HTML form, then form can be converted to object and given to
controller. [one-way-binding]
If we use Spring Form Tags, form can be converted to object and same
object can be converted to form data. [Two-way-binding]
2] <form: passwordpath=”variable”>
</select>
43
Raghu Sir [Sathya technologies, Ameerpet]
5]<form: radioButtonpath=”varName”/>
44
Raghu Sir [Sathya technologies, Ameerpet]
1)UomRegister.jsp
<%@taglibprefix="form"uri="http://www.springframework.org/tags/form"%>
<html>
<head>
<metahttp-equiv="Content-Type"content="text/html; charset=ISO-8859-1">
<title>Uom Register Page</title>
</head>
<body>
<h1>Welcome to Uom Register</h1>
<form:formaction="register"method="post"modelAttribute="uom">
<pre>
Uom Type: <form:selectpath="uomType">
<form:optionvalue="">--Select--</form:option>
<form:optionvalue="PACKING">PACKING</form:option>
<form:optionvalue="NO PACKING">NO PACKING</form:option>
<form:optionvalue="NA">-NA-</form:option>
</form:select>
Uom Model: <form:inputpath="uomModel"/>
Description: <form:textareapath="description"/>
<form:errorspath="description"></form:errors>
<inputtype="submit"value="Create Uom"/>
</pre>
</form:form>
${message}
</body>
</html>
2)Controller Code: -
@Controller
@RequestMapping("/uom")
publicclass UomController {
@Autowired
private IUomService service;
/**
* 1. To Show Register Page */
@GetMapping("/register")
public String showRegister(ModelMap map) {
// Send ModelAttribute to form
map.addAttribute("uom",new Uom());
//Specify UI Page Name
return"UomRegister";
}
/**
* 2. save Data to DB */
@PostMapping("/register")
public String saveData(@ModelAttribute Uom uom,Errorserrors,ModelMapmap)
45
Raghu Sir [Sathya technologies, Ameerpet]
//Save Data to DB using service Layer
Long uomId = service.save(uom);
//Clear form (model Object) after save
map.addAttribute("uom",new Uom());
//Send Message to UI After save
map.addAttribute("message","Uom created with ID: "+ uomId);
return"UomRegister";
}
}
46
Raghu Sir [Sathya technologies, Ameerpet]
Validator Coding: -
Validator is used to verify the input data on save or update operation. Before
performing operation in controller first invoke to validator which returns
errors.
Steps:
#1.messages.properties
uom.reg.type.error=Select one UomType
uom.reg.model.error=Enter Uom Model
uom.reg.desc.error=Enter Description
#2.UomValidator class
publicclassUomValidatorimplements Validator {
@Override
publicboolean supports(Class<?>clazz) {
returnUom.class.equals(clazz);
47
Raghu Sir [Sathya technologies, Ameerpet]
}
@Override
publicvoid validate(Object target, Errors errors) {
/**
* 2. save Data to DB */
@PostMapping("/register")
public String saveData(@ModelAttribute Uom uom,Errorserrors,ModelMapmap) {
// Before save do validation
validator.validate(uom, errors);
if(!errors.hasErrors()) {
//if no errors
//Save Data to DB using service Layer
Long uomId = service.save(uom);
//Clear form (model Object) after save
map.addAttribute("uom",new Uom());
//Send Message to UI After save
map.addAttribute("message","Uom created with ID: "+ uomId);
}
return"UomRegister";
}
<form:errors path=”uomType”/>
<form:errors path=”uomModel”/>
<form:errors path=”description”/>
48
Raghu Sir [Sathya technologies, Ameerpet]
49
Raghu Sir [Sathya technologies, Ameerpet]
This List display at UI using JSTL <forEach/> tag also use EL “${key}”in
HTML Table format.
In Controller define one method to get List from Service Layer. We can sort
based on any variable using comparator (I) also.
#Anonymous Code:
50
Raghu Sir [Sathya technologies, Ameerpet]
return…(logic here);
Java code:
List<Uom> uomList=….
JSTL Code:
<c:out value=”${uom}”>
</c:forEach>
List<Uom> uomList=repo.findAll();
Collections.sort(uomList,new Comparator<Uom>() {
@Override
51
Raghu Sir [Sathya technologies, Ameerpet]
return
o1.getUomModel().compareToIgnoreCase(o2.getUomModel());
}//method
return uomList;
}//method
52
Raghu Sir [Sathya technologies, Ameerpet]
@GetMapping("/all")
map.addAttribute("uomList", service.getAll());
return "UomData";
pageEncoding="ISO-8859-1"%>
<html>
<head>
<title>UomData Page</title>
</head>
<body>
<h1>Welcome To UomData</h1>
<table border="1">
<tr>
<th>ID</th>
53
Raghu Sir [Sathya technologies, Ameerpet]
<th>Type</th>
<th>MODEL</th>
<th>DESC</th>
<th>CREATED</th>
<th>MODIFIED</th>
</tr>
<tr>
</tr>
</c:forEach>
</table>
</body>
</html>
54
Raghu Sir [Sathya technologies, Ameerpet]
Class level
@RequestMapping(“/uom”)
@Controller
55
Raghu Sir [Sathya technologies, Ameerpet]
<a href=”delete?uomId=${uom.uomId}”>DELETE</a>
<tr>
<c:forEach items=…>
<td><a href=”delete?uomId=${uom.uomId}”>DELETE</a></td>
</tr>
</c:forEach>
@GetMapping(“/delete”)
service.delete(uomId);
return “redirect:all”;
Control Flow: -
56
Raghu Sir [Sathya technologies, Ameerpet]
UomData.jsp
<html>
<head>………
<script type=”text/javascript”
src=”../bootstrap/js/bootstrap.bundle.min.js”/>
</head>
<div class=”container”>
<div class=”card”>
57
Raghu Sir [Sathya technologies, Ameerpet]
<div class=”card-body”>
<trclass=”thead-dark”>
</tr>
</table>
</body>
</html>
Code:-
58
Raghu Sir [Sathya technologies, Ameerpet]
UomRegister.jsp
<html><head>…...</head><body>
<div class=”container”>
<div class=”card”>
</div>
<div class=”card-body”>
<div class=”form-group”>
<form:option value=””>--Select--</form:option>
</div>
<div class=”form-group”>
</div>
59
Raghu Sir [Sathya technologies, Ameerpet]
<div class=”form-group”>
</div>
</form:form>
<c:if test=”${null!=message}”>
</c:if>
</body>
</html>
UomDataEdit Design: -
60
Raghu Sir [Sathya technologies, Ameerpet]
@GetMapping(“/edit”)
map.addAtribute(“uom”,uom);
return “UomDataEdit”;
@PostMapping(“/update”)
service.update(uom);
61
Raghu Sir [Sathya technologies, Ameerpet]
return “redirect:all”;
UomDataEdit.jsp
<html><head>…<head>
<body>……….
<pre>
<form:option value=””>--select--</form:option>
<form:option value=”PACKING”>PACKING</form:option>
<form:option value=”NA”>-NA-</form:option>
</form:select>
</pre></form:form></body></html>
62
Raghu Sir [Sathya technologies, Ameerpet]
63
Raghu Sir [Sathya technologies, Ameerpet]
These operations are used to all sell an item to customer [End Customer,
A shop, Online Service]. These module are:
a. Sales order
b. Customer Invoice
c. Shipping SHP
A List created in Util (C) or Created from DB (using SL and DAL) can be sent to
UI which can be shown as: . Drop Down options 2.Radio Buttons 3.Check
BoxesNo.of values in List will be shown as No. of Options.
I. Make HAS-A Between Controller and Util Controller is Parent and Utils
is child Controller ---------<> Util
II. Add map.attribute(__,__) line in Controller methods that returns
__Register or __DataEdit
Step 3: UI Code:
65
Raghu Sir [Sathya technologies, Ameerpet]
packagecom.ramssoft.BootApp.util;
@Component
return list; */
@Controller
….
@Autowired
map.addAttribute(“uomTypes”,util.getUomTypes());
66
Raghu Sir [Sathya technologies, Ameerpet]
<form:options items=”${uomTypes}”/>
67
Raghu Sir [Sathya technologies, Ameerpet]
Spring Boot support default configuration for “ReST Web Services” also called
as “AutoConfiguration” of “FrontController” mapped to “/”.
Here FC is “DispatcherServlet”.
Like Vendors = small Scale and Medium Scale applications, Factory Outlets,
etc.
68
Raghu Sir [Sathya technologies, Ameerpet]
Use @RestController at class level, so that class behaves like Rest Web
Service which can make relations (HAS-A) with IService and Validator.
@RestController
publicclass _________{
@GetMapping(“/url”) // OR
@PostMapping(“/url”)
publicResponseEntity<?> ______(…){
return ResponseEntity;
UomRestController Code:-
Package com.ramssoft.BootApp.rest;
@RestController
@RequestMapping(“/rest/uom”)
@Autowired
@Autowired
privateUomValidator validator;
@PostMapping(“/save”)
Validator.validate(uom,errors);
if(errors.hasErrors()){
returnResponseEntity.badRequest().body(errors.getAllErrors());
}else{
}//method
}//class
PostManScreenShotFor Request:
70
Raghu Sir [Sathya technologies, Ameerpet]
71
Raghu Sir [Sathya technologies, Ameerpet]
@GetMapping(“/all”)
publicResponseEntity<Object> getAll(){
Object response=null;
If(uomList==null || uomList.size()==0){
}else{
response = uomList;
return ResponseEntity.ok(response);
@PutMapping(“/update”)
validator.validate(uom, errors);
if(errors.hasErrors()){
response=errors.getAllErrors();
returnResponseEntity.badRequest().body(response);
}else{
service.update(uom);
returnReponseEntity.ok(response);
POSTMAN SCREEN: -
73
Raghu Sir [Sathya technologies, Ameerpet]
74
Raghu Sir [Sathya technologies, Ameerpet]
…/rest/uom/delete?uomId=6
2-If we are using ReST Controller, then go for Path Parameter also called as
“PathVariable in Spring”.
…/rest/uom/delete/6
returnrepo.exists(uomId);
@DeleteMapping(“/delete/{uomId}”)
75
Raghu Sir [Sathya technologies, Ameerpet]
if(!exist){
}else{
service.delete(uomId);
returnResponseEntity.ok(response);
POSTMAN SCREEN: -
76
Raghu Sir [Sathya technologies, Ameerpet]
Swagger is a 3rd party API, given by “Spring Fox”. It is used to generate HTML
UI for all our webservices, that contains,
2.It is also works like tool, to make request and to see response.
Steps:-
77
Raghu Sir [Sathya technologies, Ameerpet]
3.Provideapiswith basePackages
6.(optional) Provide apiInfo like Provider name, Title, Contact, URL, Email
Licence details etc.
Ex: http:localhost:2018/swagger-ui.html
Coding: -
78
Raghu Sir [Sathya technologies, Ameerpet]
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.6.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.6.1</version>
<scope>compile</scope>
</dependency>
Package com.ramssoft.app.config;
@Configuration
@EnableSwagger2
@Bean
79
Raghu Sir [Sathya technologies, Ameerpet]
.select()
.apis(RequestHandlerSelectors.basePackages(“com.ramssoft.app.rest”))
.paths(PathSelectors.regex(“/rest.*”))
.build();
PAGINATION: -
80
Raghu Sir [Sathya technologies, Ameerpet]
It will not load all DB rows at a time. It selects rows with limit. Ex size = 10.
It displays the data in readable format to end user and search can be done
easy.
Pagination Implementation: -
ps = page Size
Page number starts with zero (0) ends with np-1 or n-1.
Ex: tr = 35 , ps = 10
= 3 + 5 >0 ?1 : 0
=3+1
= 4.
81
Raghu Sir [Sathya technologies, Ameerpet]
82
Raghu Sir [Sathya technologies, Ameerpet]
83
Raghu Sir [Sathya technologies, Ameerpet]
returnrepo.findAll(p);
@GetMapping(“/all”)
Page<Uom> p = service.findAll(pageable);
map.addAttribute(“page”,page);
return “UomData”;
<ul class=”pagination”>
<c:if test=”${!page.isFirst()}”>
<li class=”page-item”>
</c:if>
<c:if test=”${page.hasNext()}”>
84
Raghu Sir [Sathya technologies, Ameerpet]
<li class=”page-item”>
</c:if>
<li class=”page-item”>
</c:forEach>
<c:if test=”${page.hasPrevoius()}”>
<li class=”page-item”>
</c:if>
<c:if test=”${!page.isLast()}”>
<li class=”page-item”>
</c:if>
</ul>
</div>
85
Raghu Sir [Sathya technologies, Ameerpet]
contains(element):boolean
86
Raghu Sir [Sathya technologies, Ameerpet]
This method is used to check given input (element) exist in collection or not?
Example: -
List<String> al = Arrays.asList(“A”,”B”,”C”,”D”);
Sysout(exist);
Example: -
87
Raghu Sir [Sathya technologies, Ameerpet]
Pattern p = Pattern.compile(“[A-Z]{4,8}”);
Matcher m = p.matcher(input);
//3.Execute Matcher
Boolean b = m.matches();
Sysout(b);-java.util.regex;
Sysout(Pattern.compile(“[A-Z]{4,8}”).matcher(“RAM”).matches());
Examples Patterns: -
+ min=1 max = n
? min=0 max = 1
{4} exactly 4
Example: - [a-z]*
Inputs: ram(valid)
88
Raghu Sir [Sathya technologies, Ameerpet]
rahim(valid) Ajay(invalid)
HELLO(invalid) 98653(Invalid)
Ex: [a-zA-Z]{4,}
rahim(valid) Ajay(Invalid)
HELLO(Valid) 98653(Invalid)
Ex: [0-9]{4,8}
rahim(invalid) Ajay(invalid)
HELLO(invalid) 98653(Valid)
Code:
packagecom.ramssoft.app.validator;
@Component
@Autowired
@Autowired
@Override
returnUom.class.equals(clazz);
90
Raghu Sir [Sathya technologies, Ameerpet]
@Override
if(!uomUtil.getUomTypes.contains(uom.getUomTypes)){
If(!Pattern.compile(“[A-
Z]{4,8}”).matcher(uom.getUomModel()).matches()){
If(!Pattern.compile(“[a-zA-Z]{10-
255}”).matcher(uom.getDescription()).matches()){
If(uomService.isUomTypeAndModelExist(uom.getUomType(),uom.getU
omModel)){
errors.rejectValue(“uomModel”,””,”Uom ‘”+uom.getUomModel()+”’with
‘”+uom.getUomType()+”’ exist ”);} } }
Multipart Controller: -
It will get Request from a File [Excel File] having extension .xlsx.
In Excel One row = In Our App One Object = In DB Table one Row.
91
Raghu Sir [Sathya technologies, Ameerpet]
92
Raghu Sir [Sathya technologies, Ameerpet]
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi.ooxml</artifactId>
<version>3.9</version>
</dependency>
#2] application.properties
# Multipart Details #
spring.http.multipart.max-file-size=10MB
spring.http.multipart.max-request-size=20MB
93
Raghu Sir [Sathya technologies, Ameerpet]
#2. Use “getInputStream()” method and convert .xlsx data into WorkBook
(XSSFWorkBook).
#8. Return List to Controller and save List using service method.
Internal Flow: -
Coding:
94
Raghu Sir [Sathya technologies, Ameerpet]
this.uomType = uomType;
this.uomModel=uomModel;
this.description=description;
if(uomFile!=null){
try{
InputStream is = uomFile.getInputStream();
while(rows.hasNext()){
if(row.getRowNum()==0) continue;
95
Raghu Sir [Sathya technologies, Ameerpet]
row.getCell(0).getStringCellValue(),
row.getCell(1).getStringCellValue(),
row.getCell(2).getStringCellValue(),
);
uomList.add(uom);
}catch(IOException e){Sysout(e);}
}//if end
return uomList;
}//method end
package com.ramssoft.app.controller.multipart;
@Controller
@RequestMapping(“/uommultipart”)
@Autowired
@Autowired
@GetMapping(“/show”)
96
Raghu Sir [Sathya technologies, Ameerpet]
Return “UomMultipart”;
@PostMapping(“/uomImport”)
if(uomList.isEmpty()){
}else{
service.save(uomList);
map.addAttribute(“message”,”Success”);
return “UomMultipart”;
}//controller end
</pre></form>${message} </body></html>
97
Raghu Sir [Sathya technologies, Ameerpet]
Execution:
#1 Start Application
http://localhost:2018/uommultipart/show
#3 Create one excel file with any name but Sheet name must be “uoms”
Example
#6 Typehttp://localhost:2018/uom/all
98
Raghu Sir [Sathya technologies, Ameerpet]
Package com.app.controller.multipart.validator;
@Component
@Autowired
99
Raghu Sir [Sathya technologies, Ameerpet]
@Autowired
int i = 1;
for(Uom uom:uoms){
if(StringUtils.isEmpty(uom.getUomType())){
}else if(!util.getUomTypes.contains(uom.getUomType())){
if(StringUtils.isEmpty(uom.getUomModel())){
}else if(!Pattern.compile(“[A-
Z]{4,8}”).matcher(uom.getUomModel()).matches()){
}if(StringUtils.isEmpty(uom.getDescription())){
100
Raghu Sir [Sathya technologies, Ameerpet]
} else if(!Pattern.compile(“[a-zA-
Z]{10,255}”).matcher(uom.getDescription()).matches()){
}if(service.isUomTypeAndModelExist(uom.getUomType(),uom.getUom
Model())){
}if(!errorsList.isEmpty()){
i++;
return errorsMap;
@PostMapping(“/uomimport”)
if(uomFile==null || !uomFile.getOriginalFilename().contains(“.xlsx”)){
101
Raghu Sir [Sathya technologies, Ameerpet]
map.addAttribute(“message”,”Invalid File”);
}else{
if(uomList.isEmpty()){
}else{
Map<String,List<String>>errorMap =
validator.validateUoms(uomList);
if(errorMap.isEmpty()){
service.save(uomList);
map.addAttribute(“message”,”Success”);
}else{
map.addAttribute(“errorsMap”,errorMap);
return “UomMultipart”;
<c:out value=”${message}”>
102
Raghu Sir [Sathya technologies, Ameerpet]
</c:if>
<table border=”1”>
<tr>
<th>#</th>
<th>Errors</th>
</tr>
<tr>
<td><c:out value=”${e.key}”></td>
<td><c:out value=”${e.value}”></td>
</tr>
</c:forEach>
</table>
</c:if>
</body>
</html>
103
Raghu Sir [Sathya technologies, Ameerpet]
Specification always returns (generates) one select SQL. Example looks like
104
Raghu Sir [Sathya technologies, Ameerpet]
UomSpecification Design: -
105
Raghu Sir [Sathya technologies, Ameerpet]
106
Raghu Sir [Sathya technologies, Ameerpet]
Specification Steps: -
#3 write one new class UomSpecification that should extends one interface
Specification<Uom> and override toPredicate():Predicate method
……..
#5 Define one Search (Spring Form) Screen in UomData.jsp also add <script>
given in document.
EX#1:
(From:)
<a href=”?page=0”..>First</a>
(To:)
EX#2:
From:
<a href=”?page=${page.getNumber()-1}”..>${i}</a>
107
Raghu Sir [Sathya technologies, Ameerpet]
To:
108
Raghu Sir [Sathya technologies, Ameerpet]
Bug: -
Debug: -
Eclipse ShortCuts: -
Key Description
Break Points: -
To create break point double click on blue color bar in editor inside
eclipse,even same double click to remove breakpoint.
109
Raghu Sir [Sathya technologies, Ameerpet]
110
Raghu Sir [Sathya technologies, Ameerpet]
@DateTimeFormat(Pattern=”yyyy-MM-dd hh:mm:ss”)
(In form)
<div class=”form-group”>
111
Raghu Sir [Sathya technologies, Ameerpet]
Database table can have multiple rows, these rows are loaded into application
and exported to Excel WorkBook as one Sheet.
In this Sheet rows are constructed from Object (Model class objects).
Design:
Coding Steps#
112
Raghu Sir [Sathya technologies, Ameerpet]
Here ModelAndView should have Xlsx view object and List as Param value.
@Override
Sol:
113
Raghu Sir [Sathya technologies, Ameerpet]
114
Raghu Sir [Sathya technologies, Ameerpet]
OrderMethod/ShipmentType Module: -
115
Raghu Sir [Sathya technologies, Ameerpet]
Repository (_______Repository)
IService(I________Service)
ServiceImpl(_______ServiceImpl)
UIController (________UIController)
Util (_____Util)
JSP(__Register/__Data/__DataEdit/__ViewData)
RestController (________RestController)
Validator(____Validator)
MultipartController (____MultipartController)
JSP(____Multipart)
MultipartValidator(__MultipartValidator)
116
Raghu Sir [Sathya technologies, Ameerpet]
Notes: -
3] If variable is List type in model class then, one child table is created with 3
columns (Key column, index column, element column).
Jsp ____Register.jsp,
117
Raghu Sir [Sathya technologies, Ameerpet]
In __Data.jsp page do not display all fields, show only few important field.
** On click link it should get only that object data using Primary Key and
display all values as a HTML Table.
118
Raghu Sir [Sathya technologies, Ameerpet]
Service:
Ex: Java Example Services : Java mail, Java Securing (Jaas = Java Authentication
and Authorization) ,CODEC (COding and DECoding), Java design Generators
(JFreeCharts) , Java File Operations (Upload and Download) , Java
cryptography, Java unique key Generation, etc.
Microservices:
I] Reusable Service
119
Raghu Sir [Sathya technologies, Ameerpet]
2] Web service calls for different client and Integration Apps (Ex: Andriod,
Third party apps, Service Engine) etc.
3] Bulk Operations (Data upload and Download also called as Export and
Import using Excel sheets).
For all these programming logic should be written only one time (in common
layer i.e. Service Layer).
This Service layer can connect to Data Access Layer and even Utils (Support
classes). Use Server side (Service Side) validator for all Request Processing.
MaaS has a standard Design for module implementations which are reusable
for all types of Application, changes will be at PL (Presentation Layer) or IL
(Integration Layer).
120
Raghu Sir [Sathya technologies, Ameerpet]
Design of MaaS:
121
Raghu Sir [Sathya technologies, Ameerpet]
Every Uom will be one of type PACKED ITEM, NON PACKED ITEM, Not
APPLICABLE
TV = PACKED ITEM
ShipmentType: -
122
Raghu Sir [Sathya technologies, Ameerpet]
Truck (Tempo,DCM).
Grade B = Faster
Grade C = Secured
Grade D = Normal
Warehouse UserType: -
123
Raghu Sir [Sathya technologies, Ameerpet]
1. Vendor: One who gets an item into warehouse. Person details used in
inbound operation.
2. Customer: One who gets an item out of warehouse. Person details used
in outbound operation.
**One Item will be connected to multiple vendors and customers (at least
one).
**To perform inbound operation, must choose one vendor. Then only those
vendor connected items will be used to create in order process.
**In same way for outbound operation, must choose one customer, only that
customer items will be used to create SaleOrder.
on click “Vendor” type it should have value “Purchase” also for “Customer”
type value is “Sale”.
124
Raghu Sir [Sathya technologies, Ameerpet]
*If Other (input) must be enabled else it should be read only input
125
Raghu Sir [Sathya technologies, Ameerpet]
If UserType = “Vendor”
else
126
Raghu Sir [Sathya technologies, Ameerpet]
Code: WhUserTypeRegister.jsp
<form:form…….>
……….
<head>…
<script type=”text/javascript”>
$(document).ready(function(){
$(‘input[type=radio][name=userType]’).change(function(){
If(this.value==’Vendor’){
$(“#userFor”).val(“Purchase Type”);
Else if (this.value==’Customer’){
$(“#userFor”).val(“Sale Type”);
});
$(function(){
$(“#userIdType”).change(function(){
If(this.value=’OTHERS’){
$(“#ifOther”).prop(“readonly”,false);
127
Raghu Sir [Sathya technologies, Ameerpet]
Else{
$(“#ifOther”).val(“”).prop(“readonly”,true);
}});});});
#4 Update maven.
To handle common data, ex: menu bar, logo details, footer, etc. in each and
every jsp, define one new JSP and write code there.
128
Raghu Sir [Sathya technologies, Ameerpet]
Link this new JSP to all existed JSP’s using <%@include file=”Master.jsp”%>
Step#1 Get complete (Current open file) URL using JSTL and create Variable
Ex output:
http://localhost:2018/WEB-INF/views/UomData.jsp
129
Raghu Sir [Sathya technologies, Ameerpet]
Step#2 Remove URI from above URL and replace place contextpath
(projectname) if exist.
Code:
pageContext.request.contextPath”/>
http://localhost:2018/projname
server.servlet.context-path=/
JDK [Compiler and JVM] Version Change for Spring Boot Project in
Eclipse: -
130
Raghu Sir [Sathya technologies, Ameerpet]
Item Module: -
131
Raghu Sir [Sathya technologies, Ameerpet]
1.FindByMethods
2.ModelClassCoding
3.RepoCode
4.ServiceCode
6.Controller
7.JSP
132
Raghu Sir [Sathya technologies, Ameerpet]
List<WhUserType>findByUserType(String userType);
List<OrderMethod>findByOrderMode(String orderMode);
**Variable name should exist in model class and datatype must be matched.
Multiplicities: -
Connecting one table rows with another table rows is called as “Multiplicities”.
133
Raghu Sir [Sathya technologies, Ameerpet]
1]One-to-one (1…1)
2]One-to-many (1…*)
3]Many-to-one (*…1)
4]Many-to-many (*…*)
Note: a)To connect two tables with multiplicity one table PK should be taken
as another table FK column.
c)In case of many-to-many one extra table with two FK column is created.
d)In case of one-to-one use many-to-one and Many side “unique” condition.
e)Here,
134
Raghu Sir [Sathya technologies, Ameerpet]
135
Raghu Sir [Sathya technologies, Ameerpet]
Steps#
136
Raghu Sir [Sathya technologies, Ameerpet]
@ManyToOne
@JoinColumn(name=”itemIdFK”)
List<OrderMethod> orderMethod;
} }
137
Raghu Sir [Sathya technologies, Ameerpet]
@OneToMany(mappedBy=”orderMode”,name=”Purchase”)
@JoinColumn(name=”itemIdFK”)
List<OrderMethod> orderMethod;
} }
//Item---------------<>Uom
1…*
@OneToMany
@JoinColumn(name=”uomIdFK”)
private Uomuom;
} }
@ManyToMany
@JoinTable(name=”itemtab”,
JoinColumns=@JoinColumn (name=”itemIdFK”),
inverseJoinColumns (@JoinColumn(name=”whuserIdFK”))
138
Raghu Sir [Sathya technologies, Ameerpet]
List<WhUserType>whVendor;
} }
@ManyToMany
@JoinTable(name=”itemtab”,
JoinColumns=@JoinColumn (name=”itemIdFK”),
inverseJoinColumns (@JoinColumn(name=”whuserIdFK”))
List<WhUserType> whCustomer;
} }
139
Raghu Sir [Sathya technologies, Ameerpet]
ID is Value.
Here, <option value=””> should have PK value and between <options> tags it
should have Code or any equal word of model data.
Example:
itemLabel=”CodeVar”
itemValue=”idVar”/>
</form: select>
140
Raghu Sir [Sathya technologies, Ameerpet]
ShortCut:
Integration Steps: -
141
Raghu Sir [Sathya technologies, Ameerpet]
1.Model Class
Apply HAS-A between parent and child modules and write multiplicity
annotations code.
2.Util Code:
In Parent module Util write child IService type as HAS-A type, get data from
find methods and add to ModelMap.
3.UI Code:
Ex: Item---------------<>Uom
*…1
Coding Steps#
1.class Item{
@ManyToOne
@JoinColumn(“uomIdFK”)
2.ItemUtil
@Component
Class ItemUtil{
@Autowired
142
Raghu Sir [Sathya technologies, Ameerpet]
map.addAtttribute(“uoms”,uomService.findAll());
3.ItemRegister.jsp
<form:form>
</form:select>
143
Raghu Sir [Sathya technologies, Ameerpet]
Code:
List<OrderMethod>findByOrderMode(String orderMode);
return repo.findByOrderMode(orderMode);
C] Also write findBy method for WhUserTypein both repo and service
#2.Define Item Model class with basic UI input and multiplicity inputs
Code:
package com.app.model;
id,code,width,len,hght,cost,curr,etc.
@ManyToOne
@JoinColumn(name=”uomIdFK”)
@ManyToOne
@JoinColumn(name=”omIdSaleFK”)
@ManyToOne
145
Raghu Sir [Sathya technologies, Ameerpet]
@JoinColumn(name=”omIdPurchaseFK”)
@ManyToMany
@JoinTable(name=”itm_ven_tab”),joinColumns=
@JoinColumn(name=”itm_idFK”),inverseJoinColumns=
@JoinColumn (name=”ven_idFK”)
@ManyToMany
@JoinTable(name=”itm_cust_tab”),joinColumns=
@JoinColumn(name=”itm_idFK”),inverseJoinColumns=
@JoinColumn(name=”cust_idFK”)
#3.ItemUtil Code
@Component
//IOrderMethodServiec,IWhUserTypeService
146
Raghu Sir [Sathya technologies, Ameerpet]
m.addAttribute (“itemBseCurncies”,getBaseCurrencies());
m.addAttribute(“uoms”,uomService.getAll());
m.addAttribute(“omsales”,omService.findByOrderMode(“Sale”));
m.addAttribute(“ompurchases”,omService.findByOrderMode(“Purchase
”));
m.addAttribute(“whVendors”,whUserTypeService.findByUserType(“Ve
ndors”));
m.addAttribute(“whCustomers”,whUserTypeService.findByUserType(“Custo
mer”));
<form:form…>
//code,Currency,Cost,W,L,H..
<form:option value=””>--Select--<form:option>
</form:select>
<form:option value=””>--Select--</form:option>
147
Raghu Sir [Sathya technologies, Ameerpet]
itemValue=”orderMethdId”/>
</form:select>
<form:option value=””>--Select--</form:option>
<form:options
items=”${ompurchases}”itemLabel=”orderCode”
itemValue=”orderMethdId”/>
</form:select>
itemValue=”whUserTypeId”>
</form:select>
itemValue=”whUserTypeId”>
</form:select>
</form:form>
148
Raghu Sir [Sathya technologies, Ameerpet]
if(!Pattern.compile(“[A-Z]{4,8}”).matcher(item.getItemCode()).matches()){
if(item.getItemBaseCost()==null || item.getBaseCost<=0){
if(!util.getBaseCurrenencies().contains(item.getItemBseCurncy())){
if(item.getUom() == null ||
StringUtils.isEmpty(item.getUom().getUomModel())){
if(item.getOmSale() == null ||
StringUtils.isEmpty(item.getOmSale().getOrderCode())){
149
Raghu Sir [Sathya technologies, Ameerpet]
150
Raghu Sir [Sathya technologies, Ameerpet]
Joins: -
Joins are used to fetch data from multiple connected tables (PK-FK).
151
Raghu Sir [Sathya technologies, Ameerpet]
} }
[Join Type]
p.childVar c
where<condition>
152
Raghu Sir [Sathya technologies, Ameerpet]
#1)Uom: (Repo,IService,ServiceImpl)
#2)OrderMethod: (Repo,Iservice,ServiceImpl)
#3)WhUserType:
**These methods are used to convert String input(given from Excel sheet)
153
Raghu Sir [Sathya technologies, Ameerpet]
//set method
#2 use this as “!isEdit” to avoid any validation check at the time of edit.
#3 set this isEdit as false in register and true in update methods in Controller.
#4 ItemValidator:
“baseCost”: 2.2,
“baseCurrency”: “INR”,
“description”:”String”,
“itemCode”:”String”
“itemHgth”:2.2,
“itemLnth”:3.3,
“itemWdth”:4.4,
“uom”:{ “uomId”:2,”uomModel”:”BOXA”},
“omPurchase”:{“orderMethdId”:2,”orderCode”:”SALEONE”},
“omSale”:{“orderMethdId”:1,”orderCode”:”SALEONE”},
“whCustomers”:[{“whUserTypeId”:2}],“whVendors”:[{“whUserTypeId”:3}] }
154
Raghu Sir [Sathya technologies, Ameerpet]
INBOUND OPERATIONS
To place one order EndUser should provide main details and item details.
It is given as Screen#1.
If PO (Purchase Order) main details is created, then user can selects Items,
One line is called as One PoDtl (Purchase Order Details). Every PoDtl contains
slno, ItemCode, BaseCost, Qty.
155
Raghu Sir [Sathya technologies, Ameerpet]
PICKING: - If atleast one item is added to Po using PoDtl Screen then status
will be PICKING.
**If all items are removed from PoDtl then status will be OPEN.
**In PoHdr, “vendor” can be editable if PoHdr status is “OPEN”. Else readonly.
INVOICED: -After generating bill for Vendor as a PDF then PO status should be
INVOCED. Only ORDERED Status PO can be used in Vendor Invoice process.
156
Raghu Sir [Sathya technologies, Ameerpet]
RECEIVED: -If GRN is done for PO having status INVOICED then it will be
changed to RECEIVED.
157
Raghu Sir [Sathya technologies, Ameerpet]
158
Raghu Sir [Sathya technologies, Ameerpet]
Screen#1:
Screen#2:
159
Raghu Sir [Sathya technologies, Ameerpet]
Cascading In Multiplicity: -
Fetch [FetchType]: -
On selecting parent object if we want all it’s child objects to be loaded at same
time, then use “EAGER” Fetch Type.
On reading child object get data from DB then use “LAZY” Fetch type.
Ex:
@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
@JoinColumn(name=”poHdrId”)
160
Raghu Sir [Sathya technologies, Ameerpet]
This is Java EE concept, used to specify Security (access level) to one URL.
End User must be logged-in and also he/she has matching Role to access
the URL.
Java
Service
Example:
161
Raghu Sir [Sathya technologies, Ameerpet]
Define one class that has both authentication and authorization code by
following
Below steps:
@Configuration and
@EnableWebSecurity
162
Raghu Sir [Sathya technologies, Ameerpet]
In “configure()” method specify URLs and their access levels by writing code
like
#1 antMatchers(“/urlPattern”).permitAll()
#2 antMatchers(“/urlPattern”).hasAuthority(“ROLE”)
--OR—
antMatchers(“/urlPattern”).hasAnyAuthority(“ROLE-1”,”ROLE-2”)
#3 anyRequest().authenticated();
*= any character
163
Raghu Sir [Sathya technologies, Ameerpet]
/uomData (valid)
/uomExport (valid)
/dataUom (Invalid)
/uom/abc (Invalid)
/uom/all (Valid)
/uom (valid)
/uomData (Valid)
/uom/one/app/xy (valid)
164
Raghu Sir [Sathya technologies, Ameerpet]
#1 Define Register.jsp as shown below for both user and admin register
process
#2 On click submit data will be converted to object format. So, store data
model class design is given below
User----------------------<>Role
(com.app.model.User) *…*(com.app.model.Role)
165
Raghu Sir [Sathya technologies, Ameerpet]
@Entity
publicclass User{
privatelong userId;
@ManyToMany(fetch=FetchType.EAGER)
@JoinTable(name=”usr_role_tab”,
joinColumns=@JoinColumn(name=”uidFk”),
inverseJoinColumns=@JoinColumn(name=”ridFk”))
166
Raghu Sir [Sathya technologies, Ameerpet]
#3 In Controller method
167
Raghu Sir [Sathya technologies, Ameerpet]
Here, programmer should define one impl class for spring interface
“UserDetailsService” which converts User(Model Object) to User (Spring
framework) object.
168
Raghu Sir [Sathya technologies, Ameerpet]
Step#3 Define logic in it,that converts model class “User” to F/w “User” as
169
Raghu Sir [Sathya technologies, Ameerpet]
--<>UserDetailsService
--<>BCryptPasswordEncoder
Step#5 Define two methods one for authentication and another for
authorization
--------===================
170
Raghu Sir [Sathya technologies, Ameerpet]
Hint:
<c:if test=”${user.active==0}”>
<a href=”userStatChg=>status=1”></a>
</c:if>
171
Raghu Sir [Sathya technologies, Ameerpet]
Basic “Email API” is given by SUN (Oracle) as “MailAPI” to send email from any
domain (host).
This API is simplified by Spring f/w using POJI-POJO and Helper class pattern.
172
Raghu Sir [Sathya technologies, Ameerpet]
http://account.run.pivotal.io
Execution steps:
Project#1:
Setup PCF#2:
http://console.run.pivotal.io
173
Raghu Sir [Sathya technologies, Ameerpet]
Login PCF#3:
>Copy location
C:/>cd d:/myapp/springBoot/target
d:/myapp/springBoot/target>
d:/../target>cf login
Password>__________(enter key)
Push Application#4:
Syntax:
Login:
cf login –a api.run.pivotal.io
174
Raghu Sir [Sathya technologies, Ameerpet]
Logout
cf logout
>Click on “development”
>click On Apps
Ex:https://whapp.cfapps.io
175
Raghu Sir [Sathya technologies, Ameerpet]
Endpoint: an URL path to execute one (web) service which is developed and
added to one application also running in server.
<dependency>
<groupId>org.springframwork.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependecy>
#2 Actuator is built on top of spring Security and web services. So, AppUser
should have Role “ACTUATOR” Then only he can access end points.
#3 Here endpoint are sensitive (means secured) so AppUser must login before
accessing them.
176
Raghu Sir [Sathya technologies, Ameerpet]
https://whapp.cfapps.io/beans,env,auditevents,configprops,loggers,healt
h,logfile,metrics,mappings,sessions,info,
/beans: To see object created in Spring container and their details like name,
scope, dependencies, etc.
24 Apr,2018.
177