Home » Language IDEs » ServerTools (WTP) » Eclipse not accepting taglib tag in web.xml
Eclipse not accepting taglib tag in web.xml [message #137890] |
Fri, 09 September 2005 17:40 |
Eclipse User |
|
|
|
Originally posted by: neil.JAMMConsulting.com
Hello:
I am converting an existing struts based web app into an Eclipse WTP
project.
Eclipse does not like my web.xml, it gives me this error:
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.
Here is my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<!-- Standard Action Servlet Configuration (with debugging) -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class >
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>0</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- The Welcome File List -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- Application wide error pages -->
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/error.do</location>
</error-page>
<!-- Struts Tag Library Descriptors -->
<taglib>
<taglib-uri>/tags/struts-bean</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location >
</taglib>
<taglib>
<taglib-uri>/tags/struts-html</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location >
</taglib>
<taglib>
<taglib-uri>/tags/struts-logic</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location >
</taglib>
<taglib>
<taglib-uri>/tags/struts-nested</taglib-uri>
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location >
</taglib>
<taglib>
<taglib-uri>/tags/struts-tiles</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location >
</taglib>
<!-- Do not allow users to load jsps directly -->
<security-constraint>
<web-resource-collection>
<web-resource-name>no_access</web-resource-name>
<url-pattern>*.jsp</url-pattern>
</web-resource-collection>
<auth-constraint/>
</security-constraint>
</web-app>
Any ideas why this error is occurring?
Thanks,
Neil
--
Neil Aggarwal, JAMM Consulting, (214)986-3533, www.JAMMConsulting.com
FREE! Valuable info on how your business can reduce operating costs by
17% or more in 6 months or less! http://newsletter.JAMMConsulting.com
|
|
|
Re: Eclipse not accepting taglib tag in web.xml [message #137902 is a reply to message #137890] |
Fri, 09 September 2005 18:00 |
Larry Isaacs Messages: 1354 Registered: July 2009 |
Senior Member |
|
|
This web.xml would probably be valid for Servlet 2.3, but with Servlet
2.4, the schema requires that <taglib> elements be children of a
<jsp-config> element.
Cheers,
Larry
Neil Aggarwal wrote:
> Hello:
>
> I am converting an existing struts based web app into an Eclipse WTP
> project.
>
> Eclipse does not like my web.xml, it gives me this error:
>
> 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.
>
> Here is my web.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <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">
>
> <!-- Standard Action Servlet Configuration (with debugging) -->
> <servlet>
> <servlet-name>action</servlet-name>
> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class >
> <init-param>
> <param-name>config</param-name>
> <param-value>/WEB-INF/struts-config.xml</param-value>
> </init-param>
> <init-param>
> <param-name>debug</param-name>
> <param-value>0</param-value>
> </init-param>
> <init-param>
> <param-name>detail</param-name>
> <param-value>0</param-value>
> </init-param>
> <load-on-startup>2</load-on-startup>
> </servlet>
>
> <!-- Standard Action Servlet Mapping -->
> <servlet-mapping>
> <servlet-name>action</servlet-name>
> <url-pattern>*.do</url-pattern>
> </servlet-mapping>
>
> <!-- The Welcome File List -->
> <welcome-file-list>
> <welcome-file>index.jsp</welcome-file>
> </welcome-file-list>
>
> <!-- Application wide error pages -->
> <error-page>
> <exception-type>java.lang.Throwable</exception-type>
> <location>/error.do</location>
> </error-page>
>
> <!-- Struts Tag Library Descriptors -->
> <taglib>
> <taglib-uri>/tags/struts-bean</taglib-uri>
> <taglib-location>/WEB-INF/struts-bean.tld</taglib-location >
> </taglib>
> <taglib>
> <taglib-uri>/tags/struts-html</taglib-uri>
> <taglib-location>/WEB-INF/struts-html.tld</taglib-location >
> </taglib>
> <taglib>
> <taglib-uri>/tags/struts-logic</taglib-uri>
> <taglib-location>/WEB-INF/struts-logic.tld</taglib-location >
> </taglib>
> <taglib>
> <taglib-uri>/tags/struts-nested</taglib-uri>
> <taglib-location>/WEB-INF/struts-nested.tld</taglib-location >
> </taglib>
> <taglib>
> <taglib-uri>/tags/struts-tiles</taglib-uri>
> <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location >
> </taglib>
>
> <!-- Do not allow users to load jsps directly -->
> <security-constraint>
> <web-resource-collection>
> <web-resource-name>no_access</web-resource-name>
> <url-pattern>*.jsp</url-pattern>
> </web-resource-collection>
> <auth-constraint/>
> </security-constraint>
>
> </web-app>
>
> Any ideas why this error is occurring?
>
> Thanks,
> Neil
>
|
|
|
Re: Eclipse not accepting taglib tag in web.xml [message #137940 is a reply to message #137902] |
Fri, 09 September 2005 20:21 |
Eclipse User |
|
|
|
Originally posted by: neil.JAMMConsulting.com
Larry:
Is there a way to tell eclipse to use the servlet 2.3 spec?
My server is running Tomcat 5.0 and I dont want to go thru the
hassle of upgrading it.
Thanks,
Neil
Larry Isaacs wrote:
> This web.xml would probably be valid for Servlet 2.3, but with Servlet
> 2.4, the schema requires that <taglib> elements be children of a
> <jsp-config> element.
|
|
|
Re: Eclipse not accepting taglib tag in web.xml [message #137963 is a reply to message #137940] |
Fri, 09 September 2005 20:29 |
Eclipse User |
|
|
|
Originally posted by: jrduncans.stephenduncanjr.com
Neil Aggarwal wrote:
> Larry:
>
> Is there a way to tell eclipse to use the servlet 2.3 spec?
> My server is running Tomcat 5.0 and I dont want to go thru the
> hassle of upgrading it.
>
> Thanks,
> Neil
>
> Larry Isaacs wrote:
>
>> This web.xml would probably be valid for Servlet 2.3, but with Servlet
>> 2.4, the schema requires that <taglib> elements be children of a
>> <jsp-config> element.
>
>
>
>
Tomcat 5.0 supports the Servlet 2.4 spec. I think you'd be better off
just modifying your web.xml file to match the Servlet 2.4 spec.
However, if you really want to revert back to 2.3, you just need to fix
the web.xml to be declared as 2.3 instead of 2.4 (DOCTYPE with 2.3 dtd,
vs. 2.4 schema)
-Stephen
|
|
|
Re: Eclipse not accepting taglib tag in web.xml [message #137975 is a reply to message #137963] |
Fri, 09 September 2005 21:30 |
Eclipse User |
|
|
|
Originally posted by: neil.JAMMConsulting.com
Stephen:
So, what you are saying is that Tomcat is allowing me to specify the 2.4 DTD
and
be sloppy.
I get your point. I will change my web.xml.
Thanks,
Neil
--
Neil Aggarwal, JAMM Consulting, (214)986-3533, www.JAMMConsulting.com
FREE! Valuable info on how your business can reduce operating costs by
17% or more in 6 months or less! http://newsletter.JAMMConsulting.com
"Stephen Duncan Jr" <jrduncans@stephenduncanjr.com> wrote in message
news:dfsra8$dba$1@news.eclipse.org...
> Tomcat 5.0 supports the Servlet 2.4 spec. I think you'd be better off
> just modifying your web.xml file to match the Servlet 2.4 spec.
>
> However, if you really want to revert back to 2.3, you just need to fix
> the web.xml to be declared as 2.3 instead of 2.4 (DOCTYPE with 2.3 dtd,
> vs. 2.4 schema)
>
> -Stephen
|
|
| | |
Goto Forum:
Current Time: Wed Jan 15 04:49:14 GMT 2025
Powered by FUDForum. Page generated in 0.04468 seconds
|