先上錯誤信息
嚴(yán)重: Servlet.service() for servlet [jsp] in context with path [] threw exception [Unable to compile class for JSP:
An error occurred at line: 14 in the generated java file
Only a type can be imported. com.baidu.ueditor.ActionEnter resolves to a package
An error occurred at line: 12 in the jsp file: /ueditor/jsp/controller.jsp
ActionEnter cannot be resolved to a type
9:
10: String rootPath = application.getRealPath( "/" );
11:
12: out.write( new ActionEnter( request, rootPath ).exec() );
13:
14: %>
這是我準(zhǔn)備圖片上傳的時候颜曾,控制臺報的錯。
網(wǎng)上說的什么沒導(dǎo)包的秉剑,我部署的是maven項目泛豪,build Path 查看,發(fā)現(xiàn)是有的侦鹏,也試過clear項目
然而并沒有什么用诡曙。
QQ圖片20170428161735.png
最后弄一半天還是不行,原來我pom.xml那里寫錯了略水,剛開始我是這樣寫的
QQ圖片20170428162249.png
這樣也在build path 也是找得到价卤,但就是一直報錯,
后面我改成下面的就好了
QQ圖片20170428162531.png
解決方案
就是在WEB-INF 下創(chuàng)建一個lib文件夾渊涝,把編輯器下jsp目錄的lib下的ueditor-1.1.2.jar 拷過去就ok了慎璧。
很神奇,至今不知道為什么J簧汀Uū啊!
pom.xml 代碼
<!-- ueditor -->
<dependency>
<groupId>com.baidu</groupId>
<artifactId>ueditor</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${pom.basedir}/src/main/webapp/WEB-INF/lib/ueditor-1.1.2.jar</systemPath>
</dependency>