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.getRequestDispatch er(newURL) .include(r equest, 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.getRequestDispatch er(newURL) .include(r equest, 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 ?
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.getRequestDispatch
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.getRequestDispatch
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.