Grails : Generate text file for GSP -


i working grails 2.3.6 application.

i tried many different things generate pdf, of them failed.

is possible generate text file of contents of gsp file? have button called export , when user clicks on that, text file download there system.

will possible passing url of gsp file?

this quite straightforward. need specify response type (text/plain) in render method controller. can have plain text in gsp file , use tags needed.

def textfile = {     response.setheader('content-disposition', 'attachment;filename="textfile.txt"')      render view: 'textfile', contenttype: 'text/plain' } 

textfile.gsp:

dear ${name}, text file.

as pdf, recommend amazingly grails rendering plugin.


Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

amazon web services - Installing MobileFirst 7.0 server on AWS -

Non Unique Username with ASP.Net Identity 2.0 -