千文网小编为你整理了多篇相关的《java学生实习报告》,但愿对你工作学习有帮助,当然你在千文网还可以找到更多《java学生实习报告》。
生产实习报告
学 院: 专 业: 学 号: 姓 名: 指导教师:
年月日
一:实习内容简介:
1.了解HTTP协议,了解json数据格式,为以后的web开发,WebService,移动开发等打好基础。
2.掌握基本的网页开发技术,Html,css,JavaScript等。
3.熟悉使用各种开发工具、数据库设计工具;熟悉使用常用服务器软件安装、配置和开发;
4.掌握mysql数据库,熟练sql。5.掌握servlet,jsp,jstl等java web相关技术,学会使用SSH2 框架;了解MVC模式。6.通过完整案例的编写,提高学生对于编程的兴趣,以及其调试能力,分析分解问题的能力;
7、运用学习的内容,编写项目管理系统。
二:项目报告:
2.1需求分析说明书
编写一个项目管理系统,实现对人员,角色,和资源菜单的管理。
2.2可行性分析报告
1,编写该系统需要小组共同实现,我们组成了一个七人的小组,组员包括。由任组长,负责项目的进度管理,分工等。
2,组员应具备编写该项目的基本知识,包括java,jsp,servlet,html等
3,开发工具:myeclipse 2015(编写代码),tomcat8.0(服务器),oracle(数据库)
2.3概要设计说明书
开始登录否登录成功?是查询具有的权限根据权限显示相应内容结束
2.3详细设计说明书
人员管理,角色管理,资源菜单管理详细设计:
开始添加编辑查看删除输入相应内容查询数据库查询数据库查询数据库显示相应内容显示相应内容删除更改内容更改数据库内容结束
数据库设计:
2.4编码测试说明书
项目结构:
主要jsp文件和html文件:
主要java文件和servlet文件:
部分代码展示: package com.oracle.servlet;
import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;
import com.oracle.factory.ServiceBackFactory;import com.oracle.util.MD5Code;import com.oracle.vo.admin;
@SuppressWarnings(“serial”)public class LoginServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.setCharacterEncoding(“UTF-8”);
String username=request.getParameter(“username”);
String password=request.getParameter(“psd”);
String rand =(String)request.getSession().getAttribute(“rand”);
String code=request.getParameter(“code”);
String path=“/pages/error.jsp”;
if(code.equalsIgnoreCase(rand)){
admin vo=new admin();
vo.setUsername(username);
vo.setPassword(new MD5Code().getMD5ofStr(password+“{”+username+“}”));
try {
if(ServiceBackFactory.getIAdminServiceInstance().login(vo)){
request.getSession().setAttribute(“username”, username);
request.setAttribute(“msg”, “登录成功,欢迎:” + vo.getUsername()
+ “光临!”);
// 由forward.jsp提示信息之后的跳转路径
request.setAttribute(“path”, request.getContextPath()
+ “/pages/admin/index.jsp”);
path = “/pages/forward.jsp”;
} else {
path = “/pages/login.jsp”;
request.setAttribute(“err”, “错误的用户名及密码!”);
}
} catch(Exception e){
// TODO Auto-generated catch block
e.printStackTrace();
}
}else {
request.setAttribute(“err”, “验证码输入错误”);
path=“/pages/login.jsp”;
}
request.getRequestDispatcher(path).forward(request, response);}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
this.doGet(request, response);} } package com.oracle.servlet;
import java.io.IOException;import java.text.ParseException;import java.text.SimpleDateFormat;import java.util.ArrayList;import java.util.List;
import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;
import com.oracle.factory.ServiceBackFactory;import com.oracle.vo.Myuser;
@SuppressWarnings(“serial”)public class MyuserServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.setCharacterEncoding(“UTF-8”);
String staus=request.getParameter(“staus”);
if(“insert”.equals(staus)){
this.insert(request, response);
}else if(“list”.equalsIgnoreCase(staus)){
try {
List all=new ArrayList();
all=ServiceBackFactory.getIMyuserServiceInstance().list();
request.setAttribute(“Myuserlist”, all);
request.setAttribute(“path”,request.getContextPath()
+ “/pages/admin/list.jsp”);
} catch(Exception e){
e.printStackTrace();
}
} }
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
this.doGet(request, response);}
public void insert(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
Myuser vo = new Myuser();
vo.setPhone(Integer.parseInt(request.getParameter(“phone”)));
vo.setUname(request.getParameter(“uname”));
vo.setJob(request.getParameter(“job”));
vo.setAge(Integer.parseInt(request.getParameter(“age”)));
vo.setSex(request.getParameter(“sex”));
vo.setId(Integer.parseInt(request.getParameter(“id”)));
try {
vo.setHiredate(new SimpleDateFormat(“yyyy-MM-dd”).parse(request
.getParameter(“hiredate”)));
} catch(ParseException e){
e.printStackTrace();
}
try {
if(ServiceBackFactory.getIMyuserServiceInstance().insert(vo)){
request.setAttribute(“msg”, “用户添加成功”);
request.setAttribute(“path”, request.getContextPath()
+ “/pages/admin/list.jsp”);
} else {
request.setAttribute(“msg”, “用户添加失败”);
request.setAttribute(“path”, request.getContextPath()
+ “/pages/admin/list.jsp”);
}
} catch(Exception e){
e.printStackTrace();
}
request.getRequestDispatcher(“/pages/forward.jsp”).forward(request, response);
;} } package com.oracle.servlet;
import java.io.IOException;import java.io.PrintWriter;
import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;
import com.oracle.factory.ServiceBackFactory;import com.oracle.util.MD5Code;import com.oracle.vo.admin;
@SuppressWarnings(“serial”)public class SignUpServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.setCharacterEncoding(“UTF-8”);
String username=request.getParameter(“username”);
String password=request.getParameter(“psd”);
String path=“/pages/signup.jsp”;
admin vo=new admin();
vo.setUsername(username);;
vo.setPassword(new MD5Code().getMD5ofStr(password+“{”+username+“}”));
try {
if(ServiceBackFactory.getIAdminServiceInstance().insert(vo)){
path=“/pages/login.jsp”;
}else{
request.setAttribute(“err”, “用户已存在”);
}
} catch(Exception e){
// TODO Auto-generated catch block
e.printStackTrace();
}
request.getRequestDispatcher(path).forward(request, response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
this.doGet(request, response);} } package com.oracle.filter;
import java.io.IOException;
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;
public class LoginFilter implements Filter {
@Override public void destroy(){
// TODO Auto-generated method stub
}
@Override public void doFilter(ServletRequest request, ServletResponse response,FilterChain chain)throws IOException, ServletException {
HttpServletRequest req=(HttpServletRequest)request;
if(req.getSession().getAttribute(“username”)!=null){
chain.doFilter(request, response);
}else {
request.setAttribute(“msg”, “还未登录,请先登录”);
request.setAttribute(“path”, req.getContextPath()+“/pages/login.jsp”);
request.getRequestDispatcher(“/pages/forward.jsp”).forward(request, response);
}
}
@Override public void init(FilterConfig arg0)throws ServletException {
// TODO Auto-generated method stub
} } 运行测试:
主界面:
查看详情:
编辑界面:
添加界面:
2.5用户手册
该系统为项目管理系统,包括人员管理,角色管理,资源菜单管理,分别包括,添加,删除,编辑,查看等功能。
三:心得体会
推荐专题: 大学生实习报告范文 学生社会实践报告 java学生实习报告