• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

init-param & context-param

 
Steve Jerome
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the init-param & context-param values used in the DD are read by the container only once when the servlets are initialised.after that if we change the value of the params then we have to restart the server to reflect the changed value.THIS IS ACCORDING TO PAGE 153 OF HFSJ.

but i'm able to access the changed value without restarting the server and just by refreshing the browser.how is it possible if the above statement is true?
 
Bryan Basham
author
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Steve,

I suspect that you are using a web container that restarts your webapp whenever the web.xml file changes. I believe that new versions of Tomcat to this; check your server logs to verify this.

However, this behavior is not guarateed by the servlet spec.

HTH,
Bryan
 
Steve Jerome
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bryan,

Thanks for your reply.I'm using Tomcat3.3.2. When I change the web.xml file the server says
remove mapping Coffeeproject/allservletclassfiles
adding context default:Coffeeproject
validating web.xml

Another Question

whenever I start my server it gives lots of error message about my web.xml file like
element web-app not declared
servlet not declared
servlet-name not declared and so on for all the elements in the web.xml file.but my servlet which access these elements runs fine.
[ March 19, 2007: Message edited by: Steve Jerome ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
3.3.2

Are you really using 3.3.2 for SCWCD ? That's pretty old.
You need at least Tomcat 5.5
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic