are we sure that .gif file really contains a gif? maybe it contains a jpeg.

Juergen Donnerstag wrote:

I've just committed some java code to wicket-sandbox which shows the
strange behaviour of getContentType(). Amazingly the correct content
type is returned if the jar file or the file within the jar file does
not exist. But if the url points to an existing file, the wrong
content type is returned. It is like java does not only rely on the
extension but reads the file content as well and draws a wrong
conclusion. Realy strange.

Juergen

On 4/17/05, Juergen Donnerstag <[EMAIL PROTECTED]> wrote:


Yes I agree, it is strange. I've added additional log messages which
seem to proof it (jre 1.5.0-b64). I tried to look into the sources but
they are not provided by Sun (at least I didn't find them). I checked
the bug parade but it is not easy find anything in that database.

Juergen

On 4/17/05, Johan Compagner <[EMAIL PROTECTED]> wrote:


Why is this?
I believe the content type is get from the URL content type mapping
So if it comes from a jar then it is suddenly a jpeg.. thats strange.

johan


Juergen Donnerstag wrote:



Resource.onResourceRequested() does already set the content type with
resourceStream.getContentType() but UrlResourceStream obviously
behaves differently on url like file:/D:/.../pub/Beer.gif compared to
jar:file:/D:/.../wicket-examples.war!/WEB-INF/.../pub/Beer.gif.
Whereas the first returns a content type of image/gif the latter
returns image/jpeg.

Juergen


------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop





-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop





-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op�k
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop





-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to