gpt4 book ai didi

java - 找不到任何 标签

转载 作者:行者123 更新时间:2023-12-01 23:04:59 25 4
gpt4 key购买 nike

我想将 webflow 添加到 web。我在 pom.xml 中有 webflow 依赖项,我已经开始添加 beans,但似乎找不到任何标签,正如我在每个教程中看到的那样。我的所有 bean 都在 servlet-context.xml 中,就是这样:

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="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
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
http://www.springframework.org/schema/webflow-config
http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.3.xsd">


<!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure -->

<!-- Enables the Spring MVC @Controller programming model -->
<annotation-driven />
<mvc:annotation-driven />
<!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory -->
<resources mapping="/resources/**" location="/resources/" />

<!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory -->
<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix" value="/WEB-INF/views/" />
<beans:property name="suffix" value=".jsp" />
</beans:bean>
<!-- <beans:bean class="my.package.Controllers.LoginController"></beans:bean>-->
<!-- <beans:bean class="my.package.Controllers.NewUserFormController"></beans:bean>-->
<!-- <beans:bean class="my.package.Controllers.QueEsController"></beans:bean>-->
<beans:bean class="my.package.Services.UsuarioServiceImp"></beans:bean>
<beans:bean class="my.package.Dao.UserDaoImp">
<beans:property name="dataSource" ref="dataSource"></beans:property>
</beans:bean>
<beans:bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<beans:property name="driverClassName" value="com.mysql.jdbc.Driver"></beans:property>
<beans:property name="url" value="jdbc:mysql://localhost:3306/myschema"></beans:property>
<beans:property name="username" value="myusername"></beans:property>
<beans:property name="password" value="mypassword"></beans:property>
</beans:bean>
<beans:bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<beans:property name="dataSource" ref="dataSource"></beans:property>
</beans:bean>

<context:component-scan base-package="my.package" />

<beans:bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">

<beans:property name="mappings">
<beans:value>inicio.do=flowController</beans:value>
</beans:property>
<beans:property name="alwaysUseFullPath" value="true"></beans:property>
</beans:bean>
<beans:bean id="flowcontroller" class="org.springframework.webflow.mvc.servlet.FlowController">
<beans:property name="flowExecutor" ref="flowExecutor"></beans:property>
</beans:bean>

当我尝试添加任何 webflow 标签时,例如:

<webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry"/>

显示错误:

Multiple annotations found at this line:
- The prefix "webflow" for element "webflow:flow-executor" is not
bound.

似乎他找不到任何与 webflow 相关的标签,尽管我在 schemaLocation 中有它。

有什么帮助吗?谢谢。

编辑:我使用 Spring 3.1.1-RELEASE 版本,如 pom.xml 所示:

<org.springframework-version>3.1.1.RELEASE</org.springframework-version>

最佳答案

包含 webflow 命名空间,如下所示:

    <beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:webflow="http://www.springframework.org/schema/webflow-config"
xsi:schemaLocation="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
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
http://www.springframework.org/schema/webflow-config
http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.3.xsd">

关于java - 找不到任何 <webflow> 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22919443/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com