2009/10/4 David Chang <david_q_zh...@yahoo.com>:
> Hello, I am reading <<Wicket in Action>>. The Tip on page 291 says "it is 
> good practice to start your panels and  borders (possibly your pages) with an 
> XML declaration to force Wicket to work with them using the proper encoding".
>
> Does this mean that starting a panel, border, or page with something such as 
> the following:
> ----------
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> <html xmlns="http://www.w3.org/1999/xhtml"; lang="en" xml:lang="en">
> <head>
> <meta http-equiv="content-type" content="text/html; charset=utf-8" />
> ...
> </head>
> ----------

Actually, the xml declaration is the one starting <?xml, which
includes your encoding as soon as possible in the file, before any
actual content.  Adding the doctype is also good practice, as it makes
sure wicket/the browser/anything else that reads the file understands
it exactly as you wrote it, but is a separate issue.

>
> is better than with:
> ----------
> <html>
> <head>
> ...
> </head>
> ----------

> If yes, why do all the examples of the WIA book start simply with 
> <html><head>...</head>?

To save space I assume.

> Thanks for your help!
>

One final thing to note is that IE6 will screw up any page with an
<?xml declaration.  I prefer to include it in my source, and then have
Wicket strip it out at the last moment - at least when I'm forced to
be IE6 compatible.

-- 
Phil Housley

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to