my dog learned polymorphism*
The moose likes Servlets and the fly likes doPost Data Limit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "doPost Data Limit" Watch "doPost Data Limit" New topic

doPost Data Limit

Dave James

Joined: Jun 18, 2001
Posts: 5
I'm currently trying to call a servlet from a JSP.
I read in xml data from a file into a JSP and store the
data in a string. I attempt to call a servlet via a doPost
on a form using the servlets url; passing the string as
a data param at the same time.
Every time I attempt to send the data to the servlet, it only
receives about 2058 bytes. I'm using a WebLogic Server.
The xml file contains approx 4000 bytes.
Is there a limit to the number of bytes that you can send using a doPost?
Is there some web server config setting to allow me to send
more data using the doPost.
I'm new to jsp and servlets, anybody got any ideas.
srivatsan srinivasan

Joined: Jun 08, 2001
Posts: 26
hi dave,
yes dopost method has some limits and u cannot configure it in ur properties.what u do is put your xml file in session,dont pass it as a query string.again get it in the servlet usaing session.getValue().i think this may solve your problem.
Dave James

Joined: Jun 18, 2001
Posts: 5
Hi srivatsan,
thanks for your help, I'm still a bit lost, can you point me
to some examples.
srivatsan srinivasan

Joined: Jun 08, 2001
Posts: 26
hi dave,
assume your xml is stored in a string called str
String str=your xml
in your jsp file write
in your servlet write the following code
HttpSession session=req.getSession();
String str1=(String)session.getValue("xmlvalue");
This may work for you.
if u have any doubt please fell free to ask
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

getValue() is deprecated. Use get/setAttribute() instead.
I agree. Here's the link:
subject: doPost Data Limit
Similar Threads
Call servlets in Flex
How do I get my JSP to call a servlets doPost
Data transfer between Servlet and JSP
doPost() question
How send file data to JSP/Servlet page and save to disk?