I'm not sure the default action solves the problem.

I am put this in my struts.xml file:
<!--  Set the default action to Login_show -->
<default-action-ref name="Login_show" />

It appears that it only loads Login_show if a user types in an
*.action file.  For example:

URL: http://www.mydomain.com/package/DOESNOTEXIST.action
Result: http://www.mydomain.com/package/Login_show.action

URL: http://www.mydomain.com/package/
Result: Simply loads the index.jsp file (I believe it doesn't route
through Struts because it doesn't match a "url-pattern" for the struts
filter). And if I put a <jsp:forward name="Login_show.action"/> in
index.jsp - I still get URL not found as before.

How are you getting the user from www.mydomain.com ->
www.mydomain.com/package/default.action using this method?  I think I
am missing a step.


On Thu, Apr 15, 2010 at 12:31 AM, Brian Thompson <elephant...@gmail.com> wrote:
> Struts runs in a filter that applies to requests that come through, so
> the welcome file in web.xml doesn't matter.
>
> -Brian
>
> On Wed, Apr 14, 2010 at 9:21 PM, Krunal Dhamelia <nkle...@gmail.com> wrote:
>> I want to do the same thing but I didn't get you clear Brian.
>> If we follow your solution then Could you please explain little in brief
>> that how web.xml know about struts default action?
>> What should we put in web.xml for welcome file?
>>
>> Krunal Dhamelia
>>
>>
>> On Wed, Apr 14, 2010 at 6:00 PM, Brian Thompson <elephant...@gmail.com>wrote:
>>
>>> On Wed, Apr 14, 2010 at 4:22 PM, Burton Rhodes <burtonrho...@gmail.com>
>>> wrote:
>>> > I'm sure this answer is trivial, but I can't figure how to do a
>>> > server-side forward to a Struts action from my welcome page
>>> > (index.jsp).  Currently I have index.jsp "redirecting" the user, but I
>>> > would like to eliminate the roundtrip that a "redirect" imposes (I've
>>> > had complaints from mobile users).  All my "forward" attempts give a
>>> > RequestURL file not found error.  Has anyone done this?  Google seems
>>> > to be unhelpful.
>>> >
>>>
>>>
>>> Add a default action in your struts xml.  It's what we're doing in our
>>> Struts app where I work.
>>>
>>> <package name="foo">
>>>  <default-action-ref name="welcome"/>
>>>  <action name="welcome" class="com.example.WelcomeAction">
>>>    <result name="success">welcome.jsp</result>
>>>  </action>
>>> </package>
>>>
>>> -Brian
>>>
>>>
>>>
>>> > Currently this works but makes a roundtrip (index.jsp) :
>>> > <% response.sendRedirect("Login_show.action"); %>
>>> >
>>> > Serverside attempts without success (index.jsp):
>>> > <jsp:forward page="Login_show.action"/>
>>> > <jsp:forward page="/Login_show.action"/>
>>> > <jsp:forward page="Login_show"/>
>>> >
>>> > Using:
>>> > Struts 2.1.8
>>> > Tomcat 6.x
>>> > Apache 2.2
>>> >
>>> > Many Thanks,
>>> > Burton
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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

Reply via email to