• Home
  • About

peekay

random stuff about software, infrastructure, security, etc

Feeds:
Posts
Comments
« Moore’s law == SSL
Google Suggest vs. Privacy »

Struts2 external redirect

September 3, 2008 by Ade

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

Share this:

  • Twitter
  • Facebook

Like this:

Like Loading...

Related

Posted in java | Tagged struts2 | 5 Comments

5 Responses

  1. on September 15, 2008 at 2:13 pm Abhi

    hi,
    can u send me a simple code for struts2 action tag


  2. on June 22, 2010 at 4:07 am Joel

    thanks! 🙂


  3. on February 9, 2011 at 10:09 pm John Dondapati

    Works perfectly. Thanks a million!


  4. on October 6, 2011 at 8:45 pm Nikk Folts

    Awesome


  5. on April 5, 2012 at 7:22 am Nagaraj L H

    thanks…



Comments are closed.

  • Archives

    • March 2016 (1)
    • February 2012 (1)
    • December 2011 (1)
    • November 2009 (2)
    • March 2009 (4)
    • September 2008 (3)
  • Categories

    • iPhone (3)
    • java (1)
    • security (9)
    • Uncategorized (4)
  • Pages

    • About

Create a free website or blog at WordPress.com.

WPThemes.


Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Follow Following
    • peekay
    • Already have a WordPress.com account? Log in now.
    • peekay
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Copy shortlink
    • Report this content
    • View post in Reader
    • Manage subscriptions
    • Collapse this bar
%d bloggers like this: