This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Does getParameterValues have a Limit

 
Steve Dyke
Ranch Hand
Posts: 1602
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am building a select list on a JSP. Before I submit I select all the items and it shows to have 25 items selected. In my servlet I do:

String [] getPickListArray = arg0.getParameterValues("pickItemList");
getPickListArray.length

It only shows 24.

Any ideas?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is your request being submitted as a GET or POST? The former has severe limitations on length.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you really name your request parameter arg0?
 
Steve Dyke
Ranch Hand
Posts: 1602
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my code:

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're not going to answer questions, you're unlikely to get problems solved. I ask again, is this a GET or POST request?

Yes, you are showing us the doPost code, but it's common for doGet handlers to route to the doPost. So what is the actual method type of the request?

(And really, arg0 and arg1?)
 
Steve Dyke
Ranch Hand
Posts: 1602
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suppose I did not understand what you were asking and I could still be confused. This is how I call the servlet from the JSP:

document.pickbuildform.action= "/ShippingDocsWebApp/PickListOptionsServlet";
document.pickbuildform.submit();

As far as the arg0, arg1 I think the answer is yes.

Please forgive me of my lack of knowledge. I am really trying to learn.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Steve Dyke:
I suppose I did not understand what you were asking and I could still be confused


OK, you really need to know the difference between a GET and a POST. Search google for "HTTP methods".

If your form tag does not specify a nethod, it defaults to GET. I suspect your problem will be fixed by adding

to your <form> tag.

Please do your HTTP research to understand why it makes a difference!

As far as the arg0, arg1 I think the answer is yes.
These are horribly unreadable choices for the parameter names. If you are here to learn, then my advice is to choose variable and parameter names that enhance, rather than obscure the readability of the code. Why not use request and response?

Please forgive me of my lack of knowledge. I am really trying to learn.
That's good, no apology necessary.
 
Steve Dyke
Ranch Hand
Posts: 1602
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have made my day. The suggestion to put the 'post' in my calling form worked. I just assumed(right) that the doPost and doGet methods were literal. I have not had any trouble up until now.

Thanks again for sharring your knowledge. I am sure I will have a lot more issues to question you about.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Be sure that you understand why that worked!
 
Michael Ku
Ranch Hand
Posts: 510
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you really name your request parameter arg0?


Some IDEs use this name when you use a wizard to create a new Servlet. You will probably say that you should then change this name and I agree. I just wanted to point out that sometimes it is not a conscious choice.
 
goli reddy
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it your request is get/post it is being limitaions on length.i think get is limited 240 to 250 characters
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The URL limit is browser dependent.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic