简体   繁体   中英

how to do HTTPS post/get in java.

Is it possible to do https get/post by just using J2SE without any web components eg. servlets and other stuff. If possible then how to do?

If I am using sockets to send and receive into then there will be no get/post. I am I right in saying that?

My scenario is described below.

Application A and B running in same server. app A sends a https post to app B. What should app B do to get that URL and process the request parameters? Again no servlets . both the application will standalone application with no web interface. How will app A hit my server?

No offense but that is what Servlets do, that is the entire reason for their existence. I am sure there is some back-assward hack to simulate a Servlet, but it kind of defeats the purpose.

I guess the bare minimum you'd need is a ServerSocket (or SSLServerSocket) and HttpURLConnection (or HttpsURLConnection). If you're implementing something really trivial, then it shouldn't be too much work to implement a simple service with a custom ServerSocket.

Now that i think about it, i've actually done that once. Totally doable :)

You can use Message Queue to acheive what you want. 1st application can send http request to a message queue and 2nd application can check the queue for any waiting request.

check apache Active MQ for further reference.

http://activemq.apache.org/how-should-i-implement-request-response-with-jms.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM