基于jsp+servlet在线预约挂号系统

阅读: 评论:0

基于jsp+servlet在线预约挂号系统

基于jsp+servlet在线预约挂号系统

开发环境:idea+mysql

使用技术:jsp+servlet

关键代码:

<?xml version="1.0" encoding="UTF-8"?><project xmlns=".0.0" xmlns:xsi=""xsi:schemaLocation=".0.0 .0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>nchu</groupId><artifactId>hospital</artifactId><version>1.0-SNAPSHOT</version><packaging>war</packaging><name>hospital Maven Webapp</name><!-- FIXME change it to the project's website --><url>;/url><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><mavenpiler.source>1.7</mavenpiler.source><mavenpiler.target>1.7</mavenpiler.target></properties><dependencies><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.11</version><scope>test</scope></dependency><!--  --><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>8.0.13</version></dependency><!-- .servlet/javax.servlet-api --><dependency><groupId>javax.servlet</groupId><artifactId>javax.servlet-api</artifactId><version>3.1.0</version><scope>provided</scope></dependency><dependency><groupId>taglibs</groupId><artifactId>standard</artifactId><version>1.1.2</version></dependency><dependency><groupId>jstl</groupId><artifactId>jstl</artifactId><version>1.2</version></dependency><!-- .json/json --><dependency><groupId>org.json</groupId><artifactId>json</artifactId><version>20160810</version></dependency><!-- java邮件 --><dependency><groupId>com.sun.mail</groupId><artifactId>javax.mail</artifactId><version>1.5.6</version></dependency></dependencies><build><finalName>hospital</finalName><pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --><plugins><plugin><artifactId>maven-clean-plugin</artifactId><version>3.1.0</version></plugin><!-- see .html#Plugin_bindings_for_war_packaging --><plugin><artifactId>maven-resources-plugin</artifactId><version>3.0.2</version></plugin><plugin><artifactId>maven-compiler-plugin</artifactId><version>3.8.0</version></plugin><plugin><artifactId>maven-surefire-plugin</artifactId><version>2.22.1</version></plugin><plugin><artifactId>maven-war-plugin</artifactId><version>3.2.2</version></plugin><plugin><artifactId>maven-install-plugin</artifactId><version>2.5.2</version></plugin><plugin><artifactId>maven-deploy-plugin</artifactId><version>2.8.2</version></plugin></plugins></pluginManagement></build>
</project>
@WebServlet("/admin/doctorManage")
public class DoctorManage extends HttpServlet {@Overrideprotected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {String office = Util.Parameter("office"));String name = Util.Parameter("doctor"));String action = Util.Parameter("action"));if("add".equals(action)){String message="增加医生失败!";DoctorDao doctorDao = new DoctorDao();System.out.Parameter("account"));List<Doctor> doctors = doctorDao.query("where account=? ",new Object[]{Util.Parameter("account"))});if(doctors.size()==0){Doctor doctor=new Doctor();doctor.Parameter("account"));doctor.Parameter("password"));doctor.Parameter("name"));doctor.Parameter("fee"));doctor.Parameter("gender"));doctor.Parameter("age"));doctor.Parameter("office1"));doctor.Parameter("room"));doctor.Parameter("career"));doctor.Parameter("description"));doctor.ContextPath()+"/images/docpic/default.jpg");if(doctorDao.insert(doctor)){message="添加"&#Parameter("name")+"医生成功!";}}else {message&#Parameter("account")+"账号已存在!";}req.setAttribute("message",message);}int start = Util.Parameter("start"));DoctorDao doctorDao=new DoctorDao();String where="where office like ? and dname like ? ";int total&#DoctorCount(where,new Object[]{Like(office),Like(name)});Pages pages = new Pages(start , total, 6);where+="limit "+((CurrentPage()-1)*6)+",6";List<Doctor> doctors = doctorDao.query(where, new Object[]{Like(office),Like(name)});req.setAttribute("doctors",doctors);req.setAttribute("pages",pages);req.setAttribute("doctor",name);//OfficeDao officeDao=new OfficeDao();//List<Office> offices = officeDao.query("officename", office, "");req.setAttribute("office",office);RequestDispatcher("doctorManage.jsp").forward(req,resp);}
}

项目下载:基于jsp+servlet在线预约挂号系统 

本文发布于:2024-02-04 18:08:00,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170713301158122.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:在线   系统   jsp   servlet
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23