On 13 Jul 2002, Duke Ronlund wrote:

> Date: 13 Jul 2002 15:18:48 +1000
> From: Duke Ronlund <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: Retrieving <forward .../> elements in order
>
> Hi,
>
> I would like to be able to build my webapps main menu from the <forward
> .../> elements in struts-config, and display them in the same order that
> they appear in the config file.
>
> I can retreive this information by calling
> ApplicationConfig.findForwardConfigs(), but as the underlying collection
> is a HashMap, order is not guaranteed.
>
> I assume that next best thing to use is the commons digester, does the
> digester retain the order of the xml file it parses?
>

Because Digester is based on a SAX parser, it definitely maintains order
while the parsing is happening.  You'll need to ensure that your Rule
instances save the forwards in some collection that also maintains order
(like a List instead of a Map).

> Can anyone offer any suggestions or alternatives?
>
> TIA
>
> Duke Ronlund
>

Craig


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to