struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ramez Hassan" <ramez.has...@asset.com.eg>
Subject RE: Action as Welcome File
Date Thu, 21 Aug 2008 15:43:10 GMT
Hi,
I guess you can do that by specifying the following in web.xml:
<welcome-file-list>
        <welcome-file>/actionnamespace/welcome.action</welcome-file>
    </welcome-file-list>


And also by adding the following filter mapping attributes in struts filter
dispatcher in order to be loaded which ever the type of dispatch by the web
container

<filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
        </filter-mapping>


-----Original Message-----
From: James Neff [mailto:james.neff@tethyshealth.com] 
Sent: Thursday, August 21, 2008 4:42 PM
To: Struts Users Mailing List
Subject: Re: Action as Welcome File

Felipe Lorenz wrote:
> Hi..
>
> Did you try change in web.xml file? Change from index.jsp to
> your_action.action!! i dont know if it work...
>
> Felipe.
>
> On Thu, Aug 21, 2008 at 7:24 AM, Roger <roger.varley@googlemail.com>
wrote:
>   
>> Sorry, I know that I've read about this here before, but I can't find the
>> thread. Can someone point me to how to configure an action as the
"welcome"
>> file?
>>
>> Regards
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>   
I would like to know if there is a better way to do this.

In my web.xml I have:

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

and in index.jsp I have:

     <%
        String redirectURL = 
"http://localhost:8080/myproject/MyAction.action";
        response.sendRedirect(redirectURL);
    %>

Seems like a hack to me, but gets the job done.  Is there a more elegant 
way?

--James




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


Mime
View raw message