"Ashwini Bhat" <[EMAIL PROTECTED]> wrote:

>> public class AppServlet extends HttpServlet{
>>         DataInputStream dis;
>>         DataOutputStream dos;
>>         URL url;
>>         URLConnection con;
>>         String s,s1;
>
>
>>>Declaring member variables which are mutated per request is not a good
>>>practice unless you syncronize on these variables but this should not be

>the
>>>cause of the exception you are getting.
>
>i did not get this statement.  What members are mutated here?  Infact, I
had
>tried using serverName as local variable in the display() method but the
>same error had come so I changed it to member variable.

You are changing the value of the variables din, dos..
This is not thread safe because if 2 threads execute together then it will
cause a problem. Search the archives for more details of this.


>con.setRequestProperty("CONTENT_TYPE","application/octet-stream");
>
>>>The HTTP header that you are trying to set is "CONTENT-TYPE" and not
>>>"CONTENT_TYPE" as you have set.
>
>CONTENT_TYPE will also work.  earlier it had worked.

I am not sure what makes you so sure that CONTENT_TYPE will work. I checked
rfc2616 and did not find even a single reference to CONTENT_TYPE although
Content-Type is very much there.
Can you test your code after changing this HTTP header name.


>But now i used streams to pass the data.  It's working fine.  But still i
>would feel comfortable using getParameter(...).

what is happening in your case ( just a guess in the absence of the full
stack trace of the exception that you get) is that the container is trying
to parse the body of the request and so the container expects to find a
query string there. As it is not a query string, the exception is
generated.

Regds,
Gokul

>Thanks
>Ashwini

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to