Skip to main content



      Home
Home » Newcomers » Newcomers » Error in web.xml in Eclipse
Error in web.xml in Eclipse [message #244308] Mon, 31 December 2007 03:07 Go to next message
Eclipse UserFriend
Originally posted by: Abel.MacAdam.eden.invalid

Hi,

While I'm learning the ropes of Struts (and Eclipse) I sometimes see
errors that make me scratch my head. I learn Struts using a book [1]. I
use code from this book which I downloaded from the Internet. The last
error in web.xml Eclipse is signaling has confounded me.

The error is:
The content of element type "web-app" must match
" (icon?,display-name?,description?,distributable?,context-par am*,filter*,filter-mapping*,listener*,servlet*,servlet-mappi ng*,session-config?,mime-mapping*,welcome-file-list?,error-p age*,taglib*,resource-env-ref*,resource-ref*,security-constr aint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-l ocal-ref*) ". app15a/WEB-INF web.xml line
4 1198847441457 264

I checked this web.xml with previous ones, and could not find any fault.
Anyway, this is the xml file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app> <!-- Eclipse says the error is on this line -->
<listener>
<listener-class>app15a.listener.AppListener</listener-class >
</listener>
<context-param>
<param-name>dbType</param-name>
<param-value>mySQL</param-value>
</context-param>
<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>2</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<taglib>
<taglib-uri>/tags/struts-html</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location >
</taglib>
</web-app>

Anyone know what the cause is of this error?

TIA,
Abel

[1] Struts Design and Programming, a Tutorial.
Re: Error in web.xml in Eclipse [message #244344 is a reply to message #244308] Mon, 31 December 2007 08:29 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Abel,

I really don't have a clue, but based on the error message, I could
imagine that your context-param is perhaps required to appear before
your listener.


Abel MacAdam wrote:
> Hi,
>
> While I'm learning the ropes of Struts (and Eclipse) I sometimes see
> errors that make me scratch my head. I learn Struts using a book [1].
> I use code from this book which I downloaded from the Internet. The
> last error in web.xml Eclipse is signaling has confounded me.
> The error is:
> The content of element type "web-app" must match
> " (icon?,display-name?,description?,distributable?,context-par am*,filter*,filter-mapping*,listener*,servlet*,servlet-mappi ng*,session-config?,mime-mapping*,welcome-file-list?,error-p age*,taglib*,resource-env-ref*,resource-ref*,security-constr aint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-l ocal-ref*) ".
> app15a/WEB-INF web.xml line 4 1198847441457 264
>
> I checked this web.xml with previous ones, and could not find any
> fault. Anyway, this is the xml file
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
> Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
> <web-app> <!-- Eclipse says the error is on this line -->
> <listener>
> <listener-class>app15a.listener.AppListener</listener-class >
> </listener>
> <context-param>
> <param-name>dbType</param-name>
> <param-value>mySQL</param-value>
> </context-param> <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>2</param-value>
> </init-param>
> <load-on-startup>1</load-on-startup>
> </servlet>
> <servlet-mapping>
> <servlet-name>action</servlet-name>
> <url-pattern>*.do</url-pattern>
> </servlet-mapping>
> <taglib>
> <taglib-uri>/tags/struts-html</taglib-uri>
> <taglib-location>/WEB-INF/struts-html.tld</taglib-location >
> </taglib>
> </web-app>
>
> Anyone know what the cause is of this error?
>
> TIA,
> Abel
>
> [1] Struts Design and Programming, a Tutorial.
>
Previous Topic:How to get workspace path?
Next Topic:Annoying problem with eclipse (white strange forms)
Goto Forum:
  


Current Time: Fri May 16 12:48:55 EDT 2025

Powered by FUDForum. Page generated in 0.08806 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top