I am using a response.sendRedirect(response.encodeRedirectURL(page)) in a custom tag.

Frank Steidinger

If you send a redirect from inside a custom tag you should return Tag.SKIP_PAGE from your doEndTag() method. That ensures that the rest of the page isn't processed and might solve your problem.

You should also make sure that you aren't writing any HTML output before you send the redirect. Otherwise you should get an error but I've seen JSP engines that mixed the original page with the error page or the "redirect page".