----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

Hi Martin,

why don't you transmit the UrlQueryString as an String-Object? 

Your code seems to be correct, but what you tried to do is to use the POST
and GET command at the same time. By adding the urlQueryString after your
URL you implicitly use the GET command. But in my opinion the Object must be
send by the POST command. Am I wrong??

So if you send the "addrType=15&parentFolder=17" as an String-Object you
just have to add the reading of the String-Object to your code.

By
Ulrich

> -----Urspr�ngliche Nachricht-----
> Von:  Martin Pfeifer [SMTP:[EMAIL PROTECTED]]
> Gesendet am:  Donnerstag, 13. Januar 2000 15:29
> An:   Java Apache Users
> Betreff:      Sending serialized object to servlet, missing queryString
> 
> ----------------------------------------------------------------
> BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
> WHEN YOU POST, include all relevant version numbers, log files,
> and configuration files.  Don't make us guess your problem!!!
> ----------------------------------------------------------------
> 
> Hi to everyone,
> 
> Our client app tries to send a serialized object to a servlet.
> 
> The code looks like this
> 
>       // prepareConnection
>       URL url = new   
> URL("http://myserver/servlet/AddressServlet/insert?addrType=15&parentFolde
> r=17");
>       URLConnection urlConnection = url.openConnection();
>       urlConnection.setDoOutput(true);
>       urlConnection.setDoInput(true);
>       urlConnection.setUseCaches(false);
>       urlConnection.connect();
> 
>       // sending Object
>       OutputStream urlOutStream = urlConnection.getOutputStream();
>       ObjectOutputStream objOut = new ObjectOutputStream(urlOutStream);
>       AdressObject newAddress= getNewAddressObject();
>       objOut.writeObject(newAddress); // send request
> 
>       // cleanup
>       objOut.close();
> 
> The client app connect to the servlet but at the servlet side the
> parameters from the URL are missing. Only the url
> "myserver/servlet/AddressServlet/insert" is transmitted but a
> request.getParameter("parentFolder") or getQueryString() returns null.
> 
> If we omit sending the serialized object and do the following
> 
>       // prepareConnection
>       URL url = new           
> URL("http://myserver/servlet/AddressServlet/insert?addrType=15&parentFolde
> r=17");
>       URLConnection urlConnection = url.openConnection();
>       urlConnection.setDoOutput(true);
>       urlConnection.setDoInput(true);
>       urlConnection.setUseCaches(false);
>       urlConnection.connect();
>       Object obj=urlConnection.getContent()
> 
>       // cleanup
>       objOut.close();
> 
> everything works fine.
> 
> Is it possible to transmit a serliazed object via an URLConnection and
> transmit also the UrlQueryString (e.g. the parameters
> addrType=15&parentFolder=17) ???
> 
> Any help is appreciated. 
> Thanks in advance, Martin Pfeifer
> 
> 
> --
> --------------------------------------------------------------
> Please read the FAQ! <http://java.apache.org/faq/>
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Archives and Other:  <http://java.apache.org/main/mail.html>
> Problems?:           [EMAIL PROTECTED]


--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to