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

Parameter Limit?  RSS feed

 
Daniel Prene
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a limit to how much data you can send a jsp file? If there is, what should I do to overcome it?
[ October 03, 2005: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66186
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, sort of. There's not really any pre-defined limit to the amount of data you can post to a JSP (or any other web resource) beyond practical memory limits, but there is a limit to the length of a URL you can submit via a GET. I'm not sure of the exact number, but if you are passing a large number of parameters, you're going to run out of space quickly.

To avoid it, be sure to post large datasets using a form (with a method of POST) rather than trying to build up a URL.
[ October 03, 2005: Message edited by: Bear Bibeault ]
 
Sravan Kumar
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The amount of data that you can send in a HTTP GET request is browser dependent; most browsers limit the size to 256 characters.

If you want to send data, POST is the ideal method. As Bear said, you can send any amount of data in a POST request, unless it exceeds your (system) memory.
 
Bosun Bello
Ranch Hand
Posts: 1512
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, always use "POST" if there is a chance that you could be sending large amounts of data. Just ran into this issue the other day. I was maintaining an application and one of the JSPs used a �Get� (What an error!) as the forms method. So, all of a sudden, submitting the form with a large test data was generating a Javascript error. Using smaller data it worked okay. Even though I knew about the limitation of the data size when using �Get�, I never thought the form would have been coded to use �Get� as the method. Something just told me to check it just in case, and there it was. I changed it to POST and I was on my way.
[ October 04, 2005: Message edited by: Bosun Bello ]
 
Daniel Prene
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll be sending the information via a Command (Command and Controller stratagy style), would it make more sense to populate a bean and then have the jsp pull from that bean? The actual JSPs will not be exposed to the outside. How exactly would I go about doing this? This is how I want it to go:

With Bean:
Controller -> Command -> Bean
and then the command returns the apropriate .jsp to be dispatched. The jsp then pulls from the bean.

Without Bean
Controller -> Command -> JSP
[ October 04, 2005: Message edited by: Daniel Prene ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66186
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's an entirely different hill of beans (pun absolutely intended).

This topic started talking about passing paramters to a JSP as part of the request.

That is a completely different subject than forwarding a request from one resource (your controller) to a JSP. In that case, you can't use parameters at all.

If that's what you meant in the the first post by "how much data you can send a jsp file" then completely ignore what has been posted so far (and please be a little more explicit in your future questions).

In the case of passing data from a controller to a JSP, you would used what are now termed "scoped variables", that is, objects (usually in bean format) attached to one of the available scopes (request, session, application) via the scopes' setAttribute() method.

And the answer to the original question is then: no limit beyond the available memory.
[ October 04, 2005: Message edited by: Bear Bibeault ]
 
Daniel Prene
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for digressing. My original intent paralels to my original question... Thank you all for the help, where can I bring my new question? Should I?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66186
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have a new question, please feel free to post a new topic.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!