当前位置: 首页 > 知识库问答 >
问题:

但找不到元素'mvc:bean'的声明

姚向晨
2023-03-14

我知道很多人都问过这个问题。我正在张贴,因为我尝试了所有的选项,但仍然得到错误。

<?xml version="1.0" encoding="UTF-8"?>
<mvc:annotation-driven></mvc:annotation-driven>
<context:component-scan base-package="com.cts"></context:component-scan>
<mvc:bean
    class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="prefix" value="/WEB-INF/jsp" />
    <property name="suffix" value=".jsp" />
</mvc:bean>
<mvc:bean id="messageSource"
    class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
</mvc:bean>
<bean id="validator"
    class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"></bean>
<mvc:interceptors>
    <bean class="org.springframework.web.,servlet.i18n.LocaleChangeInterceptor">
        <property name="paramName" value="locale"></property>
    </bean>
</mvc:interceptors>

我正在使用Spring4.01释放罐

共有1个答案

单品
2023-03-14

看起来缺少架构。

如下所示更新XML标头。

<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="
        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
 类似资料:
  • 问题内容: 我有弹簧罐,并试图 从此处给出的教程中实现程序。xml配置文件为: 主要: 我不知道这些豆怎么了。到目前为止,关于其他问题的任何建议都无济于事。有什么帮助吗? 问题答案: 假设您使用的是Spring 3.1,请尝试以下操作: 在最后一行用您使用的 主要 Spring版本替换。含义:即使有Spring版本,也没有XSD 。

  • 我有这个问题 XML格式的文档 我的XSD 我有个神经衰弱的问题。有什么想法吗? 问候

  • 在spring中,每当我在dispatcher-servlet.xml中编写时,我都会得到这样的错误:-

  • 我从GitHub获取了一个android项目,并将其克隆到了我的android Studio中。当我试图运行ActivityMain时。xml文件为了检查项目是否正常工作,我遇到了这个错误“找不到元素'RelativeLayout'的声明”。我不知道怎么解决这个问题。如果任何人有任何其他方式运行该项目,请建议太多。 github文件的链接如下所示 https://github.com/PedroC

  • 我对camunda和DMN一无所知。我试图在spring启动运行DMN示例。这里是我尝试在我的机器上运行的例子的链接。 这里是我的pom依赖项, 当我运行它时,它显示遵循stacktrace null 我没有得到的一件事是,在资源中,他们在xml文件中有决策模式,而在那里,他们有用于xsd的url,这是不起作用的。 经过一些;)的研究,我找到了这个链接,其中给出了xsd url,我试过了,但名称空

  • 我对XML非常陌生,我面临验证问题,如果我的XML和XSD文件结构良好,我也希望得到一些反馈。 在根据XSD验证XML时,我经常遇到错误- 我正在windows上使用程序XML复制编辑器。我还针对XSD尝试了一个在线验证器XML,但出现了这个错误。https://www.freeformatter.com/xml-validator-xsd.html I get error Src resolve