wood burning stoves 2.0*
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


JavaRanch » Java Forums » Java » Servlets
Bookmark "doPost Data Limit" Watch "doPost Data Limit" New topic
Author

doPost Data Limit

Dave James
Greenhorn

Joined: Jun 18, 2001
Posts: 5
Hi,
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
Greenhorn

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.
srivatsan
Dave James
Greenhorn

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
Greenhorn

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
session.putValue("xmlvalue",str);
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
srivatsan
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

getValue() is deprecated. Use get/setAttribute() instead.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: doPost Data Limit