sách gpt4 ăn đã đi

java - Spring 3 applicationContext-security-JDBC.xml 有 bean :bean not bean?

In lại 作者:数据小太阳 更新时间:2023-10-29 02:21:15 25 4
mua khóa gpt4 giày nike

有人可以告诉我在我的 ApplicationContext 中我必须使用 beans:bean 而不是 bean 的什么以及如何修复它。




xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/jdbc
http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.0.xsd">





default-target-url="/index.html" always-use-default-target="true"
authentication-failure-url="/login.html?authfailed=true" />










class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">

















câu trả lời hay nhất

说明。基本上,您在这里处理的是 XML 命名空间。 Spring 配置允许您使用来自不同命名空间的配置元素作为一种扩展基本 đậu 命名空间配置的方式,具有方便的特定于域的配置,如上述案例中的安全配置。

如果您的配置文件集中在这些扩展命名空间之一——再次,让我们以安全性为例——如果您将默认命名空间声明为扩展命名空间而不是标准 đậu 命名空间。就是这样

xmlns="http://www.springframework.org/schema/security"

是——它使 security 成为默认命名空间,这意味着您不必在它前面加上 sec: hoặc bảo vệ: 前缀。

但是当您将 bảo vệ 设置为默认值时,则在使用 đậu 命名空间元素时必须明确。因此 beans: 前缀。

解决方案。如果您希望将 đậu 作为默认命名空间,只需将默认命名空间更改为 đậu:

xmlns="http://www.springframework.org/schema/beans"

替代解决方案。或者,如果您想输入更短的内容,您可以这样做

xmlns:b="http://www.springframework.org/schema/beans"

代替

xmlns:beans="http://www.springframework.org/schema/beans"

这将允许你做类似的事情


关于java - Spring 3 applicationContext-security-JDBC.xml 有 bean :bean not bean?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5607230/

25 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress