编程知识 cdmana.com

Java Web Course Design - student information management system (JSP + servlet + MySQL)

JavaWeb curriculum design , adopt Jsp+Servlet+MySql Design implementation , Function is relatively simple , Users can log in and register to enter the management interface to manage student information , Class information , Course information, etc . Page query is realized , Add information 、 Modify the information 、 Delete the information 、 Select Delete and other functions , Here is the running interface :

 Insert picture description here

Related technology :

Servlet+JSP+Bootstrap+Jquery+MYSQL

Project directory :

Back end code part :
 Insert picture description here
Front page section :
 Insert picture description here
relevant jar package :
 Insert picture description here

Database table structure :
`create database StudentInfo;
use StudentInfo;
drop table if exists student;
drop table if exists user;
drop table if exists class;
drop table if exists course;

# User table 
create table user(
    id int auto_increment primary key,
    username nvarchar(20) null,
    password nvarchar(20) null,
    name nvarchar(20) null,
    gender nchar(10) null,
    age int null,
    classno nvarchar(20) null,
    phone nvarchar(11) unique null,
    email nvarchar(30) null
);

# Student list 
create table student(
    id int auto_increment primary key,
    name nvarchar(20) null,
    gender nvarchar(10) null,
    age int null,
    classno nvarchar(20) null,
    phone nvarchar(11) unique null,
    email nvarchar(30) null
);

# Class table 
create table class(
    id int auto_increment primary key,
    cno nvarchar(10) null,
    classname nvarchar(30) null,
    department nvarchar(30) null
);

# The curriculum 
create table course(
    id int auto_increment primary key,
    courseno nvarchar(20) null,
    coursename nvarchar(20) null,
    type nvarchar(8) null,
    period int null,
    credit double null
);` 

*   1
*   2
*   3
*   4
*   5
*   6
*   7
*   8
*   9
*   10
*   11
*   12
*   13
*   14
*   15
*   16
*   17
*   18
*   19
*   20
*   21
*   22
*   23
*   24
*   25
*   26
*   27
*   28
*   29
*   30
*   31
*   32
*   33
*   34
*   35
*   36
*   37
*   38
*   39
*   40
*   41
*   42
*   43
*   44
*   45
*   46
*   47
*   48

User information sheet :User
 Insert picture description here
Student information sheet :Student
 Insert picture description here
Class information table :Class
 Insert picture description here
Course information sheet :Course
 Insert picture description here

Function display :

The user login :
 Insert picture description here
User registration :
 Insert picture description here
Login successful :
 Insert picture description here
Click the user name in the upper left corner to complete your personal information :
 Insert picture description here

The information management part realizes pagination display , increase 、 Delete 、 Change 、 check 、 Batch deletion

Student information management :
 Insert picture description here
Class information management :
 Insert picture description here
Course management :
 Insert picture description here

Design steps

More code , Just show the more important parts :

1. Database connection implementation

The database connection part uses druid Database connection pool , First, configure the database connection pool :druid.properties

`driverClassName=com.mysql.cj.jdbc.Driver
url=jdbc:mysql://localhost:3306/mydb?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8
username=root
password=123456
initialSize=5
maxActive=10
maxWait=3000` 

*   1
*   2
*   3
*   4
*   5
*   6
*   7

Then write the database connection tool class :

`/**
 * JDBC Tool class   Use Durid Connection pool 
 */
public class JDBCUtils {

    private static DataSource ds ;
    static {
        try {
            //1. Load profile 
            Properties pro = new Properties();
            // Use ClassLoader Load profile , Get byte input stream 
            InputStream is = JDBCUtils.class.getClassLoader().getResourceAsStream("druid.properties");
            pro.load(is);

            //2. Initialize connection pool object 
            ds = DruidDataSourceFactory.createDataSource(pro);
        } catch (IOException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     *  Get connection pool object 
     */
    public static DataSource getDataSource(){
        return ds;
    }

    /**
     *  Get the connection Connection object 
     */
    public static Connection getConnection() throws SQLException {
        return  ds.getConnection();
    }
}` 

*   1
*   2
*   3
*   4
*   5
*   6
*   7
*   8
*   9
*   10
*   11
*   12
*   13
*   14
*   15
*   16
*   17
*   18
*   19
*   20
*   21
*   22
*   23
*   24
*   25
*   26
*   27
*   28
*   29
*   30
*   31
*   32
*   33
*   34
*   35
*   36
*   37

