当前位置: 首页 > 工具软件 > Apache Tiles > 使用案例 >

java tiles类似_java – Apache Tiles 3和Tomcat 8

张嘉佑
2023-12-01

当我使用Tomcat 8时,我收到以下错误:

Caused by: java.io.IOException: ServletException including path '/WEB-INF/jsp/tiles-base.jsp'.

at org.apache.tiles.request.servlet.ServletUtil.wrapServletException(ServletUtil.java:61)

at org.apache.tiles.request.servlet.ServletRequest.doInclude(ServletRequest.java:245)

at org.apache.tiles.request.AbstractClientRequest.dispatch(AbstractClientRequest.java:54)

at org.apache.tiles.request.render.DispatchRenderer.render(DispatchRenderer.java:47)

at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:259)

at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:397)

... 37 more

Caused by: java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.jsp.tiles_002dbase_jsp

at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:131)

at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:62)

at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:129)

at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:171)

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:368)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:721)

at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:584)

at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:523)

at org.apache.tiles.request.servlet.ServletRequest.doInclude(ServletRequest.java:243)

... 41 more

希望摆脱这个错误,我从Tiles 2.2.2升级到Tiles 3.0.5.

但是仍然会遇到与Tomcat 8相同的错误.

使用Tomcat 7它可以工作.

我使用Spring版本3.2.9.RELEASE.

我认为它必须是Servlet API的一部分……?

知道该怎么办?

这是tiles-base.jsp:

gt;

Meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

以及Gradle构建文件的相关部分:

apply plugin: 'cargo'

configurations {

unzipTomcat

}

def cargoHome = "$buildDir/install/tomcat-home"

cargo {

containerId = 'tomcat7x'

port = 27386

local {

homeDir = file("$buildDir/install/apache-tomcat-8.0.20")

configHomeDir = file(cargoHome)

jvmArgs = "-Duser.language=en"

outputFile = file('build/tomcat_output.log')

logLevel = 'low'

rmiPort = 28511

timeout = 60000

containerProperties {

property 'cargo.tomcat.ajp.port',28411

}

}

deployable {

file = files(project(':myapp:myapp-web').war).iterator().next()

context = '/myapp'

}

}

task configureUnzipTomcat << {

unzipTomcat.inputs.file(configurations.unzipTomcat.singleFile)

unzipTomcat.outputs.dir("$buildDir/install/apache-tomcat-8.0.20")

}

task unzipTomcat(dependsOn: configureUnzipTomcat) << {

copy {

from zipTree(configurations.unzipTomcat.singleFile)

into "$buildDir/install"

}

}

dependencies {

unzipTomcat "org.apache.tomcat:tomcat:8.0.20@zip"

cargo ["org.codehaus.cargo:cargo-core-uberjar:1.4.0","org.codehaus.cargo:cargo-ant:1.4.0"]

}

 类似资料: