Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

request.getParameter() LImitation  RSS feed

 
Alok Panda
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Is there any limitation in using request.getParameter()?
I am passing a value in the request object from JSP and when ever its a bit long, it truncates half of that.
Please help !!

Regards,
Alok

 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are indeed limitations when you use GET. The limitation is unspecified and depends on the webbrowser and the application server used. Generally the limitation lies around 255 characters for the query string (the part after the "?"). You need to use POST when you want to send more than only a few input values.
 
Alok Panda
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am aware of the GET method having some limitations. We are using post method and the application is based on struts framework
But sometimes it truncates a part of the string

Regards,
Alok
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something else in your application is causing the truncation then.
 
Alok Panda
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any idea how should I debug this?

Regards,
Alok
 
Anurag Blore
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you should check the struts-config.xml file to check what is the 'scope' defnied in action mapping is it request or something else.

To debug you must first find if you are loosing the data cnsistently while doing request.getParameter or its happenning randomly. If its happening randomly then check the browser setting also.

 
Mohamed Inayath
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How browser setting will effect the getParameter value limit.
As told, GET has a limitation while POST doesn't have.

Somewhere the application code is doing the truncation.
Check your code.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you repeating other's answers? Please tell something new (and correct).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!