?
Solved

Element ordering in DD

Posted on 2005-03-05
6
Medium Priority
?
157 Views
Last Modified: 2013-11-24

From Javaranch Mock exam

Ques
  <servlet>
          .........
  </servlet>


  <listener>
      <listener-class>com.javaranch.MockListener</listener-class>
  </listener>

The above entry in DD will result in what ?

Ans.

The webapp will not be loaded due to a parse exception of DD

The ordering of DD is listener then servlet

---------------------------

But i tried the following and it worked. There was no problem in loading the webapp

  <servlet>
      <servlet-name>A</servlet-name>
      <servlet-class>com.Abc</servlet-class>
  </servlet>

  <servlet-mapping>
     <servlet-name>A</servlet-name>
       <url-pattern>/MyServlet/*</url-pattern>
  </servlet-mapping>

  <listener>
      <listener-class>com.MyListener</listener-class>
  </listener>



PLease let me know whats the correct answer. Does ordering of XML elements in DD matter ?
0
Comment
Question by:thomas908
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 29

Accepted Solution

by:
bloodredsun earned 500 total points
ID: 13466910
>>Does ordering of XML elements in DD matter ?

they do in servlet api 2.3 and lower but don't in api 2.4 so if you are running tomat 5, this will work fine, if you run tomcat 4 or lower then it will throw an error
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 13466911
Too much like homework for comfort ...
0
 
LVL 8

Author Comment

by:thomas908
ID: 13474904
>> Too much like homework for comfort ...

This a ques from javaranch Mock Exam for SCWCD exam
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 8

Author Comment

by:thomas908
ID: 13474908
Thanks for helping, bloodredsun
0
 
LVL 29

Expert Comment

by:bloodredsun
ID: 13474954
Glad to have helped.

You'll have to excuse CEHJ's comment as we are often asked to help people with their homework (CEHJ more than most as he is one of the best Java experts around EE, just have a look at his points) and I think he missed the part of your post where you stated that it was from the JavaRanch test (I used to take the JavaRanch tests too, it's nice to see a bit of humour in teaching!)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 13475381
>>You'll have to excuse CEHJ's comment as we are often asked to help people with their homework

8-)
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
A solution for Fortify Path Manipulation.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question