struts问题:注册密码不正确,返回到原来页面时,怎么样才能保存用户输入信息 使用session对象或COOKIES试试,但是好象session对象也不支持返回保留用户信息,我所学有限,帮你顶吧 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 struts有一个error message嘛,它可以返回错误信息,并把其他的信息带回去参考一下吧,struts自带的例子就有这东东 不是不需要session,直接用formaction就可以了吗,formaction不就是缓存作用吗,我看资料说能保存用户输入的 信息,当发生错误的时候能重新显示,这样只需要修改错误项就行了但是我为什么我的出错,而且除空指针错误高手指点 <input type="text" name="userName" value=<bean:write name="loginActionForm" property="userName" />这样就可以了 在register.jsp中加上 setattrtibute("username",username); setattrtibute("password1",password1); setattrtibute("password2",password2);在RegisterForm中 public class RegisterForm extends ActionForm protected String username=getattrtibute("username"); protected String password1=getattrtibute("password1"); protected String password2=getattrtibute("password2");试试看 这个应该不是很难。奇怪。我Copy你的代码到Tomcat下运行了一下,没错啊。你是不是其他地方出错,不是你上面给的几段代码出错?我这边网页registerjsp上有保存你的注册名和密码 是吗,楼上兄弟,你试过没有问题啊,难道是resin的问题? 其实是要用打印以下的javascript,就行,浏览器回帮你保留的(<input type=password>除外)<script language=javascript> history.go(-1)//返回浏览器的上一页</script> 不需要session,你所提交的数据是存放到你的formbean中的,当出现错误的时候,返回到input()页面,这个时候数据仍然是存在于你的formbean中的,你不需要进行其他操作就可以从frombean中取得刚才request上去的数据 建议你在进行类型转换以前要判断传入的参数是否为null,由此抛出异常,建议不断强化自己的代码才能使它更强健 求教下载问题,关于range的 刚进公司,居然让我搞测试,请教各位大神测试的原理? 文档在线阅读功能 各位大虾们小菜刚进公司 求救 不同系统间使用Session相互登录的问题,,分不多 可以再加 怪异问题 郁闷的HIBERANTE一对多双向关联问题 关于 web.xml 中 run-at 标签 的疑问。 Hibernate映射问题 小弟初学JSP,提一个TOMCAT初级问题! 高分求静态成员初始化代码? 关于web.xml和struts-config.xml路径问题? 一个关于xerces的问题,快帮忙啊!
参考一下吧,struts自带的例子就有这东东
formaction不就是缓存作用吗,我看资料说能保存用户输入的 信息,当发生错误的时候能重新显示,这样只需要修改错误项就行了但是我为什么我的出错,而且除空指针错误高手指点
这样就可以了
setattrtibute("username",username);
setattrtibute("password1",password1);
setattrtibute("password2",password2);在RegisterForm中
public class RegisterForm extends ActionForm
protected String username=getattrtibute("username");
protected String password1=getattrtibute("password1");
protected String password2=getattrtibute("password2");
试试看
奇怪。我Copy你的代码到Tomcat下运行了一下,没错啊。
你是不是其他地方出错,不是你上面给的几段代码出错?
我这边网页registerjsp上有保存你的注册名和密码
history.go(-1)//返回浏览器的上一页
</script>