struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From AntonyJB <>
Subject Over 100 site URLs to redirect: interceptor or action mappings?
Date Mon, 02 Jul 2007 12:56:58 GMT


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

Our site contains a large amount of marketing URLs which redirect to a small
number of actual actions. E.g.:

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

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:

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

        <action name="index">
            <result type="redirect"></result>

3 === web.xml

Unless I specifically call, 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!


View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message