This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

servlet Initialization parameters

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using a Control servlet with websphere test environment with vaj 3.5 with servlet 2.1 .
I am having a problem with getting the init parms with the command -
Enumeration enum = getInitParameterNames();
The enum comes out to be null.
Looking at the console i noticed that the servlet invoker loads the servlet initialization parms when the wte environment is being setup and loads the Control servlet. I tried changing the default_app.webapp for the autostartto make it false so that the invoker doesn't run the init parameter but then it doesn't load the init parms at all as i see in the Console.
<autostart> was set to true initially and then though the servlet init parms are loaded when the WTE starts up and shows up in the console, my program doesn't seem to pick up the init parms when i run my servlet even though it goes through the init(ServletConfig) method. I also have a super(Servletconfig) as the first statement to save the ServletConfig information.

Any help is appreciated,
Thanx,
Vijay
 
Vijay Bala
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found the problem finally. It was with calling the servlet using /servlet/com.... instead of using just /ControlServlet (i used this finally and it worked)which is how i had defined it in the default_app.webapp. I am not sure but i think the invoker servlet actually calls a new copy of the servlet if it sees /servlet.
But i am still confused - i use <autostart>false which is what i wanted. But why doesn't the invoker servlet do it the same way whether i use /servlet/com... or /ControlServlet. In the former case, it doesn't seem to get the getInitParameterNames() while in the latter case(/ControlServlet), it gets all the servlet Init parameter values.
Beats me why-i thought both options could be used ??
Thanx,
Vijay
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic