Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8431961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:59:41+00:00 2026-06-10T05:59:41+00:00

I have many destinations (say 150+) and each destination has 2 different variants: A

  • 0

I have many destinations (say 150+) and each destination has 2 different variants:

  • A
  • B

I have generated a html for each of these variants. For e.g.:

  • NewYork-A.html
  • NewYork-B.html
  • SanFrancisco-A.html
  • SanFrancisco-B.html
  • LasVegas-A.html
  • LasVegas-B.html
    …

generic format being:

  • Destination-A.html
  • Destination-B.html

each of these files are written to /seo/Destination/

How can I map a given URL to these files in struts 2:

www.mysite.com/NewYork-Tourism => http://www.mysite.com/seo/Destinations/NewYork-A.html AND
www.mysite.com/NewYork-Travel => http://www.mysite.com/seo/Destinations/NewYork-B.html

Generic:

www.mysite.com/Destination-Tourism => http://www.mysite.com/seo/Destinations/Destination-A.html

AND

www.mysite.com/Destination-Travel => http://www.mysite.com/seo/Destinations/Destination-B.html


One way I can think of doing this is generating as many actions as (destination * variant_types) and then map the result of each of those to the proper html files. Something like this:

<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>

.. and so on

Is there any other (better) way to do this ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:59:42+00:00Added an answer on June 10, 2026 at 5:59 am

    One qquick way which seems to me is to make use of Wildcard Mapping,Struts2 has a way namely Wildcard which seems more suitable to you.

    As an application grows in size, so will the number of action mappings. Wildcards can be used to combine similar mappings into one more generic mapping.

    something like

    <action name="List*s" class="actions.List{1}s">
      <result>list{1}s.jsp</result>
    </action>
    

    For more details please refer to the documents

    • wildcard-mappings
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have many MKMapViews, and each of them has an annotation. I am trying
I have many different NSArray 's stored in .dat files, in the Documents folder
We have many projects with several files inside each. Files can be checked in
I have many text files containing bank transactions in the middle of them. Each
On the database, I have these two tables: - Destination: - idDestination - name
I have the following situation: One Destination can have Many Aliases Logically : I
I have two different kinds of objects: Ride and Location . A Ride has
I have many PowerPoint presentations that I need to be able to add to
I have many many files in a folder, and I want to process them
I have many directories with files in them. I want to create a comma

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.