## **1.創建pojo包,包名為:com.baishenghua200.pojo**
在該包下創建以下類:
### **1.1創建導航菜單類**
>創建導航菜單類Menu200.java
四個個屬性:菜單編號、菜單名稱、菜單地址和菜單序號。屬性名上也加上學號后三位
重寫hashCode()和equals()方法
重寫toString()方法
實現可序列化接口
創建有參和無參構造方法

```
package com.baishenghua200.pojo;
import java.io.Serializable;
/**
* Menu200.java(導航菜單類)
* @desc 導航菜單
* @author 柏圣華
* @date 2022-1-3
*
*/
public class Menu200 implements Serializable{
private static final long serialVersionUID = 1L;
private int id200;//導航菜單編號
private String menuName200;//導航菜單名稱
private String menuURL200;//導航菜單地址
private String menuNo200;//導航菜單序號
public Menu200() {//無參構造方法
super();
}
//有參構造方法
public Menu200(int id200, String menuName200, String menuURL200,
String menuNo200) {
super();
this.id200 = id200;
this.menuName200 = menuName200;
this.menuURL200 = menuURL200;
this.menuNo200 = menuNo200;
}
@Override
public String toString() {
return "Menu200 [id200=" + id200 + ", menuName200=" + menuName200
+ ", menuURL200=" + menuURL200 + ", menuNo200=" + menuNo200
+ "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + id200;
result = prime * result
+ ((menuName200 == null) ? 0 : menuName200.hashCode());
result = prime * result
+ ((menuNo200 == null) ? 0 : menuNo200.hashCode());
result = prime * result
+ ((menuURL200 == null) ? 0 : menuURL200.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Menu200 other = (Menu200) obj;
if (id200 != other.id200)
return false;
if (menuName200 == null) {
if (other.menuName200 != null)
return false;
} else if (!menuName200.equals(other.menuName200))
return false;
if (menuNo200 == null) {
if (other.menuNo200 != null)
return false;
} else if (!menuNo200.equals(other.menuNo200))
return false;
if (menuURL200 == null) {
if (other.menuURL200 != null)
return false;
} else if (!menuURL200.equals(other.menuURL200))
return false;
return true;
}
public int getId200() {
return id200;
}
public void setId200(int id200) {
this.id200 = id200;
}
public String getMenuName200() {
return menuName200;
}
public void setMenuName200(String menuName200) {
this.menuName200 = menuName200;
}
public String getMenuURL200() {
return menuURL200;
}
public void setMenuURL200(String menuURL200) {
this.menuURL200 = menuURL200;
}
public String getMenuNo200() {
return menuNo200;
}
public void setMenuNo200(String menuNo200) {
this.menuNo200 = menuNo200;
}
}
```
### **1.2創建公司信息類**
>如何抽象設計,降低難度,只設計關于我們這個模塊
創建公司信息類CompanyInfomation200.java
6個屬性:編號、標題、圖片、內容、編輯時間和序號,要求屬性名上也加上學號后三位
重寫hashCode()和equals()方法
重寫toString()方法
實現可序列化接口
生成有參和無參構造方法
生成getter和setter方法

```
package com.baishenghua200.pojo;
import java.io.Serializable;
/**
* CompanyInfomation200.java(公司信息類)
* @desc 導航菜單
* @author 柏圣華
* @date 2022-1-3
*
*/
public class CompanyInfomation200 implements Serializable{
private static final long serialVersionUID = 1L;
private int ciId200;//公司信息編號
private String ciTitle200;//公司信息標題
private String ciImage200;//公司信息圖片
private String ciContent200;//公司信息內容
private String ciEditDate200;//公司信息編輯時間
private int ciNo200;//公司信息序號
//生成setter和getter方法
//重寫hashCode()、toString()和Equals()方法
//生成有參構造方法和無參構造方法
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((ciContent200 == null) ? 0 : ciContent200.hashCode());
result = prime * result
+ ((ciEditDate200 == null) ? 0 : ciEditDate200.hashCode());
result = prime * result + ciId200;
result = prime * result
+ ((ciImage200 == null) ? 0 : ciImage200.hashCode());
result = prime * result + ciNo200;
result = prime * result
+ ((ciTitle200 == null) ? 0 : ciTitle200.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CompanyInfomation200 other = (CompanyInfomation200) obj;
if (ciContent200 == null) {
if (other.ciContent200 != null)
return false;
} else if (!ciContent200.equals(other.ciContent200))
return false;
if (ciEditDate200 == null) {
if (other.ciEditDate200 != null)
return false;
} else if (!ciEditDate200.equals(other.ciEditDate200))
return false;
if (ciId200 != other.ciId200)
return false;
if (ciImage200 == null) {
if (other.ciImage200 != null)
return false;
} else if (!ciImage200.equals(other.ciImage200))
return false;
if (ciNo200 != other.ciNo200)
return false;
if (ciTitle200 == null) {
if (other.ciTitle200 != null)
return false;
} else if (!ciTitle200.equals(other.ciTitle200))
return false;
return true;
}
@Override
public String toString() {
return "CompanyInfomation200 [ciId200=" + ciId200 + ", ciTitle200="
+ ciTitle200 + ", ciImage200=" + ciImage200 + ", ciContent200="
+ ciContent200 + ", ciEditDate200=" + ciEditDate200
+ ", ciNo200=" + ciNo200 + "]";
}
public CompanyInfomation200() {
super();
}
public CompanyInfomation200(int ciId200, String ciTitle200,
String ciImage200, String ciContent200, String ciEditDate200,
int ciNo200) {
super();
this.ciId200 = ciId200;
this.ciTitle200 = ciTitle200;
this.ciImage200 = ciImage200;
this.ciContent200 = ciContent200;
this.ciEditDate200 = ciEditDate200;
this.ciNo200 = ciNo200;
}
public int getCiId200() {
return ciId200;
}
public void setCiId200(int ciId200) {
this.ciId200 = ciId200;
}
public String getCiTitle200() {
return ciTitle200;
}
public void setCiTitle200(String ciTitle200) {
this.ciTitle200 = ciTitle200;
}
public String getCiImage200() {
return ciImage200;
}
public void setCiImage200(String ciImage200) {
this.ciImage200 = ciImage200;
}
public String getCiContent200() {
return ciContent200;
}
public void setCiContent200(String ciContent200) {
this.ciContent200 = ciContent200;
}
public String getCiEditDate200() {
return ciEditDate200;
}
public void setCiEditDate200(String ciEditDate200) {
this.ciEditDate200 = ciEditDate200;
}
public int getCiNo200() {
return ciNo200;
}
public void setCiNo200(int ciNo200) {
this.ciNo200 = ciNo200;
}
}
```
### **1.3創建用戶信息類**
>如何抽象設計,降低難度,只設計關于我們這個模塊
創建用戶信息類User200.java
6個屬性:編號、姓名、性別、年齡、地址、QQ、郵箱、賬號和密碼 ,要求屬性名上也加上學號后三位
重寫hashCode()和equals()方法
重寫toString()方法
實現可序列化接口
生成有參和無參構造方法
生成getter和setter方法

```
package com.baishenghua200.pojo;
import java.io.Serializable;
/**
* User200.java(用戶類)
* @desc 描述用戶的屬性和方法
* @author 柏圣華
* @date 2022-1-3
*
*/
public class User200 implements Serializable{
private static final long serialVersionUID = 1L;
private int id200;
private String name200;
private String gender200;
private int age200;
private String address200;
private String qq200;
private String email200;
private String username200;
private String password200;
//生成setter和getter方法
//重寫hashCode()、toString()和Equals()方法
//生成有參構造方法和無參構造方法
//實現可序列化接口
public User200(int id200, String name200, String gender200, int age200,
String address200, String qq200, String email200,
String username200, String password200) {
super();
this.id200 = id200;
this.name200 = name200;
this.gender200 = gender200;
this.age200 = age200;
this.address200 = address200;
this.qq200 = qq200;
this.email200 = email200;
this.username200 = username200;
this.password200 = password200;
}
public User200() {
super();
}
public int getId200() {
return id200;
}
public void setId200(int id200) {
this.id200 = id200;
}
public String getName200() {
return name200;
}
public void setName200(String name200) {
this.name200 = name200;
}
public String getGender200() {
return gender200;
}
public void setGender200(String gender200) {
this.gender200 = gender200;
}
public int getAge200() {
return age200;
}
public void setAge200(int age200) {
this.age200 = age200;
}
public String getAddress200() {
return address200;
}
public void setAddress200(String address200) {
this.address200 = address200;
}
public String getQq200() {
return qq200;
}
public void setQq200(String qq200) {
this.qq200 = qq200;
}
public String getEmail200() {
return email200;
}
public void setEmail200(String email200) {
this.email200 = email200;
}
public String getUsername200() {
return username200;
}
public void setUsername200(String username200) {
this.username200 = username200;
}
public String getPassword200() {
return password200;
}
public void setPassword200(String password200) {
this.password200 = password200;
}
@Override
public String toString() {
return "User200 [id200=" + id200 + ", name200=" + name200
+ ", gender200=" + gender200 + ", age200=" + age200
+ ", address200=" + address200 + ", qq200=" + qq200
+ ", email200=" + email200 + ", username200=" + username200
+ ", password200=" + password200 + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((address200 == null) ? 0 : address200.hashCode());
result = prime * result + age200;
result = prime * result
+ ((email200 == null) ? 0 : email200.hashCode());
result = prime * result
+ ((gender200 == null) ? 0 : gender200.hashCode());
result = prime * result + id200;
result = prime * result + ((name200 == null) ? 0 : name200.hashCode());
result = prime * result
+ ((password200 == null) ? 0 : password200.hashCode());
result = prime * result + ((qq200 == null) ? 0 : qq200.hashCode());
result = prime * result
+ ((username200 == null) ? 0 : username200.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
User200 other = (User200) obj;
if (address200 == null) {
if (other.address200 != null)
return false;
} else if (!address200.equals(other.address200))
return false;
if (age200 != other.age200)
return false;
if (email200 == null) {
if (other.email200 != null)
return false;
} else if (!email200.equals(other.email200))
return false;
if (gender200 == null) {
if (other.gender200 != null)
return false;
} else if (!gender200.equals(other.gender200))
return false;
if (id200 != other.id200)
return false;
if (name200 == null) {
if (other.name200 != null)
return false;
} else if (!name200.equals(other.name200))
return false;
if (password200 == null) {
if (other.password200 != null)
return false;
} else if (!password200.equals(other.password200))
return false;
if (qq200 == null) {
if (other.qq200 != null)
return false;
} else if (!qq200.equals(other.qq200))
return false;
if (username200 == null) {
if (other.username200 != null)
return false;
} else if (!username200.equals(other.username200))
return false;
return true;
}
}
```
### **1.4創建留言信息類**
>如何抽象設計,降低難度,只設計關于我們這個模塊
創建留言信息類Message200.java
3個屬性:編號、標題和內容,要求屬性名上也加上學號后三位
重寫hashCode()和equals()方法
重寫toString()方法
實現可序列化接口
生成有參和無參構造方法
生成getter和setter方法

```
package com.baishenghua200.pojo;
import java.io.Serializable;
/**
* Message200.java(留言類)
* @desc 描述留言的屬性和方法
* @author 柏圣華
* @date 2022-1-4
*
*/
public class Message200 implements Serializable{
private static final long serialVersionUID = 1L;
private int id200;//留言編號
private String title200;//留言標題
private String content200;//留言內容
public Message200(int id200, String title200, String content200) {
super();
this.id200 = id200;
this.title200 = title200;
this.content200 = content200;
}
public Message200() {
super();
}
public int getId200() {
return id200;
}
public void setId200(int id200) {
this.id200 = id200;
}
public String getTitle200() {
return title200;
}
public void setTitle200(String title200) {
this.title200 = title200;
}
public String getContent200() {
return content200;
}
public void setContent200(String content200) {
this.content200 = content200;
}
@Override
public String toString() {
return "Message200 [id200=" + id200 + ", title200=" + title200
+ ", content200=" + content200 + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((content200 == null) ? 0 : content200.hashCode());
result = prime * result + id200;
result = prime * result
+ ((title200 == null) ? 0 : title200.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Message200 other = (Message200) obj;
if (content200 == null) {
if (other.content200 != null)
return false;
} else if (!content200.equals(other.content200))
return false;
if (id200 != other.id200)
return false;
if (title200 == null) {
if (other.title200 != null)
return false;
} else if (!title200.equals(other.title200))
return false;
return true;
}
}
```
- Java Web項目開發學習手冊
- 一、B/S開發環境搭建
- 1.1 tomcat服務器目錄結構及作用
- 1.2 在IDE開發工具上配置tomcat服務器
- 1.3 簡單web項目在tomcat服務器上運行的方法
- 1.4 開發工具設置
- 1.5 總結
- 二、Servlet技術應用
- 2.1 HttpServlet中的主要方法及應用
- 2.1.1 基于Eclipse完成一個JavaWeb項目
- 2.2 HttpRequest,HttpResponse的應用
- 2.2.1客戶端請求
- 2.2.2服務器響應
- 2.2.3Servlet HTTP 狀態碼
- 2.2.4圖片驗證碼類
- 2.2.5注冊模擬實現(帶驗證碼)
- 2.3 ServletConfig對象和ServletContext對象的概念
- 2.4 總結
- 三、JSP技術應用
- 3.1 JSP基本語法
- 3.2 JSP標簽和指令
- 3.3 JSP中的隱式對象
- 3.4 常用應用操作
- 3.4.1 JSP客戶端請求
- 3.4.2 JSP服務器響應
- 3.4.3 HTTP狀態碼
- 3.4.4 表單處理
- 3.4.5 過濾器
- 3.4.6 Cookie處理
- 3.4.7 Session處理
- 3.4.8 文件上傳
- 3.4.9 日期處理
- 3.4.10 頁面重定向
- 3.4.11 點擊量統計
- 3.4.12 自動刷新
- 3.4.13 發送郵件
- 3.5 JSP高級應用
- 3.5.1 JSP標準標簽庫(JSTL)
- 3.5.2 JSP連接數據庫
- 3.5.3 JSP XML數據處理
- 3.5.4 JSP JavaBean
- 3.5.5 自定義標簽
- 3.5.6 表達式語言
- 3.5.7 異常處理
- 3.5.8 調試
- 3.5.9 JSP國際化
- 3.6 實踐代碼
- 3.6.1 實踐代碼
- 3.6.2 項目實戰
- 3.7 總結
- 四、MVC思想的理解和搭建MVC
- 4.1 MVC設計模式的思想
- 4.2 MVC設計模式的實現步驟
- 4.3 項目實踐
- 4.4 總結
- 五、EL表達式和JSTL技術
- 5.1 EL表達式及其應用
- 5.2 常用的JSTL標簽的應用
- 5.3 項目實踐
- 5.4 總結
- 六、Cookie和Session
- 6.1 cookie對象的概念和應用
- 6.2 session對象的概念和應用
- 6.3 項目實踐
- 6.4 總結
- 七、過濾器技術應用
- 7.1 Filter的概念及應用
- 7.2 Filter、FilterChain、FilterConfig 介紹
- 7.3 用戶登錄過濾案例
- 7.4 項目實戰
- 7.5總結
- 八、異步請求技術
- 8.1 JSON數據格式
- 8.2 使用AJAX實現異步請求
- 8.3 用戶名校驗案例
- 8.4小結
- 綜合項目技術實訓
- 1.BS項目開發項目實戰
- 2.項目需求分析和系統設計
- 2.1需求分析
- 2.2類型模型設計
- 2.3原型設計
- 3.項目數據庫分析和系統設計
- 4.BS項目編程實現
- 4.1搭建框架和命名規約
- 4.2實現步驟
- 4.2.1創建實體類
- 4.2.2創建過濾器類
- 4.2.3創建工具類
- 4.2.4創建DAO接口及其實現類
- 4.2.5創建Service接口及其實現類
- 4.2.6創建測試類
- 4.2.7創建控制器類
- 5.企業開發流程規范
- 6.總結
- 九、練習題及答案
- 企業開發常用技術
- 1.Maven技術
- Java命名規范解讀
- 參考資料
- 開發中常用的應用服務器和Web服務器