JSP support not configured

Jetty内嵌 测试代码时,浏览jsp页面报错:

JSP support not configured

这时查看下后台的consol,会发现有如下日志信息:

NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet

…………

No JSP support.  Check that JSP jars are in lib/jsp and that the JSP option has been specified to start.jar

而我的依赖了明明加了jetty-jsp,如下:

<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-jsp</artifactId>
			<version>9.3.0.M1</version>
		</dependency>

百般查询,始终没找到合适的解决方法。后来又细看了下maven 库里的jetty-jsp版本,发现:

JSP support not configured_第1张图片

原来我添加的依赖不是release版本(费了我大半天时间……)。于是将版本修改如下:

<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-jsp</artifactId>
			<version>9.2.15.v20160210</version>
		</dependency>

至此,测试成功。

另外,至于milestone版本是什么意思,参考该兄弟写的:

Now, the Spring Milestone repo is a standard Maven repo - plugin or otherwise doesn't matter overmuch.

It's policy at Spring to publish milestone releases to the general public for those interested in testing them. Almost all publishing of Java binary artefacts is done on Maven these days. Hence these milestones are published into a Maven repo.

To make clear that these milestones releases are not to be used in production code they are published to a separate repo rather than Maven Central. Basically, don't use milestones unless you know what you are doing. And expect bugs.

链接如下:http://stackoverflow.com/questions/32356053/what-is-a-spring-milestone

你可能感兴趣的:(JSP support not configured)