Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

DOCTYPE/ENTITY declaration in JSP documents: Jasper throws Exception  RSS feed

 
Andreas Schildbach
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

I'm trying to use an entity in my JSP document (the XML syntax of JSP pages):

<!DOCTYPE jsp:root [
<!ENTITY nbsp " ">
]>
<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page">
 
</jsp:root>

Jasper always throws the exception "Element type 'jsp:root' must be declared.". If I remove the DOCTYPE declaration and the   all works as expected.

What is the cause of the exception?

Note that the "jsp"-namespace is declared, do I need to declare it a second type just for the DOCTYPE? How?

Regards,

Andreas
 
Andreas Schildbach
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry, the forum software has stripped my non-breakable-space "ampersand nbsp;" sequences. The correct example is:

<!DOCTYPE jsp:root [
<!ENTITY nbsp "%ampersand%%hash%160;">
]>
<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page">
%ampersand%nbsp;
</jsp:root>
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!