我想为spring view controller创建一个映射:
这有效:
<b:property name="mappings">
<b:props>
<b:prop key="/index.do">indexSpringController</b:prop>
<b:prop key="/index.htm">indexSpringController</b:prop>
<b:prop key="/index.html">indexSpringController</b:prop>
</b:props>
</b:property>
但这不起作用:
<b:property name="mappings">
<b:props>
<b:prop key="/index.pref">indexSpringController</b:prop>
</b:props>
</b:property>
结尾是* .do * .html * .htm预定义?
答案 0 :(得分:0)
您还需要将'index.pref'设置为您的web.xml:
<servlet-mapping>
<servlet-name>springapp</servlet-name>
<url-pattern>*.pref</url-pattern>
</servlet-mapping>