Reputation: 79
I have a Javascript function, that calls window.location.href
Below is the sample example of code.
function xyz () {
var URL = "https://www.web.com/getNode.jsp?param1=abc|def|ghi|.......";
window.location.href = URL;
}
Here param1
can accept any nunmber of values. But the problem is if the size of "URL" var is more than 3000 characters, encountering an exception like
500 Internal Server Error.
But my requirement is to pass all the param1 values to the JSP no matter how long param1
is.
Is there any way to solve this Problem?
Can any one please help.
Thanks.
Upvotes: 2
Views: 513
Reputation: 12495
Let's summarize the facts:
The only logical conclusion is: it will not work, no matter how you try. Unless you break (or loosen) the rules.
Any solutions that you may think of will be workarounds which will NOT solve the problem in general, but might be "good enough". You are the only person who can know what "good enough" is - in your context.
Example solutions:
Note that all those "solutions" require cheating, as your stated goal remains impossible.
BTW: url shorteners are NOT a solution - they don't do magic, they just redirect people from a short url to a long one. If the target server rejects the longer url, it will still not work.
Upvotes: 4
Reputation: 1833
you can try change method from GET to POST and add all your params data inside body. Body in POST can contains much more
Upvotes: 0