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.

