留言板
File path in portlet JSF
Hi all,
I am trying to send email with JSF portlet+JAVA but I can't find a real file PATH. My code:
thanks for answers !
I am trying to send email with JSF portlet+JAVA but I can't find a real file PATH. My code:
String filename = "\\downLoadForm-portlet\\docroot\\zip_rar\\" + "fileD.zip"; /// there is my problem + what is correct PATH ?
FileDataSource fds = new FileDataSource(filename);
message.setDataHandler(new DataHandler(fds));
message.setFileName(fds.getName());
thanks for answers !
Toshiro Mifune,修改在8 年前。
RE: File path in portlet JSF (答复)
Regular Member 帖子: 238 加入日期: 14-12-11 最近的帖子
The solution is >> String realPath = FacesContext.getCurrentInstance().getExternalContext().getRealPath("zip_rar/confession.zip");
Juan Gonzalez,修改在8 年前。
Moving to Liferay Faces category
Liferay Legend 帖子: 3089 加入日期: 08-10-28 最近的帖子
Moving to Liferay Faces category