Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml 属性p:此处不允许使用前缀_Xml_Spring_Spring Mvc - Fatal编程技术网

Xml 属性p:此处不允许使用前缀

Xml 属性p:此处不允许使用前缀,xml,spring,spring-mvc,Xml,Spring,Spring Mvc,我已经用SpringMVC在我的dispatcherServlet.xml文件中创建了一个项目 <bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/WEB-INF/views/" p:suffix=".jsp" /> 不允许使

我已经用SpringMVC在我的
dispatcherServlet.xml
文件中创建了一个项目

<bean id="jspViewResolver"
          class="org.springframework.web.servlet.view.InternalResourceViewResolver"
          p:prefix="/WEB-INF/views/"
          p:suffix=".jsp"
            />


不允许使用
p:prefix
p:suffix
。我如何解决这个问题?我使用了SpringVersion
3.2.3.RELEASE

您需要添加p-namespace声明:
xmlns:p=”http://www.springframework.org/schema/p“


参见Spring参考:


xmlns:p=它已经被添加,我发现了这个链接[也无法解决。这是为什么?我遇到了相同的问题。xmlns:p=springframework.org/schema/p已经添加。您如何解决您的问题?您应该解释您的答案如何解决问题,即您需要将spring框架名称空间添加到xml beans定义文件的顶部。特别是您需要的部分是
xmlns:p="http://www.springframework.org/schema/p“
。请注意,没有什么要求您使用p:。它们只是按照约定使用。您可以重写XML以使用:everywhere,只要它们被定义为映射到相同的XML命名空间。(这就是为什么需要定义它们。)
<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"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans.xsd">