Looking into the code finally helped.
The problem is like this.

Before the first call to getParameter(), the parameters map is built by parsing the message body in POST request. Parsing happends only when Content-Type: application/x-www-form-urlencoded and Content-Length is sent.

The J2ME application for some reason still unknown does fails to set the Content-Length for requests with content above 2016 characters.

Therefore, when the data is below 2016 characters, things work. And when its greater than that, they fail.

Thanks alot for all your help.
Santosh.

Santosh Puranshettiwar wrote:
The J2ME application that sends the data to my server is built on the MIDP 2.0 profile. And MIDP 2.0 does support Unicode.

Moreover, could it really be a problem related to encoding? I unable to correlate it with the peculiar behavior I am observing whereby the server fails to parse the parameters in the message body, if its length is greater than 2016 characters. What's it got to do with 2016?

On the other hand, it might as well be a problem with encoding (or bug) in J2ME. Because, the same data when sent from a browser does not cause any problems.

One more query. Will digging the source code help? If so what should I specifically look for?

Thanks alot.
Santosh.
Martin Gainty wrote:
I know the initial versions of J2ME did not have UNICODE (either UTF-8 or UTF-16) support.

I would search the lists located here
https://subscriptions.sun.com/subscription_center/ecomm.jsp
2 years ago I met a fellow who coded a UTF-8 MIDP device for collecting Patient info (with the conclusion that UNICODE enabled handhelds are possible)

You will probably wind up hand coding the UTF-8 encoding logic...
provided your displays will have to be UNICODE display enabled display
and your input devices will need to be IME enabled..

Martin --
*********************************************************************
This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



----- Original Message ----- From: "Santosh Puranshettiwar" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Monday, August 21, 2006 12:49 AM
Subject: Re: Parsing keyvalue pairs in POST data


Thanks alot for your reply Martin.
Its just a simple setup. I am using Tomcat 4.1 listening on port 80 (OS: Windows - if that matters). Its not coupled with Apache.

Why would the same data when sent from a browser would parse well while not from a J2ME application? I'm baffled.

Santosh.

Martin Gainty wrote:
I assume you are front-ending with Apache..?

I would use HTTP 1.1 instead of (HTTP 1.0 where length must be specified beforehand)

Here are some keyword values in httpd.conf that will help you overcome your current limitations

You can adjust the limit on the size of any field via
LimitRequestFieldSize

You can adjust the limit on the size of the request line via LimitRequestLine

You can adjust the limit on the size of the HTTP body sent via text/xml
LimitXMLRequestBody
documenation available at
http://httpd.apache.org/docs/2.0/mod/core.html

Martin --
*********************************************************************
This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



----- Original Message ----- From: "Santosh Puranshettiwar" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Saturday, August 19, 2006 8:03 AM
Subject: Re: Parsing keyvalue pairs in POST data


Well, there's another problem.
HttpServletRequest.getParameter() is unable to parse the key-value pairs in the http message body if the the total content-length is greater that 2016.

Any ideas? Please.
Santosh.

Santosh Puranshettiwar wrote:
Managed to digg it.
Had to set Content-Type=application/x-www-form-urlencoded

Santosh Puranshettiwar wrote:
Hello,

How does tomcat parse the key-value pairs sent in a Http Request as POST data? I am unable to read the parameters using the HttpServletRequest.getParameter() method. Parameters are being sent by a J2ME application.

Tell me if more details are required.

Thanks alot.
Santosh.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to