It's Tomcat 4.

On Friday 04 May 2001 18:23, Anthony W. Marino wrote:
> (Redhat 7 with kernel 2.42; TomCat/ServletApi Build2001-05-04) - please
> note that I've tried this on TCb1 and TCb3 with 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());
>       return url;
>     }
>     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
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to