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

    How to get httprequest?

    Denis Agapitov Newbie

      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!