[ Team LiB ] Previous Section Next Section

Q&A

Q1:

Why do some header values show up on only one kind of browser?

A1:

There are standard header names, but a browser isn't required to send any header values. Some browser implementations just send more information than others.

Q2:

Why can't I access a particular header value?

A2:

You probably misspelled the name of the header value. The HttpServletRequest class is very forgiving when it comes to capitalization, but it does require you to spell the header name correctly. Also, make sure you use hyphens and not underscores for header values, as in content-type and content-length.

Q3:

Where are my log messages going?

A3:

Each JSP and servlet engine stores its log messages in different places. Tomcat places logs in the logs/ subdirectory of the installation directory. For other servers, consult the documentation for your server.

Q4:

Why aren't my log messages showing up in the log file?

A4:

Occasionally, a server might delay logging, either intentionally or unintentionally. This is purely an implementation-specific detail and not related at all to the JSP or servlet specifications. Sometimes you can force the server to write to the log by shutting it down gracefully.

Q5:

I stored a cookie on the browser; why can't I see it?

A5:

First check to make sure you spelled the cookie name correctly. Next make sure the browser has cookies enabled. Also, if you specified a root path for the cookie, make sure that the JSP or servlet reading the cookie is in that path. Remember, too, that if you don't give the cookie a specific expiration time, the cookie vanishes when the user shuts the browser down.


    [ Team LiB ] Previous Section Next Section