For web server development, especially when the code is in a jar file, you need to write some code, stop the application inside the server, deploy the new one, start it all up etc. That takes time - and then you find that the code doesn't work so you try something else which takes more time and so on ...
It's much easier to write the snippet inside an Eclipse scrapbook first and test it.
"File / New / Other / Java / Java Run/Debug / Scrapbook Page
Then just write some code in the editor e.g.
Then highlight the snippet, right click, "Display"