我在设计界面时遇到的问题如下:
为了结合拖放功能,我正在使用 SWT,并且所有 SWT 拖放类都在包中定义
org.eclipse.swt.dnd
。现在我的问题是,在开发独立应用程序时,我已经包含了名为的外部 jar
swt-4.2.1-win32-win32-x86
,它工作正常。但是,在开发 Java EE 应用程序时,如果我
org.eclipse.swt.dnd
在 jsp 页面中
包含该包,<%@page language="java" import="org.eclipse.swt.SWT"%>
则会显示以下错误:
HTTP Status 500 - Unable to compile class for JSP:
--------------------------------------------------------------------------------
type Exception report
message Unable to compile class for JSP:
description The server encountered an internal error that prevented it
from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: [16] in the generated java file:
[C:\javaPrograms\.metadata\.plugins\org.eclipse.wst.server.core\tmp3\work\Catalina\localhost\wanem\org\apache\jsp\wanem_jsp.java]
只能导入一个类型。org.eclipse.swt.SWT 解析为一个包
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:331)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:468)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
note The full stack trace of the root cause is available in the Apache
Tomcat/7.0.37 logs.