Here we use JdbcTemplate To connect data to operate the database :

`private JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());` 

*   1

2. Implement persistence layer (Dao)

Write the persistence interface :

`/**
 *  User operated DAO
 */
public interface UserDao {

}` 

*   1
*   2
*   3
*   4
*   5
*   6

Implement persistence layer interface :

`public class UserDaoImpl implements UserDao {

    private JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());

}` 

*   1
*   2
*   3
*   4
*   5

3. Implement the business layer (Service)

Write business layer interface :

`/**
 *  User management business interface 
 */
public interface UserService {

}` 

*   1
*   2
*   3
*   4
*   5
*   6

Implement business layer interface :

`public class UserServiceImpl implements UserService {
    private UserDao dao = new UserDaoImpl();

}` 

*   1
*   2
*   3
*   4

4. Realize the function of presentation layer

Write the presentation layer :

`@WebServlet("/loginServlet")
public class LoginServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
       /*
        * Code
        */
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request, response);
    }
}` 

*   1
*   2
*   3
*   4
*   5
*   6
*   7
*   8
*   9
*   10
*   11
*   12

5. Because of the presentation layer Servlet Too much , We can do simple extraction

To write BaseServlet class , And then by the other servlet Inherit

`public class BaseServlet extends HttpServlet {
    
    private static final long serialVersionUID = 1L;

    public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

       try {
           //  Get the request ID 
           String methodName = request.getParameter("method");
           //  Gets the bytecode object of the specified class 
           Class<? extends BaseServlet> clazz = this.getClass();// there this It means inheritance BaseServlet object 
           //  Get the bytecode object of the method through the bytecode object of the class 
           Method method = clazz.getMethod(methodName, HttpServletRequest.class, HttpServletResponse.class);
           //  Let the method execute 
           method.invoke(this, request, response);

       } catch (Exception e) {
           // TODO Auto-generated catch block
           e.printStackTrace();
       }
    }
}` 

*   1
*   2
*   3
*   4
*   5
*   6
*   7
*   8
*   9
*   10
*   11
*   12
*   13
*   14
*   15
*   16
*   17
*   18
*   19
*   20
*   21
*   22

5. Write the corresponding front page : With user_login.jsp For example
`<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html> 
<html lang="zh-CN">
  <head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <title> Administrator login </title>

    <!-- 1.  Import CSS The overall style of  -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <!-- 2. jQuery Import , It is recommended to use 1.9 Version above  -->
    <script src="js/jquery-2.1.0.min.js"></script>
    <!-- 3.  Import bootstrap Of js file  -->
    <script src="js/bootstrap.min.js"></script>
    <script type="text/javascript"> // Switch verification code 
        function refreshCode(){
            //1. Get captcha image object 
            var vcode=document.getElementById("vcode");
            //2. Set up src attribute , Time stamp 
            //2. Set up src attribute , Time stamp 
            vcode.src = "${pageContext.request.contextPath}/checkCodeServlet?time="+new Date().getTime();
        
        } </script>
  </head>
  <body>
      <div class="container" style="width: 400px;">
          <h3 style="text-align: center;"> Administrator login </h3>
        <form action="${pageContext.request.contextPath}/loginServlet" method="post">
          <div class="form-group">
            <label for="user"> user name :</label>
            <input type="text" name="username" class="form-control" id="user" placeholder=" Please enter a user name "/>
          </div>
          
          <div class="form-group">
            <label for="password"> password :</label>
            <input type="password" name="password" class="form-control" id="password" placeholder=" Please input a password "/>
          </div>
          
          <div class="form-inline">
            <label for="vcode"> Verification Code :</label>
            <input type="text" name="verifycode" class="form-control" id="verifycode" placeholder=" Please enter the verification code " style="width: 120px;"/>
            <a href="javascript:refreshCode();">
            <img src="${pageContext.request.contextPath}/checkCodeServlet" title=" Can't see clearly, click refresh " id="vcode"/>
            </a>
          </div>
          <hr/>
          <div class="form-group" style="text-align: center;">
            <input class="btn btn btn-primary" type="submit" value=" Sign in ">
           </div>
          </form>
        
        <!--  Error display information box  -->
          <div class="alert alert-warning alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert" >
              <span>&times;</span></button>
            <strong>${login_msg}</strong>
        </div>
      </div>
  </body>
</html>` 

*   1
*   2
*   3
*   4
*   5
*   6
*   7
*   8
*   9
*   10
*   11
*   12
*   13
*   14
*   15
*   16
*   17
*   18
*   19
*   20
*   21
*   22
*   23
*   24
*   25
*   26
*   27
*   28
*   29
*   30
*   31
*   32
*   33
*   34
*   35
*   36
*   37
*   38
*   39
*   40
*   41
*   42
*   43
*   44
*   45
*   46
*   47
*   48
*   49
*   50
*   51
*   52
*   53
*   54
*   55
*   56
*   57
*   58
*   59
*   60
*   61
*   62
*   63
*   64
*   65
*   66

Run a screenshot :
 Insert picture description here
Test the login function , Find the problem of Chinese garbled code ( Direct inheritance HttpServlet There will be no , Inherit BaseServlet There will be )

6. Write a filter to solve the problem of Chinese garbled
`@WebFilter("/*")
public class CharchaterFilter implements Filter {

    protected String encoding; 
    
    @Override
    public void destroy() {
        // TODO  Automatically generated method stubs 
        
    }

    @Override
    public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
        // TODO  Automatically generated method stubs 
        HttpServletRequest request=(HttpServletRequest)req;
        HttpServletResponse response=(HttpServletResponse)res;
        
        String method=request.getMethod();
        
        if(method.equalsIgnoreCase("post")){
            request.setCharacterEncoding("utf-8");
        }
        
        response.setContentType("text/html;charset=utf-8");
        
        chain.doFilter(request, response);
    }

    @Override
    public void init(FilterConfig arg0) throws ServletException {
        // TODO  Automatically generated method stubs 
        
    }

}` 

*   1
*   2
*   3
*   4
*   5
*   6
*   7
*   8
*   9
*   10
*   11
*   12
*   13
*   14
*   15
*   16
*   17
*   18
*   19
*   20
*   21
*   22
*   23
*   24
*   25
*   26
*   27
*   28
*   29
*   30
*   31
*   32
*   33
*   34
*   35

7. Write a list page , And implement the function of response on the back-end code
`<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
<head>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title> Website background management </title>
 
    <!-- Bootstrap -->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <!-- jQuery (Bootstrap  All of the  JavaScript  Plug ins all depend on  jQuery, So it has to be in the front ) -->
    <script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
    <!--  load  Bootstrap  All of the  JavaScript  plug-in unit . You can also load only a single plug-in as needed . -->
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <style type="text/css"> @media (min-width: 768px) {
           #slider_sub{
               width: 200px;
               margin-top: 51px;
               position: absolute;
               z-index: 1;
               height: 600px;
           }
            .mysearch{
                margin: 10px 0;
            }
            .page_main{
                margin-left: 205px;
            }
        } </style>
    <script> function deleteStudent(id){
            // User security tips 
            if(confirm(" Are you sure you want to delete ?")){
                // Access path 
                location.href="${pageContext.request.contextPath}/student?method=delStudent&id="+id;
            }
        }

        window.onload = function(){
            // Add click event to delete selected button 
            document.getElementById("delSelectedStudent").onclick = function(){
                if(confirm(" Are you sure you want to delete the selected entry ?")){

                   var flag = false;
                    // Determine whether there are selected items 
                    var cbs = document.getElementsByName("id");
                    for (var i = 0; i < cbs.length; i++) {
                        if(cbs[i].checked){
                            // There is an entry selected 
                            flag = true;
                            break;
                        }
                    }

                    if(flag){// There are items selected 
                        // Form submission 
                        document.getElementById("form").submit();
                    }

                }

            }
            //1. Get the first one cb
            document.getElementById("firstCb").onclick = function(){
                //2. Get all the... In the list below cb
                var cbs = document.getElementsByName("uid");
                //3. Traverse 
                for (var i = 0; i < cbs.length; i++) {
                    //4. Set these cbs[i] Of checked state  = firstCb.checked
                    cbs[i].checked = this.checked;

                }

            }

        } </script>
</head>
<body>
    <nav class="navbar navbar-default navbar-static-top">
        <div class="navbar-header">
            <!-- The zoom  -->
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#slider_sub">
                <span class="sr-only"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a href="#" class="navbar-brand"> Student information management </a>
        </div>
        <ul class="nav navbar-nav navbar-right" style="margin-right: 25px">
            <li><a href="${pageContext.request.contextPath}/user?method=findUser&id=${user.id}"><span class="badge" style="background: #C12E2A">${user.username}</span></a></li>
            <li><a href="${pageContext.request.contextPath}/user?method=destroyUser"><span class="glyphicon glyphicon-off"></span>&nbsp; Cancellation </a></li>
        
        </ul>
 
        <!--  Sidebar   -->
        <div class="navbar-default navbar-collapse" id="slider_sub">
            <ul class="nav">
                <li>

                    <form class="form-inline" action="${pageContext.request.contextPath}/student?method=findAll" method="post">
                        
                        <!-- Search for  -->
                        <div class="input-group mysearch">
                            <input type="text" name="name" value="${condition.name[0]}" class="form-control" id="exampleInputName2" >
                            <span class="input-group-btn">
                                <button type="submit" class="btn btn-default">
                                    <span class="glyphicon glyphicon-search"></span>
                                </button>
                            </span>
     
                        </div>
                    </form>

                    
                </li>
                <li><a href="${pageContext.request.contextPath}/index.jsp" class="collapse" data-toggle="collapse"> home page <span class="glyphicon glyphicon-chevron-right pull-right"></span></a>
                     <!-- <ul id="sub2" class="nav collapse">
                        <li><a href="#"><span class="glyphicon glyphicon-info-sign"></span>&nbsp; information management </a></li>
                        <li><a href="#"><span class="glyphicon glyphicon-user"></span>&nbsp; Student management </a></li>
                    </ul> -->
                </li>
                <li><a href="${pageContext.request.contextPath}/student?method=findAll"  class="collapse" data-toggle="collapse"> Student management <span class="glyphicon glyphicon-chevron-right pull-right"></span></a>
                    
                </li>
                <li><a href="${pageContext.request.contextPath}/classno?method=findAll"  class="collapse" data-toggle="collapse"> Class management <span class="glyphicon glyphicon-chevron-right pull-right"></span></a>
                    
                </li>
                <li><a href="${pageContext.request.contextPath}/course?method=findAll"  class="collapse" data-toggle="collapse"> Course management <span class="glyphicon glyphicon-chevron-right pull-right"></span></a>
                    
                </li>
                <li><a href="${pageContext.request.contextPath}/about.jsp"  class="collapse" data-toggle="collapse"> About us <span class="glyphicon glyphicon-chevron-right pull-right"></span></a>
                    
                </li>
            </ul>
        </div>
    </nav>
 
    <!--  The primary area  -->
    <div class="page_main" style="background: rgba(92,88,116,0.34)">
        <ol class="breadcrumb">
            <li><a href="#"> Management home page </a></li>
            <li><a href="#"> Student management </a></li>
            <li><a href="#"> Student information </a></li>
        </ol>
 
        <div class="row">
            <div class="col-md-12 col-sm-3">
                <div class="panel panel-default">
                    <!-- <div class="panel-header"> Student information </div> -->
                    
                    <div class="panel-body table-responsive">
                    
                
                    <div style="float: right;margin: 5px;">
                
                        <a class="btn btn-primary" href="${pageContext.request.contextPath}/student_add.jsp"> Add student </a>
                        <a class="btn btn-primary" href="javascript:void(0);" id="delSelectedStudent"> Delete selected </a>
                
                    </div>
                    
                    <form id="form" action="${pageContext.request.contextPath}/student?method=delSelectedStudent" method="post">
                        <table class="table table-striped table-hover" style="margin: 10px;">
                            <thead>
                                <tr>
                                    <th><input type="checkbox" id="firstCb"></th>
                                    <th> Number </th>
                                    <th> full name </th>
                                    <th> Gender </th>
                                    <th> Age </th>
                                    <th> class </th>
                                    <th> Telephone </th>
                                    <th> mailbox </th> 
                         
                                </tr>
                            </thead>
                            
                            <c:forEach items="${pb.list}" var="student" varStatus="s">
                                <tr>
                                    <td><input type="checkbox" name="id" value="${student.id}"></td>
                                    <td>${student.id}</td> 
                                    <td>${student.name}</td>
                                    <td>${student.gender}</td>
                                    <td>${student.age}</td>
                                    <td>${student.classno}</td>
                                    <td>${student.phone}</td>
                                    <td>${student.email}</td>
                                    <td><a class="btn btn-default btn-sm" href="${pageContext.request.contextPath}/student?method=findStudent&id=${student.id}"> modify </a>&nbsp;
                                        <a class="btn btn-default btn-sm" href="javascript:deleteStudent(${student.id});"> Delete </a></td>
                                </tr>

                            </c:forEach>
                            
                          
                        </table>
                        </form>
     
                        
                        
                        <nav aria-label="Page navigation" class="pull-right">
                            <ul class="pagination" style="margin-top: 10px;">
   
                                <c:if test="${pb.currentPage == 1}">
                                    <li class="disabled">
                                </c:if>
                
                                <c:if test="${pb.currentPage != 1}">
                                    <li>
                                </c:if>
                
                                    <a href="${pageContext.request.contextPath}/student?method=findAll&currentPage=${pb.currentPage - 1}&rows=5&name=${condition.name[0]}&address=${condition.address[0]}&email=${condition.email[0]}" aria-label="Previous">
                                        <span aria-hidden="true">&laquo;</span>
                                    </a>
                                    </li>
                
                                <c:forEach begin="1" end="${pb.totalPage}" var="i" >
                
                                    <c:if test="${pb.currentPage == i}">
                                        <li class="active"><a href="${pageContext.request.contextPath}/student?method=findAll&currentPage=${i}&rows=5&name=${condition.name[0]}&address=${condition.address[0]}&email=${condition.email[0]}">${i}</a></li>
                                    </c:if>
                                    <c:if test="${pb.currentPage != i}">
                                        <li><a href="${pageContext.request.contextPath}/student?method=findAll&currentPage=${i}&rows=5&name=${condition.name[0]}&address=${condition.address[0]}&email=${condition.email[0]}">${i}</a></li>
                                    </c:if>
                
                                </c:forEach>
                
                                <li>
                                    <a href="${pageContext.request.contextPath}/student?method=findAll&currentPage=${pb.currentPage + 1}&rows=5&name=${condition.name[0]}&address=${condition.address[0]}&email=${condition.email[0]}" aria-label="Next">
                                        <span aria-hidden="true">&raquo;</span>
                                    </a>
                                </li>
                                <span style="font-size: 25px;margin-left: 5px;">
                                         common ${pb.totalCount} Bar record , common ${pb.totalPage} page 
                                </span>
                            </ul>
                        </nav>
                    </div>
                </div>
            </div>
 
        </div>
    </div>

</body>
</html>` 

