struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Pratt <thechrispr...@gmail.com>
Subject Re: [S2] Welcome Page as Action?
Date Thu, 15 Apr 2010 07:05:16 GMT
How'd it go when you put an empty default.action file in the directory?
  (*Chris*)

On Wed, Apr 14, 2010 at 10:54 PM, Burton Rhodes <burtonrhodes@gmail.com>wrote:

> 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 <elephantium@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 <nkle004@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 <elephantium@gmail.com
> >wrote:
> >>
> >>> On Wed, Apr 14, 2010 at 4:22 PM, Burton Rhodes <burtonrhodes@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-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
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message