aspose file tools*
The moose likes Struts and the fly likes welcome-file element to use a Struts action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "welcome-file element to use a Struts action" Watch "welcome-file element to use a Struts action" New topic
Author

welcome-file element to use a Struts action

Tony Smith
Ranch Hand

Joined: Jul 07, 2007
Posts: 229
It says in a book:
"Because the web containers don't use the servlet mappings for resources in the welcome-filelist,
you can't directly set up a welcome-file element to use a Struts action."

Maybe I misunderstood this statement, but I got the impression that we can't use struts action on the welcome file. But I put couple input text box and struts submit button on the welcome file and it still works. So what is going on?
Joachim Rohde
Ranch Hand

Joined: Nov 27, 2006
Posts: 423

You can't put any action in the <welcome-file-list> tag in your web.xml. That's what is meant.
Tony Smith
Ranch Hand

Joined: Jul 07, 2007
Posts: 229
Why is the solution suggest that we do a forward from welcome-file page into another page as soon as possible? What would be the advantage then?

<global-forwards>
<forward name="welcome" path="viewsignin.do"/>
</global-forwards>
Tony Smith
Ranch Hand

Joined: Jul 07, 2007
Posts: 229
I searched some more on the web, I guess my question is why would someone want to set index.do as an homepage. I think one of the explanation is that maybe some people want to hide index.html and not use it as the default page, which makes sense I suppose...
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Tony: I am not sure what you are asking. I would rather have an action (welcome.do) as the "welcome-file" in my web.xml file, but my understanding is that this does not work. I suppose that I have never actually tried it out. So I have the file index.jsp that redirects to the action that displays the first page.

- Brent
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: welcome-file element to use a Struts action