The problem is that many servlet containers won't even execute the filter
chain unless there's a match.  And http://www.domain.com/path doesn't
inherently match index.html.  So it looks to see if there is a file matching
the <welcome-file> ready to be dispatched.  If so it starts the chain and
the filters get executed as you said.  But without that empty file, many
servlet containers won't even get to the filter chain.
  (*Chris*)

On Wed, Apr 14, 2010 at 10:31 PM, 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
>
>

Reply via email to