On Wed, Apr 14, 2010 at 4:22 PM, Burton Rhodes <[email protected]> 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: [email protected]
For additional commands, e-mail: [email protected]