How can I set the welcome page to a struts action?

后端 未结 15 2021
天涯浪人
天涯浪人 2020-11-29 20:15

I have a struts-based webapp, and I would like the default \"welcome\" page to be an action. The only solutions I have found to this seem to be variations on making the welc

15条回答
  •  难免孤独
    2020-11-29 21:00

    I have configured like following. it worked perfect and no URL change also...

    Create a dummy action like following in struts2.xml file. so whenever we access application like http://localhost:8080/myapp, it will forward that to dummy action and then it redirects to index.jsp / index.tiles...

    
        /index.tiles
    
    

    w/o tiles

    
        /index.jsp
    
    

    may be we configure some action index.action in web.xml as index.action, and use that action to forward required page...

提交回复
热议问题