I knew somebody would ask me why :-)
Okay, I am using the String[] that returns from mapping.findForwards() to
generate links in the left nav bar. This way, I will only generate the
links for the Action I call. For example,
<action path="/project"
type="com.evebill.billyng.ui.about_me.AboutMeBase"
name="AboutMeAction">
<forward name="bridge" path="/jsp/about_me/bridge.jsp"/>
<forward name="subway" path="/jsp/about_me/subway.jsp"/>
<forward name="library" path="/jsp/about_me/library.jsp"/>
</action>
String[] forwards = mapping.findForwards();
for (int i=0; i< forwards.length; i++) {
ActionForward forward = mapping,findForward(forwards[i]);
out.print("<A href=\""+forward.getPath()+"\">"+forward.getName()+"</A>";
}
I know I am lazy, but it works very good except the sorting. That's why I
want the elements of the String[] has the order I put in struts-conf.xml
Billy Ng
----- Original Message -----
From: "Eddie Bush" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Saturday, September 21, 2002 8:23 AM
Subject: Re: preserve Forward order
> I'm not sure what you're trying to do. Most generally, folks use
> 'mapping.findForward( "success")' -- or something very close to it.
> That returns the forward in question. Why do you need the whole list?
>
> Billy Ng wrote:
>
> >When I use mapping.findForwards(), it returns me the sorted forward
names. How can I get the forward names in the same order as in the
struts-conf.xml?
> >
> >Thanks!
> >
> >Billy Ng
> >
>
> --
> Eddie Bush
>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>