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
import org.apache.struts.action.*; | |
import org.apache.struts.upload.FormFile; | |
/** | |
* Form bean for Struts File Upload. | |
* | |
*/ | |
public class StrutsUploadForm extends ActionForm | |
{ | |
private FormFile theFile; |
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
import groovyx.net.http.HTTPBuilder | |
import static groovyx.net.http.Method.POST | |
import static groovyx.net.http.ContentType.JSON | |
import java.util.Random | |
String[] inputs=[ | |
'200', | |
'400', | |
'600', | |
'800', |
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
.gist{ | |
margin: 15px 0 !important; | |
} | |
.gist-file{ | |
border: none !important; | |
} | |
.gist-meta{ | |
border: 1px solid #D2d2d2 !important; |
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
@Produces("image/jpeg") | |
@Path("/images") | |
public class ImageRestServiceImpl { | |
@Path("{id}") | |
public StreamingOutput getImage(@PathParam("id") int id) { | |
BufferedImage image = generateImage(id); //generate image using | |
return new StreamingImageOutput(image); | |
} | |
} | |
NewerOlder