1) 我在下面给出的请求对象中添加了一个元素,我需要在我的网页中获取/读取它,我该怎么做?
1) i have added an element in request object given below, i need to get/read this in my webpage, how can i do it?
<input type="hidden"> wicket:id="submitted" value="false" />
例如:在 servlet 中,使用隐藏会话中的 request.getParameter("submitted").
eg: in servlet, use request.getParameter("submitted") from hidden session.
2) 在我的控制器类中,我想在会话或隐藏字段中设置值,以便我可以识别用户是否已经处理了请求或进入了我的代码块.
2) in my controller class i want to set the value in session or hidden field, so that i can identify the user if he already processed the request or enetered my block of code.
1) 使用HiddenField
2) 使用自定义 WebSession
对象:
2) use a custom WebSession
object:
public class MySession extends WebSession{
public Mysession(Request request){super(request);}
private boolean completedRegistration;
public boolean hasCompletedRegistration() {
return completedRegistration;
}
public void setCompletedRegistration(boolean completedRegistration) {
this.completedRegistration = completedRegistration;
}
}
这篇关于wicket 框架中请求对象的会话处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!