File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes EL Configuration Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "EL Configuration Problem" Watch "EL Configuration Problem" New topic
Author

EL Configuration Problem

Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Hi, I'm having a problem configuring EL in my web.xml file. I'm modifying the web.xml in my application and I am using Tomcat 5.0. Currently, my web.xml looks like this...





Following the example given in http://courses.coreservlets.com/Course-Materials/pdf/struts/Struts-and-JSP2-EL.pdf
I tried to modify my web.xml into something like this...




But Eclipse is giving me these errors that says...


4:93 Attribute "version" must be declared for element type "web-app".
4:93 Attribute "xsi:schemaLocation" must be declared for element type "web-app".
Attribute "version" must be declared for element type "web-app".
Attribute "xsi:schemaLocation" must be declared for element type "web-app".


Please help...


SCJP 1.5
http://devpinoy.org/blogs/lamia/ - http://everypesocounts.com/
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The web.xml file that ships with Tomcat (tomcat/webapps/ROOT/WEB-INF/web.xml) is properly configured for use with EL.

You've got a Servlet 2.3 declaration in your web-app tag.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Thanks! I've already tried subtituting that line with



but I still get the same error message... I did follow your instruction... To be more precise with my version of Tomcat... I'm using Tomcat 5.0

Are there any Jar files that I need to place in the lib folder?
[ January 17, 2006: Message edited by: Timothy Sam ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

There is a JSP FAQ entry that contains all the info you need.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
hey guys, sorry but I still get the same error after following what is said in the FAQ... Actually, the instructions provided in the FAQ isn't any diffent from the other sites I've seen... Please check my xml file and see what's wrong with it...






Here are the errors again...



Attribute "version" must be declared for element type "web-app".
Attribute "xmlns:xsi" must be declared for element type "web-app".
Attribute "xmlns" must be declared for element type "web-app".
Attribute "xsi:schemaLocation" must be declared for element type "web-app".
cvc-complex-type.2.4.a: Invalid content was found starting with element 'taglib'. One of '{"http://java.sun.com/xml/ns/j2ee" escription, "http://java.sun.com/xml/ns/j2ee" isplay-name, "http://java.sun.com/xml/ns/j2ee":icon, "http://java.sun.com/xml/ns/j2ee" istributable, "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.



sorry fo the bother... Thanks!
[ January 17, 2006: Message edited by: Timothy Sam ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

Why do you have a DOCTYPE entry declaring the web app as a 2.3 web app AND a web-app element declaring it as a 2.4 app?

It can't be both.
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
I wonder if it's eclipse that has a problem... I'm only getting a single error now but it's really annoying... Here's my updated web.xml





and here's the error message...


The markup declarations contained or pointed to by the document type declaration must be well-formed.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

Remove the DOCTYPE declaration.
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
I get these errors when I remove that...


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.




[ January 17, 2006: Message edited by: Timothy Sam ]
[ January 17, 2006: Message edited by: Timothy Sam ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

The error message clearly shows you the elements that are allowed and what order they should be in. Notice that taglib is nowhere to be found.
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1016
Taglib declarations should appear nested under jsp-config section.
ie


However I don't normally bother with them now.
The tlds are bundled with struts.jar. If you use the common uri for the struts taglibs, you don't need any entries in web.xml

These are the ones I use for struts 1.2

<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html"%>
<%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean"%>
<%@ taglib prefix="logic" uri="http://struts.apache.org/tags-logic"%>
[ January 17, 2006: Message edited by: Bear Bibeault ]
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Bear, Stefan
Thanks fot your help guys! I was finally Able to solve my problem! Bear, I was finally able to get what you said and applied it to my code. Thank you guys!Thank you soooo much!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EL Configuration Problem
 
Similar Threads
need help using Javaranch Struts example
new to tiles please help
Parsing error processing resource path
Servlet Action currently Unavailable
HTTP Status 500