Java EE的 - 使用servlet验证用户 [英] java ee - authenticate users using servlets

查看:153
本文介绍了Java EE的 - 使用servlet验证用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始学习Java,并没有使用Java EE工作。我需要使用servlet来验证用户身份。提醒,请样本code和技术文献。谢谢!


解决方案

  1. 创建接受用户名/密码的HTML表单。


  2. 这些数据发布到一个servlet。


  3. 在的doPost(读要求对这些数据检查他们对数据库。


  4. 设置一些参数会议,将显示你的系统该用户进行身份验证并登录。


请参见

I just started learning java, and have not worked with java ee. I need to authenticate users using servlets. Advise, please, sample code and technical literature. Thank you!

解决方案

  1. create a html form that accept username / password.

  2. post these data to a servlet.

  3. in doPost() read these data from request check them against database.

  4. set some parameter in session that will show your system that this user is authenticated and logged in.

Also See

这篇关于Java EE的 - 使用servlet验证用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