简体   繁体   中英

java writing to a text file using FreeMarker Templates

Need to write data to a text file using Free Marker API, but when the line encounters 255 characters, the remaining characters should be printed to the next line .

Is this supported by Free Marker?

Since you can pass whatever java.io.Writer to Template.process (or to Environment.process ), you can pass one that writes to a file and inserts a CR when the line has reached 255 character. You will have to implement that Writer of course.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM