[seam-commits] Seam SVN: r7410 - trunk/examples/seamspace/src/org/jboss/seam/example/seamspace.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Sun Feb 10 03:40:45 EST 2008
Author: shane.bryzak at jboss.com
Date: 2008-02-10 03:40:45 -0500 (Sun, 10 Feb 2008)
New Revision: 7410
Modified:
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/ContentServlet.java
Log:
better image type handling
Modified: trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/ContentServlet.java
===================================================================
--- trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/ContentServlet.java 2008-02-10 04:01:13 UTC (rev 7409)
+++ trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/ContentServlet.java 2008-02-10 08:40:45 UTC (rev 7410)
@@ -117,9 +117,10 @@
g2d.dispose();
String formatName = "";
- if ("image/png".equals(contentType))
+ if (contentType != null && contentType.indexOf("png") != -1)
formatName = "png";
- else if ("image/jpeg".equals(contentType))
+ else if (contentType != null && (contentType.indexOf("jpg") != -1) ||
+ contentType.indexOf("jpeg") != -1)
formatName = "jpeg";
ImageIO.write(bImg, formatName, response.getOutputStream());
More information about the seam-commits
mailing list