Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing parameters in URL  RSS feed

 
Siddhesh Khedekar
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Experts,

We have an existing project in which we are using document.location.replace().
Is there a limit to passing number of characters in this function, I am trying to pass around 350 characters.
I am using this to process it in another JSP, where in I get a null pointer exception

Please suggest.

Thanks
 
Rob Spoor
Sheriff
Posts: 21087
85
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Browsers usually don't allow addresses to have much more than 250 or so characters. If you exceed this amount then you should use POST instead of GET. Which of course means you can't use location.replace() as that uses GET. An alternative is to store much of that data in the session and retrieve it from there instead.
 
Amit Ghorpade
Bartender
Posts: 2856
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes there is a length restriction on the number of characters that are present in the URL parameters.
Why not use POST request or hidden form fields?
 
Siddhesh Khedekar
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Amit and Rob. I will try storing in session and work with the data.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!