• 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Possible addition to the Servlet FAQ

Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've noticed this issue appear in multiple posts in this sub-forum. I apologize if this is the wrong spot to bring this up, but I think it might be helpful.
I've been reading up on servlet programming in Core Servlets and JavaServer Pages, Vol. 1 by Marty Hall. One of the conventions which this book uses is that the first line of the Document Descriptor is

The author explains that the encoding allows it to work with both serlets 2.3 (JSP 1.2) and servlets 2.4 (JSP 2.0). However, this appears in a number of threads where someone has said that it was causing their servlet to not be recognized. Apparently, in some cases, substituting UTF-8 for ISO-8859-1 has resolved the issue. Since this is a popular book, perhaps this would be a good addition to the FAQ under things to check if your servlet is not working?
Has anyone had this issue with Headfirst Servlets?
Posts: 43081
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is interesting, but it also sounds a bit odd. The encoding of the web.xml file is not supposed to make any difference to the working of the web app.

XML requires that UTF-8 be supported, but not ISO-8859-1, although all major parsers do (certainly all the ones ever shipped with a JRE do). But if a parser encounters a file in an unknown encoding, then it should throw an exception to that effect.

Maybe in the cases were this was reported as the solution, the file was not actually in the encoding that the "encoding" attribute said it was?
    Bookmark Topic Watch Topic
  • New Topic