init param em um jsp

View: New views
1 Messages — Rating Filter:   Alert me  

init param em um jsp

by Marcelo Pinheiro :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Boa tarde lista,
estou estudando aqui os parametros de inicialização de um jsp.
No web.xml configurei assim:

    <servlet>
        <servlet-name>meuPrimeiroMapeamentoJsp</servlet-name>
        <jsp-file>/jspConfig.jsp</jsp-file>
        <init-param>
            <param-name>jspParamName</param-name>
            <param-value>jspParamValue</param-value>
        </init-param>
    </servlet>


no jsoConfig.jsp tentei retornar o valor assim:

Sobrescrevendo o jspInit e resgatando o valor pelo servletConfig

  <%!
    String paramValue;
      public void jspInit(){
          paramValue = getServletConfig().getInitParameter("jspParamName");
          getServletContext().setAttribute("jsp",paramValue);
      }
  %>

Dentro do _jspService chamei o attributo assim:

<%= application.getAttribute("jsp") %>

Mas sempre me retorna null,
alguma idéia de onde eu esteja errando?



--
--------------------------------
Analista de Sistemas
Sun Certified Programmer for Java 2 Platform 1.4
----------------------------------------------------------------------
Secretaria da Fazenda do Estado do Ceará
----------------------------------------------------------------------