当前位置: 动力学知识库 > 问答 > 编程问答 >

Spring view controller different mapping

问题描述:

i want to create a mappings for a spring view controller:

this works:

<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>

but this does not work:

<b:property name="mappings">

<b:props>

<b:prop key="/index.pref">indexSpringController</b:prop>

</b:props>

</b:property>

are the endings *.do *.html *.htm predefined?

网友答案:

You also need to set 'index.pref' to your web.xml:

<servlet-mapping>
    <servlet-name>springapp</servlet-name>
    <url-pattern>*.pref</url-pattern>
</servlet-mapping>
分享给朋友:
您可能感兴趣的文章:
随机阅读: