Skip to content

Instantly share code, notes, and snippets.

@axelhzf
Created November 22, 2011 15:14
Show Gist options
  • Save axelhzf/1385897 to your computer and use it in GitHub Desktop.
Save axelhzf/1385897 to your computer and use it in GitHub Desktop.
CSV Action
package controllers;
import java.util.List;
import models.Agente;
import play.mvc.Controller;
public class CSV extends Controller {
public static void agentes(){
List<Agente> agentes = Agente.findAll();
StringBuilder sb = new StringBuilder();
for(Agente agente : agentes){
sb.append(agente.username + "," + agente.email + "\n");
}
renderText(sb.toString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment