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

Configuration file..

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have just started learning Servlets and am using Resin1.2.1 as my servlet engine. I am trying to access the initialization parameter from a web.xml file which I placed in the /install-dir/doc/Web-inf/classes directory. My class file is in /install-dir/doc/Web-inf/classes/<package-name>/<classfile>.
When I run the servlet from Internet Explorer it cannot find the
parameter and hence prints a default message which I supplied in my code.
Can anybody help me with this problem.
Thank you in advance,
Chuck
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Web.xml is pretty sensitive to syntax and the order of elements.
Here is an example that creates an alias and provides a single init paramater.
<servlet><servlet-name>saynumb.au</servlet-name>
<servlet-class>com.JSPbook.Chap04.NumberSoundServ</servlet-class>
<init-param>
<param-name>basepath</param-name>
<param-value>c:\\tomcat\\webapps\\Root\\JSPbook\\Chap04\\sounds</param-value>
</init-param>
</servlet>
Incidently be sure that directory name is WEB-INF, all caps.
Bill

------------------
author of:
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic