init-params from web.xml not come in right order

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

init-params from web.xml not come in right order

Sallo Laszlo
Hi,

 

I am using tomcat 4.1.30.

 

I introduced some <init-params> and I need them in the same order as in web.xml. Right now I am getting in an arbitrary order with  :

 

Enumeration urlPatternEnum =  filterConfig.getInitParameterNames();

 

How can I fix this ? Is a higher version of tomcat where this is works ?

 

Best Regards,

Sallo Laszlo


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.10/43 - Release Date: 7/6/2005
 
Reply | Threaded
Open this post in threaded view
|

Re: init-params from web.xml not come in right order

Mikolaj Rydzewski
Sallo Laszlo wrote:

>I introduced some <init-params> and I need them in the same order as in web.xml.
>
Why do you need them this way? I would use another parameter, let's say
params-list, with ordered list of other parameters' names, i.e.:

<param>
    <name>params-list</name>
    <value>param1, param_other, param_3, param7</value>
</param>

--
Mikolaj Rydzewski  <[hidden email]>
Becomo S.A.
tel. (12) 2927104



smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: init-params from web.xml not come in right order

Sallo Laszlo
In reply to this post by Sallo Laszlo
Hi,

Unfortunately this is not what I need. My list is like :

                <init-param>
                        <param-name>/index.jsp</param-name>
                        <param-value>none</param-value>
                </init-param>
                <init-param>
                        <param-name>/img/*</param-name>
                        <param-value>none</param-value>
                </init-param>
                <init-param>
                        <param-name>/*</param-name>
                        <param-value>admin</param-value>
                </init-param>  

Is a list with some path-role mapping. And I need in this order. I
looked in Context implementation of tomcat and I saw they are using
HashMap-s and that's why it comes arbitrary.

Laszlo

-----Original Message-----
From: Mikolaj Rydzewski [mailto:[hidden email]]
Sent: Thursday, July 07, 2005 4:13 PM
To: Tomcat Users List
Subject: Re: init-params from web.xml not come in right order

Sallo Laszlo wrote:

>I introduced some <init-params> and I need them in the same order as in
web.xml.
>
Why do you need them this way? I would use another parameter, let's say
params-list, with ordered list of other parameters' names, i.e.:

<param>
    <name>params-list</name>
    <value>param1, param_other, param_3, param7</value>
</param>

--
Mikolaj Rydzewski  <[hidden email]>
Becomo S.A.
tel. (12) 2927104



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.10/43 - Release Date: 7/6/2005
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: init-params from web.xml not come in right order

Mikolaj Rydzewski
Sallo Laszlo wrote:

>Unfortunately this is not what I need. My list is like :
>
> <init-param>
> <param-name>/index.jsp</param-name>
> <param-value>none</param-value>
> </init-param>
> <init-param>
> <param-name>/img/*</param-name>
> <param-value>none</param-value>
> </init-param>
> <init-param>
> <param-name>/*</param-name>
> <param-value>admin</param-value>
> </init-param>  
>
>Is a list with some path-role mapping. And I need in this order. I
>looked in Context implementation of tomcat and I saw they are using
>HashMap-s and that's why it comes arbitrary.
>  
>
So add another parameter:

<init-param>
    <param-name>params-order</param-name>
    <param-value>/index.jsp /img/* /*</param-value>
</init-param>

Tokenize its value with spaces (or some other char) and you are ready to
read the rest of parameters in the order you want.

--
Mikolaj Rydzewski  <[hidden email]>
Becomo S.A.
tel. (12) 2927104



smime.p7s (3K) Download Attachment