【问题标题】:MY Application is giving org.springframework.beans.factory.BeanCreationException我的应用程序正在提供 org.springframework.beans.factory.BeanCreationException
【发布时间】:2012-03-13 10:39:46
【问题描述】:

我的应用程序出现以下异常

org.springframework.beans.factory.BeanCreationException:在 ServletContext 资源 [/WEB-INF/dispatcher-servlet.xml] 中定义名称为“/userRegistration.htm”的 bean 创建错误:设置属性值时出错;嵌套异常是 org.springframework.beans.NotWritablePropertyException:bean 类 [com.vaannila.web.UserController] 的无效属性“successVeiw”:Bean 属性“successVeiw”不可写或具有无效的 setter 方法。您指的是“successView”吗?

这是我的 dispatcher-servlet.xml 文件

 <?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"
xsi:schemaLocation="http://www.springframework.org/schema/beans                    http://www.springframework.org/schema/beans/spring-beans.xsd">

   <bean id="viewResolver"

   class="org.springframework.web.servlet.view.InternalResourceViewResolver"

    p:prefix="/WEB-INF/JSPs/" p:suffix=".jsp" />

   <bean id="userService" class="com.vaannila.service.UserServiceImpl"/>

   <bean name="/userRegistration.htm" class="com.vaannila.web.UserController"
    p:userService-ref="userService"
    p:formView="userForm"
    p:successVeiw="userSuccess"/>
   </beans>

【问题讨论】:

    标签: java spring-mvc


    【解决方案1】:

    这是一个错字。异常告诉你出了什么问题:

    无效的属性“successVeiw”

    你想要

    p:successView
    

    不是

    p:successVeiw
    

    【讨论】:

      猜你喜欢
      • 2018-12-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-14
      • 2020-04-18
      • 2019-03-07
      • 2013-08-24
      相关资源
      最近更新 更多