当前位置:首页 > 停车场毕业论文
基于J2EE的停车场管理系统的设计与实现
sb.append(c); } else {
byte[] b; try {
b = Character.toString(c).getBytes(\); }catch (Exception ex) { System.out.println(ex); b = new byte[0]; }
for (int j = 0; j < b.length; j++) { int k = b[j]; if (k < 0) { k += 256; }
sb.append(\ + Integer.toHexString(k). toUpperCase()); } }
return sb.toString(); }
基于J2EE的停车场管理系统的设计与实现
第四章 系统功能实现
在管理信息系统的生命周期中,仅过了需求分析、系统设计等阶段之后,便开始了系统实施阶段。在系统分析和设计阶段,系统开发工作主要是集中在逻辑、功能和技术设计上,系统实施阶段要继承此前面各个阶段的工作成果,将技术设计转化为物理实现,因此系统实施的成果是系统分析和设计阶段的结晶。
4.1系统登陆页面实现
1.描述:为了保证系统的安全性,要先使用本系统必须先登陆到系统中,并且不同角色的用户进入不同的界面,功能也随之不同。
2.程序运行效果图如图4.1所示:
图4.1 系统登陆页面设计
3.在登陆页面输入用户名和密码以,选择登陆身份后,点击提交按钮,跳转到登陆的service中,在该service中会对用户名,密码,验证码进行判断,并根据相应的用户角色进入对应的页面,loginservice关键代码:
public String login(String userName,String userPw,int userType) {
try {
Thread.sleep(700);
} catch (InterruptedException e)
基于J2EE的停车场管理系统的设计与实现
{
// TODO Auto-generated catch block e.printStackTrace(); }
String result=\
if(userType==0)//系统管理员登陆 {
String sql=\ Object[] con={userName,userPw};
List adminList=adminDAO.getHibernateTemplate().find(sql,con); if(adminList.size()==0) {
result=\ } else {
WebContext ctx = WebContextFactory.get(); HttpSession session=ctx.getSession(); TAdmin admin=(TAdmin)adminList.get(0); session.setAttribute(\ session.setAttribute(\ result=\ } }
if(userType==2)//操作员登陆 {
String sql=\ Object[] con={userName.trim(),userPw.trim()}; List
caozuoyuanList=caozuoyuanDAO.getHibernateTemplate().find(sql,con); if(caozuoyuanList.size()==0) {
result=\ } else {
WebContext ctx = WebContextFactory.get(); HttpSession session=ctx.getSession();
TCaozuoyuan caozuoyuan=(TCaozuoyuan)caozuoyuanList.get(0); session.setAttribute(\
session.setAttribute(\
基于J2EE的停车场管理系统的设计与实现
result=\ } } rs.close(); }
catch (SQLException e) {
System.out.println(\登录失败!\ e.printStackTrace(); }
finally {
mydb.closed(); } }
return result;
}
4.2管理员模块
1.描述:管理员主页面:左方页面展示了管理员可操作的五大功能。进入相关的管理页面可以链接到子菜单,并且高亮显示,每个管理模块下面都有相应的子菜单。
2.程序运行效果图如图4.2所示:
图4.2管理员主页面
在每个jsp页面将会对相关用户进行拦截操作,这样可以提高安全性,防止用户不经过登陆页面而进入任何子菜单页面: if(session.getAttribute(\
共分享92篇相关文档