0

When I run my strust2 web application, I want to execute an action for the root path [/]. It would be something like an action with no name or just "/", something like:

<action name="/" class="ControllerName" method="execute">
        <result name="success">ShowTheFirstPageAfterTheAction.jsp</result>
 </action>
O.Badr
  • 2,853
  • 2
  • 27
  • 36
  • 1
    What you are asking is unclear and the question has not the proper statement/format, please refer to http://stackoverflow.com/help/how-to-ask and learn how to ask a good question on StackOverflow – svelandiag Feb 03 '17 at 02:21
  • You're referring to the "welcome page"; a quick web or SO search will get you what you want. – Dave Newton Feb 03 '17 at 17:45
  • @SsouLlesS You are right. I should have read the the "how-to-ask" before posting this question. Im so sorry about it. I still really dont know how to execute an action before the welcome page gets displayed, but as soon as I learn how Ill post it here. – CodeLain Feb 05 '17 at 18:56

1 Answers1

0
...
<struts>
...
    <package name="user" namespace="/" extends="struts-default">
       <action name="" class="ControllerName" method="execute">
           <result name="success">ShowTheFirstPageAfterTheAction.jsp</result>
       </action>
       // Other actions depending on how you've designed your application
    <package
    // Other packages (also) depending on how you've designed your application
</struts>
O.Badr
  • 2,853
  • 2
  • 27
  • 36