Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doPost Data Limit

 
Dave James
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi srivatsan,
thanks for your help, I'm still a bit lost, can you point me
to some examples.
 
srivatsan srinivasan
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getValue() is deprecated. Use get/setAttribute() instead.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic