jsf配置问题 Error performing conversion of value ' of type class java.lang.String to type class
来源:互联网 发布:手机淘宝客户端删评价 编辑:程序博客网 时间:2024/06/07 03:25
managed-bean:UserBean
/**
*
*/
package com.joary.jsf;
/**
* @author Administrator
*
*/
public class UserBean {
private java.lang.String name;
private Friend friend;
public UserBean() {
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Friend getFriend() {
return friend;
}
public void setFriend(Friend friend) {
this.friend = friend;
}
public String add(){
return "success";
}
}
//对应的配置文件
<managed-bean>
<managed-bean-name>userBean</managed-bean-name>
<managed-bean-class>com.joary.jsf.UserBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>name</property-name>
<property-class>java.lang.String</property-class>
<value/>
<property-name>friend</property-name>
<property-class>com.joary.jsf.Friend</property-class>
<null-value/>
</managed-property>
</managed-property>
</managed-bean>
(此为正确的配置文件)
<managed-bean>
<managed-bean-name>userBean</managed-bean-name>
<managed-bean-class>com.joary.jsf.UserBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>name</property-name>
<property-class>java.lang.String</property-class>
<value/>
<property-name>friend</property-name>
<property-class>com.joary.jsf.Friend</property-class>
<value/>
</managed-property>
</managed-bean>
(此为错误的配置文件)
问题应该是:如是类型是JSF不能自己从String为型中转换过来的话,vlaue值就必须得设置成null-value才行。
- jsf配置问题 Error performing conversion of value ' of type class java.lang.String to type class
- Cannot convert 0:0 of type class java.lang.String to class java.lang.Long
- Cannot convert 临时用户 of type class java.lang.String to class java.lang.Long
- 配置Spring Cannot convert value of type [java.lang.String] to required type [javax.sql.DataSource]
- javax.el.ELException: Cannot convert 1 of type class java.lang.String to int
- javax.el.ELException: Cannot convert 2015-12-03 18:50 of type class java.lang.String to class java.u
- 解决:Failed to convert value of type 'java.lang.String' to required type 'java.util.Date';
- Cannot convert 0 of type class java.lang.Integer to class java.lang.Boolean
- Failed to convert property value of type [java.lang.String] to required type [boolean] for property
- Failed to convert value of type 'java.lang.String' to required type 'org.springframework.web.multipa
- springmvc-- Failed to convert property value of type 'java.lang.String' to required type
- Failed to convert property value of type [java.lang.String] to required type [int]
- Failed to convert property value of type 'java.lang.String' to required type 'int' for property
- java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.Has
- java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.Has
- 【已解决】java.lang.IllegalArgumentException: No converter found for return value of type: class java.uti
- 解决java.lang.IllegalArgumentException: No converter found for return value of type: class java.util
- java.lang.IllegalArgumentException: No converter found for return value of type: class java.util
- mysql:Table 'xxxxx' is marked as crashed and should be repaired
- JDBC 连接SQLServer 错误总结
- 离职前部门聚餐
- 10 iOS Libraries to Make Your Life Easier
- 2011年的11个网页设计趋势热点
- jsf配置问题 Error performing conversion of value ' of type class java.lang.String to type class
- POJ 3750 小孩报数问题
- 今天看到的一个评论,就一对联。
- 未来几年上市潮的看法
- 4PM Task2 successful version(20110318)
- 面向对象分析与设计[OOAD]
- 几个逻辑智力题
- code snippets about copy constructor and temporary
- 检查操作系统版本: 必须是redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2 未通过 <<<<