这是我在蓝桥班初学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&#