You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Craig R. McClanahan" <Cr...@eng.sun.com> on 2001/02/01 00:49:15 UTC

Re: Setting initial page to be an action

"Winters, Jason" wrote:

> I'm trying to setup my application so that the initial page is an action.
> When the user enters a URL like this, http://server/myapp they should be
> sent to http://server/myapp/index.do.  At the moment, they get forwarded to
> http://server/myapp/index.jsp which crashes because stuff that was setup in
> the index action does not exist.
>

In your web.xml file, you can define a "welcome file" that is used by the
servlet container (that's how it knows to try index.html or index.jsp).  So,
you could add something like this:

    <welcome-file-list>
        <welcome-file>index.do</welcome-file>
    </welcome-file-list>

One thing to note is that your index.do method will get called for any
"directory name" within the app as well.

>
> Any ideas on how to accomplish this would be greatly appreciated!
>
> Jason Winters

Craig McClanahan



Re: Setting initial page to be an action

Posted by renzo estrella <re...@yahoo.com>.
I tried this a couple of days ago but the results
 back where a directly listing. I also had to add
 an entry in my action.xml to handle "index" action
 but it still returned the directory listing.
While specifying index.do does give the correct
result.
Perhaps this behavior is due to weblogic5.1 ?

--- "Craig R. McClanahan"
<Cr...@eng.sun.com> wrote:
> "Winters, Jason" wrote:
> 
> > I'm trying to setup my application so that the
> initial page is an action.
> > When the user enters a URL like this,
> http://server/myapp they should be
> > sent to http://server/myapp/index.do.  At the
> moment, they get forwarded to
> > http://server/myapp/index.jsp which crashes
> because stuff that was setup in
> > the index action does not exist.
> >
> 
> In your web.xml file, you can define a "welcome
> file" that is used by the
> servlet container (that's how it knows to try
> index.html or index.jsp).  So,
> you could add something like this:
> 
>     <welcome-file-list>
>         <welcome-file>index.do</welcome-file>
>     </welcome-file-list>
> 
> One thing to note is that your index.do method will
> get called for any
> "directory name" within the app as well.
> 
> >
> > Any ideas on how to accomplish this would be
> greatly appreciated!
> >
> > Jason Winters
> 
> Craig McClanahan
> 
> 


__________________________________________________
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/