• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A JSP document template for XHTML output

 
Ralf Wahner
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Colleagues

May I request a few minutes of your time, please? I would like to know if my interpretation is correct.

Question: The JSP document write-xhtml.jspx is supposed to produce XHTML output (as opposed to plain HTML). Let's further assume that the deployment descriptor is compliant with version 2.4, so that write-xhtml.jspx is undoubtfully a JSP document. Which of the following two templates should we use, to guarantee that the output is recognized to be XHTML?

Template 1:

Template 2:

Testing
Testing reveals, that Template 1 generates

whereas Template 2 solely generates

Interpretation
From my point of view the correct answer is "Template 1", for its output is XML-compliant and owns an XML declaration. I deem Template 2 wrong, since there is no clue concerning the content type.

Kind regards,

Ralf Wahner
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic