tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve E. Lee" <lcs...@cs.ccu.edu.tw>
Subject Config jsp init-param in web.xml
Date Thu, 01 Jan 1970 00:00:00 GMT
Hi,

      With Apache 1.3.12 and Tomcat 3.1, our servlets and jsps run perfectly.
  We tried to config init param for an application successfully -- by 
  <context-param> tag in web.xml. But we can't config init param for a jsp.

  Here is our configurations:
  =================================
  ****** web.xml

    <!-- init paramters for entire application -->
    <context-param>
        <param-name>te</param-name>
        <param-value>app-te-value</param-value>
    </context-param>

    <!-- init parameters for a servlet -->
    <servlet>
        <servlet-name>
            myjsp
        </servlet-name>
        <jsp-file>
            /myjsp.jsp
        </jsp-file>
        <init-param>
            <param-name>te</param-name>
            <param-value>jsp-te-value</param-value>
        </init-param>
    </servlet>

  
  ******* myjsp.jsp

     <%
        str = getServletConfig().getInitParameter("te");
        if (str != null) {
     %>
	   Value of init param "te" is: <%= str %>
     <%
        }
        else {
     %>
           failed...
     <%
        }
     %>
  =========================================

  Plz help!! 
  Thanks in advance. >=)

Mime
View raw message