8 Replies Latest reply on Sep 24, 2012 9:53 AM by smatthews

    How to get httprequest?

    dva

      I want it to get the IP address in the Login module.

       

      In JBoss 6 i got so:

       

       

      private String getIP() throws PolicyContextException {
        HttpServletRequest request = (HttpServletRequest) PolicyContext.getContext("javax.servlet.http.HttpServletRequest");
        return request.getRemoteHost()
      }
      

       

      In JBoss 7 i get an error: IllegalArgumentException: No PolicyContextHandler for key=javax.servlet.http.HttpServletRequest

       

      When scanning, I found that there are only two keys: CallbackHandler and SubjectHandler...

       

      Thanks for you answers!