add,update,list.jsp源碼

來源:互聯網
上載者:User

標籤:ffffff   class   ddl   entity   lan   jsp   cat   pattern   inpu   

add:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><%@page import="entity.*,java.util.*,java.text.*"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><title>員工管理</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link rel="stylesheet" type="text/css" href="css/style.css" /></head><body> <div id="wrap"> <div id="top_content"> <div id="header"> <div id="rightheader"> <p> <% SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); %> <%=sdf.format(new Date())%><br /> </p> </div> <div id="topheader"> <h1 id="title"> <a href="#">Main</a> </h1> </div> <div id="navigation"></div> </div> <div id="content"> <p id="whereami"></p> <h1>添加員工</h1> <form action="add.do" method="post"> <table cellpadding="0" cellspacing="0" border="0" class="form_table"> <tr> <td valign="middle" align="right">姓名:</td> <td valign="middle" align="left"><input type="text" class="inputgri" name="name" /></td> </tr> <tr> <td valign="middle" align="right">薪資:</td> <td valign="middle" align="left"><input type="text" class="inputgri" name="salary" /></td> </tr> <tr> <td valign="middle" align="right">年齡:</td> <td valign="middle" align="left"><input type="text" class="inputgri" name="age" /></td> </tr> </table> <p> <input type="submit" class="button" value="提交" /> </p> </form> </div> </div> <div id="footer"> <div id="footer_bg">[email protected]</div> </div> </div></body></html>
update:<%@page import="dao.EmployeeDAO"%><%@ page language="java" contentType="text/html; charset=UTF-8"    pageEncoding="UTF-8"%><%@page import="entity.*,java.util.*,java.text.*"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><title>員工管理</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link rel="stylesheet" type="text/css" href="css/style.css" /></head><body>    <div id="wrap">        <div id="top_content">            <div id="header">                <div id="rightheader">                    <p>                        <%                            SimpleDateFormat sdf = new SimpleDateFormat();                        %>                        <%=sdf.format(new Date())%><br />                    </p>                </div>                <div id="topheader">                    <h1 id="title">                        <a href="#">Main</a>                    </h1>                </div>                <div id="navigation"></div>            </div>            <div id="content">                <p id="whereami"></p>                <h1>修改員工</h1>                <%                    Employee e = (Employee) request.getAttribute("e");                %>                <form action="modify.do" method="post">                    <table cellpadding="0" cellspacing="0" border="0"                        class="form_table">                        <tr>                            <td valign="middle" align="right">id:</td>                            <td valign="middle" align="left"><%=e.getId()%>></td>                        </tr>                        <tr>                            <td valign="middle" align="right">name:</td>                            <td valign="middle" align="left"><input type="text"                                class="inputgri" name="name" value="<%=e.getName()%>" /></td>                        </tr>                        <tr>                            <td valign="middle" align="right">salary:</td>                            <td valign="middle" align="left"><input type="text"                                class="inputgri" name="salary" value="<%=e.getSalary()%>" /></td>                        </tr>                        <tr>                            <td valign="middle" align="right">age:</td>                            <td valign="middle" align="left"><input type="text"                                class="inputgri" name="age" value="<%=e.getAge()%>" /></td>                        </tr>                    </table>                    <p>                        <input type="submit" class="button" value="提交" />                    </p>                    <input type="hidden" name="id" value="<%=e.getId()%>" />                </form>            </div>        </div>        <div id="footer">            <div id="footer_bg">[email protected]</div>        </div>    </div></body></html>list:
<%@page import="dao.EmployeeDAO"%><%@ page language="java" contentType="text/html; charset=UTF-8"    pageEncoding="UTF-8"%><%@page import="entity.*,java.util.*,java.text.*"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><title>員工管理</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link rel="stylesheet" type="text/css" href="css/style.css" /></head><body>    <div id="wrap">        <div id="top_content">            <div id="header">                <div id="rightheader">                    <p>                        <%                            SimpleDateFormat sdf = new SimpleDateFormat();                        %>                        <%=sdf.format(new Date())%>                        <br />                    </p>                </div>                <div id="topheader">                    <h1 id="title">                        <a href="#">main</a>                    </h1>                </div>                <div id="navigation"></div>            </div>            <div id="content">                <p id="whereami"></p>                <h1>歡迎</h1>                <table class="table">                    <tr class="table_header">                        <td>ID</td>                        <td>姓名</td>                        <td>薪資</td>                        <td>年齡</td>                        <td>操作</td>                    </tr>                    <%                        List<Employee> employees = (List<Employee>) request.getAttribute("employees");                        for (int i = 0; i < employees.size(); i++) {                            Employee e = employees.get(i);                    %>                    <tr class="row<%=i % 2 + 1%>>">                        <td><%=e.getId()%></td>                        <td><%=e.getName()%></td>                        <td><%=e.getSalary()%></td>                        <td><%=e.getAge()%></td>                        <td><a href="del.do?id=<%=e.getId()%>">刪除</a>&nbsp;<a                            href="load.do?id=<%=e.getId()%>">修改</a></td>                    </tr>                    <%                        }                    %>                </table>                <p>                    <input type="button" class="button" value="添加員工"                        onclick="location=‘addEmp.jsp‘" />                </p>            </div>        </div>        <div id="footer">            <div id="footer_bg">[email protected]</div>        </div>    </div></body></html>
web.xml:
<?xml version="1.0" encoding="UTF-8"?><web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" 
xsi:schemaLocation
="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> <servlet> <servlet-name>actionServlet</servlet-name> <servlet-class>web.ActionServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>actionServlet</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping></web-app>

add,update,list.jsp源碼

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.