1

我正在嘗試使用Play進行網站製作!框架(Java中的v2.2.0 &)將作業保存在供學生瀏覽的存儲庫中。我想讓學生將.doc/.docx文件上傳到服務器,並在上傳時將文件自動轉換爲.html文件。將Play Framework中的文件(特別是.doc/.docx轉換爲.html)

這裏是我的HomeworkSnippet數據類型代碼,以供參考:

@SuppressWarnings("serial") 
@Entity  
public class HomeworkSnippet extends Model { 
public HomeworkSnippet (String filepath) { 
    this.filepath = filepath; 
    this.snippetRender = snippet.render(/*code for html version of file at filepath here*/); 
} 

public static Finder<Long,HomeworkSnippet> find = new Finder<Long,HomeworkSnippet>(
     Long.class, HomeworkSnippet.class 
); 

@Id 
public Long id; 

public String filepath; 

public Html snippetRender; 
} 

現在我想這樣做的方法是使用JODConverter tool,讓你轉換的.docx爲.html明確使用OpenOffice的.org或LibreOffice。但是,如果在播放時JODConverter SEEMS需要一個warfile,我該如何做到這一點!框架不使用warfiles。如果這沒有意義,請原諒我。

回答

0

也可以下載jar文件。如果你到一個下載頁面的項目,比如這個:

http://sourceforge.net/projects/jodconverter/files/JODConverter/2.2.2/

您將有機會下載一個Tomcat ZIP,web應用程序的zip或其他..拉鍊,也就是隻是圖書館的名字:jodconverter-2.2.2.zip。下載一個,並將其作爲播放庫加入。有趣的項目!請享用!