java - struts2的xml验证用户名密码不为空 但是验证却不通过?
黄舟
黄舟 2017-04-18 09:20:04
0
1
649

1.我的问题是:我用struts2的xml验证去验证登陆的用户名密码不能为空,为空的话不会访问action,在jsp上显示错误信息。这一步没问题,问题是当用户名和密码不为空时,jsp上仍然显示错误信息,无法访问action,自己想了好久,找不到问题所在。
2.

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(1)
小葫芦

Found the problem. It's a rather careless question. UserAction does not implement the ModelDriven interface, so the model driver cannot encapsulate the data passed from the front desk into the User, so the username and password obtained by verifying the file are always null. You only need the UserAction class to implement the ModelDriven interface, and the problem is solved

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!