• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

unable to send huge data from jsp to servlet using doPost

 
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using post method for sending some data from jsp to servlet but it takes only 2K of data and moreover for postmethod the browser should not display the content in url
what might be the problem
here is the code i am using in the jsp page


thanking u
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're using the post method but it still looks like you're sending the data in the query string.
Why don't you send it in the post body?

Also, this is not an example of sending data from a JSP to a Servlet.
You're sending data from the browser to the servlet.
[ May 05, 2006: Message edited by: Ben Souther ]
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ya u r right i am sending huge data from textarea(browser) to servlet
but unable to send :roll:
anyway the code which i have given in my previous post was from jsp file so i am considering it as sending data from jsp to servlet

what ever,I wanan know the reason why it is taking 2K of data???
can any one tell me the reason???

thanking u
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is a limit to how large a query string can be.
It used to be 255 chars, but some browsers will now take more.

Merely specifying that the method is 'post' isn't going to help if you are still embedding the data in the query string.

If you have to build up the name/value pairs with javascript, create hidden input fields, add them to the form, populate them, and then submit the form.
Doing it this way will cause the data to be placed in the body of the post rather than the query string. You won't have to deal with the size constraints and (as a plus) all the data won't show up in the address bar of your browser.

If you need help, with the Javascript, let me know and I'll move this thread to the HTML/Javascript forum.

-Ben
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry boss i dont want to use hidden fields in my form , i just want to send the data directly from textarea using javascript function but i dont want to make visible my data in the url but i want to use javascript for url.
is there nay other way for sneding the data with out using hidden fields??

thanx in advance
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could use AJAX.
If you need help/examples, of this, let me know and I'll move this thread to the HTML/Javascript forum where the AJAX gurus hang out.
 
reply
    Bookmark Topic Watch Topic
  • New Topic