我正在開發託管在谷歌應用程序引擎上的雲應用程序,並在此我想通過servlet點擊按鈕生成excel文件。如何在servlet中爲谷歌應用程序引擎應用程序創建excel文件?
我已經做到了本地機器上,但是當我部署我在App Engine應用中顯示錯誤HTTP錯誤500內部服務器錯誤
我使用JXL的Java API生成excel文件
代碼我用的是這裏
try
{
//i have used following content type but didn't worked.....
//response.setContentType("application/CSV");
//response.setContentType("application/x-ms-excel");
response.setContentType("application/vnd.ms-excel");
WritableWorkbook w = Workbook.createWorkbook(response.getOutputStream());
WritableSheet s = w.createSheet("Demo", 0);
Label label = new Label(0, 2, "A label record");
s.addCell(label);
w.write();
w.close();
}
catch (Exception e)
{
response.getOutputStream().println("Exception :"+e);
}
finally
{
}
jxl api是否支持谷歌應用程序引擎或不? – swan