title: JBoss RESTEasy Client and Servlet
body: <p>My RESTEasy service does have a method using cookie parameters:</p>
  
  <pre><code>public interface SimpleService
  {
    public String test(@CookieParam("param") String param);
  }
  </code></pre>
  
  <p>Now I am trying to use my SimpleService with RESTEasy client framework and it's proxy factory from within my Servlet. However, how can I "forward" the cookie parameters correctly? Right now, I need to manually loop through the request's cookies array and provide the cookie's value manually to the test(..) function call. Reading RESTEasy client framework documentation on <a href="http://docs.jboss.org/resteasy/docs/2.3.0.GA/userguide/html/RESTEasy_Client_Framework.html" rel="nofollow">http://docs.jboss.org/resteasy/docs/2.3.0.GA/userguide/html/RESTEasy_Client_Framework.html</a> reads:</p>
  
  <p>@CookieParam works the mirror opposite of its server-side counterpart and creates a cookie header to send to the server. You do not need to use @CookieParam if you allocate your own javax.ws.rs.core.Cookie object and pass it as a parameter to a client proxy method. The client framework understands that you are passing a cookie to the server so no extra metadata is needed.</p>
  
  <p>So I am curious what this means for my case? How to properly use RESTEasy client framework &amp; cookie parameters in my servlet?</p>
  
  <p>thanks!</p>