• 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:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

ServletConfig for JSP-converted servlet

 
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers,

I am not able to fetch servlet config init parameters for my JSP's servlet.

Here is my DD entry for my JSP's servlet:



and here is my test JSP:



The following output of JSP comes in browser when I try to access it:

---------------------------------------------------------
Config Params:
lsInitParamName = [fork] lsInitParamvalue = [false]
lsInitParamName = [xpoweredBy] lsInitParamvalue = [false]
---------------------------------------------------------

I am using Tomcat 5.0 and above two parameters 'fork' / 'xpoweredBy' are being set automatically by tomcat!!

Could anyone please see where / what I am doing wrong to get init parameters? What do I need to fetch init parameters that I have specified in the DD for my JSP?

Thanks!
[ May 08, 2005: Message edited by: Anand Wadhwani ]
 
Anand Wadhwani
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just figured this out, I need to define servlet-mapping for my JSP, then only servlet config gets instantiated with the init parameters secified in web.xml.

Anyone pls describe why is this behavior? Is the servlet-mapping mandatory for each servlet in my application? For JSPs if I dont define servlet-mapping they work perfectly until I need to define init parameters for my JSP. Is this how it is supposed to be or is it tomcat bug! ?
[ May 08, 2005: Message edited by: Anand Wadhwani ]
 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
do you mean servlet mapping for your servlet

In case of servlets , servlet mapping is mandatory since only
using the url specified in the servlet mapping an external client can access the servlet

In short , for every servlet tag in web.xml , you need to have
servlet mapping
 
He baked a muffin that stole my car! And this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic