You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jan Peter Hecking <ja...@verdisoft.com> on 2004/04/01 09:48:27 UTC

Re: Clean url for home page

John Boyes wrote:

>I would like to have a clean url for my site's home page (built with Struts) 
>displayed to the
>user.
>
>e.g
>http://www.mysite.com
>
>not
>http://www.mysite.com/home.do
>or
>http://www.mysite.com/index.jsp
>
>Is there a straightforward way to accomplish this, while still processing a
>Struts action in the request?
>  
>
I'm just using a simple index.jsp like this:

<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" 
prefix="logic" %>
<logic:forward name="index"/>

My stuts-config.xml then declares a global forward that defines what 
action gets executed for requests to index.jsp:

    <global-forwards>
        <forward name="index" path="/home.do"/>
       <!-- ... -->
    </global-forwards>

Hope this helps,
Jan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org