欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Ueditor的controller.jsp文件总是报错说包没有import问题解决

程序员文章站 2022-07-05 23:13:57
an error occurred at line: 6 in the generated java file only a type can be imported. com.baidu.uedi...

an error occurred at line: 6 in the generated java file

only a type can be imported. com.baidu.ueditor.actionenter resolves to a package

an error occurred at line: 11 in the file: /jsp/controller.jsp

actionenter cannot be resolved to a type

8:

9: string rootpath = application.getrealpath( "/" );

10:

11: out.write( new actionenter( request, rootpath ).exec() );

12:

13: %>

stacktrace:

at org.apache.jer.compiler.defaulterrorhandler.javacerror(defaulterrorhandler.java:92)

at org.apache.jasper.compiler.errordispatcher.javacerror(errordispatcher.java:330)

at org.apache.jasper.compiler.jdtcompiler.generateclass(jdtcompiler.java:451)

at org.apache.jasper.compiler.compiler.compile(compiler.java:356)

at org.apache.jasper.compiler.compiler.compile(compiler.java:334)

at org.apache.jasper.compiler.compiler.compile(compiler.java:321)

at org.apache.jasper.jspcompilationcontext.compile(jspcompilationcontext.java:592)

at org.apache.jasper.servlet.jspservletwrapper.service(jspservletwrapper.java:328)

at org.apache.jasper.servlet.jspservlet.servicejspfile(jspservlet.java:313)

at org.apache.jasper.servlet.jspservlet.service(jspservlet.java:260)

at javax.servlet.http.httpservlet.service(httpservlet.java:723)

at org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:290)

at org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)

at org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:233)

at org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:191)

at org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:127)

at org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:103)

at org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:109)

at org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:293)

at org.apache.coyote.http11.http11aprprocessor.process(http11aprprocessor.java:879)

at org.apache.coyote.http11.http11aprprotocol$http11connectionhandler.process(http11aprprotocol.java:617)

at org.apache.tomcat.util.net.aprendpoint$worker.run(aprendpoint.java:1774)

at java.lang.thread.run(thread.java:619)

问题描述:我的项目是用maven构建的,我在myeclipse我添加了百度的相关lib但是用myeclipse运行的时候总是提示报上面的错误,(但是我的项目又是可以直接复制到其他非maven项目中去直接运行的)

1、于是我就怀疑,因为项目是用maven构建的,所有在发布到web服务器之后可能没有把jar添加到运行时服务器上,只有编译时才有该jar。

 然后我就在pom文件里面添加如下

   <dependency>

<groupid>org.webjars.bower</groupid>

<artifactid>ueditor</artifactid>

<version>1.4.3</version>

</dependency>

2、添加之后重新发布运行项目,(这时我删除了lib文件夹下的jar,因为怕会有冲突),运行之后还是包一样错误

3、这时我回到controller.jsp去查看发现 import="com.baidu.ueditor.actionenter"都已经报错了 编译都不通过

4、于是我打开重新把ueditor相应的jar添加到了webinfo目录下的lib文件夹,并且add build path

5、这下重新编译 发布项目 到myeclipse的时候发现,没有再报错了。