aspose file tools*
The moose likes Servlets and the fly likes Configuration file.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Configuration file.." Watch "Configuration file.." New topic
Author

Configuration file..

Chuck Meduri
Ranch Hand

Joined: Nov 29, 2000
Posts: 48
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
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12678
    
    5
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:


Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Configuration file..
 
Similar Threads
question about SERVLET tag
How to link Apache And Resin
struts/jboss/tomcat application not working
problem with first servlet
Anybody using Resin?