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 6931005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:31:16+00:00 2026-05-27T11:31:16+00:00

Basically when the user goes to example.com I want to serve it the same

  • 0

Basically when the user goes to example.com I want to serve it the same content I would have, if it went to example.com/news. Below is the code snippet.

Current COnfig

  <action name="" class="action.public.news">
        <result>/jsp/labs/listLabs.jsp</result>
    </action>
<action name="news" class="action.public.news">
        <result>/jsp/labs/listLabs.jsp</result>
    </action>

Desried COnfig

<action name="" class="action.public.news">
        Use Action Named "news" instead
    </action>

    <action name="news" class="action.public.news">
        <result>/jsp/labs/listLabs.jsp</result>
    </action>
  • 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-05-27T11:31:17+00:00Added an answer on May 27, 2026 at 11:31 am

    If i understand it right you want that when user hit the base domain example.com it should fetch the content of the action news one way to do this is.

    create an empty file name welcome in your web-content folder.Add following entry to your web.xml

     <filter>
            <filter-name>action2</filter-name>
            <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
        </filter>
     <filter-mapping>
            <filter-name>action2</filter-name>
             <url-pattern>/*</url-pattern>
             <dispatcher>REQUEST</dispatcher>    
             <dispatcher>FORWARD</dispatcher>
             <dispatcher>INCLUDE</dispatcher>
             <dispatcher>ERROR</dispatcher>
        </filter-mapping>
    

    replace your welcome list file in web.xml as

    <welcome-file-list>
            <welcome-file>welcome</welcome-file>
    </welcome-file-list>
    

    and finally in your strus.xml do something like

    <action name="welcome" class="action.public.news">
            <result>/jsp/labs/listLabs.jsp</result>
        </action>
    

    what we are trying to do is that when we hit example.com instead of showing the welcome jsp file we are hitting the action and using its result

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have an auto login option check for a user. Basically that
I have a web site with two routes. Basically the user can do one
I want to make a site where there user can basically navigate the web
Basically I want to check what url the user is on and compare it
Basically what I want to do is allow a user to type in a
Basically, I do not want the user to enter '0' (zero) as the first
Basically I will tell you what I want to do. 1: If a user
I have a div element that I'm trying, basically, to move wherever the user
Alright so here it goes, I have my user system working perfectly, and now
We are building a configurator application for conveyors. Basically user comes in and picks

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.