Spring MVC Configuration with Hibernate in Eclipse-maven-JQuery-JSON-CRUD

Most of the people stuck when they are trying to configure Spring MVC project first time and They don’t know about Each of statement or file. What is the purpose of it and How it works. I’ll try to define each of thing in this example

For the Database table mapping with Java Object, I have used Hibernate which is the most famous Object Relational Mapping tool.

In the most of projects an AJAX call is used for web services which returns JSON so we will learn ajax in JQuery too.

I have used many APIs in this project, Instead of including each of individual API in project I have used Maven Software Project Management tool for managing project APIs.

Package Explorer



Here in Package Explorer, the Project Structure of Spring MVC is shown each of section is expanded to see each of file with file extension.

FILE: SpringMVC/pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.spring</groupId> <artifactId>SpringMVC</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <name>SpringMVC Maven Webapp</name> <url>http://maven.apache.org</url> <properties> <java-version>1.7</java-version> <org.springframework-version>4.2.6.RELEASE</org.springframework-version> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.1.0</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency> <!-- --> <!-- http://mvnrepository.com/artifact/org.springframework/spring-context-support --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>4.2.6.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>4.2.6.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>4.2.6.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>4.2.6.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>4.2.6.RELEASE</version> </dependency> <dependency> <groupId>commons-dbcp</groupId> <artifactId>commons-dbcp</artifactId> <version>1.4</version> </dependency> <!-- MySQL Server Libraries --> <!-- <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.36</version> </dependency> --> <!-- SQL Server 2012 and 2014 Libraries --> <dependency> <groupId>com.microsoft.sqlserver</groupId> <artifactId>sqljdbc4</artifactId> <version>3.0</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-mapper-asl</artifactId> <version>1.9.10</version> </dependency> <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.3</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>4.1.0.Final</version> </dependency> <dependency> <groupId>org.hibernate.javax.persistence</groupId> <artifactId>hibernate-jpa-2.0-api</artifactId> <version>1.0.0.Final</version> </dependency> <dependency> <groupId>net.sf.jasperreports</groupId> <artifactId>jasperreports</artifactId> <version>6.4.0</version> </dependency> </dependencies> <build> <finalName>SpringMVC</finalName> </build> </project>

Why we use pom.xml file in spring mvc

POM stands for “Project Object Model”, This is a file which contain all Maven Configuration for building a project.

<project> element is the root element of this POM file. There are following possible children of this element with short description.

element is the root element of this POM file. There are following possible children of this element with short description. < modelVersion > 4.0.0 is a child element of <project>. It is currently describing the support for Maven 2 and Maven 3 versions.

4.0.0 is a child element of <project>. It is currently describing the support for Maven 2 and Maven 3 versions. <groupId> is a child element of <project>. It is universally unique identifier for project, as a normal to use fully qualified package name to distinguish similar project names

is a child element of <project>. It is universally unique identifier for project, as a normal to use fully qualified package name to distinguish similar project names <artifactId> is a child element of <project>. It is a unique identifier within group by the group Id. Artifact Id is produced by Maven for project include JARs, Wars etc.

is a child element of <project>. It is a unique identifier within group by the group Id. Artifact Id is produced by Maven for project include JARs, Wars etc. <packaging> is a child element of <project>. If you are running a command “maven clean install” It’ll generate .war file with artifactId. There is in this project we have a name of ArtifactId is SpringMVC so our generated file will be SpringMVC.war in target direct of project.

is a child element of <project>. If you are running a command “maven clean install” It’ll generate .war file with artifactId. There is in this project we have a name of ArtifactId is SpringMVC so our generated file will be SpringMVC.war in target direct of project. <version> is a child element of <project>. It is a version number of current project.

is a child element of <project>. It is a version number of current project. <name> is a child element of <proect>. It is a full name of Project.

is a child element of <proect>. It is a full name of Project. <url> is a child element of <project>. It is a project’s home page URL.

