如何在Struts2操作中获取请求标头我无法使用request.header("")
方法,因为在struts2请求只是Map<String,Object>
,因此此方法不可用。
答案 0 :(得分:2)
在互联网上查看后,我发现我需要采取行动来实施ServletRequestAware
,这会让拦截器在你的行动中推动HttpServletRequest
。以后我可以使用相同的。 Thanx所有回复.. :)
public class CategoryAction implements ServletRequestAware{
// Your code goes here...
}