By default, Struts 2 “redirect” is a temporary redirect (302). This makes sense. However, for SEO purposes, I need to issue a permanent redirect (301). Is there an easy way to achieve this?
By default, Struts 2 redirect is a temporary redirect (302). This makes sense. However,
Share
ServletRedirectResult has a
statusCodethat should work. Try setting thestatusCodeparam on your redirect result. If you’re using the Conventions plugin, something like:or the old style: