in your web.xml 
map the .do extension to map to an Action Class as in 

  <!-- Action Servlet Mapping -->
  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>

in web.xml
then config your Display welcome page as on
  <!-- ========== Action Mapping Definitions ============================== -->
  <action-mappings>

      <!-- Display welcome page -->
      <action    path="/Index"
                 type="org.apache.struts.webapp.example.IndexAction">
          <forward name="error" path="/Error.jsp" />
          <forward name="success" path="/welcome.jsp" />
      </action>

the IndexAction class would be
public final class IndexAction extends BaseAction {
    public ActionForward execute(
        ActionMapping mapping,
        ActionForm form,
        HttpServletRequest request,
        HttpServletResponse response)
        throws Exception {
    //ok will findForward to success
    //error will findForward to error
}
}
HTH
Martin--
--------------------------------------------------------------------------- 
This e-mail message (including attachments, if any) is intended for the use of 
the individual or entity to which it is addressed and may contain information 
that is privileged, proprietary , confidential and exempt from disclosure. If 
you are not the intended recipient, you are notified that any dissemination, 
distribution or copying of this communication is strictly prohibited.
--------------------------------------------------------------------------- 
Le présent message électronique (y compris les pièces qui y sont annexées, le 
cas échéant) s'adresse au destinataire indiqué et peut contenir des 
renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le 
destinataire de ce document, nous vous signalons qu'il est strictement interdit 
de le diffuser, de le distribuer ou de le reproduire.
----- Original Message ----- 
From: "Nicolas Laplante" <[EMAIL PROTECTED]>
To: <user@struts.apache.org>
Sent: Sunday, February 11, 2007 11:29 PM
Subject: Struts and welcome-file-list


> My website's homepage is the index action: /index.do.
> 
> In web.xml, I configured the welcome-file-list like this:
> 
> <welcome-file-list>
>        <welcome-file>index.do</welcome-file>
> </welcome-file-list>
> 
> When I access the application with no action or filename, I get the 
> directory listing. It is not serving the homepage as configured in the 
> above snippet.
> 
> How can I tell the container to serve index.do when no filename is provided?
> 
> Nicolas Laplante
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

Reply via email to