is a child element of <project>. It is a project’s home page URL. <properties> is a child element of <project>. The various plugins use these project properties.

is a child element of <project>. The various plugins use these project properties. <java-version> is a child element of <properties>. The Java version for plugin use

is a child element of <properties>. The Java version for plugin use <org.springframework-version> is a child element of <properties>. The Spring frame work version for plugin use.

is a child element of <properties>. The Spring frame work version for plugin use. <dependencies> is a child element of <project>. This element describes all dependencies associated with a project. They are automatically downloaded from repositories for this project.

is a child element of <project>. This element describes all dependencies associated with a project. They are automatically downloaded from repositories for this project. <dependency> is a child element of <project>. It is a element for downloading and installing dependency.

is a child element of <project>. It is a element for downloading and installing dependency. <groupId> is a child element of <dependency>. It is a unique identifier for project group, which is produced for dependency.

is a child element of <dependency>. It is a unique identifier for project group, which is produced for dependency. <artifactId> is a child element of <dependency>. It is a unique identifier for artifact.

is a child element of <dependency>. It is a unique identifier for artifact. <version> is a child element of <dependency>. It is a version of dependency.

FILE: /SpringMVC/src/main/webapp/index.jsp

<html> <body> <h2>Hello World!</h2> <p>List of URLs for Available Demos</p> <ul> <li><a href="http://localhost:8080/SpringMVC/users/page"> Users CRUD Operations </a></li> </ul> </body> </html>

It is an Index file, which is displayed first and contains Users CURD page URL

FILE: /SpringMVC/src/main/webapp/WEB-INF/applicationContext.xml

<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"> <!-- Enable autowire --> <context:annotation-config /> <context:component-scan base-package="com" /> <mvc:annotation-driven /> <mvc:resources mapping="/resources/**" location="/resources/" /> <!-- If you use MySQL Database comment out this bean and let others commented --> <!-- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="url" value="jdbc:mysql://127.0.0.1:3306/tests" /> <property name="username" value="root" /> <property name="password" value="root" /> </bean> --> <!-- SQL Server 2012 and 2014 Database drivers and connectivity code --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" /> <property name="url" value="jdbc:sqlserver://localhost;databaseName=mydb" /> <property name="username" value="sa" /> <property name="password" value="abcd@1234" /> </bean> <!-- Session Factory Declaration --> <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="packagesToScan" value="com.entities" /> <property name="hibernateProperties"> <props> <!-- SQL Dialect --> <!-- <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop> --> <!-- SQL Server 2014 Dialect --> <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop> <!-- Your required Database Name --> <prop key="hibernate.default_schema">dbo</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.enable_lazy_load_no_trans">true</prop> <prop key="format_sql">true</prop> <prop key="use_sql_comments">true</prop> </props> </property> </bean> <tx:annotation-driven transaction-manager="transactionManager" /> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> </beans>

Why we use application contenxt file in spring mvc?

This fie is used when Spring configuration is provided to Application by application context file. It defines beans at root webapp context.

By <context:annotation-config/> element, we tells application to activate beans already registered in application context. It gives general support for annotation Like @Required, @Autowired, @PostConstructor

element, we tells application to activate beans already registered in application context. It gives general support for annotation Like @Required, @Autowired, @PostConstructor By <context:component-scan base-package=”com”/> element, we tells application to activate beans already registered in application context and scan package to find, register beans in application context.

element, we tells application to activate beans already registered in application context and scan package to find, register beans in application context. By < mvc:annotation-driven /> element, we gives application to support for annotation-driven MVC Controllers Like @RequestMapping, @Controller, @RequestBody, @ResponseBody

element, we gives application to support for annotation-driven MVC Controllers Like @RequestMapping, @Controller, @RequestBody, @ResponseBody By < mvc:resources mapping=”/resources/**” location=”/resources/” /> element,

element, <mvc:annotation-driven /> is to tell that you can define spring beans dependencies without defining much elements in xml or implements interface or extends a class.

is to tell that you can define spring beans dependencies without defining much elements in xml or implements interface or extends a class. @Repository is to tell that Class is a Dao without having to extend JpaDaoSupport or SubClass DaoSupport.

is to tell that Class is a Dao without having to extend JpaDaoSupport or SubClass DaoSupport. @Controller is to tell that Class having all methods to handle HTTP request without implements Controller interface or extends Sub class of Controllers.

is to tell that Class having all methods to handle HTTP request without implements Controller interface or extends Sub class of Controllers. <context:component-scan base-package=”com” /> is to tell that your spring application will search base package for scanning classes with @Controller, @Services, @Repository, or @Component

is to tell that your spring application will search base package for scanning classes with @Controller, @Services, @Repository, or @Component <mvc:resources mapping=”/resources/**” location=”/resources/” /> is tell that spring application needs to define path location and mapping to static resources like CSS, Images or JavaScripts.

is tell that spring application needs to define path location and mapping to static resources like CSS, Images or JavaScripts. <bean> is a java bean. Java Bean is a simple class with private fields and setter, getter methods. In XML we can defined it for usage. So here in this file three of beans tags are used with properties. Each property is like Class Private Field.

is a java bean. Java Bean is a simple class with private fields and setter, getter methods. In XML we can defined it for usage. So here in this file three of beans tags are used with properties. Each property is like Class Private Field. DataSource Bean: There are two attribute defined in this bean. ID is defined for Unique Identifier for this bean as “dataSource” CLASS is defined for reference type of “org.apache.commons.dbcp.BasicDataSource”.

There are two attribute defined in this bean. BasicDataSource of Apache Commos is used for interaction with Relational Database. It helps for creating a new connection for an application.

of Apache Commos is used for interaction with Relational Database. It helps for creating a new connection for an application. Properties of BasicDataSource class: driverClassName: The JDBC Driver Class Name to be used. url: The connection URL to be passed to JDBC driver to establish a connection. username: The connection username to be passed to JDBC driver to establish a connection. password: The connection password to be passed to JDBC driver to establish a connection.

SessionFactory Bean: There are two attribute defined in this bean. ID Is defined for Unique Identifier for this bean as “sessionFactory” CLASS is defined for reference type of “org.springframework.orm.hibernate4.LocalSessionFactoryBean”.

There are two attribute defined in this bean. Properties of LocalSessionFactoryBean class: dataSource: SessionFactory uses dataSource properties. There is ref a attribute for referring bean by its ID. packagesToScan: To specify packages to search for auto detection of entity classes in the classpath. hibernateProperties : It sets hibernate properties. hibernate.dialect: To specify correct database Dialect. Each Database has different SQL code generator. hibernate.show_sql: Write all SQL statements to CONSOLE hibernate.default_schema: Qualifies unqualified Table names with Given Table Name and Schema Name. format_sql: Pretty print the SQL in Console and LOG. use_sql_comments: Hibernate will generate Comments inside SQL.

TransactionManager Bean: There are two attribute defined in this bean. ID Is defined for Unique Identifier for this bean as “transactionManager” CLASS is defined for reference type of “org.springframework.orm.hibernate4.HibernateTransactionManager”.

There are two attribute defined in this bean. Properties of HibernateTransactionManager Class:

This transaction manager is appropriate for applications that use a single Hibernate SessionFactory for transaction data access

FILE:/SpringMVC/src/main/webapp/WEB-INF/SpringMVC-servlet.xml

<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/views/" /> <property name="suffix" value=".jsp" /> </bean> </beans>

ServletContext.xml: It is a servlet level configuration file. Each application context can have multiple servlet context files. It holds all the configurations for the whole servlet application.

It is a servlet level configuration file. Each application context can have multiple servlet context files. It holds all the configurations for the whole servlet application. InternalResourceViewResolver Bean: By this resolver, we tell the servlet application about path of JSP views under the WEB-INF. Controllers always access them. It takes prefix for the name path and suffix for the file name.

FILE:/SpringMVC/src/main/webapp/WEB-INF/web.xml

<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>Archetype Created Web Application</display-name> <context-param> <param-name>ApplicationContext</param-name> <param-value>/WEB-INF/applicationContext.xml</param-value> </context-param> <servlet> <servlet-name>SpringMVC</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>SpringMVC</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> </listener> </web-app>

WEB.xml : It is a configuration file for web application in java. It instructs the servlet container (Tomcat) which class to load. Filters could be defined in it. Welcome file list could be defined in it. Error pages could be defined in it.

It is a configuration file for web application in java. It instructs the servlet container which class to load. Init-param: It is a static parameter, which is defined within servlet tag.It is a servlet level scope. At the servlet level you can get value of this.

It is a static parameter, which is defined within servlet tag.It is a servlet level scope. At the servlet level you can get value of this. Context-param: It is a static parameter, which is defined in web.xml file. It is an application level scope parameter. If the data does not change frequently you can store in it.

It is a static parameter, which is defined in web.xml file. It is an application level scope parameter. If the data does not change frequently you can store in it. Servlet: The servlet element contains the declarative data of a servlet.

The servlet element contains the declarative data of a servlet. Servlet-Mapping: The servlet-mapping element defines a mapping between a servlet and a URL pattern.

The servlet-mapping element defines a mapping between a servlet and a URL pattern. Listener: The Listener element defines an event of the web application.

FILE:/SpringMVC/src/main/webapp/WEB-INF/views/users.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Users</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script> </head> <body onload="load();"> <input type="hidden" id="user_id"> Name: <input type="text" id="name" required="required" name="user_name"><br> Email: <input type="email" id="email" required="required" name="email"><br> <button onclick="submit();">Submit</button> <table id="table" border=1> <tr> <th> Name </th> <th> Email </th> <th> Edit </th> <th> Delete </th> </tr> </table> <script type="text/javascript"> data = ""; submit = function(){ $.ajax({ url:'saveOrUpdate', type:'POST', data:{user_id:$("#user_id").val(),user_name:$('#name').val(),email:$('#email').val()}, success: function(response){ alert(response.message); load(); } }); } delete_ = function(id){ $.ajax({ url:'delete', type:'POST', data:{user_id:id}, success: function(response){ alert(response.message); load(); } }); } edit = function (index){ $("#user_id").val(data[index].user_id); $("#name").val(data[index].user_name); $("#email").val(data[index].email); } load = function(){ $.ajax({ url:'list', type:'POST', success: function(response){ data = response.data; $('.tr').remove(); for(i=0; i<response.data.length; i++){ $("#table").append("<tr class='tr'> <td> "+response.data[i].user_name+" </td> <td> "+response.data[i].email+" </td> <td> <a href='#' onclick= edit("+i+");> Edit </a> </td> </td> <td> <a href='#' onclick='delete_("+response.data[i].user_id+");'> Delete </a> </td> </tr>"); } } }); } </script> </body> </html>

Users.jsp is user-defined page. It is a view for CRUD operations. It contains the javascript functions.

is user-defined page. It is a view for CRUD operations. It contains the javascript functions. Load Function: It loads the data from server sides to the table.

It loads the data from server sides to the table. Submit Function: It adds new record or updated record.

It adds new record or updated record. Edit Function: It edit the data to fields.

FILE:/SpringMVC/src/main/java/com/controllers/UsersController.java

Package: com.controllers

package com.controllers; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import com.entities.Users; import com.servicesapi.UsersService; @Controller @RequestMapping("users") public class UsersController { @Autowired UsersService userServices; @RequestMapping(value="/page", method = RequestMethod.GET) public ModelAndView getPage(){ ModelAndView view =new ModelAndView("users"); return view; } @RequestMapping(value="/saveOrUpdate", method=RequestMethod.POST) public @ResponseBody Map<String,Object> getSaved(Users users){ Map<String,Object> map = new HashMap<String,Object>(); if(userServices.saveOrUpdate(users)){ map.put("status","200"); map.put("message","Your record have been saved successfully"); } return map; } @RequestMapping(value="/list", method=RequestMethod.POST) public @ResponseBody Map<String,Object> getAll(Users users){ Map<String,Object> map = new HashMap<String,Object>(); List<Users> list = userServices.list(); if (list != null){ map.put("status","200"); map.put("message","Data found"); map.put("data", list); }else{ map.put("status","404"); map.put("message","Data not found"); } return map; } @RequestMapping(value="/delete", method=RequestMethod.POST) public @ResponseBody Map<String,Object> delete(Users users){ Map<String,Object> map = new HashMap<String,Object>(); if(userServices.delete(users)){ map.put("status","200"); map.put("message","Your record have been deleted successfully"); } return map; } }

UsersController.java : This is a controller, which receives the http request each time for saveOrEdit record, delete record or retrieving list of records.

FILE:/SpringMVC/src/main/java/com/daoapi/UsersDao .java

Package: com.daoapi

package com.daoapi; import java.util.List; import com.entities.Users; public interface UsersDao { public boolean saveOrUpdate(Users users); public List<Users> list(); public boolean delete(Users users); }

UsersDao: It is a service for Dao repository.

FILE:/SpringMVC/src/main/java/com/daoimpl/UsersImpl .java

Package: com.daoimpl

package com.daoimpl; import java.util.List; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.ResponseBody; import com.daoapi.UsersDao; import com.entities.Users; @Repository @Transactional public class UsersImpl implements UsersDao{ @Autowired SessionFactory session; public boolean saveOrUpdate(Users users) { // TODO Auto-generated method stub session.getCurrentSession().saveOrUpdate(users); return true; } public List<Users> list() { return session.getCurrentSession().createQuery("from Users").list(); } public boolean delete(Users users) { try{ session.getCurrentSession().delete(users); }catch(Exception ex){ return false; } return true; } }

UsersDaoImpl: It is a implementation of UsersDao Repository.

FILE:/SpringMVC/src/main/java/com/entities/Users.java

Package: com.entities

package com.entities; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name="users") public class Users { @Id @GeneratedValue(strategy=GenerationType.AUTO) @Column(name="user_id") private Integer user_id; @Column(name="user_name") private String user_name; @Column(name="email") private String email; public Integer getUser_id() { return user_id; } public void setUser_id(Integer user_id) { this.user_id = user_id; } public String getUser_name() { return user_name; } public void setUser_name(String user_name) { this.user_name = user_name; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } }

Users.java: It is an entity class with setter and getter methods.

FILE:/SpringMVC/src/main/java/com/servicesapi/UsersService.java

Package: com.servicesapi

package com.servicesapi; import java.util.List; import com.entities.Users; public interface UsersService { public boolean saveOrUpdate(Users users); public List<Users> list(); public boolean delete(Users users); }

UsersServices: It is a service for Users.

FILE:/SpringMVC/src/main/java/com/servicesimpl/UsersServiceImpl .java

Package: com.servicesimpl

package com.servicesimpl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.daoapi.UsersDao; import com.entities.Users; import com.servicesapi.UsersService; @Service public class UsersServiceImpl implements UsersService{ @Autowired UsersDao userDao; public boolean saveOrUpdate(Users users) { return userDao.saveOrUpdate(users); } public List<Users> list() { // TODO Auto-generated method stub return userDao.list(); } public boolean delete(Users users) { // TODO Auto-generated method stub return userDao.delete(users); } }

UsersServicesImpl: It is a service implementation for Users.

If you want watch this tutorial in video, check this Tutorial in Video