<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=mnoda" rel="nofollow">Mauricio Noda</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6744?redirect=false" rel="nofollow">SPR-6744</a></strong> and commented</p>
<p dir="auto">While creating a custom Spring Security AuthenticationProvider I stumbled on the need for instances of both HttpServletRequest and HttpServletResponse. There´s no way to easily access them. Modifying org.springframework.web.context.request.RequestContextListener to register both instances in Spring request scope would be ideal.</p>
<p dir="auto">I´m trying to integrate Spring Security with Weblogic Servlet Authentication. (<a href="http://download.oracle.com/docs/cd/E15051_01/wls/docs103/javadocs/weblogic/servlet/security/ServletAuthentication.html" rel="nofollow">http://download.oracle.com/docs/cd/E15051_01/wls/docs103/javadocs/weblogic/servlet/security/ServletAuthentication.html</a>)</p>
<p dir="auto">I see it becoming a major issue for any web container as JSR-196, which has the same problem, made its way into JEE 1.6 specification.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0 GA</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398102258" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11409" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11409/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11409">#11409</a> Make HttpServlertRequest and HttpServletResponse available for injection (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=sgarlatm" rel="nofollow">Matthew Sgarlata</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-637?redirect=false" rel="nofollow">SPR-637</a></strong> and commented</p>
<p dir="auto">I recently went on a little odyssey fixing a bug that ended up giving me much more insight into the JavaMail framework than I ever wanted ;)</p>
<p dir="auto">To make a long story short, I think we should include additional file extension to mime type mappings in Spring.  I think this is in line with Spring's goal of simplifying J2EE APIs, because providing mappings for these simple file types will alleviate reading up on the Java Activation Framework when you just want to send an email :)</p>
<p dir="auto">Now the whole story:</p>
<p dir="auto">JavaMail (and Spring... good work!) use the Java Activation Framework to resolve filename extensions to mime types.  The default mime types built into the framework are defined in activation.jar\META-INF\mimetypes.default.  They are rather meager, and don't even include types in widespread use such as PNG and CSS.  Here are the types that are included in the Java Activation Framework version 1.0.2:</p>
<p dir="auto">text/html		html htm HTML HTM<br>
text/plain		txt text TXT TEXT java c c++ pl cc h<br>
image/gif		gif GIF<br>
image/ief		ief<br>
image/jpeg		jpeg jpg jpe JPG<br>
image/tiff		tiff tif<br>
image/x-xwindowdump	xwd<br>
application/postscript	ai eps ps<br>
application/rtf		rtf<br>
application/x-tex	tex<br>
application/x-texinfo	texinfo texi<br>
application/x-troff	t tr roff<br>
audio/basic		au<br>
audio/midi		midi mid<br>
audio/x-aifc		aifc<br>
audio/x-aiff            aif aiff<br>
audio/x-mpeg		mpeg mpg<br>
audio/x-wav             wav<br>
video/mpeg		mpeg mpg mpe<br>
video/quicktime		qt mov<br>
video/x-msvideo		avi</p>
<p dir="auto">Fortunately, there is a simple mechanism to extend the list of file types.  Just drop a mime.types file in your META-INF folder.  (See <a href="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/activation/MimetypesFileTypeMap.html" rel="nofollow">http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/activation/MimetypesFileTypeMap.html</a> for more information).</p>
<p dir="auto">Attached is such a file, based on the types listed at <a href="http://www.utoronto.ca/webdocs/HTMLdocs/Book/Book-3ed/appb/mimetype.html" rel="nofollow">http://www.utoronto.ca/webdocs/HTMLdocs/Book/Book-3ed/appb/mimetype.html</a>.  I used my discretion to remove some of the types listed, but hopefully the attached mime.types file will work for most use cases.</p>
<p dir="auto">In terms of packaging this file with Spring, I'm not really sure the best approach.  Here are two thoughts:</p>
<ul dir="auto">
<li>Place the file in dist/META-INF</li>
<li>Include the file in spring.jar/META-INF</li>
</ul>
<hr>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/10460/mime.types" rel="nofollow">mime.types</a> (<em>7.11 kB</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/10435/mime.types" rel="nofollow">mime.types</a> (<em>7.60 kB</em>)</li>
</ul>