Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

welcome-file element to use a Struts action

 
Tony Smith
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 433
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic