Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for MediaType for PDF and XLSX [SPR-13831] #18404

Closed
spring-projects-issues opened this issue Dec 29, 2015 · 1 comment
Closed

Add support for MediaType for PDF and XLSX [SPR-13831] #18404

spring-projects-issues opened this issue Dec 29, 2015 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: task A general task
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Dec 29, 2015

Manuel Jordan opened SPR-13831 and commented

Hello

I must currently work in the following way:

@Override
	public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
		configurer.favorPathExtension(true)  	//default -> true
		          .favorParameter(true)      	//default -> false
		          .ignoreAcceptHeader(false)  	//default -> false
		          .mediaType("html", MediaType.TEXT_HTML)
		          .mediaType("xml", MediaType.APPLICATION_XML)
		          .mediaType("json", MediaType.APPLICATION_JSON)	
			  .mediaType("pdf", MediaType.valueOf("application/pdf"));	
	}

Check the MediaType.valueOf("application/pdf")

and for my @RequestMapping's produces attribute

@RequestMapping(value={PersonaFindAllURLSupport.FINDALL}, produces="application/pdf")

Could be added MediaType.APPLICATION_PDF and MediaType.APPLICATION_PDF_VALUE? Same consideration about XLSX files.

Thank you


Affects: 4.2 GA, 4.2.4

Referenced from: commits 7690f27

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jan 14, 2016

Rossen Stoyanchev commented

I've added this. In general there are way too many media types but it makes sense to have constants at least for the once we have built-in to but it makes sense

@spring-projects-issues spring-projects-issues added in: web Issues in web modules (web, webmvc, webflux, websocket) type: task A general task labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.3 RC1 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: task A general task
Projects
None yet
Development

No branches or pull requests

2 participants