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 ?
Java EEJSPJava

Avatar of undefined
Last Comment
rrz

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
mrcoffee365

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
rrz

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck