I have a simple question, but I'm searching for longer time, but I always found the same answers,which i don't really know how to handle...
i want to get the IP adress of the client, when he registers to my application...
i found something like this:
@ManagedBean(name="testController")
@SessionScoped
public class TestController implements Serializable {
private static final long serialVersionUID = -3244711761400747261L;
protected final HttpServletRequest req;
public TestController(HttpServletRequest req) {
this.req = req;
System.out.println(this.req.getRemoteAddr().toString());
}
}
but i don't have the HttpServletRequest in the constructor.... or i don't know how to use it, all i get are errors....