struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Al Sutton" <al.sut...@alsutton.com>
Subject RE: Over 100 site URLs to redirect: interceptor or action mappings?
Date Mon, 02 Jul 2007 13:47:32 GMT
Any reason you're not using your web servers or app servers configuration to
send a redirect back for requests to these URLs? 

-----Original Message-----
From: AntonyJB [mailto:antonyb@bigfoot.com] 
Sent: 02 July 2007 13:57
To: user@struts.apache.org
Subject: Over 100 site URLs to redirect: interceptor or action mappings?


Hi,

I searched for similar situations but haven't come across anything - an easy
one I'm sure though.

Issue:
Our site contains a large amount of marketing URLs which redirect to a small
number of actual actions. E.g.: 
  www.mysite.com/offer1
  www.mysite.com/offeragain
  www.mysite.com/GreatOffer
  ...

I don't want carry on creating individual index.jsp for each sub-URL (as
respective directories offer1, offeragain, GreatOffer) containing a single
<%response.sendRedirect(...)%>

Solutions
Since my Struts FilterDispatcher is watching all url patterns, I can either:
  * create some proprietary interceptor that checks the URI against a
privately held hash of redirect URLs or
  * use a tweak on the following which didn't work out so well:

1 === browser
Example URL: www.mysite.com/offer1

2 === struts.xml
<struts>
    <package name="offer1" extends="struts-default">
        <default-action-ref name="index"/>

        <action name="index">
            <result type="redirect">http://www.newredirection.com</result>
        </action>
    </package>
</struts>

3 === web.xml
    <welcome-file-list>
        <welcome-file>index.do</welcome-file>
    </welcome-file-list>


Unless I specifically call www.mysite.com/offer1/index.do, I get a 404 on
the original URL.

So which way do you propose I ought to go? A proprietary interceptor, a
fixed version of the above, or another solution?

I'm not 100% on Struts 2 yet so your assistance is appreciated. I'm going
live very soon with this!

Thanks,
Antony


--
View this message in context:
http://www.nabble.com/Over-100-site-URLs-to-redirect%3A-interceptor-or-actio
n-mappings--tf4012051.html#a11393485
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message