Feeds:
Posts
Comments

Archive for the ‘java’ Category

Struts2 external redirect

For one of my S2 apps I needed to redirect to an external site. If you Google on how to do this, you’ll see examples in the form of:

<result name=”foo” type=”redirect”>${externalUrl}</result>

which doesn’t actually work, at least not in 2.0.11.2. Instead, I’m using the httpheader result type to do a 301 redirect:

<result name=”foo” type=”httpheader”>
<param name=”status”>301</param>
<param name=”headers.Location”>${externalUrl}</param>
</result>

Advertisement

Read Full Post »