null pointer exception in setting response header in servlet
response.setHeader(keys[i].toString(),value);
in a servlet is throwing null pointer exception even though none of keys[i] or value 开发者_JAVA技巧are null why is it so?
One of the following is true:
- response is null
- keys is null
- keys[i] is null
- the exception is not thrown from the line you posted.
精彩评论