开发者

Using Request object in a validate method STRUTS

开发者 https://www.devze.com 2023-04-07 18:44 出处:网络
Is it possible to set an attribute in a request or session scope in a HttpServletRequest object of a validate method in Struts.

Is it possible to set an attribute in a request or session scope in a HttpServletRequest object of a validate method in Struts.

Example:

@Override
public ActionErrors validate(ActionM开发者_开发问答apping mapping, HttpServletRequest request){
ActionErrors ae = new ActionErrors();
request.getSession().setAttribute("unit", request.getParameter("unit"));
}

Because ive been trying this and it is not working in my jsp. If it is not working then what is the purpose of this object in this method.

0

精彩评论

暂无评论...
验证码 换一张
取 消