Created
November 22, 2011 15:14
-
-
Save axelhzf/1385897 to your computer and use it in GitHub Desktop.
CSV Action
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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