Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am creating a database project for a student information system for my databas

ID: 3862834 • Letter: I

Question

I am creating a database project for a student information system for my database class using oracle and SQL. I want to create a login page that would prompt the user for login information so they could acess the student information in my database. Please show me how I would create a page with PHP and HTML to connect to my database to check if the username and password exists that the user provides. If the password and username exist, the page would go to the next page where you could see the information you have previlage for. I also want there to be an option for the user to create new login information (this case would only be for students). Students could see their information in the database only, but administration login could see all students information.

Also if there are any ideas for features I could implement in my site, I would greatly appreciate it. Thanks!

Explanation / Answer

In this type of projects, it is more suggestible to use MVC architecture...
   MVC is a guideline, which says divide the application into three parts Model(Business logic), View(User Interface) and Controller(To control flow of execution)
  
1.You have to create a table in the database
       create table userdetails(
       id varchar2(15) primary key,
       name varchar2(20) unique,
       email varchar2(20) not null,
       contact varchar2(12) not null,
       address varchar2(30) not null,
       password varchar2(20) not null
       )
       )
2. You have to connect database to your application, the easiest way is to use hibernate
   You just required an ApplicationContextConfiguration class to connect with database.
3. Write required Java classes in order to add, delete, and update user and check whether user exists or not?
   I am using DAO in order to make it loosely coupled application by following Strategy design pattern
4. You need a controller to control the flow of execution.
5. Finally, you need view pages

I am adding all the required things in order to achieve your purpose

=================================================

ApplicationContextConfiguration class
package com.niit.shoppingcart.config;

import java.util.Properties;


import javax.sql.DataSource;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.orm.hibernate5.HibernateTransactionManager;
import org.springframework.orm.hibernate5.LocalSessionFactoryBuilder;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import com.niit.shoppingcart.model.BillingAddress;
import com.niit.shoppingcart.model.CardDetail;
import com.niit.shoppingcart.model.Cart;
import com.niit.shoppingcart.model.Category;
import com.niit.shoppingcart.model.Product;
import com.niit.shoppingcart.model.ShippingAddress;
import com.niit.shoppingcart.model.Supplier;
import com.niit.shoppingcart.model.UserDetails;

@Configuration
@ComponentScan("com.niit.shoppingcart")
@EnableTransactionManagement
public class ApplicationContextConfiguration {

   @Bean(name = "dataSource")
   public DataSource getDataSource() {
       DriverManagerDataSource dataSource = new DriverManagerDataSource();
       dataSource.setDriverClassName("oracle.jdbc.driver.OracleDriver");       //database class name, no need to change
       dataSource.setUrl("jdbc:oracle:thin:@localhost:1521:XE");       // driver url, no need to change
       dataSource.setUsername("CL");       // your database username
       dataSource.setPassword("CL");       // your database password

       Properties connectionProperties = new Properties();
       connectionProperties.setProperty("hibernate.hbm2ddl.auto", "update");
       connectionProperties.setProperty("hibernate.show_sql", "true");
       connectionProperties.setProperty("hibernate.dialect", "org.hibernate.dialect.Oracle11gDialect"); //Dialect for oracle, depending on the version of oracle you are using
       connectionProperties.setProperty("hibernate.format_sql", "true");
       connectionProperties.setProperty("hibernate.jdbc.use_get_generated_keys", "true");
       dataSource.setConnectionProperties(connectionProperties);
       return dataSource;
   }

   @Autowired
   @Bean(name = "sessionFactory")
   public SessionFactory getSessionFactory(DataSource dataSource) {

       LocalSessionFactoryBuilder sessionBuilder = new LocalSessionFactoryBuilder(dataSource);
       sessionBuilder.addProperties(getHibernateProperties());
       sessionBuilder.addAnnotatedClasses(UserDetails.class);   // class you are going to use
       return sessionBuilder.buildSessionFactory();
   }

   @Autowired
   @Bean(name = "transactionManager")
   public HibernateTransactionManager getTransactionManager(SessionFactory sessionFactory) {
       HibernateTransactionManager transactionManager = new HibernateTransactionManager(sessionFactory);

       return transactionManager;
   }
}


================================================
UserDetails class for setting and getting data


package com.niit.shoppingcart.model;

import java.io.Serializable;


import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.stereotype.Component;

@Entity
@Table
@Component
public class UserDetails implements Serializable {
   /**
   *
   */
   private static final long serialVersionUID = 1L;
   @Id
   @Length(min = 6, max = 15, message = "Id should contain 6-15 characters")
   private String id;
  
