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 13: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 14:00   |
Eclipse User |
|
|
|
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 #138296 is a reply to message #137997] |
Mon, 12 September 2005 10:47  |
Eclipse User |
|
|
|
Larry is describing some additional metadata that tracks the "module"
version, and should be changed as well. The .wtpmodules file uses the
<module-type module-type-id="jst.web">
<version>2.3</version> attribute, make sure you change this as
well.
The servlet schema didn't change too much between these versions, so you
should be fine....
- Chuck
Larry Isaacs <Larry.Isaacs@sas.com> wrote in
news:dft26d$lus$1@news.eclipse.org:
> If you only change the web.xml, only the server will think the webapp
> is 2.3. WebTools will still think it's 2.4 since that is how it was
> created. WebTools wouldn't let you test it with a Tomcat 4.1 server.
>
> When you create a Dynamic Web Application, make sure the Advanced
> section is displayed. It is there that you can select the module's
> J2EE version. You may want to create a new 2.3 Dynamic Web
> Application and copy your current content over.
>
> You could compare ".*" files between the two and try to manually
> change your current project to 2.3. However, I don't know if that
> might make the project inconsistent with cached information that would
> lead to erroneous behavior.
>
> Larry
>
|
|
|
Goto Forum:
Current Time: Sun Jun 08 06:36:00 EDT 2025
Powered by FUDForum. Page generated in 0.05872 seconds
|