简体   繁体   中英

How can I map the root path of my web application using struts2?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM