• 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

doPost() method problem

 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have created a blank form and sending data from javascript to the servlet with the help of the form here below is the code

URL=URL + "&header_hsmChanceGrid="+header_hsmChanceGrid;//and so on

document.myForm.method="POST";
document.myForm.action=URL ;
document.myForm.submit();


Now when I am sending huge data in the URL my servlet is not getting invoked.
but with less data I can get the data in my servlet .


Can anybody have any idea how to pass thease data to my servlet ? Am I doing something wrong POST can manage the data right?Please help
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


URL=URL + "&header_hsmChanceGrid="+header_hsmChanceGrid;//and so on


This looks like you are passing parameters as part of the URL? That's not going to work with POST, which doesn't read parameters from the query string.
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Now when I am sending huge data in the URL my servlet is not getting invoked.
but with less data I can get the data in my servlet .



What makes you think that the servlet is not getting invoked with large data.
maybe its only taking more time
 
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 are limits to what some browsers will send on the queryline.
Initially, the limit was 255 chars. Most browsers allow more than that these days but the querystring is still a poor choice for passing anything but small and predictable amounts of data.

Move that data into the body of your post and you won't need to worry about bumping into a limit.
 
Monoj Roy
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having the data in the javascript level not in the form
I am using the form just to send the data to my servlet .As you are telling me to put the data in the body how can I put the data in the body from the java script?
 
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

Originally posted by Monoj Roy:
I am having the data in the javascript level not in the form
I am using the form just to send the data to my servlet .As you are telling me to put the data in the body how can I put the data in the body from the java script?



You can do that by creating an HTML form and using Javascript to submit it.
 
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
Would you like this thread moved to our HTML/Javascript forum where you can get better help with Javascript issues?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic