Redhat 7 with kernel 2.42; TomCat/ServletApi 4 Build2001-05-04) - please note
that I've also tried this on TC4b1 as well as TC4b3 in standalone mode with
all exhibiting the same results.
The following request url (as well as all other valid urls) always returns
null for contentType:
http://localhost:8080/xyz/servlet/ViewResource/index.html
******************* Some code within doGet method **********************
// Get the resource to view
URL url = null;
try {
url = getServletContext().getResource(req.getPathInfo());
}
catch (IOException e) {
....
return;
}
// Connect to the resource
URLConnection con = url.openConnection();
con.connect();
// con.getURL() returns jndi:/localhost/xyz/index.html
// Get and set the type of the resource
String contentType = con.getContentType(); // This returns null
res.setContentType(contentType);
***************************************************************************
Any suggestions?
Thank You,
Anthony