我正在使用Jodd Madvoc
MVC 框架。我想获取 Web 应用程序客户端的 IP 地址。如何HttpServletRequest
在动作类中获取对象?
@MadvocAction(value = "login")
public class LoginAction extends BaseAction {
Logger logger = LoggerFactory.getLogger(getClass());
@PetiteInject
UserService userService;
@Action
public void view() {
if (logger.isInfoEnabled())
logger.info("LoginAction.view()");
// Code for getting ip Address
forwardTo("/login.jsp");
}
}