2012-03-26 49 views
1

我想定製Liferay Web Forms portlet來接受一個文件控件,並且我剛剛得到了一切工作,除了UploadPortletRequest處理實際從表單上傳文件!Liferay Developer Studio不解析包com.liferay.portal.upload

我有:

import com.liferay.portal.upload.UploadPortletRequestImpl; 

,並在編譯器輸出:

[javac] 1. ERROR in C:\Program Files\Liferay Developer Studio\liferay-plugins-sdk-6.0-ee-sp2-20110727\portlets\AZ_WebForms-portlet\docroot\WEB-INF\src\com\liferay\autozone\webform\portlet\AZ_WebForm.java (at line 34) 
[javac]  import com.liferay.portal.upload.UploadPortletRequestImpl; 
[javac]   ^^^^^^^^^^^^^^^^^^^^^^^^^ 
[javac] The import com.liferay.portal.upload cannot be resolved 

但是...如果我添加portal-impl.jarPortal Dependency JARs才能夠解決這個類,它贏得't編譯,因爲portal-impl.jar是在WEB-INF/lib! (而且它不喜歡那樣)

我在這裏有點不知所措。我需要做什麼?

回答

0

您不能使用portal-impl.jar中的任何內容,除非您使用ext環境並修改了Liferay。

從你的編譯器輸出,我會說你正在編寫自己的portlet,而不是自定義現有的。我錯了嗎?

你必須處理上傳你的自我。你可以使用Apache commons fileupload,它支持portlet。

普萊斯看到Using FileUpload,特別是Servlets and portlets part

+0

我其實從定製Liferay的核心現有的Web表單的portlet。我將研究Apache Commons的fileupload。謝謝。 – daniel0mullins 2012-03-27 13:28:58