You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by John Boyes <jo...@blueyonder.co.uk> on 2004/03/31 14:42:16 UTC

Clean url for home page

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've had a good look at the archives but haven't found a solution.

Thanks for any help

John


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


Re: Clean url for home page

Posted by Jan Peter Hecking <ja...@verdisoft.com>.
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