   @NotBlank(message = "Name field can not be blank")
   @Length(min = 5 , message = "Name contains atleast 5 character")
   private String username;
  
   @Email(message="Please provide a valid email address")
   private String mail;

   @NotBlank
   private String address;
  
   @Pattern(regexp="(^$|[0-9]{10})", message = "Please provide a valid phone no.")
   private String contact;
  
   @NotBlank(message="Please select a password")
   @Length(min=4, max=15, message="Password should be between 4 - 15 charactes")
   private String password;
  
   private String role="ROLE_USER";

   public String getRole() {
       return role;
   }
  
   public String getId() {
       return id;
   }
   public void setId(String id) {
       this.id = id;
   }

   public String getUsername() {
       return username;
   }

   public void setUsername(String username) {
       this.username = username;
   }

   public String getPassword() {
       return password;
   }
   public void setPassword(String password) {
       this.password = password;
   }
   public String getMail() {
       return mail;
   }
   public void setMail(String mail) {
       this.mail = mail;
   }
   public String getContact() {
       return contact;
   }
   public void setContact(String contact) {
       this.contact = contact;
   }
   public String getAddress() {
       return address;
   }
   public void setAddress(String address) {
       this.address = address;
   }
  
  
  

}
====================================================
UserDetailsDAO, depending on the methods you need

package com.niit.shoppingcart.dao;

import java.util.List;


import com.niit.shoppingcart.model.UserDetails;

public interface UserDetailsDAO {
   public boolean save(UserDetails userDetails);

   public boolean update(UserDetails userDetails);

   public boolean delete(UserDetails userDetails);

   public UserDetails get(String id);

   public boolean isValidUser(String id, String password);

   public UserDetails getByUser(String username);
  
   public List<UserDetails> list();
}
======================================================
Implementation class for userDetailsDAO

package com.niit.shoppingcart.dao;

import java.util.List;
import org.hibernate.HibernateException;
import org.hibernate.SessionFactory;
import org.hibernate.query.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.transaction.annotation.Transactional;

import com.niit.shoppingcart.model.Cart;
import com.niit.shoppingcart.model.UserDetails;
@Repository("userDetailsDAO")
@EnableTransactionManagement

public class UserDetailsDAOImpl implements UserDetailsDAO {
  
   @Autowired
   private SessionFactory sessionFactory;

   @Transactional
   public boolean save(UserDetails userDetails) {
      
       try {
           sessionFactory.getCurrentSession().save(userDetails);
           return true;
       } catch (HibernateException e) {
           // TODO Auto-generated catch block
           e.printStackTrace();
           return false;
       }
      
   }
   @Transactional
   public boolean update(UserDetails userDetails) {
       try {
           sessionFactory.getCurrentSession().update(userDetails);
           return true;
       } catch (HibernateException e) {
           // TODO Auto-generated catch block
           e.printStackTrace();
           return false;
       }
   }
   @Transactional
   public boolean delete(UserDetails userDetails) {
       try {
           sessionFactory.getCurrentSession().delete(userDetails);
           return true;
       } catch (HibernateException e) {
           // TODO Auto-generated catch block
           e.printStackTrace();
           return false;
       }
   }
   @Transactional
   public UserDetails get(String id) {
       String hql = " from UserDetails where id ="+"'"+id+"'";
       Query query = sessionFactory.getCurrentSession().createQuery(hql);
       List<UserDetails> list = query.list();
       if(list == null|| list.isEmpty())
       {
           return null;
       }
       else
       {
           return list.get(0);
       }
   }
  
   @Transactional
   public List<UserDetails> list() {
       String hql = "from UserDetails";
       Query query = sessionFactory.getCurrentSession().createQuery(hql);
       return query.list();
   }
  
   @Transactional
   public boolean isValidUser(String id, String password) {
      
       String hql="from UserDetails where id='"+id+"' and password='"+password+"'";
       Query query = sessionFactory.getCurrentSession().createQuery(hql);
       List<UserDetails> list=query.list();
       if(list!=null && !list.isEmpty()){
  
           return true;
       }
          
               return false;
          
       }

      
   @Transactional
   public UserDetails getByUser(String username) {
       String hql = " from UserDetails where username ="+"'"+username+"'";
       Query query = sessionFactory.getCurrentSession().createQuery(hql);
       List<UserDetails> list = query.list();
       if(list == null|| list.isEmpty())
       {
           return null;
       }
       else
       {
           return list.get(0);
       }
   }
  

}
====================================================================
Controller

package com.niit.shoppingcart;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import com.niit.shoppingcart.dao.UserDetailsDAO;
import com.niit.shoppingcart.model.UserDetails;

@Controller // this annotation is used to specify this class as controller
public class UserDetailsController {
   // when user clicked login based on the credentials i want to find whether
   // he is admin or not
   // if he is admin, he has to navigate to adminHomePage
   // if he is user, he has to navigate to home page
   // if user does not exist, display error message

   @Autowired
   UserDetailsDAO userDetailsDAO;

   @Autowired
   UserDetails userDetails;

   @RequestMapping(value="register", method=RequestMethod.POST)
   public ModelAndView registerUser(@ModelAttribute("userDetails") UserDetails userDetails,HttpSession session) {
      
       ModelAndView mv = new ModelAndView("/Home");


       if(userDetailsDAO.get(userDetails.getId())==null){
           userDetailsDAO.save(userDetails);
           mv.addObject("successRegister", "true");
           mv.addObject("SuccessMessage","YOU ARE SUCCESSFULLY REGISTER,PLEASE LOGIN WITH THIS CREDENTIALS");
       }
       else{
           mv.addObject("userExist", "true");
       mv.addObject("failureMessage","USER EXIST WITH THIS ID,PLEASE REGISTER WITH NEW USER ID");
       }
       return mv;
   }
  
   @RequestMapping("/Registration")
   public ModelAndView register(HttpSession session) {
       ModelAndView mv = new ModelAndView("/Home");
       mv.addObject("RegisterMsg", "REGISTER");
       mv.addObject("userDetails", userDetails);
       mv.addObject("userClickedRegisterHere", true);
       return mv;
   }

   @RequestMapping("/Login")
   public ModelAndView Login(HttpSession session) {
       ModelAndView m = new ModelAndView("/Home");
       m.addObject("LoginMsg", "LOGIN");
       m.addObject("userDetails", userDetails);
       m.addObject("userClickedLoginHere", true);
      
       return m;
   }

   @RequestMapping(value="login" , method=RequestMethod.POST)
   public ModelAndView login(@RequestParam(value = "id") String id,@RequestParam(value = "password") String password,HttpSession session) {
      
       ModelAndView mv = new ModelAndView("/Home");


       boolean isValidUser = userDetailsDAO.isValidUser(id, password);
      
       if (isValidUser == true) {
       userDetails=userDetailsDAO.get(id);
       session.setAttribute("loggedInUser", userDetails.getName());
       session.setAttribute("loggedInUserID", userDetails.getId());
       session.setAttribute("userDetails", userDetails);
      
           // find out whether the user is admin or not
           if (userDetails.getRole().equals("ROLE_ADMIN")) {
               mv.addObject("isAdmin", "true");
              
           }
          
           else{
               mv.addObject("isAdmin", "false");
               // he/she is normal user
          
           }
       }
       else{
          
               mv.addObject("InvalidCredentials", "true");
           mv.addObject("errorMessage", "INVALID CREDENTIALS,PLEASE LOGIN WITH VALID CREDENTIALS");
       }

       return mv;
       }
  

   @RequestMapping("/logout")
   public String logout(HttpServletRequest request, HttpSession session,Model model) {
       session.invalidate();
       session = request.getSession(true);
       model.addAttribute("logoutMsg", "LOGOUT SUCCESSFUL");
       model.addAttribute("loggedout", "true");
       model.addAttribute("carousel", true);
       return "/Home";

   }
}

================================================================
Home.html


<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<html>
<head>
<link rel="stylesheet"
   href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script
   src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>

<script
   src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
   <link rel="stylesheet" href="css/demo.css">
   <link rel="stylesheet" href="css/footer-distributed-with-address-and-phones.css">

   <link href="http://fonts.googleapis.com/css?family=Cookie" rel="stylesheet" type="text/css">
<title>fabGift</title>
<style>
h1 {
   vertical-align: baseline;
   font-weight: 900;
   font-size: 53px;
   font-family: serif;
   color:#000000 !important;
   text-align:center;
}
.carousel {
   background-color: 2f4357;
}
.container-fluid {
   background-color: #2f4357;
}
#myCarousel{
padding-bottom:100px;
}
#logo {
   color: #2f4357;
}
.btn-primary {
   color: #fff;
   background-color: #2f4357;
   border-color: #2e6da4;
}

footer{
   position: fixed;
   bottom: 0;
}
@media (max-height:800px){
   footer { position: static; }
   header { padding-top:40px; }
}
.footer-distributed{
   background-color: #292c2f;
   box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.12);
   box-sizing: border-box;
   width: 100%;
   text-align: left;
   font: bold 16px sans-serif;
   padding: 55px 50px;
   margin-top: 80px;
}
.footer-distributed .footer-left,
.footer-distributed .footer-center,
.footer-distributed .footer-right{
   display: inline-block;
   vertical-align: top;
}
/* Footer left */
.footer-distributed .footer-left{
   width: 40%;
}
/* The company logo */
.footer-distributed h3{
   color: #ffffff;
   font: normal 36px 'Cookie', cursive;
   margin: 0;
}
.footer-distributed h3 span{
   color: #5383d3;
}
/* Footer links */
.footer-distributed .footer-links{
   color: #ffffff;
   margin: 20px 0 12px;
   padding: 0;
}
.footer-distributed .footer-links a{
   display:inline-block;
   line-height: 1.8;
   text-decoration: none;
   color: inherit;
}
.footer-distributed .footer-company-name{
   color: #8f9296;
   font-size: 14px;
   font-weight: normal;
   margin: 0;
}
/* Footer Center */
.footer-distributed .footer-center{
   width: 35%;
}
.footer-distributed .footer-center i{
   background-color: #33383b;
   color: #ffffff;
   font-size: 25px;
   width: 38px;
   height: 38px;
   border-radius: 50%;
   text-align: center;
   line-height: 42px;
   margin: 10px 15px;
   vertical-align: middle;
}
.footer-distributed .footer-center i.fa-envelope{
   font-size: 17px;
   line-height: 38px;
}
.footer-distributed .footer-center p{
   display: inline-block;
   color: #ffffff;
   vertical-align: middle;
   margin:0;
}
.footer-distributed .footer-center p span{
   display:block;
   font-weight: normal;
   font-size:14px;
   line-height:2;
}
.footer-distributed .footer-center p a{
   color: #5383d3;
   text-decoration: none;;
}
/* Footer Right */
.footer-distributed .footer-right{
   width: 20%;
}
.footer-distributed .footer-company-about{
   line-height: 20px;
   color: #92999f;
   font-size: 13px;
   font-weight: normal;
   margin: 0;
}
.footer-distributed .footer-company-about span{
   display: block;
   color: #ffffff;
   font-size: 14px;
   font-weight: bold;
   margin-bottom: 20px;
}
.footer-distributed .footer-icons{
   margin-top: 25px;
}
.footer-distributed .footer-icons a{
   display: inline-block;
   width: 35px;
   height: 35px;
   cursor: pointer;
   background-color: #33383b;
   border-radius: 2px;
   font-size: 20px;
   color: #ffffff;
   text-align: center;
   line-height: 35px;
   margin-right: 3px;
   margin-bottom: 5px;
}
/* If you don't want the footer to be responsive, remove these media queries */
@media (max-width: 880px) {
   .footer-distributed{
       font: bold 14px sans-serif;
   }
   .footer-distributed .footer-left,
   .footer-distributed .footer-center,
   .footer-distributed .footer-right{
       display: block;
       width: 100%;
       margin-bottom: 40px;
       text-align: center;
   }
   .footer-distributed .footer-center i{
       margin-left: 0;
   }
</style>
</head>
<body>
   <div data-role="header" data-position="fixed">
       <h1><b>FabGift</b> </h1>
       <div>
           <c:choose>
               <c:when test="${not empty loggedInUser}">
                   <h4>
                       <em>Welcome ${loggedInUser}</em>
                   </h4>
               </c:when>
               <c:when test="${loggedout==true}">
                   <h4>
                       <em>${logoutMsg}</em>
                   </h4>
               </c:when>
           </c:choose>
       </div>
      
   <!--    ================================================================================================================== -->
       <!-- menu starts -->
       <nav class="navbar navbar-inverse ">
      
           <div class="container-fluid">
      
               <ul class="nav navbar-nav">
                   <li><a href="Home">Home</a></li>
               </ul>
               <ul class="nav navbar-nav navbar-right">
                   <li><a href="about">ABOUT US</a></li>
                   <c:choose>
                       <c:when test="${empty loggedInUser}">
                           <li><a href="Login">LOGIN</a></li>
                           <li><a href="Registration">REGISTER</a></li>
                       </c:when>
                   </c:choose>
               </ul>
           </div>
       </nav>
       <!-- menu ends-->
      
<div id="Registration">
       <c:if test="${userClickedRegisterHere==true}">
           <jsp:include page="Registration.jsp"></jsp:include>
       </c:if>
   </div>
   <div id="Login">
       <c:if test="${userClickedLoginHere==true}">
           <jsp:include page="Login.jsp"></jsp:include>
       </c:if>
   </div>
         
   <div>
       <c:if test="${InvalidCredentials==true}">
           <h4>
               <em>${errorMessage}</em>
           </h4>
       </c:if>
      
       <c:if test="${successRegister==true}">
       <h4>
               <em>${SuccessMessage}</em>
           </h4>
       </c:if>
      
       <c:if test="${userExist==true}">
       <h4>
               <em>${failureMessage}</em>
           </h4>
       </c:if>
      
   </div>
  

<jsp:include page="adminHome.jsp"></jsp:include>

the page would go to the next page where you could see the information admin have previlage for.

   <div id="admin">
       <c:if test="${isAdmin==false}">
           <jsp:include page="UserHome.jsp"></jsp:include>

the page would go to the next page where user could see the information user have previlage for.
       </c:if>
       </div>


=================================================================
Login.html

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<html>
<head>
<link rel="stylesheet"
   href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script
   src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script
   src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<title>Login</title>
<style>
.container {
   padding-top:100px;
padding-right: 270px;
padding-left: 270px;
}
.panel-default>.panel-heading {
background-color: #2f4357;
color:white !important;
text-align: center;
font-size: 30px;
}
.btn-primary {
color: #fff;
background-color: #2f4357;
border-color: #2e6da4;
</style>
</head>
<body>
   <div class=container>
   <form:form class="form-responsive" action="login" commandName="userDetails" method="post">
       <div class="panel panel-default" >
      
           <div class="panel-heading">
       <h3><span class="glyphicon glyphicon-lock"></span> LOGIN</h3>
           </div>
             
             
           <div class="panel-body">
          
                       <div>
                   <form:label path="id"><spring:message text="USER ID"></spring:message> </form:label>
                   <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
    <form:input path="id" class="form-control" required="true" placeholder="PLEASE ENTER YOUR USER ID" />
</div>
                   </div>
                   <div>
                   <form:label path="password"><spring:message text="PASSWORD"></spring:message></form:label>
                   <div class="input-group">
   <span class="input-group-addon"><i class="glyphicon glyphicon-eye-open"></i></span>
   <form:password path="password" class="form-control" placeholder="PLEASE ENTER YOUR PASSWORD" required="true" />
</div>
                       </div>
                      
                       </div>
                      
                       <div class="panel-footer">
                       <input type="submit" value="Login" class="btn btn-primary btn-block">
                       </div>
                      
                   </div>
                   </form:form>  
           </div>
  
</body>
</html>
============================================================================
Registration.html

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet"
   href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script
   src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script
   src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<title>Registration</title>
<style>
.container {
   padding-top:200px;
padding-right: 270px;
padding-left: 270px;
}
.panel-default>.panel-heading {
background-color: #2f4357;
color:white !important;
text-align: center;
font-size: 30px;
}
.btn-primary {
color: #fff;
background-color: #2f4357;
border-color: #2e6da4;
</style>
</head>
<body>
   <div class="container">
   <form:form action="register" method="post" commandName="userDetails">
      
       <div class="panel panel-default">
      
           <div class="panel-heading">  
           <h3><span class="glyphicon glyphicon-lock"></span> REGISTER</h3></div>
           <div class="panel-body">
                  
                     
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
    <form:input path="id" class="form-control" required="true" placeholder="USER ID" />
</div>
  
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
<form:input path="name" class="form-control" required="true" placeholder="USER NAME" />
</div>
  
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span>
   <form:input path="mail" class="form-control" required="true" placeholder="EMAIL" />
</div>
  
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-home"></i></span>
   <form:input path="address" class="form-control" required="true" placeholder="ADDRESS" />
</div>
  
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-earphone"></i></span>
   <form:input path="contact" class="form-control" required="true" placeholder="CONTACT" />
</div>
  
  
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-eye-open"></i></span>
   <form:password path="password" class="form-control" placeholder="PASSWORD" required="true" />
</div>
  
                      
              
                       </div>
                       <div class="panel-footer">
                       <input type="submit" value="Register" class="btn btn-primary btn-block">
                       </div>
                      
                   </div>
   </form:form>
</div>
</body>
</html>
============================================================================

<div id="admin"> <c:if test="${isAdmin==true}">

<jsp:include page="adminHome.jsp"></jsp:include>

the page would go to the next page where you could see the information admin have previlage for.

</c:if>