• Post Reply Bookmark Topic Watch Topic
  • New Topic

context-param and EL

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my web.xml I have specified a context-param as:



And in my JSP I have the following line:



When I view the source after deploying this I just get an empty "" where I should have the url. EL works everywhere else I am using it. I am running Tomcat 5. Am I just specifying something wrong here or what?
[ September 24, 2004: Message edited by: Gregg Bolinger ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
applicationScope refers to scoped variables (attributes) saved on the servlet context. There is no EL implicit variable that maps to the context parameters.

In my apps, I collect all configuration parameters for the application -- whether they come from properties files, context params or elsewhere -- at startup and abstract them into a map I place on the servlet (application) context with a name like appConfig. I can then reference them anywhere as appConfig.whatever.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. I use a ContextListener to trigger this activity.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
P.S. I use a ContextListener to trigger this activity.


I was just about to ask. Thanks Bear. I'll give that a shot.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!