我在我的构建块中使用 Spring MVC。
当我java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
签入黑板日志并且 UI 显示以下错误消息时出现错误 -
The specified resource was not found, or you do not have permission to access it.
我的 web.xml 配置是 -
<servlet>
<servlet-name>main</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>main</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</spring>
我的视图解析器配置是 -
<bean>
<bean id="primaryViewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/" />
<property name="suffix" value=".jsp" />
</bean>
我在 web.xml 中的权限配置是 -
<permission type="java.lang.reflect.ReflectPermission" name="suppressAccessChecks" />
<permission type="java.lang.RuntimePermission" name="accessDeclaredMembers" />
<permission type="java.lang.RuntimePermission" name="createClassLoader" />
<permission type="java.lang.RuntimePermission" name="setContextClassLoader" />
<permission type="java.io.FilePermission" name="${java.home}/lib/*" actions="read" />