回复评论

myface1.1.5中的默认转换

  今天在做一个数据导出JSF的时候,发现新的myfaces1.1.5的数据默认转换写法有点不一样了。

mllm © 2004-2008, allblue
<f:view>
  <h:form>
    <h:selectOneMenu id="exptype" value="#{exp.type_no}">
      <f:selectItem itemLabel="业务1" itemValue="#{1}"/>
    </h:selectOneMenu>
    <h:commandButton value="导出指定用户"/>
    <h:messages showDetail="true"/>
  </h:form>
</f:view>
Parsed in 0.001 seconds

并且默认对应的数值转换类型为Long,对应上面的itemValue,Java的Bean的写法为

mllm © 2004-2008, allblue
 public void setType_no(Long type_no) {
      //...
  }

  public Long getType_no() {
    return type_no;
  }
Parsed in 0 seconds

回复

此内容将保密,不会被其他人看见。
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
请输入图中的字母(区分大小写)