struts2改造项目 - >编译错误

时间:2017-06-13 02:16:39

标签: java struts2

我有下面的代码,但它有编译错误。它从struts1迁移到struts2。我试图在网上搜索但没有用,例如" resetToken struts2"或" getLocalAddr请求" ... 请帮忙!!!

HttpServletRequest request = ServletActionContext.getRequest();

String serverNumber = request.getLocalAddr().substring(request.getLocalAddr().length()-1);
// *it said The method getLocalAddr() is undefined for the type HttpServletRequest* ...

resetToken(request);
//*The method resetToken(HttpServletRequest) is undefined for the type CardAction*

0 个答案:

没有答案