It's difficult without a clearer explanation of what you're trying to do.
You want to respond to HTTP Post requests using Java.
You can do that using the
servlet API to create a
webapp, which is served using a servlet engine provided by software such as
Jetty/
Tomcat/others.
Beyond that, it's hard to say much more because responding to requests is a very generic requirement.
There are
lots of Java frameworks, some of which may be relevant and potentially help you with building the webapp, and should hopefully guide you towards doing it securely.