这个问题已经被我知道了很多次,但这里对我来说还不清楚。在会话中存储密码的JSP
我使用JSP与Hibernate,我想通过数据库的功能来实现用户的认证 - create user ...
- 并使用相同的方法登录。 所以每次我的脚本应该知道当前用户的登录名和密码,我知道有类似的会议做的唯一方法:
SessionFactory sf = new Configuration()
.configure("/hibernate.cfg.xml")
.setProperty("hibernate.connection.username", session.getAttribute("username"))
.setProperty("hibernate.connection.password", session.getAttribute("password"))
.buildSessionFactory();
是它似乎脆弱?如果它在服务器端执行,为什么我应该避免在会话中传递存储?
我对HibernateSession的HttpSession感到困惑。你为什么要这样? – Keerthivasan
我有多个index.jsp,所以hibernateSession会在完成一些脚本执行 – WildDev