• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting object through context-param

 
vivek ja
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I set a value in <context-param>? if so
In <param-value> How can I set an Address object that contains streetaddress, apt #, city, etc.,

Thank you!
 
Serghei Jelauc
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, there is no way to do it.
Put in your <context-param> name-value pairs where values are: streetaddress, apt #, city, etc., . In the init() method of your servlet or in the ServletContextListener's contextInitialized you can get that values, create an Address object, set the values to it's fields and put this object as attribute in context scope (context.setAttribute(String name, String value)).

Hope it helps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic