Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on DTD

 
Rohit Poddar
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Element web-app is defined as :
<!ELEMENT web-app (icon?, display-name?, description?, distributable?, context-param*, filter*, filter-mapping*, listener*, servlet*, servlet-mapping*, session-config?,
mime-mapping*, welcome-file-list?, error-page*, taglib*,
resource-env-ref*, resource-ref*, security-constraint*, login-config?, security-role*,
env-entry*, ejb-ref*, ejb-local-ref*)>
As you see it says the context-param comes before filter but as you go down in dtd they have defined filter before context-param. Please help me understand this.
Thanks,
Rohit
 
Paul Anilprem
Enthuware Software Support
Ranch Hand
Posts: 3817
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Order is not important.
------------------
SCJP2, SCWCD Resources, Free Question A Day, Mock Exam Results and More!
www.jdiscuss.com
Get Certified, Guaranteed!
JQPlus - For SCJP2
JWebPlus - For SCWCD
JDevPlus - For SCJD
 
Tim Duncan
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Paul Anil:
Order is not important.

I think that deserves a bit more explanation.
The context-param and filter sections in the DTD can be in any order, however ...
The DTD does require that context-param comes before filter in the deployment descriptor (i.e. the XML file).
 
Paul Anilprem
Enthuware Software Support
Ranch Hand
Posts: 3817
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're correct. I should've explained that
 
Rohit Poddar
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Tim and Paul,
I have a few more questions....
1) Is there anything specified in the DTD or in the Servlet specification that context comes before filter?
2) Are there any more of such restrictions, as to which element comes before any other element?
Thanks,
Rohit
 
Tim Duncan
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rohit Poddar:

2) Are there any more of such restrictions, as to which element comes before any other element?

Yes, it's all in the DTD Specification . The specification for <web-app> ...
<!ELEMENT web-app (icon?, display-name?, description?, distributable?, context-param*, filter*, filter-mapping*, listener*, servlet*, servlet-mapping*, session-config?,
mime-mapping*, welcome-file-list?, error-page*, taglib*,
resource-env-ref*, resource-ref*, security-constraint*, login-config?, security-role*,
env-entry*, ejb-ref*, ejb-local-ref*)>
tells you what other elements can occur inside <web-app>. A question mark indicates that the item is optional, and a star means zero-or-more occurrences, however the elements (where they appear) must occur in the order given (indicated by the commas).
Hope that answers your question.
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does SCWCD test <web-app> only? Or the test may cover other DTDs? Would anybody shed light on this question?
 
Tim Duncan
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by JiaPei Jen:
Does SCWCD test <web-app> only? Or the test may cover other DTDs? Would anybody shed light on this question?

Section 12 requires knowledge of Tag Library Descriptors
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic