Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Param in Java class  RSS feed

 
Dan Parsons
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I need a web.xml context value to work in a plain Java Class that is not a Servlet.


For a servlet I can fetch the value like this:
config.getInitParameter("myValue")


Anyway to get a web.xml param or something similiar to work in a Java class?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66040
140
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fetch it in the servlet and pass it to the non-servlet class as a parameter.
 
CLUCK LIKE A CHICKEN! Now look at this tiny ad:
Thoughts on deprecation in Java
https://coderanch.com/t/683016/java/Deprecation-Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!