日期:2014-05-18  浏览次数:20728 次

jsf的validator问题,在线等
开发环境为myeclipes5+tomcat5,最简单的jsf开发。用validator,不知道为什么message就是显示不到页面上,请大虾帮忙看看代码。
页面代码:

<%@   page   contentType= "text/html "   language= "java "   pageEncoding= "gb2312 "%>
<%@   taglib   prefix= "f "   uri= "http://java.sun.com/jsf/core "%>
<%@   taglib   prefix= "h "   uri= "http://java.sun.com/jsf/html "%>
<%@   taglib   prefix= "ig "   uri= "http://www.infragistics.com/faces/netadvantage "%>
<html>
<head>
<title> Infragistics   NetAdvantage   For   Java   Server   Faces   -   Demo </title>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 ">
<meta   name= "description "
        content= "Infragistics   NetAdvantage   for   Java   Server   Faces   -   Demo ">
<link   href= "../../resources/default.css "   rel= "stylesheet "
        type= "text/css ">
       
</head>
<body   class= "rightPanel ">
<f:view>
        <h:form>
        <h:messages   id= "userMessages "   showDetail= "true "   layout= "table "/>
                <h:panelGroup   styleClass= "main ">  
                        <!--   TITLE   -->    
                        <h:panelGroup   styleClass= "section ">    
                        <h:outputText   styleClass= "title "   value= "请输入查询条件:(输入日期格式为yyyy-mm-dd) "   />
                                  <h:panelGrid   columns= "3 ">  
<h:outputLabel   for= "queryTime_1 "   rendered= "true "   value= "起始时间 "> </h:outputLabel>  
<h:inputText   id= "queryTime_1 "   required= "false "   rendered= "true "   value= "#{dcmlogBean.queryTime_1} ">  
<f:validator   validatorId= "abs.obs.controller.log.date "/>
</h:inputText>
<h:message  
  style= "color:   red;   text-decoration:   overline "  
  id= "queryTime_1Error "  
  for= "queryTime_1 "/>

<h:outputLabel   for= "queryTime_2 "   rendered= "true "   value= "截止时间 "> </h:outputLabel>  
<h:inputText   id= "queryTime_2 "   required= "false "   rendered= "true "   value= "#{dcmlogBean.queryTime_2} ">
<f:validator   validatorId= "abs.obs.controller.log.date "/>
</h:inputText>  
<h:message  
&n