servlet映射ViewRendererServlet
指的是未定义web.xml的servlet
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="3.0" 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_3_0.xsd">
<display-name>NWRedirectPortlet</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/context/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>ViewRendererServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.ViewRendererServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ViewRendererServlet</servlet-name>
<url-pattern>/WEB-INF/servlet/view</url-pattern>
</servlet-mapping>
答案 0 :(得分:0)
它抱怨,因为你在web.xml
中没有其中一个:
<servlet>
<servlet-name>ViewRendererServlet</servlet-name>
<servlet-class>com.example.MyClass</servlet-class>
...
</servlet>
<强>更新强>
<servlet>
和<servlet-mapping>
是兄弟姐妹:
<servlet>
<servlet-name>ViewRendererServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.ViewRendererServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ViewRendererServlet</servlet-name>
<url-pattern>/WEB-INF/servlet/view</url-pattern>
</servlet-mapping>
答案 1 :(得分:0)
我只是修复了相同的错误。这不是语法错误,更多的是日食带来的问题。
只需打开servlet类 (在您的情况下:org.springframework.web.servlet.ViewRendererServlet) 一次,错误神奇地消失了。