package www.test.utils; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; public class HibernateUtils { private static SessionFactory sf; static{ // 1 建立,調用空參構造 Configuration conf = new Configuration().configure(); // 2 根據配置信息,建立 SessionFactory對象 sf = conf.buildSessionFactory(); } // 得到session==>得到全新的session public static Session openSession() { // 3 得到session Session session = sf.openSession(); return session; } // 得到session==>得到與線程綁定的session public static Session getCurrentSession() { // 3 得到session Session session = sf.getCurrentSession(); return session; } /*public static void main(String[] args) { System.out.println(HibernateUtils.openSession()); }*/ }
package www.test.utils; import org.dom4j.Document; import org.dom4j.Element; import org.dom4j.io.SAXReader; @SuppressWarnings("all") public class BeanFactory { public static Object getBean(String id){ //生成對象--根據清單生產--配置文件--將每個bean對象的生產細節配置到配置文件中 //使用dom4j的xml解析技術 導入兩個jar包 // dom4j-1.6.1.jar 和 jaxen-1.1-beta-6.jar try { // 1 建立解析器 SAXReader reader = new SAXReader(); // 2 解析文檔--bean.xml 在src下面 String path = BeanFactory.class.getClassLoader().getResource("bean.xml").getPath(); //讀取 Document doc = reader.read(path); // 3 得到元素--參數是xpath規則 Element element = (Element) doc.selectSingleNode("//bean[@id='"+id+"']"); //<bean id="adminService" class="www.test.service.impl.AdminServiceImpl"></bean> String className = element.attributeValue("class"); //www.test.service.impl.AdminServiceImpl //使用反射建立對象 Class clazz = Class.forName(className); Object object = clazz.getDeclaredConstructor().newInstance(); return object; } catch (Exception e) { e.printStackTrace(); } return null; } }
package www.test.domain; public class Customer { /* * CREATE TABLE `cst_customer` ( `cust_id` BIGINT(32) NOT NULL AUTO_INCREMENT COMMENT '客戶編號(主鍵)', `cust_name` VARCHAR(32) NOT NULL COMMENT '客戶名稱(公司名稱)', `cust_source` VARCHAR(32) DEFAULT NULL COMMENT '客戶信息來源', `cust_industry` VARCHAR(32) DEFAULT NULL COMMENT '客戶所屬行業', `cust_level` VARCHAR(32) DEFAULT NULL COMMENT '客戶級別', `cust_linkman` VARCHAR(64) DEFAULT NULL COMMENT '聯繫人', `cust_phone` VARCHAR(64) DEFAULT NULL COMMENT '固定電話', `cust_mobile` VARCHAR(16) DEFAULT NULL COMMENT '移動電話', PRIMARY KEY (`cust_id`) ) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; */ private Long cust_id; private String cust_name; private String cust_source; private String cust_industry; private String cust_level; private String cust_linkman; private String cust_phone; private String cust_mobile; public Long getCust_id() { return cust_id; } public void setCust_id(Long cust_id) { this.cust_id = cust_id; } public String getCust_name() { return cust_name; } public void setCust_name(String cust_name) { this.cust_name = cust_name; } public String getCust_source() { return cust_source; } public void setCust_source(String cust_source) { this.cust_source = cust_source; } public String getCust_industry() { return cust_industry; } public void setCust_industry(String cust_industry) { this.cust_industry = cust_industry; } public String getCust_level() { return cust_level; } public void setCust_level(String cust_level) { this.cust_level = cust_level; } public String getCust_linkman() { return cust_linkman; } public void setCust_linkman(String cust_linkman) { this.cust_linkman = cust_linkman; } public String getCust_phone() { return cust_phone; } public void setCust_phone(String cust_phone) { this.cust_phone = cust_phone; } public String getCust_mobile() { return cust_mobile; } public void setCust_mobile(String cust_mobile) { this.cust_mobile = cust_mobile; } @Override public String toString() { return "Customer [cust_id=" + cust_id + ", cust_name=" + cust_name + "]"; } }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> <!-- 配置表與實體的關係 --> <!-- package屬性:填寫一個包名。在元素內部凡是須要書寫完整類名得屬性,能夠直接寫簡單類名就能夠了 --> <hibernate-mapping package="www.test.domain"> <!--Class元素:配置實體與表得對應關係得 name:完整類名 table:數據庫表名 --> <class name="Customer" table="cst_customer"> <!--id:配置主鍵映射得屬性 name:填寫主鍵對應得屬性名 column:填寫表中得主鍵得列名 默認值:列名會默認使用屬性名 type:填寫列(屬性)得類型。hibernate會自動檢測實體的屬性類型 每一個類型有三種寫法:分別是java類型 | hibernate類型 | 數據庫類型 java類型: <property name="cust_name" column="cust_name" type="java.lang.String"></property> hibernate類型: <property name="cust_name" column="cust_name" type="string"></property> 數據庫類型: <property name="cust_name" column="cust_name" > <column name="cust_name" sql-type="varchar"></column> </property> 注意:不建議指定,自動檢測實體屬性類型就能夠。 not-null(可選):配置該屬性(列)是否不能爲空,默認值false默承認覺得空 <property name="cust_name" column="cust_name" not-null="true"></property> length(可選):配置數據庫中列的長度。 默認值:使用數據庫類型的最大長度 varchar默認最大長度255。 --> <id name="cust_id" column="cust_id" > <!-- generator:主鍵生成得策略(後面講) --> <generator class="native"></generator> </id> <!-- property:配置除了id以外得普通屬性映射 name:填寫屬性名 column(可選):填寫屬性對應得列名 默認值:列名會默認使用屬性名 type:填寫列(屬性)得類型。hibernate會自動檢測實體的屬性類型 每一個類型有三種寫法:分別是java類型 | hibernate類型 | 數據庫類型 java類型: <property name="cust_name" column="cust_name" type="java.lang.String"></property> hibernate類型: <property name="cust_name" column="cust_name" type="string"></property> 數據庫類型: <property name="cust_name" column="cust_name" > <column name="cust_name" sql-type="varchar"></column> </property> 注意:不建議指定,自動檢測實體屬性類型就能夠。 not-null(可選):配置該屬性(列)是否不能爲空,默認值false默承認覺得空 <property name="cust_name" column="cust_name" not-null="true"></property> length(可選):配置數據庫中列的長度。 默認值:使用數據庫類型的最大長度 varchar默認最大長度255。 --> <property name="cust_name" column="cust_name"></property> <property name="cust_source" column="cust_source"></property> <property name="cust_industry" column="cust_industry"></property> <property name="cust_level" column="cust_level"></property> <property name="cust_linkman" column="cust_linkman"></property> <property name="cust_phone" column="cust_phone"></property> <property name="cust_mobile" column="cust_mobile"></property> </class> </hibernate-mapping>
package www.test.web.servlet; import java.io.IOException; import java.lang.reflect.Method; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @SuppressWarnings("all") public class BaseServlet extends HttpServlet { @Override protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { //解決亂碼問題 resp.setContentType("text/html;charset=UTF-8"); try { // 1 得到請求的method方法 String methodName = req.getParameter("method"); // 2得到當前被訪問的對象的字節碼對象 Class clazz = this.getClass(); //ProductServlet.class --- UserServlet.class // 3 獲取當前字節碼對象中指定的方法 Method method = clazz.getMethod(methodName,HttpServletRequest.class,HttpServletResponse.class); // 4 執行相應的方法 method.invoke(this,req,resp); } catch (Exception e) { e.printStackTrace(); } } }
package www.test.web.servlet; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.beanutils.BeanUtils; import www.test.domain.Customer; import www.test.service.CustomerService; import www.test.utils.BeanFactory; @SuppressWarnings("all") public class CustomerServlet extends BaseServlet { private CustomerService customerService =(CustomerService) BeanFactory.getBean("customerService"); // 1 新增用戶addCustomer public void addCustomer(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //解決亂碼問題經過GenericEncodingFilter // 1 得到參數並封裝到Customer對象 Customer customer = new Customer(); try { BeanUtils.populate(customer, request.getParameterMap()); } catch (IllegalAccessException | InvocationTargetException e) { e.printStackTrace(); } //2 調用Service保存客戶 customerService.save(customer); // 3 重定向到客戶列表 response.sendRedirect(request.getContextPath()+"/ListCustomerServlet"); } }
package www.test.web.filter; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.Map; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; /** * 通用編碼解決方案 * */ public class GenericEncodingFilter implements Filter { @Override public void destroy() { } @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { // 轉型爲與協議相關對象 HttpServletRequest httpServletRequest = (HttpServletRequest) request; // 對request包裝加強 HttpServletRequest myrequest = new MyRequest(httpServletRequest); chain.doFilter(myrequest, response); } @Override public void init(FilterConfig filterConfig) throws ServletException { } } // 自定義request對象 class MyRequest extends HttpServletRequestWrapper { private HttpServletRequest request; private boolean hasEncode; public MyRequest(HttpServletRequest request) { super(request);// super必須寫 this.request = request; } // 對須要加強方法 進行覆蓋 @Override public Map getParameterMap() { // 先得到請求方式 String method = request.getMethod(); if (method.equalsIgnoreCase("post")) { // post請求 try { // 處理post亂碼 request.setCharacterEncoding("utf-8"); return request.getParameterMap(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } } else if (method.equalsIgnoreCase("get")) { // get請求 Map<String, String[]> parameterMap = request.getParameterMap(); if (!hasEncode) { // 確保get手動編碼邏輯只運行一次 for (String parameterName : parameterMap.keySet()) { String[] values = parameterMap.get(parameterName); if (values != null) { for (int i = 0; i < values.length; i++) { try { // 處理get亂碼 values[i] = new String(values[i].getBytes("ISO-8859-1"), "utf-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } } } } hasEncode = true; } return parameterMap; } return super.getParameterMap(); } @Override public String getParameter(String name) { Map<String, String[]> parameterMap = getParameterMap(); String[] values = parameterMap.get(name); if (values == null) { return null; } return values[0]; // 取回參數的第一個值 } @Override public String[] getParameterValues(String name) { Map<String, String[]> parameterMap = getParameterMap(); String[] values = parameterMap.get(name); return values; } }
package www.test.service; import www.test.domain.Customer; public interface CustomerService { //保存客戶 void save(Customer customer); }
package www.test.service.impl; import www.test.dao.CustomerDao; import www.test.domain.Customer; import www.test.service.CustomerService; import www.test.utils.BeanFactory; public class CustomerServiceImpl implements CustomerService { private CustomerDao customerDao = (CustomerDao) BeanFactory.getBean("customerDao"); @Override public void save(Customer customer) { //調用Dao保存客戶 customerDao .save(customer); } }
package www.test.dao; import www.test.domain.Customer; public interface CustomerDao { //保存客戶 void save(Customer customer); }
package www.test.dao.impl; import org.hibernate.Session; import org.hibernate.Transaction; import www.test.dao.CustomerDao; import www.test.domain.Customer; import www.test.utils.HibernateUtils; public class CustomerDaoImpl implements CustomerDao { @Override //保存客戶 public void save(Customer customer) { // 1 得到session Session session = HibernateUtils.openSession(); // 2 打開事務 Transaction transaction = session.beginTransaction(); // 3執行保存 session.save(customer); // 4提交事務 transaction.commit(); // 5關閉資源 session.close(); } }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <!-- #hibernate.dialect org.hibernate.dialect.MySQLDialect #hibernate.dialect org.hibernate.dialect.MySQLInnoDBDialect #hibernate.dialect org.hibernate.dialect.MySQLMyISAMDialect #hibernate.connection.driver_class com.mysql.jdbc.Driver #hibernate.connection.url jdbc:mysql:///test #hibernate.connection.username gavin #hibernate.connection.password --> <!-- 數據庫驅動 --> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <!-- 數據庫的url --> <property name="hibernate.connection.url">jdbc:mysql:///hibernate</property> <!-- /// 表示鏈接本機 --> <!-- 數據庫鏈接的用戶名 --> <property name="hibernate.connection.username">root</property> <!-- 數據庫鏈接密碼 --> <property name="hibernate.connection.password">root</property> <!-- 數據庫方言 不一樣的數據庫中,sql語法略有區別,指定方言可讓hibernate框架生成sql語句時。針對數據庫方言生成。 sql99標準:DDL 定義語言 庫表的增刪改查 DML 控制語言 事務權限 DCL 操做語言 針對增刪改查 注意事項:MySQL在選擇方言時候,請選擇最短的方言。 org.hibernate.dialect.MySQLDialect --> <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> <!-- #hibernate.show_sql true //打印生成的sql #hibernate.format_sql true //格式化sql 若是不格式都會在一行 --> <!--將hibernate生成的sql語言打印到控制檯 --> <property name="hibernate.show_sql">true</property> <!--將hibernate生成的sql語句格式化(語法縮進) --> <property name="hibernate.format_sql">true</property> <!-- ## auto schema export 自動導出表結構 。 自動建表 #hibernate.hbm2ddl.auto create-drop 自動建表。每次框架運行結束都會將全部的表刪除。(開發環境中測試使用) #hibernate.hbm2ddl.auto create 自動建表。每次框架的運行都會自動建立新的表。之前表將會被覆蓋,表數據會丟失,(開發環境中測試使用) #hibernate.hbm2ddl.auto update(推薦使用) 自動生成表。若是已經存在不會再生成。若是表有變更。自動更新表(不會刪除任何數據) #hibernate.hbm2ddl.auto validate 校驗。不自動生成表。每次啓動會校驗數據庫中表是否正確。校驗失敗 --> <property name="hibernate.hbm2ddl.auto">update</property> <!-- 引入orm元數據 路徑書寫:填寫src下的路徑 --> <mapping resource="www/test/domain/Customer.hbm.xml"/> </session-factory> </hibernate-configuration>
<?xml version="1.0" encoding="UTF-8"?> <beans> <!-- 配置CustomerServiceImpl的清單 --> <bean id="customerService" class="www.test.service.impl.CustomerServiceImpl"></bean> <!-- 配置CustomerDaoImpl的清單 --> <bean id="customerDao" class="www.test.dao.impl.CustomerDaoImpl"></bean> </beans>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <!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 href="${pageContext.request.contextPath }/css/Style.css" type=text/css rel=stylesheet> <LINK href="${pageContext.request.contextPath }/css/Manage.css" type=text/css rel=stylesheet> <META content="MSHTML 6.00.2900.3492" name=GENERATOR> </HEAD> <BODY> <FORM id=form1 name=form1 action="${pageContext.request.contextPath }/customer" method="post"> <input type="hidden" name="method" value="addCustomer"> <TABLE cellSpacing=0 cellPadding=0 width="98%" border=0> <TBODY> <TR> <TD width=15><IMG src="${pageContext.request.contextPath }/images/new_019.jpg" border=0></TD> <TD width="100%" background="${pageContext.request.contextPath }/images/new_020.jpg" height=20></TD> <TD width=15><IMG src="${pageContext.request.contextPath }/images/new_021.jpg" border=0></TD> </TR> </TBODY> </TABLE> <TABLE cellSpacing=0 cellPadding=0 width="98%" border=0> <TBODY> <TR> <TD width=15 background=${pageContext.request.contextPath }/images/new_022.jpg><IMG src="${pageContext.request.contextPath }/images/new_022.jpg" border=0></TD> <TD vAlign=top width="100%" bgColor=#ffffff> <TABLE cellSpacing=0 cellPadding=5 width="100%" border=0> <TR> <TD class=manageHead>當前位置:客戶管理 > 添加客戶</TD> </TR> <TR> <TD height=2></TD> </TR> </TABLE> <TABLE cellSpacing=0 cellPadding=5 border=0> <TR> <td>客戶名稱:</td> <td> <INPUT class=textbox id=sChannel2 style="WIDTH: 180px" maxLength=50 name="cust_name"> </td> <td>客戶級別 :</td> <td> <INPUT class=textbox id=sChannel2 style="WIDTH: 180px" maxLength=50 name="cust_level"> </td> </TR> <TR> <td>信息來源 :</td> <td> <INPUT class=textbox id=sChannel2 style="WIDTH: 180px" maxLength=50 name="cust_source"> </td> <td>聯繫人:</td> <td> <INPUT class=textbox id=sChannel2 style="WIDTH: 180px" maxLength=50 name="cust_linkman"> </td> </TR> <TR> <td>固定電話 :</td> <td> <INPUT class=textbox id=sChannel2 style="WIDTH: 180px" maxLength=50 name="cust_phone"> </td> <td>移動電話 :</td> <td> <INPUT class=textbox id=sChannel2 style="WIDTH: 180px" maxLength=50 name="cust_mobile"> </td> </TR> <tr> <td rowspan=2> <INPUT class=button id=sButton2 type=submit value=" 保存 " name=sButton2> </td> </tr> </TABLE> </TD> <TD width=15 background="${pageContext.request.contextPath }/images/new_023.jpg"> <IMG src="${pageContext.request.contextPath }/images/new_023.jpg" border=0></TD> </TR> </TBODY> </TABLE> <TABLE cellSpacing=0 cellPadding=0 width="98%" border=0> <TBODY> <TR> <TD width=15><IMG src="${pageContext.request.contextPath }/images/new_024.jpg" border=0></TD> <TD align=middle width="100%" background="${pageContext.request.contextPath }/images/new_025.jpg" height=15></TD> <TD width=15><IMG src="${pageContext.request.contextPath }/images/new_026.jpg" border=0></TD> </TR> </TBODY> </TABLE> </FORM> </BODY> </HTML>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"> <HTML xmlns="http://www.w3.org/1999/xhtml"> <HEAD id=Head1> <TITLE>導航</TITLE> <META http-equiv=Content-Type content="text/html; charset=utf-8"> <STYLE type=text/css> BODY { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; BACKGROUND-COLOR: #2a8dc8 } BODY { FONT-SIZE: 11px; COLOR: #003366; FONT-FAMILY: Verdana } TD { FONT-SIZE: 11px; COLOR: #003366; FONT-FAMILY: Verdana } DIV { FONT-SIZE: 11px; COLOR: #003366; FONT-FAMILY: Verdana } P { FONT-SIZE: 11px; COLOR: #003366; FONT-FAMILY: Verdana } .mainMenu { FONT-WEIGHT: bold; FONT-SIZE: 14px; cursor: pointer; COLOR: #000000 } A.style2:link { PADDING-LEFT: 4px; COLOR: #0055bb; TEXT-DECORATION: none } A.style2:visited { PADDING-LEFT: 4px; COLOR: #0055bb; TEXT-DECORATION: none } A.style2:hover { PADDING-LEFT: 4px; COLOR: #ff0000; TEXT-DECORATION: none } A.active { PADDING-LEFT: 4px; COLOR: #ff0000; TEXT-DECORATION: none } .span { COLOR: #ff0000; } </STYLE> <SCRIPT language=javascript> function MenuDisplay(obj_id) { for (var i = 1; i <= 9; i++) { var obj = document.getElementById('table_' + i); if(obj){ document.getElementById('table_' + i).style.display = 'none'; document.getElementById('table_' + i + 'Span').innerText = '+'; } } var obj = document.getElementById(obj_id); if(obj){ if (obj.style.display == 'none') { obj.style.display = 'block'; document.getElementById(obj_id + 'Span').innerText = '-'; } else { obj.style.display = 'none'; document.getElementById(obj_id + 'Span').innerText = '+'; } } } </SCRIPT> <META content="MSHTML 6.00.2900.3492" name=GENERATOR> </HEAD> <BODY> <FORM id=form1 name=form1 action=YHMenu.aspx method=post> <TABLE cellSpacing=0 cellPadding=0 width=210 align=center border=0> <TBODY> <TR> <TD width=15><IMG src="images/new_005.jpg" border=0></TD> <TD align=middle width=180 background=images/new_006.jpg height=35><B>人力資源 -功能菜單</B></TD> <TD width=15><IMG src="images/new_007.jpg" border=0></TD> </TR> </TBODY> </TABLE> <TABLE cellSpacing=0 cellPadding=0 width=210 align=center border=0> <TBODY> <TR> <TD width=15 background=images/new_008.jpg></TD> <TD vAlign=top width=180 bgColor=#ffffff> <TABLE cellSpacing=0 cellPadding=3 width=165 align=center border=0> <TBODY> <TR> <TD class=mainMenu onClick="MenuDisplay('table_1');"><SPAN class=span id=table_1Span>+</SPAN> 客戶管理</TD> </TR> <TR> <TD> <TABLE id=table_1 style="DISPLAY: none" cellSpacing=0 cellPadding=2 width=155 align=center border=0> <TBODY> <TR> <TD class=menuSmall><A class=style2 href="${pageContext.request.contextPath }/jsp/customer/add.jsp" target=main>- 新增客戶</A></TD> </TR> <TR> <TD class=menuSmall><A class=style2 href="customerServlet?method=list" target=main>- 客戶列表</A></TD> </TR> </TBODY> </TABLE> </TD> </TR> <TR> <TD background=images/new_027.jpg height=1></TD> </TR> <TR> <TD class=mainMenu onClick="MenuDisplay('table_2');"><SPAN class=span id=table_2Span>+</SPAN> 聯繫人管理</TD> </TR> <TR> <TD> <TABLE id=table_2 style="DISPLAY: none" cellSpacing=0 cellPadding=2 width=155 align=center border=0> <TBODY> <TR> <TD class=menuSmall><A class=style2 href="linkmanServlet?method=add" target=main>- 新增聯繫人</A></TD> </TR> <TR> <TD class=menuSmall><A class=style2 href="linkmanServlet?method=list" target=main>-聯繫人列表</A></TD> </TR> </TBODY> </TABLE> </TD> </TR> <TR> <TD background=images/new_027.jpg height=1></TD> </TR> <TR> <TD class=mainMenu onClick="MenuDisplay('table_5');"><SPAN class=span id=table_5Span>+</SPAN> 客戶拜訪管理</TD> </TR> <TR> <TD> <TABLE id=table_5 style="DISPLAY: none" cellSpacing=0 cellPadding=2 width=155 align=center border=0> <TBODY> <TR> <TD class=menuSmall><A class=style2 href="#" target=main>-新增客戶拜訪</A></TD> </TR> <TR> <TD class=menuSmall><A class=style2 href="#" target=main>-客戶拜訪列表</A></TD> </TR> </TBODY> </TABLE> </TD> </TR> <TR> <TD background=images/new_027.jpg height=1></TD> </TR> <TR> <TD class=mainMenu onClick="MenuDisplay('table_3');"><SPAN class=span id=table_3Span>+</SPAN> 綜合查詢</TD> </TR> <TR> <TD> <TABLE id=table_3 style="DISPLAY: none" cellSpacing=0 cellPadding=2 width=155 align=center border=0> <TBODY> <TR> <TD class=menuSmall><A class=style2 href="#" target=main>- 客戶信息查詢</A></TD> </TR> <TR> <TD class=menuSmall><A class=style2 href="#" target=main>- 聯繫人信息查詢</A></TD> </TR> <TR> <TD class=menuSmall><A class=style2 href="#" target=main>- 客戶拜訪記錄查詢</A></TD> </TR> </TBODY> </TABLE> </TD> </TR> <TR> <TD background=images/new_027.jpg height=1></TD> </TR> <TR> <TD class=mainMenu onClick="MenuDisplay('table_4');"><SPAN class=span id=table_4Span>+</SPAN> 統計分析</TD> </TR> <TR> <TD> <TABLE id=table_4 style="DISPLAY: none" cellSpacing=0 cellPadding=2 width=155 align=center border=0> <TBODY> <TR> <TD class=menuSmall><A class=style2 href="#" target=main>-客戶行業統計</A></TD> </TR> <TR> <TD class=menuSmall><A class=style2 href="#" target=main>-客戶來源統計</A></TD> </TR> </TBODY> </TABLE> </TD> </TR> <TR> <TD background=images/new_027.jpg height=1></TD> </TR> <TR> <TD class=mainMenu onClick="MenuDisplay('table_6');"><SPAN class=span id=table_6Span>+</SPAN>系統管理</TD> </TR> <TR> <TD> <TABLE id=table_6 style="DISPLAY: none" cellSpacing=0 cellPadding=2 width=155 align=center border=0> <TBODY> <TR> <TD class=menuSmall><A class=style2 href="#" target=main>-角色管理</A></TD> </TR> <TR> <TD class=menuSmall><A class=style2 href="#" target=main>-用戶管理</A></TD> </TR> <TR> <TD class=menuSmall><A class=style2 href="#" target=main>-數據字典</A></TD> </TR> </TBODY> </TABLE> </TD> </TR> </TBODY> </TABLE> </TD> <TD width=15 background=images/new_009.jpg></TD> </TR> </TBODY> </TABLE> <TABLE cellSpacing=0 cellPadding=0 width=210 align=center border=0> <TBODY> <TR> <TD width=15><IMG src="images/new_010.jpg" border=0></TD> <TD align=middle width=180 background=images/new_011.jpg height=15></TD> <TD width=15><IMG src="images/new_012.jpg" border=0></TD> </TR> </TBODY> </TABLE> </FORM> </BODY> </HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/frameset.dtd"> <HTML xmlns="http://www.w3.org/1999/xhtml"> <HEAD> <TITLE>客戶關係管理系統</TITLE> <META http-equiv=Content-Type content="text/html; charset=utf-8"> <META content="MSHTML 6.00.2900.3492" name=GENERATOR> </HEAD> <FRAMESET frameSpacing=0 rows=80,* frameBorder=0> <FRAME name=top src="top.htm" frameBorder=0 noResize scrolling=no> <FRAMESET frameSpacing=0 frameBorder=0 cols=220,*> <FRAME name=menu src="menu.jsp" frameBorder=0 noResize> <FRAME name=main src="welcome.htm" frameBorder=0> </FRAMESET> <NOFRAMES> <p>This page requires frames, but your browser does not support them.</p> </NOFRAMES> </FRAMESET> </HTML>
1.建立web項目javascript
2.導包css
hibernate包html
數據庫驅動包java
標籤庫包mysql
BeanUtils包web
3.引入靜態頁面sql
4.搭建hibernate框架數據庫
5.思路分析apache
6.開發session
7.測試