debugging - How can I debug efficiently in java when I'm using curl? -
i'm using maven/jetty run app , sending post requests it.
$mvn jetty:run $curl -h "content-type:application/json" -xpost 'http://localhost:8080/hi' -d '{"url":"http://www.subway.com", "operator":1}
here example of class. using resteasy hook curl localhost:8080/hi causes handlepost() called:
@path("/hi") public class hi { @post @consumes("application/json") @produces("text/plain") public response handlepost() { return response.status(httpstatus.sc_ok).entity("hey!").build(); } }
note output
"hey!"
i want able debug code efficiently, , wondering if there way to
- make breakpoints work , debug ide (using intellij)
- output simple terminal
for #1, i'm not sure start. #2, tried
system.out.println("hello!");
but never gets outputted, presumably because i'm not running program terminal?
instead of using mvn jetty:run
launch web application command line, launch application ide. should attach debugger , allow use standard tools. client use talk application doesn't matter, curl work fine.
Comments
Post a Comment