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

  1. make breakpoints work , debug ide (using intellij)
  2. 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

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

c++ - End of file on pipe magic during open -