tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Renee Petris <re...@loudeye.com>
Subject jsp and config.getInitParameter()
Date Thu, 08 Feb 2001 04:43:33 GMT
Has anybody had success using config.getInitParameter() in jsp pages?
 
I was looking at the web.dtd and noticed that the the servlet element is
defined as:
<!ELEMENT servlet (icon?, servlet-name, display-name?, description?,
(servlet-class|jsp-file), init-param*, load-on-startup?,
security-role-ref*)>

jsp-file is described as: 

<!-- The jsp-file element contains the full path to a JSP file within

the web application. -->

Based on how init-param is used for servlets, I assumed that for a jsp page
the web.xml would look like:

<web-app>    <servlet>
        <servlet-name>helloworld</servlet-name>
 
<jsp-file>d:\apps\jakarta-tomcat\webapps\helloworld\hello.jsp</jsp-file>
        <init-param>
            <param-name>test</param-name>
            <param-value>This Is It</param-value>
        </init-param>
    
    </servlet> </web-app>

Then in my jsp page I use:

<p>The config param test is <%= config.getInitParameter("test") %></p>


The output is

The config param test is null

I've gotten context-param to work great. But I'm curious if anyone knows how
to get config.getInitParameter("xx") to work?

Renée Petris
Overseer of the Execution
Loudeye Technologies
renee.petris@loudeye.com <mailto:renee.petris@loudeye.com> 
414 Olive Way, Suite 300
Seattle, WA 98101
206-832-4500 phone
206-832-4475 fax 

 

Mime
View raw message