Add javascript and server code for 1st step

add a single javascript function that could work for get, post, put
method.
add the handler in servlet to handle different situation.

pending send payload from ui which is not working.