用户名、邮箱、手机号搭配密码都可以实现登陆(2种方法)

这是我在蓝桥班初学java做的第二个项目所遇到和解决的问题,写下来纪念,顺便供有缘人参考。
用户名/手机号/邮箱+密码登陆是当今最常用的登陆,对初学者而言这是必须掌握和精通的,这也是在我基础薄弱的我坚持解决的动力,其中感谢队友李青的大力协助。

前提:

model中写好teacher实体类,并提供getter和setter方法、toString重写转字符串。
SqlMapConfig.xml中configuration的typeAliases标签设置别名:

<configuration>
 <typeAliases>
  <typeAlias type="com.lq.model.Teacher" alias="teacher"/>
 </typeAliases>
</configuration>

service层applicationContext-service.xml中使用 dubbo协议设置要暴露的接口

<dubbo:service interface="com.lq.service.ITeacherService" ref="teacherService" protocol="dubbo" />

web层spring-servlet.xml中配置zookeeper
注:运行时别忘启动zookeeper

<dubbo:reference id="teacherService" interface="com.lq.service.ITeacherService" timeout="1200000"/>

teacherLogin.jsp

<form class="form-auth-small" action="/teacher/teacherLogin.do" method="post">
	<div class="form-group">
		<label for="signin-email" class="control-label sr-only">教师姓名</label>
		<input type="text" class="form-control" id="signin-email" 
		placeholder="输入用户名/邮箱/手机号" name="teaName">
	</div>
	<div class="form-group">
		<label for="signin-password" class="control-label sr-only">密码</label>
		<input type="password" class="form-control" id="signin-password&#
  • 4
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值