S Ramakrishnan wrote:
> Environment:
> Tomcat 4.0 on NT4.0
> Browser: IE5.5
>
> Problem:
> I am unable to get <init-param> to work.
> In my web.xml I have
> <servlet>
> <servlet-name>Quote</servlet-name>
> <servlet-class>Quote</servlet-class>
> <init-param>
> <param-name>quotesFile</param-name>
> <param-value>quotes.txt</param-value>
> </init-param>
> </servlet>
>
> The ServletContext in init() fetches null for
> init-param "quotesFile". (I've tried restrating catalina).
>
For this to be recognized, you need to do two more things:
* Establish a servlet mapping for your servlet:
<servlet-mapping>
<servlet-name>Quote</servlet-name>
<url-pattern>/quote</url-pattern>
</servlet-mapping>
* Use this mapping in the URL that requests the servlet:
http://localhost:8080/myapp/quote
where "/myapp" is the context path of your web application.
>
> Could someone please give me an example of
> storing and using resources (say, Files) in my
> web application? I am not sure if I should put the file
> in thge root of the web app or in the classes directory.
>
> Thanks,
>
> Rk
> x77309
>
Craig McClanahan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]