我正在dispatcher-servlet.xml文件中使用spring MVC开发一个netbeans Web服务器,自动生成的标头如下所示。
<?xml version='1.0' encoding='UTF-8' ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">
在 xml 的某些部分我有这个
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:prefix="/WEB-INF/jsp/"
p:suffix=".jsp" />
使用了后缀p,但是当我访问url时http://www.springframework.org/schema/p它给了我一个404
抱歉,我是java新手,我不太了解
如何解决这个问题?
提前致谢
p 模式似乎消失了。您可以返回声明属性,就像在 p 模式之前一样。
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" />
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>