I'm trying to grab initialization parameters for my servlet, based on params established in my deployment descriptor. Yet my servlet can't find any of them (returns nulls). This is in my deployment descriptor snippet for a particular servlet:
Yet, in my servlet, it cannot read any of the initialization parameters (in the init() method of MyServletController snippet below):
The above code snippet would return strParam as null. In fact, no matter what's in the deployment descriptor for this servlet, no initialization parameters can be found. I know the web.xml is deployed properly, otherwise this servlet could not be invoked in the first place. Something I'm missing that's simple I hope? -- [ June 05, 2002: Message edited by: Toby Davis ]
Author and all-around good cowpoke
posted 13 years ago
Pretty odd alright. Just for fun try working with the config object directly.
The other thing you might try is to rearrange the order of elements in web.xml - the Sun examples always put servlet-class right after servlet-name, and then put init-param elements so thats the way I have always done it. Bill