基于javaweb的JSP+Servlet家政服务管理系统(java+jsp+struts+javascript+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

400023422402

410023422402

430023422402

440023422402

450023422402

460023422402

基于javaweb的JSP+Servlet家政服务管理系统(java+jsp+struts+javascript+mysql)

项目介绍

雇主用户角色包含以下功能: 首页,注册账号,雇主登录,查询家政阿姨,查看供求信息,查看家政公司,阿姨预约,查看我的预约,发布需求信息等功能。

管理员角色包含以下功能: 登录,添加新闻,家政合同管理,家政阿姨管理,审核供应信息,企业用户管理,雇主管理等功能。

家政阿姨角色包含以下功能: 登陆页面,发布供应信息,管理我的预约等功能。

家政公司角色包含以下功能: 登录,发布家政名片等功能。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;  5.数据库:MySql 5.7版本;

技术栈

HTML+CSS+JavaScript+jsp+mysql

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/login.jsp 登录

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
    }    
}
package com.ytf.action;



@SuppressWarnings("serial")
public class ForgetPass extends ActionSupport {
private ConnDB mydb;
private static String propFileName = "/com/connDB.properties";
private static Properties prop = new Properties();
private static String emailUser = null;
private static String emailPass = null;
private static String emailServerHost = null;
private static String emailServerPort = null;
private String toAddress = null;
private String userName = null;
private String userType = null;
private String userPass = null;

public ForgetPass() {
//验证用户输入


try {
//将Properties文件读取到InputStream对象中
InputStream in = getClass().getResourceAsStream(propFileName);
prop.load(in);
emailUser = prop.getProperty("USER_NAME");
emailPass = prop.getProperty("USER_PASSWORD");
emailServerHost = prop.getProperty("USER_SERVER_HOST");
emailServerPort = prop.getProperty("USER_SERVER_PORT");
} catch (Exception e) {
e.printStackTrace();
}
}

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


public class BmInfo extends MySuperAction{
//private UserInfoForm bmInfo = new UserInfoForm();
///**
// * @return the bmInfo
// */
//public UserInfoForm getBmInfo() {
// return bmInfo;
//}
///**
// * @param bmInfo the bmInfo to set
// */
//public void setBmInfo(UserInfoForm bmInfo) {
// this.bmInfo = bmInfo;
//}




private static final long serialVersionUID = 1L;
int userId;
String surname;
String birthdate;
String hometown;
String uptime;
/*
* 0:未选择,默认查询所有
* 1:终点计时
* 2:半天
* 3:全天
*/
private String workTime;
/*
* 0:未选择,默认查询所有
* 1:包吃/包住
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
   ps3.setInt(5, result_lang[4]);
ps3.setInt(6, result_lang[5]);
ps3.setInt(7, result_lang[6]);
ps3.setInt(8, userId);
ps3.executeUpdate();
ps3.close();
logger.info("执行SQL:"+sql_lang);
//更新用户口味表
ps4.setInt(1, result_flavor[0]);
ps4.setInt(2, result_flavor[1]);
ps4.setInt(3, result_flavor[2]);
ps4.setInt(4, result_flavor[3]);
ps4.setInt(5, result_flavor[4]);
ps4.setInt(6, result_flavor[5]);
ps4.setInt(7, result_flavor[6]);
ps4.setInt(8, result_flavor[7]);
ps4.setInt(9, result_flavor[8]);
ps4.setInt(10, result_flavor[9]);
ps4.setInt(11, userId);
ps4.executeUpdate();
ps4.close();
logger.info("执行SQL:"+sql_flavor);
//更新用户姓名
ps.setString(1, surname);
//更新用户籍贯
ps.setString(2, hometown);
//更新用户性别
ps.setInt(3, sex);
//更新用户出生年月
ps.setString(4, birthdate);
//更新用户联系方式
ps.setString(5, phone);
//更新用户婚姻状况
ps.setInt(6, marriage);
//更新用户学历
ps.setInt(7, education);
//更新用户居住地址
ps.setString(8, address);
//更新用户个人简介
ps.setString(9, profile);
//更新更新时间
ps.setString(10, uptime);
//更新用户头像
ps.setBinaryStream(11, fis,length);
ps.setBinaryStream(11, fis, fis.available());
//当前用户Id为查询对象
ps.setInt(12, userId);
ps.executeUpdate();
ps.close();
logger.info("执行SQL:"+sql_employee);
fis.close();
rs.close();
conn.close();
addActionMessage("信息更新成功!");
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
<dt><a class="samples" href="plugins/magicline/magicline.html">Magicline plugin</a></dt>
<dd>Using the Magicline plugin to access difficult focus spaces.</dd>

<dt><a class="samples" href="plugins/wysiwygarea/fullpage.html">Full page support</a></dt>
<dd>CKEditor inserted with a JavaScript call and used to edit the whole page from &lt;html&gt; to &lt;/html&gt;.</dd>
</dl>
</div>
<div class="twoColumnsRight">
<h2 class="samples">
Inline Editing
</h2>
<dl class="samples">
<dt><a class="samples" href="inlineall.html">Massive inline editor creation</a></dt>
<dd>Turn all elements with <code>contentEditable = true</code> attribute into inline editors.</dd>

<dt><a class="samples" href="inlinebycode.html">Convert element into an inline editor by code</a></dt>
<dd>Conversion of DOM elements into inline CKEditor instances by using a JavaScript call.</dd>

<dt><a class="samples" href="inlinetextarea.html">Replace textarea with inline editor</a> <span class="new">New!</span></dt>
<dd>A form with a textarea that is replaced by an inline editor at runtime.</dd>


</dl>

<h2 class="samples">
Advanced Samples
</h2>
<dl class="samples">
<dt><a class="samples" href="datafiltering.html">Data filtering and features activation</a> <span class="new">New!</span></dt>
<dd>Data filtering and automatic features activation basing on configuration.</dd>

<dt><a class="samples" href="divreplace.html">Replace DIV elements on the fly</a></dt>
<dd>Transforming a <code>div</code> element into an instance of CKEditor with a mouse click.</dd>

<dt><a class="samples" href="appendto.html">Append editor instances</a></dt>
<dd>Appending editor instances to existing DOM elements.</dd>

<dt><a class="samples" href="ajax.html">Create and destroy editor instances for Ajax applications</a></dt>
<dd>Creating and destroying CKEditor instances on the fly and saving the contents entered into the editor window.</dd>

<dt><a class="samples" href="api.html">Basic usage of the API</a></dt>
<dd>Using the CKEditor JavaScript API to interact with the editor at runtime.</dd>

<dt><a class="samples" href="xhtmlstyle.html">XHTML-compliant style</a></dt>
<dd>Configuring CKEditor to produce XHTML 1.1 compliant attributes and styles.</dd>

<dt><a class="samples" href="readonly.html">Read-only mode</a></dt>
<dd>Using the readOnly API to block introducing changes to the editor contents.</dd>

<dt><a class="samples" href="tabindex.html">"Tab" key-based navigation</a></dt>
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
private void generateText(){
char[] source = new char[4];
for(int i=0; i<source.length; i++){
source[i] = ImageAction.source[rdm.nextInt(ImageAction.source.length)];
}
this.text = new String(source);
// 设置Session
ServletActionContext.getRequest().getSession().setAttribute(SessionName, this.text);
}

/**
* 在内存中生成打印了随机字符串的图片
* @return 在内存中创建的打印了字符串的图片
*/
private BufferedImage createImage(){
int width = 50;
int height = 20;

BufferedImage image =
new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);

Graphics g = image.getGraphics();
//设置背景色
g.setColor(Color.WHITE);
//填充背景
g.fillRect(0, 0, width, height);
//设置边框颜色
g.setColor(Color.LIGHT_GRAY);
//设置字体样式
g.setFont(new Font("Arial",Font.BOLD,height-2));
//绘制边框
g.drawRect(0, 0, width - 1, height - 1);
//会制噪点
Random rand = new Random();
//设置噪点颜色
g.setColor(Color.LIGHT_GRAY);
for (int i = 0;i < 30;i++) {
int x = rand.nextInt(width);
int y = rand.nextInt(height);
//绘制1 * 1大小的矩形
g.drawRect(x, y, 1, 1);
}

//绘制验证码
g.setFont(font);
for(int i=0; i<this.text.length(); i++){
g.setColor(colors[rdm.nextInt(colors.length)]);
g.drawString(this.text.substring(i, i+1), 8 + i * 8, 15);
}
g.dispose();

return image;


项目链接:
https://javayms.github.io?id=421122522008200pa
https://javayms.pages.dev?id=421122522008200pa