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-action-mappings--tf4012051.html#a11393485
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]