如何用条纹清理豆田
在 JSP 中,我有以下字段:
<stripes:text name="email"/>
该字段位于我的操作 bean(片段)中:
public class CreateClaim implements ActionBean {
private String email;
public void setEmail(String email) {
this.email = email;
}
public String getEmail() {
return email;
}
public Resolution alc(){
email = "poodle";
return new ForwardResolution("aForward.jsp");
}
}
在 alc() 方法中,我将电子邮件设置为空。但是,当页面呈现时,电子邮件字段的值与最初输入的值完全相同。 有没有办法在事件触发后清除该字段?
干杯
戴夫
In a JSP I have the following field:
<stripes:text name="email"/>
This field is in my action bean(snippet):
public class CreateClaim implements ActionBean {
private String email;
public void setEmail(String email) {
this.email = email;
}
public String getEmail() {
return email;
}
public Resolution alc(){
email = "poodle";
return new ForwardResolution("aForward.jsp");
}
}
In the alc() methos I am setting email to be null. But when the pages renders the value of the email field is exactly as it was entered originally.
Is there a way of clearing this field once and event has triggered?
Cheers
Dave
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这与Stripes框架的群体策略有关。默认情况下,它具有请求优先策略(由于与早期版本的向后兼容性),但我总是将其更改为bean 优先填充策略。
只需编辑 web.xml 即可为您的 Stripes 过滤器添加 init-param:
This has to do with the population strategy of the Stripes framework. By default it has a Request first strategy (due to backward compatibility with earlier versions), but I always change it to the bean first population strategy.
Just edit the web.xml to add a init-param for your Stripes filter: