How to send http request parameters using Jersey client
<p>I use the following rest client implementation of jersey to consume a rest service.I am able to do it successfully.Additionally now I need to send request parameters which will be consumed as part of HttpServletRequest on the producer side.</p>

<p>Consumer side Jersey client code</p>

<pre><code>    private ClientResponse getWebClientResponse(String RESOURCE_PATH, String methodType, Object requestObj) {
    WebResource webResource;
    ClientResponse response = null;
    try {
        String environmentHost = EnvironmentUtil.resolveEnvironmentHost();
        Client client = prepareClient();
        String RWP_BASE_URI = environmentHost + "/workflow/rest";
        webResource = client.resource(RWP_BASE_URI);
        WebResource path = webResource.path(RESOURCE_PATH);
        if (GET.equals(methodType)) {
            response = path.type(javax.ws.rs.core.MediaType.APPLICATION_JSON).get(
                ClientResponse.class);
        } else if (POST.equalsIgnoreCase(methodType)) {
            response = path.type(javax.ws.rs.core.MediaType.APPLICATION_JSON).post(ClientResponse.class, requestObj);
        }
    } catch (Exception e) {
        throw new RuntimeException(e.getMessage());
    }
    return response;
}
</code></pre>

<p>Producer side </p>

<pre><code>@Context
public void setContext(SecurityContext context) {
    this.context = context;
}

public HttpServletRequest getRequest() {
    return request;
}

@Context
public void setRequest(HttpServletRequest request) {
    this.request = request;
}

public String getSessionUserPID(final HttpServletRequest request,
                                final SecurityContext context) {
    if (request.getSession(false) == null) {
        final String exceptionMessage = "getSessionUserPID() failed, session NOT FOUND for this request";
        final Response response = Response.status(ExceptionStatus.UNAUTHORIZED.getNumber())
                .entity(exceptionMessage).build();
        LOG.error(exceptionMessage);
        throw new WebApplicationException(response);
    }

    if (context.getUserPrincipal() == null) {
        final String exceptionMessage = "getSessionUserPID() failed, user principal NOT FOUND";
        final Response response = Response.status(ExceptionStatus.UNAUTHORIZED.getNumber())
                .entity(exceptionMessage).build();
        LOG.error(exceptionMessage);
        throw new WebApplicationException(response);
    }

    final String userPID = context.getUserPrincipal().getName();
    if (userPID == null || userPID.isEmpty()) {
        final String exceptionMessage = "getSessionUserPID() failed, user principal name cannot be null or empty";
        final Response response = Response.status(ExceptionStatus.UNAUTHORIZED.getNumber())
                .entity(exceptionMessage).build();
        LOG.error(exceptionMessage);
        throw new WebApplicationException(response);
    }

    return userPID;
}
</code></pre>

<p>The main intention here is currently I get user information from weblogic security context but for a particular scenario I need to pass this part of rest service request and obtain it from HttpServletRequest object.How can I obtain this from httpservletrequest</p>