java - Why is my QueryParam returning null -


disclaimer : not j2ee developer. code works elsewhere, 1 api going crazy.

code

@get     @path("getcloseby")     @consumes({ mediatype.text_plain })     @produces({ mediatype.application_json })     public cservicecenters getlist(@queryparam("latitude") double latitude,             @queryparam("longitude") double longitude) {             log.info("getcloseby searching lat "                     + latitude + " lng " + longitude); 

getcloseby searching lat 17.63 lng null

calling client

curl http://:8080/mywar/myapi/getcloseby?latitude=17.63&longitude=73.9

disclaimer: not big curl user, don't know nuances, , why works. may shell problem.

to work had add quotes " around url

curl "http://:8080/mywar/myapi/getcloseby?latitude=17.63&longitude=73.9"

note: tried escape & (without quotes) urisyntaxexeption server.


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -