Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ServletConfig  RSS feed

 
Robin Rath
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to set attributes in ServletConfig object?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

You can't. Attributes are a feature of the servlet context, not the servlet configuration. If you have a ServletConfig object you can get a ServletContext object through the getServletContext method.
 
Ankur Bohra
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This interface is implemented by services in order to pass configuration information to a servlet when it is first loaded. A service writer implementing this interface must write methods for the servlet to use to get its initialization parameters and the context in which it is running.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!