Adds a <base> tag only when necessary.
After forward (or forward fall-back from redirect), relative paths might not resolve relative to the current JSP page. This will be most evident when forwarding between different directories.
To keep paths relative to the page after a forward, a <base> tag is written when the path of the current JSP page does not equal the path of the original request.
A <base> tag will affect any anchor links on a page. For this reason, this <base> tag primarily exists for when a redirect has to fall-back to a forward to a resource in another path. Properly displaying the main contents in this case is considered more important than correctly behaving anchors.