struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Billy Ng" <evebi...@hotmail.com>
Subject Re: preserve Forward order
Date Sat, 21 Sep 2002 16:14:46 GMT
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" <ekbush@swbell.net>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
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:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
>

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message