Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Init Parameter value return null.  RSS feed

Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In tomcat4.1, I try to set a parameter in conf/server.xml so i can get it back from jsp page. In my jsp page, I always get a null string for the parameter i set in server.xml. I search through all document to verify my server.xml. I hit dead end. Hope someone will shine some light. This is the context in my server.xml.
<Context path="/pw" docBase="pw" debug="0"
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_pw_log." suffix=".txt"
<Environment name="maxExemptions" type="java.lang.Integer"
<Parameter name="DEBUG" value="1" override="false"/>
THis is my jsp page under webapps/pw/check.jsp
<title>Check Attribute</title>
<%@ page import="*" %>
<%@ page import="javax.servlet.*" %>
ServletContext sc = getServletContext();
String creator = (String)sc.getAttribute("DEBUG");
The page and log file show "null"
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!