Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
アプリケーションで RESTEasy サービスを使用していますが、クライアントの IP アドレスを取得する必要があります。問題は...どうすればそれを行うことができますか?. 前もって感謝します
EDITEDサーブレットフィルターを使用したソリューションにたどり着きました...しかし、それでも..RESTEasyサービス内でそれを行うことはできますか?
次のように、リソースの Context に注釈を付けることができます。
@GET @Path("/{id}") public Response getMe( final @PathParam("id") String id, @Context HttpServletRequest req) { System.err.println(req.getRemoteAddr());