This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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
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