基于javaweb的JSP+Servlet网上订餐在线点餐管理系统(前台、后台)(java+jsp+servlet+jdbc+mysql+tomcat)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

1.前台模块:
    (1)食品展示模块
    (2)食品查询模块
    (3)购物车模块
    (4)收银台模块
    (5)用户维护模块
    (6)订单查询模块
    (7)公告模块

2.后台模块:
    (1)食品管理模块
    (2)用户管理模块
    (3)管理员维护模块
    (4)订单管理模块
    (5)公告管理模块
    (6)留言管理模块

eclipse或MyEclipse或idea

430123102502

440123102502

460123102502

普通用户(前台)

240123102502

250123102502

260123102502

270123102502

280123102502

290123102502

300123102502

310123102502

320123102502

管理员(后台)

330123102502

350123102502

360123102502

370123102502

380123102502

390123102502

400123102502

410123102502

420123102502

技术框架

CSS JavaScript JSP Servlet JDBC MySQL

基于javaweb的JSP+Servlet网上订餐在线点餐管理系统(前台、后台)(java+jsp+servlet+jdbc+mysql+tomcat)

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
if(i == 0)
{
if(isVirtual(s1))
{
s1 = m_application.getRealPath(s1);
if(s1.endsWith(s3))
{
s1 = s1 + s2;
}
else
{
s1 = s1 + s3 + s2;
}
return s1;
}
if(flag)
{
if(m_denyPhysicalPath)
{
throw new IllegalArgumentException("Physical path is denied (1125).");
}
else
{
return s;
}
}
else
{
throw new IllegalArgumentException("This path does not exist (1135).");
}
}
if(i == 1)
{
if(isVirtual(s1))
{
s1 = m_application.getRealPath(s1);
if(s1.endsWith(s3))
{
s1 = s1 + s2;
}
else
{
s1 = s1 + s3 + s2;
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
			request.setAttribute("stocks", al);
}
RequestDispatcher rd=request.getRequestDispatcher("/admin/statistic_list.jsp");
rd.forward(request,response);
}

public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}

/**
* Initialization of the servlet. <br>
*
* @throws ServletException if an error occure
*/
public void init() throws ServletException {
// Put your code here
}

}
package com.demo.servlet.admin;





public class UpdateBookServlet extends HttpServlet {

/**
* Constructor of the object.
*/
public UpdateBookServlet() {
super();
}

/**
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
        rd.forward(request,response);
}

public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}

/**
* Initialization of the servlet. <br>
*
* @throws ServletException if an error occure
*/
public void init() throws ServletException {
// Put your code here
}

}
package com.demo.servlet.admin;





public class UpdateBookServlet extends HttpServlet {

/**
* Constructor of the object.
*/
public UpdateBookServlet() {
super();
}

/**
* Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}

public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
Validate vd = new Validate();
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
ArrayList al2 = ib.select(sql2, args2);
request.setAttribute("books", al2);

String sql3 = "select * from books order by sums1 desc";
String[] args3 = {"id","name","author","publishing","number","price","storage","brief","type","tate","sums","imgpath","price1","sums1"};
ArrayList al3 = ib.select(sql3, args3);
request.setAttribute("xiaosou", al3);

String sql5 = "select * from books where tate=1";
String[] args5 = {"id","name","author","publishing","number","price","storage","brief","type","tate","sums","imgpath","price1","sums1"};
ArrayList al5 = ib.select(sql5, args5);
request.setAttribute("tuibook", al5);

String sql6 = "select * from books where tate=2";
String[] args6 = {"id","name","author","publishing","number","price","storage","brief","type","tate","sums","imgpath","price1","sums1"};
ArrayList al6 = ib.select(sql6, args6);
request.setAttribute("newbook", al6);

String sql7 = "select * from users";
String[] args7 = {"id","name","pwd","realname","sex","age","card","address","phone","email","code"};
ArrayList al7 = ib.select(sql7, args7);
request.setAttribute("users", al7);

String sql10 = "select * from leaveword";
String[] args10 = {"id","users","title","content","times"};
ArrayList al10 = ib.select(sql10, args10);
request.setAttribute("leaveword", al10);

String sql13 = "select * from books order by id desc";
String[] args13 = {"id","name","author","publishing","number","price","storage","brief","type","tate","sums","imgpath","price1","sums1"};
ArrayList al13 = ib.select(sql13, args13);
request.setAttribute("xiaosou1", al13);

String sql14 = "select * from nutrition";
String[] args14 = {"id","name","content"};
ArrayList al14 = ib.select(sql14, args14);
request.setAttribute("nutrition", al14);

String sql15 = "select * from emp";
String[] args15 = {"id","name","sex","birthday","phone","addr","duty","estate"};
ArrayList al15 = ib.select(sql15, args15);
request.setAttribute("emp", al15);

String sql16 = "select * from stock";
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
}

public void downloadFile(String s,String s1,String s2,int i) throws ServletException,IOException,SmartUploadException
{
if(s == null)
{
throw new IllegalArgumentException("File '" + s + "' not found (1040).");
}
if(s.equals(""))
{
throw new IllegalArgumentException("File '" + s + "' not found (1040).");
}
if(!isVirtual(s) && m_denyPhysicalPath)
{
throw new SecurityException("Physical path is denied (1035).");
}
if(isVirtual(s))
{
s = m_application.getRealPath(s);
}
java.io.File file = new java.io.File(s);
FileInputStream fileinputstream = new FileInputStream(file);
long l = file.length();
//boolean flag = false;
int k = 0;
byte abyte0[] = new byte[i];
if(s1 == null)
{
m_response.setContentType("application/x-msdownload");
}
else
{
if(s1.length() == 0)
{
m_response.setContentType("application/x-msdownload");
}
else
{
m_response.setContentType(s1);
}
}
m_response.setContentLength((int)l);
m_contentDisposition = m_contentDisposition != null ? m_contentDisposition : "attachment;";
if(s2 == null)
{
m_response.setHeader("Content-Disposition",m_contentDisposition + " filename=" + getFileName(s));
}
else
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
    //System.out.println("m_application.getRealPath:::" + s);
FileNames = new String[m_files.getCount()];
for(int k = 0;k < m_files.getCount();k++)
{
if(!m_files.getFile(k).isMissing())
{
//System.out.println("s + m_files.getFile(k).getFileName():" + s + m_files.getFile(k).getFileName());
m_files.getFile(k).saveAs(s + m_files.getFile(k).getFileName(),i);
FileNames[j] = s + m_files.getFile(k).getFileName();
j++;
}
}

return j;
}

//Add
private String[] FileNames;
public String[] getFileNames()
{
//Method may expose internal representation by returning array
//Returning an array value stored in one of the object's fields exposes the internal representation of the object.? For classes shared by other untrusted classes, this could potentially be a security issue.? Returning a new copy of the array is better approach in many situations.
String[] vFileNames = new String[FileNames.length];
System.arraycopy(FileNames,0,vFileNames,0,FileNames.length);
return vFileNames;
}

public int getSize()
{
return m_totalBytes;
}

public byte getBinaryData(int i)
{
byte byte0;
try
{
byte0 = m_binArray[i];
}
catch(Exception exception)
{
throw new ArrayIndexOutOfBoundsException("Index out of range (1005).");
}


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