I am having the same problem I am trying to access the jsp init parameters from the jsp file. And its not working. If somebody know please tell.
Here is the jsp file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<%@ page import="java.util.*" %>
<%@ page
language="java"
contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"
%>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="IBM WebSphere Studio">
<META http-equiv="Content-Style-Type" content="text/css">
<LINK href="theme/Master.css" rel="stylesheet" type="text/css">
<TITLE>AccessGlobalAttrbutes.jsp</TITLE>
</HEAD>
<BODY>
<P>Place content here.</P>
This is a local Parameter: <%= config.getInitParameter("email") %> <br />
This is a local Parameter: <%= pageContext.getServletConfig().getInitParameter("email") %>
<%
Enumeration en = config.getInitParameterNames();
while(en.hasMoreElements()){
%>
<%= "Elements " + en.nextElement() %>
<% } %>
</BODY>
</HTML>
Here the web.xml file.
<servlet>
<servlet-name>AccessGlobalAttrbutes</servlet-name>
<display-name>AccessGlobalAttrbutes</display-name>
<jsp-file>/AccessGlobalAttrbutes.jsp</jsp-file>
<init-param>
<param-name>email</param-name>
<param-value>
localtina@hotmail.com</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>AccessGlobalAttrbutes</servlet-name>
<url-pattern>/AccessGlobalAttrbutes</url-pattern>
</servlet-mapping>
in the output is is giving me
Place content here.
This is a local Parameter: null
This is a local Parameter: null
any hint will be of great help.
Have a nice day.
[ October 02, 2006: Message edited by: Tina Jain ]