0

サーブレット-spring.xml

<mvc:annotation-driven />
<mvc:resources mapping="/mgis/**" location="/mgis/" />
<context:component-scan base-package="com.app.controller" />

web.xml:

<servlet-mapping>
    <servlet-name>mvc-dispatcher</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>

今、アプリケーションを起動できません。

エラー:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Invocation of init method
 failed; nested exception is org.springframework.http.InvalidMediaTypeException: Invalid media type "charset=utf-8": does not contain '/'

を削除する<mvc:annotation-driven />と、アプリケーションを起動できますが、静的リソースにしかアクセスできません。すべてのコントローラーが機能しません。

と の両方を削除する<mvc:annotation-driven /><mvc:resources mapping="/mgis/**" location="/mgis/" />、アプリケーションが起動し、静的リソースにアクセスできなくなりますが、コントローラーは機能しました。

4

0 に答える 0