Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why dont we have a request.setParameter() ?

 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not know if it is a smart question but I am curious to know.
I am checking the various scope and attributes/parameters associated and i am a bit surprised to see that the request scope has a java.lang.String getParameter(java.lang.String name) method but no setParameter method.

Why ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64838
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Request parameters are submitted to a servlet or JSP from a client via HTTP. They are not set by server-side code so there is no need for any set methods.
 
Shankar sanjay
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to redirect (out of our website) to some other site with adding some parameters as input. How can i solve this?

can you please help me on this?
 
Vishal Shaw
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shankar sanjay wrote:Hi,

I want to redirect (out of our website) to some other site with adding some parameters as input. How can i solve this?

can you please help me on this?


you can append those data with the url. But that is not advisable if the data is too bulky. Instead you can post your data . But the other page ( the url where you are redirecting), must know how to fetch the data you are sending
 
Shankar sanjay
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the reply, the problem is the data is like 2mb size characters(textarea) and other site is expecting in POST method and i think they are using request.paramter("textarea") something like, otherwise i could have used request.setAttribute(). is there any better way to handle this?
 
jatan bhavsar
Ranch Hand
Posts: 299
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shankar,

If you want to use redirect to transfer to another page and at the same time if you want to transfer the data then the option is
session only.

you can set it and once you get the data you can remove it from the session .
Please correct me if i am wrong as with redirect request object will not be available.

Regards
Jatan

 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Snce we're talking about redirecting to another server, no session is available. Nor is a POST possible.
 
Vishal Shaw
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think sending the data through web services is a better option .
 
jatan bhavsar
Ranch Hand
Posts: 299
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I think i misunderstood the question.

Correct me if i am wrong

we can use httpclient in this scenario to redirect to another server.I am interested to know which is good httpclient or java.net ?

Regard
jatan



 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HttpClient can help to access another web site, not to redirect a request.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic