Repository navigation
Conversation
This commit drops the Java Activation Framework dependency from the MediaTypeFactory, in favor of parsing our own `mime.types` file, which was obtained from Apache HTTPD. Issue: SPR-14908
This commit updates the main code base to conform to the dropped JAF dependency in MediaTypeFactory. Specifically, it - Removes JAF detection (JAF_PRESENT constants) - Deprecated useJaf properties, with no direct replacement. - Updated docs to remove JAF references, in favor of MediaTypeFactory. Issue: SPR-14908
This commit updates the test code base to conform to changes in media types returned by the MediaTypeFactory. Issue: SPR-14908
|
What about the use of |
I decided to keep that as is, since the MediaTypeFactory does not have a manual override mechanism, and the Javadoc comment on |
|
In any case, it can't be overridden if the Spring TestContext Framework or parts of Spring MVC Test are creating the mock for the user transparently within a test. So, in such situations, if JAF is not available (e.g., on Java 9), then the tests would no longer work. Or am I missing something? |
|
I wasn't talking about method overriding; I was talking about overriding or customising the mime types returned by Except for replacing the So, in summary: JAF has a customisation mechanism; the new MediaTypeFactory does not. |
|
OK, I now understand where you're coming from. So... I guess we are then going to make JAF a requirement for the testing frameworks. I can live with that; we'll just have to document it. My real concern was that production code and test code would demonstrate different behavior with regard to available mime types out of the box. Do you not foresee any issues with that? |
|
By the way, nice investigative work on finding that use case. 😉 |
This commit changes the `MockServletContext.getMimeType` method to use `MediaTypeFactory` instead of JAF. It also adds a `addMimeType(String, MediaType)` method to customize the mime types returned from said method. Issue: SPR-14908
I do, but to be fair: If anything, I think we should make it easier for users to let |
|
I've processed the PR to avoid further merge conflicts. That said we do need an alternative to the deprecated We should also consider some improvement to |
|
|
|
I've pushed a branch here, the main commit being this one, that introduces a |
For your consideration, @jhoeller and @rstoyanchev, here is my PR for resolving https://jira.spring.io/browse/SPR-14908. I've opted to split the PR in three commits: the first showing the
MediaTypeFactorychanges, the second fixes the main code base to conform to these changes, and the third does the same for the test code base.As per discussion with Juergen, I've dropped all JAF usage in favour of the new
MediaTypeFactory, including that in pre 5.0 code, and deprecate the varioususeJafproperties we had in that code, with no direct replacement.