• 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Struts2 : modify response header  RSS feed

Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I modify an already set response header?

This is required for an application which behaves like this -

Client C talks to server A in a different syntax and server A sends the request to server S ( struts2 server) . Now after a successful login, i am using a actionRedirect to take the user to the Home page whose URL is like this : http:/mywebserver.com/secure/home . So, struts2 sets the Location header to this URL. But, server A expects us to write the URL in the form >> Location: widget:secure/home or Location: http://mobileapp.com/secure/home

So, I want to edit the header by replacing the mywebserver.com with mobilesite.com and keep the rest of the value intact.

How can I do that in struts? what sort of interceptor I must use? Or is it possible at all?
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know if this will work for you, but here's an example from one blogger on how to modify the response object by using a custom interceptor:


Good Luck
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!