*   1
*   2
*   3
*   4
*   5
*   6
*   7
*   8
*   9
*   10
*   11
*   12
*   13
*   14
*   15
*   16
*   17
*   18
*   19
*   20
*   21
*   22
*   23
*   24
*   25
*   26
*   27
*   28
*   29
*   30
*   31
*   32
*   33
*   34
*   35
*   36
*   37
*   38
*   39
*   40
*   41
*   42
*   43
*   44
*   45
*   46
*   47
*   48
*   49
*   50
*   51
*   52
*   53
*   54
*   55
*   56
*   57
*   58
*   59
*   60
*   61
*   62
*   63
*   64
*   65
*   66
*   67
*   68
*   69
*   70
*   71
*   72
*   73
*   74
*   75
*   76
*   77
*   78
*   79
*   80
*   81
*   82
*   83
*   84
*   85
*   86
*   87
*   88
*   89
*   90
*   91
*   92
*   93
*   94
*   95
*   96
*   97
*   98
*   99
*   100
*   101
*   102
*   103
*   104
*   105
*   106
*   107
*   108
*   109
*   110
*   111
*   112
*   113
*   114
*   115
*   116
*   117
*   118
*   119
*   120
*   121
*   122
*   123
*   124
*   125
*   126
*   127
*   128
*   129
*   130
*   131
*   132
*   133
*   134
*   135
*   136
*   137
*   138
*   139
*   140
*   141
*   142
*   143
*   144
*   145
*   146
*   147
*   148
*   149
*   150
*   151
*   152
*   153
*   154
*   155
*   156
*   157
*   158
*   159
*   160
*   161
*   162
*   163
*   164
*   165
*   166
*   167
*   168
*   169
*   170
*   171
*   172
*   173
*   174
*   175
*   176
*   177
*   178
*   179
*   180
*   181
*   182
*   183
*   184
*   185
*   186
*   187
*   188
*   189
*   190
*   191
*   192
*   193
*   194
*   195
*   196
*   197
*   198
*   199
*   200
*   201
*   202
*   203
*   204
*   205
*   206
*   207
*   208
*   209
*   210
*   211
*   212
*   213
*   214
*   215
*   216
*   217
*   218
*   219
*   220
*   221
*   222
*   223
*   224
*   225
*   226
*   227
*   228
*   229
*   230
*   231
*   232
*   233
*   234
*   235
*   236
*   237
*   238
*   239
*   240
*   241
*   242
*   243
*   244
*   245
*   246
*   247
*   248
*   249
*   250
*   251
*   252

 Insert picture description here

8. Realize the function of deleting and modifying different information , And further improve
`<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!--  The language of the web page  -->
<html lang="zh-CN">
    <head>
        <!--  Specify character set  -->
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title> Modify student information </title>

        <link href="css/bootstrap.min.css" rel="stylesheet">
        <script src="js/jquery-2.1.0.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        
    </head>
    <body>
        <div class="container" style="width: 400px;">
        <h3 style="text-align: center;"> Modify student information </h3>
        <form action="${pageContext.request.contextPath}/student?method=updateStudent" method="post">
            <!--   Hidden fields   Submit id-->
            <input type="hidden" name="id" value="${student.id}">

          <div class="form-group">
            <label for="name"> full name :</label>
            <input type="text" class="form-control" id="name" name="name"  value="${student.name}" readonly="readonly" placeholder=" Please enter a name " />
          </div>

          <div class="form-group">
            <label> Gender :</label>
              <c:if test="${student.gender == ' male '}">
                  <input type="radio" name="gender" value=" male " checked /> male 
                  <input type="radio" name="gender" value=" Woman "  /> Woman 
              </c:if>

              <c:if test="${student.gender == ' Woman '}">
                  <input type="radio" name="gender" value=" male "  /> male 
                  <input type="radio" name="gender" value=" Woman " checked  /> Woman 
              </c:if>

          </div>

          <div class="form-group">
            <label for="age"> Age :</label>
            <input type="text" class="form-control" value="${student.age}" id="age"  name="age" placeholder=" Please enter age " />
          </div>

          <div class="form-group">
            <label for="classno"> class :</label>
            
            <input type="text" id="classno" class="form-control" value="${student.classno}" name="classno" placeholder=" Please input class information "/>
          
          </div>

          <div class="form-group">
            <label for="phone"> Telephone </label>
            <input type="text" id="phone" class="form-control" value="${student.phone}" name="phone" placeholder=" Please enter the phone number "/>
          </div>

          <div class="form-group">
            <label for="email">Email:</label>
            <input type="text" id="email" class="form-control" value="${student.email}" name="email" placeholder=" Please enter email address "/>
          </div>

             <div class="form-group" style="text-align: center">
                <input class="btn btn-primary" type="submit" value=" Submit " />
                <input class="btn btn-default" type="reset" value=" Reset " />
             </div>
        </form>
        </div>
    </body>
</html>` 

*   1
*   2
*   3
*   4
*   5
*   6
*   7
*   8
*   9
*   10
*   11
*   12
*   13
*   14
*   15
*   16
*   17
*   18
*   19
*   20
*   21
*   22
*   23
*   24
*   25
*   26
*   27
*   28
*   29
*   30
*   31
*   32
*   33
*   34
*   35
*   36
*   37
*   38
*   39
*   40
*   41
*   42
*   43
*   44
*   45
*   46
*   47
*   48
*   49
*   50
*   51
*   52
*   53
*   54
*   55
*   56
*   57
*   58
*   59
*   60
*   61
*   62
*   63
*   64
*   65
*   66
*   67
*   68
*   69
*   70
*   71
*   72
*   73

版权声明
本文为[The city]所创,转载请带上原文链接,感谢
https://cdmana.com/2020/12/20201225140025289k.html

Scroll to Top