Link to home
Start Free TrialLog in
Avatar of wpeereboom
wpeereboom

asked on

Get cache-control headers from request for redirect

Hello,

I have created a servlet for using in jsp pages. It's for rewriting urls so i can have nice urls in my jsp website. For example
www.example.com/nicedir/nicefile.html

redirects thru a servlet depents on the subdirectory. It's not a realy redirect but:
request.getRequestDispatcher(newURL).include(request, response);
Where newURl is the jsp page for serving the content. like article.jsp
This works fine, but i send cache-control headers with the article.jsp and these are lost when the
request.getRequestDispatcher(newURL).include(request, response); line is called. So the compleet url www.example.com/nicedir/nicefile.html doesn't contain cache-control headers.

It is possible the add hardcoded cache-control headers in the servlet, but i would like to take over the cach-control headers that are set within the jsp page. So i have to retrieve these header and set this again within the servlet.

Does anyone has experience with this ?
ASKER CERTIFIED SOLUTION
Avatar of mrcoffee365
mrcoffee365
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial