I did some Googling and read some posts on stackoverflow and theserverside on this same issue. There were several suggested approaches. The two most common suggestions were:
- Create a index.jsp and issue a <% response.sendRedirect(myaction.do); %> or alternatively a <jsp:forward page="/myaction.do" />. Of course you'll also need to add index.jsp as a <welcome-file> in your web.xml.
- Create an empty file named welcome.do. Add welcome.do to your <welcome-file> tag and create a Struts Action mapping for welcome.do. This is a nice little hack and Struts will go ahead and serve your Action.
- Create an empty file named "welcome.action" in "FlashCardsWeb\WebContent"
- Modified the web.xml as follows:
<welcome-file-list>
<welcome-file>welcome.action</welcome-file>
</welcome-file-list> - Modified the struts.xml to create the following Action. "baseLayout" is Tiles definition that includes my header, menu, body, and footer.
<action name="welcome">
<result name="success" type="tiles">baseLayout</result>
</action>
Interesting hack (the second option). Worked like a charm!
ReplyDeleteSecond Options works perfectly!
ReplyDelete