Configuração de JSLT

3 respostas
M

Salve galera do PJ,

Fui utilizar tags libary em um de meus projetos utilizando o plugin Lomboz do eclipse.
Configurei o arquivo web.xml desta maneira:

<?xml version="1.0" ?> 
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" 
version="2.4">
 
<!-- tags libary--> 

<taglib>
 <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
  <taglib-location>/WEB-INF/tld/c-1_0-rt.tld</taglib-location> 
  </taglib> 
<taglib>
 <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
  <taglib-location>/WEB-INF/tld/fmt-1_0-rt.tld</taglib-location> 
</taglib>

....

</web-app>
Compiei os arquivos .dld para uma pasta tld dentro da web-inf. Copiei os arquivos standard.jar e jstl.jar para a pasta lib da web-inf (também copiei para pasta TOMCAT_HOME\commons\lib) não resolveu.

A mensagem de erro é a seguinte quando compilo o módulo:

SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base C:\Arquivos de programas\Apache Software Foundation\Tomcat 5.0\webapps\balancer does not exist or is not a readable directory
...
24/03/2005 20:38:46 org.apache.catalina.core.StandardContext start
SEVERE: Error in resourceStart()
24/03/2005 20:38:46 org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
24/03/2005 20:38:46 org.apache.catalina.core.StandardContext start
SEVERE: Context startup failed due to previous errors
24/03/2005 20:38:46 org.apache.catalina.core.StandardContext start
SEVERE: Exception during cleanup after start failed
LifecycleException:  Container StandardContext[/balancer] has not been started
...
24/03/2005 20:38:46 org.apache.catalina.core.StandardHostDeployer install

bem, e meus jsps aparentemente não apresenta erros, e isto não vem ao caso. Tem algo que deixei de fazer?

3 Respostas

J

Oi

Marcos, este erro não parece ser na sua app não, veja que ele ocorre no contexto Balancer, esse contexto já existe no Tomcat, provavelmente deu algum problema com ele…

Sobre as JSTL, se quiser mudar os nomes dos mapeamentos :wink:

<taglib> <taglib-uri>jstl/c</taglib-uri> <taglib-location>/WEB-INF/tld/c-1_0-rt.tld</taglib-location> </taglib> <taglib> <taglib-uri>jstl/fmt</taglib-uri> <taglib-location>/WEB-INF/tld/fmt-1_0-rt.tld</taglib-location> </taglib>

T+

M

na última especificação de jsp/servlets tu não precisa definir taglib no DD… o proprio container vai procurar por arquivos .tld em diretórios específicos, como sub-diretórios de WEB-INF…

M

Salve,

Galerinha, valeu pelas dicas, na verdade era o meu tomcat que estava mal configurado.

Valeu!!

:okok: :pensativo:

Criado 24 de março de 2005
Ultima resposta 26 de mar. de 2005
Respostas 3
Participantes 3