It's not a secret anymore!
The moose likes Spring and the fly likes Big RequestParameters from  JSP. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Big RequestParameters from  JSP." Watch "Big RequestParameters from  JSP." New topic

Big RequestParameters from JSP.

Lucky J Verma
Ranch Hand

Joined: Apr 11, 2007
Posts: 278

Hi all
I have a display table in my jsp. In this table one column is clickable and clicking this sends 2 request parameters (ReasonsText and account)to my spring controller.
And i am creating links using Decoratros.
But there could be cases when first request paramter(reasonsText) can be extra large.It fails in that case .Is there any alternative to that?
I tried finding something in my database tables which i could use in place of reasonsText(like reason ID) but i use group by on reasonsText so i couldnot use id.

Please suggest.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63858

Please be sure to ask Spring questions in the Spring forum. I have moved this post there for you.

[Asking smart questions] [About Bear] [Books by Bear]
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Remember that request URL with parameters have a length limitation. Typically it is better to have that submitted through a form, I would think. So that it ends up in the body of the request instead of as a request parameter. Or you can limit the amount of text the user can type in so that it doesn't reach the request parameter limitation.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Lucky J Verma
Ranch Hand

Joined: Apr 11, 2007
Posts: 278

Hi Mark ,
Thanks for help.
Can you please give me an example on how to send data to @RequestBody for <display:table> column?
Adding it in form and then i use Will it automatically go to @RequestBody and not @RequestParam
. And data is sent in
Also i tried sneding POST data -by adding hidden fields to display:column and no which is not working .Since variables contain duplicated comma separated values
and no hint of what value was user-selected.
Furthur research taught me ts limitation of sending POST values.
Ken Blair
Ranch Hand

Joined: Jul 15, 2003
Posts: 1078

That's not what he's talking about.

A GET sends parameters in the request URL. A POST sends parameters in the body of the request. Because the length of a URL is restricted the length of the parameters is inherently limited. If you need to send a lot of data through a parameter, or even just a lot of parameters, you should prefer using POST as it's less likely to run into the length issues.

@RequestParam works for both. @RequestBody has nothing to do with it.

If you're getting a comma separated value it means that the parameter was included more than once. Look at your form and request URL and ensure you haven't submitted the value in two different places at the same time. If you're expecting multiple values for a parameter then it should probably be a List.
I agree. Here's the link:
subject: Big RequestParameters from JSP.
It's not a secret anymore!