• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DOCTYPE/ENTITY declaration in JSP documents: Jasper throws Exception

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone,

I'm trying to use an entity in my JSP document, the XML syntax of JSP pages (I had to replace the ampersand and hash characters by a %character% construct due to misinterpretation of this forum software):

<!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>

Jasper, the JSP compiler of Tomcat, always throws the exception "Element type 'jsp:root' must be declared.". If I remove the DOCTYPE declaration and the %ampersand%nbsp; all works as expected.

What is the cause of the exception? What does it mean in this case?

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

Regards,

Andreas
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic