掲示板
Resource export and filename
9年前 に antonio perez によって更新されました。
Resource export and filename
New Member 投稿: 15 参加年月日: 13/02/07 最新の投稿
Hi,
I have been looking the example jsf2-export-pdf-portlet but I have not seen how to change the file name.
Can someone help me, please?
I have been looking the example jsf2-export-pdf-portlet but I have not seen how to change the file name.
Can someone help me, please?
9年前 に Juan Gonzalez によって更新されました。
RE: Resource export and filename
Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Hi antonio,
you can use Resource#getResponseHeaders method to change the file name:
https://github.com/liferay/liferay-faces/blob/3.2.4-ga5/demos/bridge/jsf2-export-pdf-portlet/src/main/java/com/liferay/faces/demos/resource/CustomerExportResource.java#L159-161
you can use Resource#getResponseHeaders method to change the file name:
https://github.com/liferay/liferay-faces/blob/3.2.4-ga5/demos/bridge/jsf2-export-pdf-portlet/src/main/java/com/liferay/faces/demos/resource/CustomerExportResource.java#L159-161
9年前 に Gaël Paruta によって更新されました。
RE: Resource export and filename
New Member 投稿: 13 参加年月日: 14/05/05 最新の投稿
Hi,
@Override
public Map<String, String> getResponseHeaders() {
Map<String, String> map = new HashMap<String, String>();
map.put("Content-Disposition","attachment;filename="+ YOURFILENAME+"."+YOURFILEEXTENSION);
return map;
}
@Override
public Map<String, String> getResponseHeaders() {
Map<String, String> map = new HashMap<String, String>();
map.put("Content-Disposition","attachment;filename="+ YOURFILENAME+"."+YOURFILEEXTENSION);
return map;
}
9年前 に antonio perez によって更新されました。
RE: Resource export and filename
New Member 投稿: 15 参加年月日: 13/02/07 最新の投稿
It's what I needed. thank you very much.