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 -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -