When "sendRedirect" is used, some times the relative url is being translated into an absolute url using wrong scheme (http vs https). This articles explores the problem and a possible solution using servlet filters.
Rewriting SendRedirect to deal with SSL (or https) offloading