I have a mock Beer-recommendations web app, with a servlet that accesses the init-parameters (servlet config parameters) from the DD, sets them as attributes and forwards the request to a JSP. The JSP retrieves the attributes and prints them to the response stream.
The entire set up works fine and along with the Beer Recommendations, i get the output as This application has been created by Aniket Patil.
The problem: Instead of having 2 separate <init-param>, i tried to club together both the params i.e. name and lastName into one init-param, as in:
However, now i am only able to access the second param, lastName correctly. If the order of declaration of the params within <init-param> is reversed (i.e. lastName comes first, then name), i am able to access only "name" value correctly i.e. the output is one of
This application has been created by Aniket null. OR This application has been created by null Patil.
Can there be only a single init parameter declared within <init-param> at a time, and for multiple declarations, can it access only the last one correctly? [ January 17, 2007: Message edited by: Aniket Patil ]
SCJP 5.0 | SCWCD 1.4 <br /> <br />If you don't know where you are going, any road will take you there!
Using Tomcat 5.x, which from my observations reads the DD at server startup, and no parse error is seen then.
Is it mentioned in the spec that only a single param is allowed per init-param? I myself havent been through the spec yet, so would be good if you could post the exact statement from spec to settle the issue for good. [ January 17, 2007: Message edited by: Aniket Patil ]