私には多くの目的地(たとえば150以上)があり、各目的地には2つの異なるバリエーションがあります。
- A
- B
これらのバリアントごとにhtmlを生成しました。例:
- NewYork-A.html
- NewYork-B.html
- SanFrancisco-A.html
- SanFrancisco-B.html
- ラスベガス-A.html
- LasVegas-B.html..。
一般的な形式は次のとおりです。
- 宛先-A.html
- 宛先-B.html
これらの各ファイルはに書き込まれます/seo/Destination/
Struts 2のこれらのファイルに特定のURLをマッピングするにはどうすればよいですか?
www.mysite.com/NewYork-Tourism
=> www.mysite.com/seo/Destinations/NewYork-A.html AND
www.mysite.com/NewYork-Travel
=> www.mysite.com/seo/Destinations/NewYork-B.html
ジェネリック:
www.mysite.com/Destination-Tourism
=> www.mysite.com/seo/Destinations/Destination-A.html
と
www.mysite.com/Destination-Travel
=> www.mysite.com/seo/Destinations/Destination-B.html
これを行うことを考える1つの方法は、(destination * Variant_types)と同じ数のアクションを生成し、それらのそれぞれの結果を適切なhtmlファイルにマップすることです。このようなもの:
<action name="NewYork-Tourism">
<result name="success">/seo//Destination/NewYork-A.html</result>
</action>
<action name="NewYork-Travel">
<result name="success">/seo//Destination/NewYork-B.html</result>
</action>
.. 等々
これを行う他の(より良い)方法はありますか?