You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mark Woon <mo...@SMI.Stanford.EDU> on 2002/01/05 03:26:19 UTC

index.do as welcome file?

Mark Woon wrote:

> I've just started looking at Struts, and I'm trying to figure out how to
> set an action as the default file for the webapp?  For example, I have
> an index.do Action, and I'd like that served by default instead of
> index.htm[l].  Is this possible?

After looking at the struts-config.xml DTD (thanks, Muthu!) , it looked as if
the unknown attribute would solve this problem, but a quick trial of

    <action path="/index"
            type="test.IndexAction"
            unknown="true">
    </action>

showed that this isn't the solution that I'm looking for.  Am I doing something
wrong?  Is ther another way to go about this?

Thanks,
-Mark


Re: index.do as welcome file?

Posted by "Barry L. White" <ba...@charter.net>.
Mark Woon wrote:

>Mark Woon wrote:
>
>>I've just started looking at Struts, and I'm trying to figure out how to
>>set an action as the default file for the webapp?  For example, I have
>>an index.do Action, and I'd like that served by default instead of
>>index.htm[l].  Is this possible?
>>
>
>After looking at the struts-config.xml DTD (thanks, Muthu!) , it looked as if
>the unknown attribute would solve this problem, but a quick trial of
>
>    <action path="/index"
>            type="test.IndexAction"
>            unknown="true">
>    </action>
>
>showed that this isn't the solution that I'm looking for.  Am I doing something
>wrong?  Is ther another way to go about this?
>
>Thanks,
>-Mark
>
>
You can do the same thing by just having a index.jsp page that just 
forwards to your index.do servlet.

Barry




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: index.do as welcome file?

Posted by Ted Husted <hu...@apache.org>.
Using an Action as a welcome doesn't work, but you can use an index.jsp
to forward to a welcome Action. 

<%@ page language="java" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<logic:forward name="welcome"/>


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Building Java web applications with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/



> Mark Woon wrote:
> 
> > I've just started looking at Struts, and I'm trying to figure out how
> > to set an action as the default file for the webapp?  For example, I
> > have an index.do Action, and I'd like that served by default instead
> > of index.htm[l].  Is this possible?
> 
> After looking at the struts-config.xml DTD (thanks, Muthu!) , it looked
> as if the unknown attribute would solve this problem, but a quick trial
> of
> 
>     <action path="/index"
>             type="test.IndexAction"
>             unknown="true">
>     </action>
> 
> showed that this isn't the solution that I'm looking for.  Am I doing
> something wrong?  Is ther another way to go about this?
> 
> Thanks,
> -Mark
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: index.do as welcome file?

Posted by James Dasher <jf...@thermopylae.com>.
If this is solely a cosmetic thing, why not make an index.jsp your
welcome file, and have it requestDispatcher.forward into your struts
framework....Put it in a bean if it makes you happy.
I haven't tried this, but I don't see why it wouldn't work....

-----Original Message-----
From: woon@SMI.Stanford.EDU [mailto:woon@SMI.Stanford.EDU] On Behalf Of
Mark Woon
Sent: Friday, January 04, 2002 9:26 PM
To: Struts Users Mailing List
Subject: index.do as welcome file?


Mark Woon wrote:

> I've just started looking at Struts, and I'm trying to figure out how 
> to set an action as the default file for the webapp?  For example, I 
> have an index.do Action, and I'd like that served by default instead 
> of index.htm[l].  Is this possible?

After looking at the struts-config.xml DTD (thanks, Muthu!) , it looked
as if the unknown attribute would solve this problem, but a quick trial
of

    <action path="/index"
            type="test.IndexAction"
            unknown="true">
    </action>

showed that this isn't the solution that I'm looking for.  Am I doing
something wrong?  Is ther another way to go about this?

Thanks,
-Mark



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>