Note that there are some explanatory texts on larger screens.

plurals
  1. POJersey GET param returning null
    primarykey
    data
    text
    <p>I am new to Java EE, and am attempting to write a GET service. To get a value from the webservice, I need to send the primary key to the service as a parameter. I am getting a null on the parameter value at the server end. I know I am missing something basic here.</p> <p>Client Side Junit test</p> <pre><code>//VehicleList service = client.resource(UriBuilder.fromUri( "http://localhost:8081/mCruiseOnCarPool4All/carpool4all/VehicleList/Request").build()); service.setProperty("identityHash", identityHash) ; VehicleDetailsConcrete[] vehicleList = service.type(MediaType.APPLICATION_JSON).get( VehicleDetailsConcrete[].class); assertNotNull(vehicleList) ; assertTrue(vehicleList.length &gt; 0) ; </code></pre> <p>Server Side Service</p> <pre><code>@GET @Path ("Request") @Produces({ MediaType.APPLICATION_JSON }) public Response getVehicleList(@PathParam("identityHash") String identityHash) { VehicleListRequest request = new VehicleListRequest(identityHash) ; VehicleListResponse response ; clientSession = sessionManager.getClientSession(identityHash) ; clientSession.getSendQueue().sendRequest(request) ; try { response = (VehicleListResponse)clientSession.waitAndGetResponse(request) ; } catch (WaitedLongEnoughException e) { return Response.serverError().build() ; } catch (UnableToResolveResponseException e) { return Response.serverError().build() ; }; return Response.ok(response).build(); } </code></pre> <p>identityHash in getVehicleList is null</p> <p>I am using setProperty, assuming it will do a setParam. I am certain that is what I am missing. A setParameter kinda call.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload