• Post Reply Bookmark Topic Watch Topic
  • New Topic

how do I get the name of the sender of request  RSS feed

 
alsoumahi alBatal
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys , How are you all , let's say we have three servltes s1 s2 s3 , both s1 and s2 send a request to s3
so is there a way to know the name of sender(s1 or s2) from the request itself , is there any methods something like request.getSourceName()
because I want to respond with different actions for s1 and s2

thanks
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "send a request" - client-side redirect? Server-side forward? An actual HTTP call?

If it's a forward then you can add an attribute to the request. For the others you could add an URL parameter.
 
JasonGg Wang
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
request is like a kind of map,you can put what you want into the request..
request.setattribute(Key,Value)......
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JasonGg Wang wrote:request.setattribute(Key,Value)......

No, it's setAttribute().
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!