Bom dia,
Estou iniciando um projeto aqui com struts, mas estou tendo problema com uma exception que ta me enchendo o saco!
É o seguinte, primeiramente em meu web.xml quando adicionei as
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
.
.
.
<taglib>
<taglib-uri>/WEB-INF/struts-template.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-template.tld</taglib-location>
</taglib>
tenho o seguinte erro:
cvc-complex-type.2.4.a: Invalid content was found starting with element ‘taglib’. One of ‘{“http://java.sun.com/xml/ns/j2ee ”:description, “http://java.sun.com/xml/ns/j2ee ”:display-name, “http://java.sun.com/xml/ns/j2ee ”:icon, “http://java.sun.com/xml/ns/j2ee ”:distributable, “http://java.sun.com/xml/ns/j2ee ”:context-param, “http://java.sun.com/xml/ns/j2ee ”:filter, “http://java.sun.com/xml/ns/j2ee ”:filter-mapping, “http://java.sun.com/xml/ns/j2ee ”:listener, “http://java.sun.com/xml/ns/j2ee ”:servlet, “http://java.sun.com/xml/ns/j2ee ”:servlet-mapping, “http://java.sun.com/xml/ns/j2ee ”:session-config, “http://java.sun.com/xml/ns/j2ee ”:mime-mapping, “http://java.sun.com/xml/ns/j2ee ”:welcome-file-list, “http://java.sun.com/xml/ns/j2ee ”:error-page, “http://java.sun.com/xml/ns/j2ee ”:jsp-config, “http://java.sun.com/xml/ns/j2ee ”:security-constraint, “http://java.sun.com/xml/ns/j2ee ”:login-config, “http://java.sun.com/xml/ns/j2ee ”:security-role, “http://java.sun.com/xml/ns/j2ee ”:env-entry, “http://java.sun.com/xml/ns/j2ee ”:ejb-ref, “http://java.sun.com/xml/ns/j2ee ”:ejb-local-ref, “http://java.sun.com/xml/ns/j2ee ”:service-ref, “http://java.sun.com/xml/ns/j2ee ”:resource-ref, “http://java.sun.com/xml/ns/j2ee ”:resource-env-ref, “http://java.sun.com/xml/ns/j2ee ”:message-destination-ref, “http://java.sun.com/xml/ns/j2ee ”:message-destination, “http://java.sun.com/xml/ns/j2ee ”:locale-encoding-mapping-list}’ is expected. HibernateAnnotation/web/WEB-INF web.xml line 26 1175690618796 7096
Pois bem, li em alguns foruns que poderia ser por causa da minha versão 2.4 da minha servlet-api.jar … então disseram que eu teria que colocar a tag como pai de … blz, ate ai não tenho erro de compilação…
Porém ligo o tomcat e mando executar minha classe tenho a seguinte exception:
Tipo, acredito que o tomcat não está conseguindo ler meu web.xml e interpretar as taglibs.
Alguém ja teve esse pequeno problema? Ou tem alguma idéia de como resolver isso?
Ninguém pode me ajudar???
Como está o cabeçalho do seu web.xml?
Tenta:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
<web-app>
....
</web-app>
Tipo que com esse cabeçalho que vc me mandou o xml eh da versão 2.3
já a que eu estou usando eh da versão 2.4
<?xml version="1.0" encoding="UTF-8"?>
A diferença que percebi eh q na versão 2.3 não precisava declarar a tag como pai de como tem que ser na versão que estou usando 2.4.
Coloquei esse cabeçalho que vc mandou, tirei a tag e não funcionou, continua com a mesma exception.
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: javax/servlet/jsp/tagext/TagExtraInfo
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:274)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.10 logs.
Cadê a galera expert em jee pra me ajudar?
Tente colocar a dentro da tag .
exemplo :
bla bla bla
/WEB-INF/SuaTAG.tld
Verifique se no seu codigo xml existe o short-name. Ex:
1.0
Qualquer coisa
nome da tlib
nomefuncao
com.exemplo
int rolldice()
abs