spingmvc 返回jsp或html配置

<!-- 返回.jsp -->
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix">
            <value>/jsp</value>
        </property>
        <property name="suffix">
            <value>.jsp</value>
        </property>
    </bean>
    
    <!-- 返回html -->
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
        <property name="prefix">
            <value>/jsp</value>
        </property>
        <property name="suffix">
            <value>.html</value>
        </property>
        <property name="contentType" value="text/html;charset=UTF-8"/>
    </bean>

猜你喜欢

转载自blog.csdn.net/u014450465/article/details/84255483