日期:2014-05-18  浏览次数:20620 次

用struts写一个修改密码的action,新手没有多少分,希望大家帮忙,谢谢!!!~~~
我用的是eclipes3.2,怎么才能写一个修改密码的Action阿  


------解决方案--------------------
用FORM把新参数传到后台
用UPDATE语句更新就可以了
------解决方案--------------------
页面
<form action= "AA.do ">
<input type= "text " name= "pwd ">
<input type= "text " name= "name ">
<input type= "submit " name=提交 value= "提交 ">
</form>

你的AAaction
得到页面参数新密码
String name= request.getParameter( "name ");
String new = request.getParameter( "pwd ");
连接你的数据库update wokao set userid = 80 where userName = 11
String sql = "update 表名 set mima(你的数据库字段) = ' "+new+ " ' " where name= " '+name+ ' ";