1. Your servlets and web pages should be ignorant of whether they are invoked via http
or https.
2. the Jason Hunter book (Java Servlet Programming) describes how to do a POST request
and comes with a url from whence you can
download a class that handles the details for you.
3. The essential steps are
instantiate a URL
open the URLConnection
setDoInput and setDoOutput to true
set the request content type to "application/x-www-form-urlencoded")
url encode the request e.g. parm1=x¶m2=y
open an output stream on the urlconnection
write the request
open an input stream on the connection
write the request
read the reply
This should be enough to get you going. You can figure out the details by referencing
the net api docs and the http rfc or just get
the book (I'd copy the code directly but copyright aside I think OReilly and Jason
Hunter deserve all their revenue for resources
like these.)
HTH
***********************************************************
Brett Knights 626-432-5767 work
[EMAIL PROTECTED] 626-355-1017 home
***********************************************************
> Hi!
> Kindly help me resolve two questions.
>
> Q 1) Does servlets support https i.e. can I make a getURL request like
> https://www..........xxx.cgi
>
> I have to invoke a CGI script on server B (which is non-java server)
> from server A which has a Apache Jserv(1.0b5) on it.
> The scenario is like this.
> If the user chooses a particular option on the html page on
> the browser,
> a cgi request is made (IN THE BACKGROUND WITHOUT THE USER
> BEING AWARE OF
> IT) to a different server (server B).
> i.e. The java enabled server A makes the cgi request to
> non-java server
> B and tags along some sensistive info, over https.
> Q 2) Is it possible???
>
> Any input, pointer or info is highly appreciated.
>
> TIA
> Gaurav
>
>
>
> -- --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> READ THE FAQ!!!! <http://java.apache.org/faq/>
> Archives and Other: <http://java.apache.org/main/mail.html/>
> Problems?: [EMAIL PROTECTED]
>
>
-- --------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
READ THE FAQ!!!! <http://java.apache.org/faq/>
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]