菜单
  

            </property>
            <!-- 数据库的用户名 -->
            <property name="connection.username">root</property>
            <!-- 数据库的密码 -->
            <property name="connection.password">root</property>
            <!-- 数据库的驱动程序 -->
            <property name="connection.driver_class">
                com.mysql.jdbc.Driver
            </property>

            <!-- 数据库的Dialet"方言" -->
            <property name="dialect">
                org.hibernate.dialect.MySQLDialect
            </property>
    (2) 然后在hibernate.cfg.xml中加载持久化对象配置文件。
    <!-- HBM文件列表    -->
            <mapping resource="cn/com/medicineMSys/model/DrugInfo.hbm.xml" />
            <mapping resource="cn/com/medicineMSys/model/OrderForm.hbm.xml" />
            <mapping resource="cn/com/medicineMSys/model/CaseList.hbm.xml" />
            <mapping resource="cn/com/medicineMSys/model/EnterStorage.hbm.xml" />
            <mapping resource="cn/com/medicineMSys/model/Users.hbm.xml" />
            <mapping resource="cn/com/medicineMSys/model/Storage.hbm.xml" />
            <mapping resource="cn/com/medicineMSys/model/Sale.hbm.xml" />
    (3) 读取hibernate.cfg.xml配置文件,加载配置信息。
     private static Configuration configuration;
    private static SessionFactory sessionfactory;    
    static{
            configuration = new Configuration();
            configuration.configure();        
            sessionfactory = configuration.buildSessionFactory();
        }
    (4) 获取数据库会话,执行有关SQL操作。
    return sessionfactory.openSession();
    4.3 系统登录模块实现
    该功能主要负责的是用户的登录。在用户输入用户名和密码后,点击登录,系统就会将登录信息发送到服务端进行验证,即和数据库中的用户表里面的信息进行比对,如果正确,则利用户成功登录进入系统首页,比对出来不一致的话,则提示输入错误,返回登录页面,让用户重新输入。
    (1)    登录界面对应JSP中,将登录处理提交给loginUsers
    <form name="myform" action="loginUsers" onsubmit="return validate()"  method="post">
    (2) 该Action在struts.xml中配置,对应处理代码是UsersAction类。
    <!-- 用户登录、新增、修改信息对应处理代码配置 -->
            <action name="*Users" class="cn.com.medicineMSys.action.UsersAction" method="{1}">
                    <result name="loginsuccessM">web/index.jsp</result>
                    <result name="loginsuccessU">web/index_user.jsp</result>
  1. 上一篇:Android平台手机图片浏览软件的开发实现
  2. 下一篇:VC出租车路线规划算法Dijkstra设计
  1. jsp+mysql学生选课信息系统设计与实现

  2. jsp+mysql电影推荐系统的设计与实现

  3. jsp+mysql学生实践创新项目管理系统设计与实现

  4. jsp+mysql停车场车辆管理系统的设计与实现

  5. jsp+mysql运动会管理系统设计与实现

  6. jsp+mysql制衣网站的设计与实现

  7. jsp+mysql知识产权代理服务系统的设计与实现

  8. 中考体育项目与体育教学合理结合的研究

  9. 电站锅炉暖风器设计任务书

  10. 当代大学生慈善意识研究+文献综述

  11. 杂拟谷盗体内共生菌沃尔...

  12. 十二层带中心支撑钢结构...

  13. 大众媒体对公共政策制定的影响

  14. 酸性水汽提装置总汽提塔设计+CAD图纸

  15. 乳业同业并购式全产业链...

  16. java+mysql车辆管理系统的设计+源代码

  17. 河岸冲刷和泥沙淤积的监测国内外研究现状

  

About

751论文网手机版...

主页:http://www.751com.cn

关闭返回