This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Setting request parameter from interceptor and accessing in ActionClass  RSS feed

 
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 ?
 
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
Boost this thread!