• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting request parameter from interceptor and accessing in ActionClass

 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am setting parameters from my custom interceptor, and trying to access from my ActionClass but i am not able to get the parameter in My Action Class.



I think they are action parameter not request parameters.

Can i set request parameters from interceptors ?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, using the request object.
 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


but there is no no method for setting request parameter. such as request.setParameter(..,..); I can setAttribute only.

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...

http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getParameterMap()

In general it will almost always be quicker to do the research yourself.

(Hmm, that might be an immutable map though.)

Why do you want to do this, anyway? In general, S2 tries to remove dependencies on the request.
 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, my requirement is as below..

I have my personal website,
in which i am trying to display google ads based on the content of the page.
And few pages requres authentication.
So i have created one super user for google ads,
and when the client user logs in, google user will also login with its username/password.
and will try to read the loginId of the client user from query string(requestParameters)
and google will get the same content which client user got,
and based on the content google ads will get displayed on client user's page.

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh. I don't see any reason to (a) do that in an interceptor, or (b) modify any request parameters.
 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh then how will google user get the id of currently logged in user
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic