嗨,我得到以下錯誤:NumberFormatException的錯誤
2014-09-26T14:17:40.779-0300|Grave: 'java.lang.NumberFormatException' recebido ao invocar escuta de a��o '#{comentario.cancelarAtendimento}' para o componente 'j_idt140'
2014-09-26T14:17:40.780-0300|Grave: java.lang.NumberFormatException: For input string: ""
我創造了這個格式化:
DateFormat formatter = DateFormat.getDateInstance(DateFormat.MEDIUM, new Locale("pt", "BR"));
,我想以檢索從會話這樣的日期:
if (sessao.getAttribute("dataInicial") != null)
{
dataInicial = (String) sessao.getAttribute("dataInicial");
dataIni = new java.sql.Date(formatter.parse(dataInicial).getTime());
}
然後我通過dataIni這裏
ocorrencias = cadastradorOcorrecia.pesquisarAvancada(usuario.getCodigo(), Integer.parseInt(pesqCodigo), pesquisaCliente, pesquisaStatus, pesquisaDepartamento, pesquisaSolicitante, pesquisaUltimoAtend, pesquisaSistema, dataIni, dataFi, pesquisaCriador,Integer.parseInt(pesquisaProduto),Integer.parseInt(pesquisaModulo));
在這裏,我得到了NumberFormatException異常--->誰能有什麼i'm做錯了的想法?
在此先感謝
,然後將其轉到DAO實例retrive與數據庫中的信息。
什麼是'dataInicial'的價值?空字符串? – gtgaxiola 2014-09-26 17:39:02
在這種情況下爲空 – marco 2014-09-26 17:40:41
如果它爲空格式化程序將給出NullPointerException ..如果它是空的,它將是ParseException ..你得到一個NumberFormatException – gtgaxiola 2014-09-26 17:41:46