Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp-config query

 
Ashu Jain
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is something wrong with my DD

<?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/dtd/web-app_2_3.dtd">
<web-app>
<display-name></display-name>
<description></description>
<jsp-config>
<jsp-property-group>
<url-pattern>/*.do</url-pattern>
<scripting-invalid>true</scripting-invalid>
</jsp-property-group>
</jsp-config>
<servlet>
<servlet-name>JSPTest</servlet-name>
<description>Chapter JSP test</description>
<jsp-file>/BasicCounter.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>JSPTest</servlet-name>
<url-pattern>/BasicCounter.do</url-pattern>
</servlet-mapping>
</web-app>

It gave me error after i added jsp-config element. Error is <jsp-config> must be declared.
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are using the 2.3 version ? USe 2.4 instead. Remove the DOCTYPE, and use the web-app tag shown in this FAQ.
 
Ashu Jain
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it that doctype was refering to 2.3 DTD. I removed docType from web.xml and give following web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<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">
<display-name></display-name>
<description></description>
<jsp-config>
<jsp-property-group>
<url-pattern>*.do</url-pattern>
<scripting-invalid>true</scripting-invalid>
</jsp-property-group>
</jsp-config>
<servlet>
<servlet-name>JSPTest</servlet-name>
<description>Chapter JSP test</description>
<jsp-file>/BasicCounter.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>JSPTest</servlet-name>
<url-pattern>/BasicCounter.do</url-pattern>
</servlet-mapping>


</web-app>

It is giving error "Document root element must match DOCTYPE root = null. What does that mean? How to rectify this.
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also remove the xml tag at the top.
 
Ashu Jain
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does not seem to work still.

It gives error that Document root element "web-app" must match DOCTYPE root "null".
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which container are you using ?
 
Surajsingh Thakur
Ranch Hand
Posts: 124
Eclipse IDE MySQL Database Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends on the container,perhaps ..

 
Ashu Jain
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using tomcat 4.1.37 and java 1.4.2
 
Ashu Jain
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
u were right. Things started working after i installed tomcat 5.X

Thanks a lot
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic