problem in getInitParameterNames() method of ServletConfig

A part of my deployment descriptor is as below.

<servlet>

<servlet-name>GetJar</servlet-name>

<servlet-class>ReadingJarFile</servlet-class>

<load-on-startup>1</load-on-startup>

<init-param>

<param-name>name1</param-name>

<param-value>value2</param-value>

</init-param>

<init-param>

<param-name>name2</param-name>

<param-value>value1</param-value>

</init-param>

</servlet>

Although 2 parameters are mentioned here but during the execution of the following code:

PrintWriter writer = response.getWriter();

ServletConfig config = getServletConfig();

Enumeration initParameters = config.getInitParameterNames();

while(initParameters.hasMoreElements())

{

writer.write((String)initParameters.nextElement()+"\n");

}

writer.flush();

I get output asname2 name1 .

Why is line seperator not taking any effect. And why is the order in the output different I mean name2 and then name1 and not the other way round.

Kind Regards,

jaay.

[1322 byte] By [jaaya] at [2007-11-26 19:35:01]
# 1
Output will be interpereted as an html and browser will not print \n so use instead.
Vishwas_Prasannaa at 2007-7-9 22:09:18 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...