如何解决;“未配置JSP支持”;当使用码头和斜坡时

如何解决;“未配置JSP支持”;当使用码头和斜坡时,jsp,gradle,jetty,Jsp,Gradle,Jetty,我正在尝试用gradle+jetty启动新的web应用程序。当我运行gradlejettyrunwar并在浏览器中打开页面时,我得到了 HTTP ERROR 500 Problem accessing /WEB-INF/view/home.jsp. Reason: JSP support not configured Powered by Jetty:// 有什么建议吗 我有父母和孩子的项目。Web的gradle.build文件是: apply plugin: 'war' app

我正在尝试用gradle+jetty启动新的web应用程序。当我运行
gradlejettyrunwar
并在浏览器中打开页面时,我得到了

HTTP ERROR 500

Problem accessing /WEB-INF/view/home.jsp. Reason:

    JSP support not configured

Powered by Jetty://
有什么建议吗

我有父母和孩子的项目。Web的gradle.build文件是:

apply plugin: 'war'
apply plugin: 'jetty'

dependencies {
    compile project(':fbv-services')

    compile project(':fbv-model')

    compile "org.springframework:spring-webmvc:$springVersion"

    compile "org.springframework.security:spring-security-web:$springSecurityVersion",
            "org.springframework.security:spring-security-config:$springSecurityVersion"

    providedCompile 'javax.servlet:servlet-api:2.5'

    runtime 'javax.servlet:jstl:1.1.2'
}

jettyRunWar {
    contextPath = ''
    httpPort = 8078
    stopPort = 9078
    stopKey = 'stop'
}

jettyStop {
    stopPort = 9078
    stopKey = 'stop'
}
和父级gradle.build:

ext {
    springVersion = "4.0.6.RELEASE"
    springSecurityVersion = "3.2.4.RELEASE"
    slf4jVersion = "1.5.8"
}

allprojects {
    apply plugin: 'idea'

    group = 'net.vosta.fbvideo'

    version = '1.0-SNAPSHOT'
}

subprojects {
    apply plugin: 'java'

    repositories {
        mavenLocal()
        mavenCentral()
    }

}
main.jsp文件非常简单:

<!DOCTYPE HTML>
<html>
<head>
    <title>Feedback Video</title>
</head>
<body>
<h1>Hello from ${name}!</h1>
</body>
</html>

反馈视频
来自${name}的您好!
web.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

  <servlet>
    <servlet-name>fbvideo</servlet-name>
    <servlet-class>
        org.springframework.web.servlet.DispatcherServlet
    </servlet-class>
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>/WEB-INF/spring/spring-servlet.xml</param-value>
    </init-param>
  </servlet>

  <servlet-mapping>
    <servlet-name>fbvideo</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>

</web-app>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans    http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
  http://www.springframework.org/schema/mvc    http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
  http://www.springframework.org/schema/context    http://www.springframework.org/schema/context/spring-context-3.2.xsd">

  <context:component-scan base-package="net.vosta.fbvideo" /> 
  <mvc:annotation-driven />

  <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="prefix" value="/WEB-INF/view/"/>
    <property name="suffix" value=".jsp"/>
  </bean>

</beans>

fbvideo
org.springframework.web.servlet.DispatcherServlet
上下文配置位置
/WEB-INF/spring/spring-servlet.xml
fbvideo
/
spring-servlet.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

  <servlet>
    <servlet-name>fbvideo</servlet-name>
    <servlet-class>
        org.springframework.web.servlet.DispatcherServlet
    </servlet-class>
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>/WEB-INF/spring/spring-servlet.xml</param-value>
    </init-param>
  </servlet>

  <servlet-mapping>
    <servlet-name>fbvideo</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>

</web-app>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans    http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
  http://www.springframework.org/schema/mvc    http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
  http://www.springframework.org/schema/context    http://www.springframework.org/schema/context/spring-context-3.2.xsd">

  <context:component-scan base-package="net.vosta.fbvideo" /> 
  <mvc:annotation-driven />

  <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="prefix" value="/WEB-INF/view/"/>
    <property name="suffix" value=".jsp"/>
  </bean>

</beans>


你不需要web.xml吗?@SureshKoya当然,我已经在问题中添加了web.xml和spring-servlet.xml文件