Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet init parameters

 
Vladimir Kositsky
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,
i am trying to work over an example http://novocode.de/doc/servlet-essentials/chapter2b.html
(UnavailableException constructor and init(ServletConfig)(?) is
deprecated, but it not cousing the problem)
Finally i have compiled this code, but i got
"The "addressfile" property must be set to a file name" that throws from
filename = config.getInitParameter("addressfile");
whether that mean that i should set paramater addressfile in web.xml
(Tomcat)?
If yes, how to set value of addressfile as file name?
Thanks,
Vladimir
 
Marilyn de Queiroz
Sheriff
Posts: 9079
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems to me that in this line
filename = config.getInitParameter("addressfile");
you should substitute the name of the file (i.e. "address.txt") as a String for "addressfile".
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!