Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Web.xml context-param  RSS feed

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to setup parameter values in my web.xml file I tried adding the following to my web.xml file.

<context-param>
<param-name>debug_mode</param-name>
<param-value>true</param-value>
</context-param>
I create .war file and try to open a .jsp page and I get a HTTP ERROR: 404
.jsp not found.

I haven't even tried to access the parameter.
Is this the correct way to setup and access a parameter in a .jsp page? Do you have any suggestions?

Thanks so much for any help,

Lisa
 
Author and ninkuma
Marshal
Posts: 66783
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First things first. You need to get the JSP page to display. Then you can explore exposing the context params.

If you are using JSP 2.0, the easiest way is via the initParam built-in scoped variable of the EL.
 
Lisa Zapson
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, I figured it out. Lisa
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!