Mauricio_de_Mello 9 de ago. de 2010
Da uma olhada nesta taglib, tem vários exemplos.
http://displaytag.sourceforge.net/1.2/
juniorsatanas 9 de ago. de 2010
Mauricio, o negocio não é esse !
O negocio e o Struts que tem que configurar 500 xml e 350 mais não sei o que !
um parto cortado a faca o unbingu !
juniorsatanas 9 de ago. de 2010
& lt ;! -- ======================== = Paginação ================================ = --& gt ;
& lt ; action path = "/principal" name = "inicialForm" parameter = "operacao" type = "br.ufc.action.displaytag.PaginaInicial" & gt ;
& lt ; forward name = "paginaInicial" path = "/WEB-INF/pages/home.jsp" & gt ; & lt ; / forward & gt ;
& lt ; / action & gt ;
& lt ;! -- ======================== = Paginação fim ================================ = --& gt ;
para configurar o struts.config.xml
aeciovc 9 de ago. de 2010
é tão ruim assim??
cara… pra fazer uma paginação simples use o DisplayTag.
juniorsatanas 9 de ago. de 2010
Para quem ta acostumado com jsf rickfaces… STRUTS == ASSEMBLE !
<action path="/principal" name="inicialForm" parameter="operacao" type="br.ufc.action.PaginaInicial">
<forward name="paginaInicial" path="/WEB-INF/pages/home.jsp"></forward>
duvida é esta, se tenho que por algo aqui no xml !
Não to conseguindo configura o bixo !
juniorsatanas 9 de ago. de 2010
09 / 08 / 2010 10 : 09 : 33 or g . apache . catalina . core . ApplicationDispatcher invoke
SEVERE : Servlet . service () for servlet jsp threw exception
javax . servlet . jsp . JspException : ServletException in ' / WEB - INF / tiles / template . jsp ' : javax . servlet . jsp . JspException : ServletException in ' / principal . do ? operacao = paginaInicial ' : The abs olute uri : http : // displaytag . sf . net cannot be resolved in either web . xml or the jar files deployed with this application
at or g . apache . struts . taglib . tiles . InsertTag$InsertHandler . doEndTag ( InsertTag . java : 923 )
at or g . apache . struts . taglib . tiles . InsertTag . doEndTag ( InsertTag . java : 462 )
at or g . apache . jsp . WEB_002dINF . index_jsp . _jspx_meth_tiles_005finsert_005f0 ( index_jsp . java : 149 )
at or g . apache . jsp . WEB_002dINF . index_jsp . _jspService ( index_jsp . java : 78 )
at or g . apache . jasper . run time . HttpJspBase . service ( HttpJspBase . java : 70 )
at javax . servlet . http . HttpServlet . service ( HttpServlet . java : 717 )
at or g . apache . jasper . servlet . JspServletWrapper . service ( JspServletWrapper . java : 377 )
at or g . apache . jasper . servlet . JspServlet . serviceJspFile ( JspServlet . java : 313 )
at or g . apache . jasper . servlet . JspServlet . service ( JspServlet . java : 260 )
at javax . servlet . http . HttpServlet . service ( HttpServlet . java : 717 )
at or g . apache . catalina . core . ApplicationFilterChain . int ernalDoFilter ( ApplicationFilterChain . java : 290 )
at or g . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 206 )
at or g . apache . catalina . core . ApplicationDispatcher . invoke ( ApplicationDispatcher . java : 646 )
at or g . apache . catalina . core . ApplicationDispatcher . processRequest ( ApplicationDispatcher . java : 436 )
at or g . apache . catalina . core . ApplicationDispatcher . doForward ( ApplicationDispatcher . java : 374 )
at or g . apache . catalina . core . ApplicationDispatcher . for ward ( ApplicationDispatcher . java : 302 )
at or g . apache . struts . action . RequestProcessor . doForward ( RequestProcessor . java : 1085 )
at or g . apache . struts . tiles . TilesRequestProcessor . doForward ( TilesRequestProcessor . java : 263 )
at or g . apache . struts . action . RequestProcessor . processForwardConfig ( RequestProcessor . java : 398 )
at or g . apache . struts . tiles . TilesRequestProcessor . processForwardConfig ( TilesRequestProcessor . java : 318 )
at or g . apache . struts . action . RequestProcessor . process ( RequestProcessor . java : 241 )
at or g . apache . struts . action . ActionServlet . process ( ActionServlet . java : 1196 )
at or g . apache . struts . action . ActionServlet . doPost ( ActionServlet . java : 432 )
at javax . servlet . http . HttpServlet . service ( HttpServlet . java : 637 )
at javax . servlet . http . HttpServlet . service ( HttpServlet . java : 717 )
at or g . apache . catalina . core . ApplicationFilterChain . int ernalDoFilter ( ApplicationFilterChain . java : 290 )
at or g . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 206 )
at br . ufc . filters . Val idaLoginFilter . doFilter ( Val idaLoginFilter . java : 59 )
at or g . apache . catalina . core . ApplicationFilterChain . int ernalDoFilter ( ApplicationFilterChain . java : 235 )
at or g . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 206 )
at or g . apache . catalina . core . StandardWrapperValve . invoke ( StandardWrapperValve . java : 233 )
at or g . apache . catalina . core . StandardContextValve . invoke ( StandardContextValve . java : 191 )
at or g . apache . catalina . core . StandardHostValve . invoke ( StandardHostValve . java : 127 )
at or g . apache . catalina . val ves . ErrorReportValve . invoke ( ErrorReportValve . java : 102 )
at or g . apache . catalina . core . StandardEngineValve . invoke ( StandardEngineValve . java : 109 )
at or g . apache . catalina . connector . CoyoteAdapter . service ( CoyoteAdapter . java : 298 )
at or g . apache . coyote . http11 . Http11Processor . process ( Http11Processor . java : 852 )
at or g . apache . coyote . http11 . Http11Protocol$Http11ConnectionHandler . process ( Http11Protocol . java : 588 )
at or g . apache . to mcat . util . net . JIoEndpoint$Worker . run ( JIoEndpoint . java : 489 )
at java . lang . Thread . run ( Thread . java : 636 )
09 / 08 / 2010 10 : 09 : 33 or g . apache . catalina . core . StandardWrapperValve invoke
SEVERE : Servlet . service () for servlet action threw exception
javax . servlet . jsp . JspException : ServletException in ' / WEB - INF / tiles / template . jsp ' : javax . servlet . jsp . JspException : ServletException in ' / principal . do ? operacao = paginaInicial ' : The abs olute uri : http : // displaytag . sf . net cannot be resolved in either web . xml or the jar files deployed with this application
at or g . apache . struts . taglib . tiles . InsertTag$InsertHandler . doEndTag ( InsertTag . java : 923 )
at or g . apache . struts . taglib . tiles . InsertTag . doEndTag ( InsertTag . java : 462 )
at or g . apache . jsp . WEB_002dINF . index_jsp . _jspx_meth_tiles_005finsert_005f0 ( index_jsp . java : 149 )
at or g . apache . jsp . WEB_002dINF . index_jsp . _jspService ( index_jsp . java : 78 )
at or g . apache . jasper . run time . HttpJspBase . service ( HttpJspBase . java : 70 )
at javax . servlet . http . HttpServlet . service ( HttpServlet . java : 717 )
at or g . apache . jasper . servlet . JspServletWrapper . service ( JspServletWrapper . java : 377 )
at or g . apache . jasper . servlet . JspServlet . serviceJspFile ( JspServlet . java : 313 )
at or g . apache . jasper . servlet . JspServlet . service ( JspServlet . java : 260 )
at javax . servlet . http . HttpServlet . service ( HttpServlet . java : 717 )
at or g . apache . catalina . core . ApplicationFilterChain . int ernalDoFilter ( ApplicationFilterChain . java : 290 )
at or g . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 206 )
at or g . apache . catalina . core . ApplicationDispatcher . invoke ( ApplicationDispatcher . java : 646 )
at or g . apache . catalina . core . ApplicationDispatcher . processRequest ( ApplicationDispatcher . java : 436 )
at or g . apache . catalina . core . ApplicationDispatcher . doForward ( ApplicationDispatcher . java : 374 )
at or g . apache . catalina . core . ApplicationDispatcher . for ward ( ApplicationDispatcher . java : 302 )
at or g . apache . struts . action . RequestProcessor . doForward ( RequestProcessor . java : 1085 )
at or g . apache . struts . tiles . TilesRequestProcessor . doForward ( TilesRequestProcessor . java : 263 )
at or g . apache . struts . action . RequestProcessor . processForwardConfig ( RequestProcessor . java : 398 )
at or g . apache . struts . tiles . TilesRequestProcessor . processForwardConfig ( TilesRequestProcessor . java : 318 )
at or g . apache . struts . action . RequestProcessor . process ( RequestProcessor . java : 241 )
at or g . apache . struts . action . ActionServlet . process ( ActionServlet . java : 1196 )
at or g . apache . struts . action . ActionServlet . doPost ( ActionServlet . java : 432 )
at javax . servlet . http . HttpServlet . service ( HttpServlet . java : 637 )
at javax . servlet . http . HttpServlet . service ( HttpServlet . java : 717 )
at or g . apache . catalina . core . ApplicationFilterChain . int ernalDoFilter ( ApplicationFilterChain . java : 290 )
at or g . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 206 )
at br . ufc . filters . Val idaLoginFilter . doFilter ( Val idaLoginFilter . java : 59 )
at or g . apache . catalina . core . ApplicationFilterChain . int ernalDoFilter ( ApplicationFilterChain . java : 235 )
at or g . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationFilterChain . java : 206 )
at or g . apache . catalina . core . StandardWrapperValve . invoke ( StandardWrapperValve . java : 233 )
at or g . apache . catalina . core . StandardContextValve . invoke ( StandardContextValve . java : 191 )
at or g . apache . catalina . core . StandardHostValve . invoke ( StandardHostValve . java : 127 )
at or g . apache . catalina . val ves . ErrorReportValve . invoke ( ErrorReportValve . java : 102 )
at or g . apache . catalina . core . StandardEngineValve . invoke ( StandardEngineValve . java : 109 )
at or g . apache . catalina . connector . CoyoteAdapter . service ( CoyoteAdapter . java : 298 )
at or g . apache . coyote . http11 . Http11Processor . process ( Http11Processor . java : 852 )
at or g . apache . coyote . http11 . Http11Protocol$Http11ConnectionHandler . process ( Http11Protocol . java : 588 )
at or g . apache . to mcat . util . net . JIoEndpoint$Worker . run ( JIoEndpoint . java : 489 )
at java . lang . Thread . run ( Thread . java : 636 )
to pegando este erro !::
maior_abandonado 9 de ago. de 2010
repare que no seu código ele está usando JSTL + EL para criar a tabela, e não o struts.
para paginar esse treco você tem duas opções:
a mais facil é aproveitar a mesma lista que ja está sendo pega via EL ai e usar o displaytag (sim, refazer a tabela com o displaytag… ele facilita você lidar com uma lista de VOs como parece que o cara está fazendo).
a mais dificil seria você criar os links da pagina que o cara quer (próxima, ultima, etc) na mão, passar esse parâmetro para a sua action e la de acordo com a página você filtrar no banco de dados quais registros você quer (usando o rownum do oracle, o limit do mysql, etc)
Hebert_Coelho 9 de ago. de 2010
Cara, na sua jsp da ação “/principal.do?operacao=paginaInicial ” ela ta apontando para a uri “http://displaytag.sf.net ” veja lah onde vc declara suas tags. Vc está apontando para um caminho que não está mapeado na sua aplicação.
juniorsatanas 9 de ago. de 2010
O sistema ta dessa maneira, ele gera uma lista de 9999999999999 registro na cara do sistema de porrada, não sei por que esse anormal fez assim sem paginar !
& lt ;? xml version = & quot ; 1.0 & quot ; encoding = & quot ; ISO - 8859 - 1 & quot ;? & gt ;
& lt ;! DOCTYPE struts - config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
"http://struts.apache.org/dtds/struts-config_1_2.dtd" & gt ;
& lt ; struts - config & gt ;
& lt ; data - sources /& gt ;
& lt ; form - beans & gt ;
& lt ; form - bean name = "logonForm" type = "br.ufc.form.LogonForm" /& gt ;
& lt ; form - bean name = "notaFiscalForm" type = "br.ufc.form.NotaFiscalForm" /& gt ;
& lt ; form - bean name = "itensNotaFiscalForm" type = "br.ufc.form.ItensNotaFiscalForm" /& gt ;
& lt ; form - bean name = "parcelaForm" type = "br.ufc.form.ParcelaForm" /& gt ;
& lt ; form - bean name = "formasPagamentoForm" type = "br.ufc.form.FormasPagamentoForm" /& gt ;
& lt ; form - bean name = "caixaEntradaSaidaForm" type = "br.ufc.form.CaixaEntradaSaidaForm" /& gt ;
& lt ; form - bean name = "caixaForm" type = "br.ufc.form.CaixaForm" /& gt ;
& lt ; form - bean name = "caixaContasReceberForm" type = "br.ufc.form.ContasReceberForm" /& gt ;
& lt ; form - bean name = "caixaContasPagarForm" type = "br.ufc.form.ContasPagarForm" /& gt ;
& lt ; form - bean name = "relatorioForm" type = "br.ufc.form.RelatorioForm" /& gt ;
& lt ; form - bean name = "inicialForm" type = "br.ufc.form.InicialForm" /& gt ;
& lt ; form - bean name = "pedidoDespesaForm" type = "br.ufc.form.PedidoDespesaForm" /& gt ;
& lt ; form - bean name = "itensPedidoDespesaForm" type = "br.ufc.form.ItensPedidoDespesaForm" /& gt ;
& lt ; form - bean name = "acompanhamentoPDForm" type = "br.ufc.form.AcompanhamentoPDForm" /& gt ;
& lt ; / form - beans & gt ;
& lt ; global - exceptions /& gt ;
& lt ; global - forwards & gt ;
& lt ; forward name = "index" path = "/WEB-INF/index.jsp" /& gt ;
& lt ; / global - forwards & gt ;
& lt ; action - mappings & gt ;
& lt ; action path = "/logon" type = "br.ufc.action.LogonAction" parameter = "operacao" name = "logonForm" & gt ;
& lt ; forward name = "sair" path = "/logon.do?operacao=sair" & gt ; & lt ; / forward & gt ;
& lt ; / action & gt ;
& lt ; action path = "/principal" name = "inicialForm" parameter = "operacao" type = "br.ufc.action.PaginaInicial" & gt ;
& lt ; forward name = "paginaInicial" path = "/WEB-INF/pages/home.jsp" & gt ; & lt ; / forward & gt ;
& lt ; / action & gt ;
& lt ; action name = "notaFiscalForm" parameter = "operacao" path = "/notaFiscal" type = "br.ufc.action.NotaFiscalAction" & gt ;
& lt ; forward name = "itensNotaFiscal" path = "/itensNotaFiscal.do?operacao=prepareSave" /& gt ;
& lt ; / action & gt ;
& lt ; action name = "itensNotaFiscalForm" parameter = "operacao" path = "/itensNotaFiscal" type = "br.ufc.action.ItensNotaFiscalAction" & gt ;
& lt ; forward name = "parcelaNotaFiscal" path = "/parcela.do?operacao=prepareSave" /& gt ;
& lt ; forward name = "listNotaFiscal" path = "/notaFiscal.do?operacao=listAll" /& gt ;
& lt ; / action & gt ;
& lt ; action name = "parcelaForm" parameter = "operacao" path = "/parcela" type = "br.ufc.action.ParcelaAction" & gt ;
& lt ; forward name = "listNotaFiscal" path = "/notaFiscal.do?operacao=listAll" & gt ;
& lt ; / forward & gt ;
& lt ; / action & gt ;
& lt ; action name = "formasPagamentoForm" parameter = "operacao" path = "/formasPagamento" type = "br.ufc.action.FormasPagamentoAction" & gt ;
& lt ; forward name = "prepareUpdate" path = "/WEB-INF/pages/formasPagamento/formasPagamentoPrepareUpdate.jsp" /& gt ;
& lt ; forward name = "list" path = "/WEB-INF/pages/formasPagamento/formasPagamento.jsp" /& gt ;
& lt ; / action & gt ;
& lt ; action name = "caixaEntradaSaidaForm" parameter = "operacao" path = "/caixaEntradaSaida" type = "br.ufc.action.CaixaEntradaSaidaAction" & gt ;
& lt ; forward name = "prepareSave" path = "/WEB-INF/pages/caixaEntradaSaida/formEntradaSaida.jsp" /& gt ;
& lt ; / action & gt ;
& lt ; action name = "caixaForm" parameter = "operacao" path = "/caixa" type = "br.ufc.action.CaixaAction" & gt ;
& lt ; / action & gt ;
& lt ; action name = "caixaContasReceberForm" parameter = "operacao" path = "/caixaContasReceber" type = "br.ufc.action.ContasReceberAction" & gt ;
& lt ; forward name = "caixaContasReceber" path = "/WEB-INF/pages/caixaContasReceber/caixaContasReceber.jsp" /& gt ;
& lt ; / action & gt ;
& lt ; action name = "caixaContasPagarForm" parameter = "operacao" path = "/caixaContasPagar" type = "br.ufc.action.ContasPagarAction" & gt ;
& lt ; forward name = "caixaContasPagar" path = "/WEB-INF/pages/caixaContasPagar/caixaContasPagar.jsp" /& gt ;
& lt ; / action & gt ;
& lt ; action path = "/relatorio" name = "relatorioForm" type = "br.ufc.action.RelatorioAction" parameter = "operacao" & gt ;
& lt ; forward name = "relatorio" path = "/WEB-INF/pages/relatorio/relatorio.jsp" & gt ; & lt ; / forward & gt ;
& lt ; / action & gt ;
& lt ; action path = "/pedidoDespesa" name = "pedidoDespesaForm" type = "br.ufc.action.PedidoDespesaAction" parameter = "operacao" & gt ;
& lt ; forward name = "itensPedidoDespesa" path = "/itensPedidoDespesa.do?operacao=prepareSave" & gt ; & lt ; / forward & gt ;
& lt ; forward name = "acompanhamentoPD" path = "/itensPedidoDespesa.do?operacao=prepareSave" & gt ; & lt ; / forward & gt ;
& lt ; / action & gt ;
& lt ; action path = "/itensPedidoDespesa" name = "itensPedidoDespesaForm" type = "br.ufc.action.ItensPedidoDespesaAction" parameter = "operacao" & gt ;
& lt ; forward name = "pedidoDespesa" path = "/pedidoDespesa.do?operacao=listAll" /& gt ;
& lt ; / action & gt ;
& lt ; action path = "/acompanhamentoPD" name = "acompanhamentoPDForm" type = "br.ufc.action.AcompanhamentoPDAction" parameter = "operacao" & gt ;
& lt ; forward name = "listPD" path = "/pedidoDespesa.do?operacao=listAll" & gt ; & lt ; / forward & gt ;
& lt ; / action & gt ;
& lt ; / action - mappings & gt ;
& lt ; controller /& gt ;
& lt ; message - resources parameter = "br.ufc.i18n.application" /& gt ;
& lt ;! -- ======================== = Validator plugin ================================ = --& gt ;
& lt ; plug - in className = "org.apache.struts.validator.ValidatorPlugIn" & gt ;
& lt ; set - property property = "pathnames"
value = "/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" /& gt ;
& lt ; / plug - in & gt ;
& lt ; plug - in className = "org.apache.struts.tiles.TilesPlugin" & gt ;
& lt ; set - property property = "definitions-config"
value = "/WEB-INF/tiles-defs.xml" /& gt ;
& lt ; / plug - in & gt ;
& lt ; / struts - config & gt ;
& lt ; % @ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %& gt ;
& lt ; div style = "display: table-column; float:left; clear: right; border: 1px solid #c1c1c1; width: 49%" & gt ;
& lt ; fieldset & gt ;
& lt ; legend & gt ; Vencimentos do dia & lt ; / legend & gt ;
& lt ; table width = "100%" border = "0" cellspacing = "1" & gt ;
& lt ; tr bgcolor = "#c1c1c1" & gt ;
& lt ; th & gt ; Documento & lt ; / th & gt ;
& lt ; th & gt ; Valor & lt ; / th & gt ;
& lt ; / tr & gt ;
& lt ; c : forEach items = "${vencimentosDia}" var = "vencimentos" & gt ;
& lt ; tr bgcolor = "#f1f1f1" & gt ;
& lt ; td & gt ; $ { vencimentos . numeroNotaFiscal } & lt ; / td & gt ;
& lt ; td align = "right" & gt ; $ { vencimentos . valorPrevista } & lt ; / td & gt ;
& lt ; / tr & gt ;
& lt ; / c : forEach & gt ;
& lt ; / table & gt ;
& lt ; / fieldset & gt ;
& lt ; / div & gt ;
& lt ; div style = "display: table-column; float:right; clear: right; border: 1px solid #c1c1c1; width: 49%" & gt ;
& lt ; fieldset & gt ;
& lt ; legend & gt ; Inadimplentes & lt ; / legend & gt ;
& lt ; table width = "100%" border = "0" cellspacing = "1" & gt ;
& lt ; tr bgcolor = "#c1c1c1" & gt ;
& lt ; th width = "20%" & gt ; Documento & lt ; / th & gt ;
& lt ; th width = "20%" align = "center" & gt ; Valor & lt ; / th & gt ;
& lt ; th align = "center" width = "40%" & gt ; Data de Pagamento & lt ; / th & gt ;
& lt ; th align = "center" width = "20%" & gt ; Dias em Atraso & lt ; / th & gt ;
& lt ; / tr & gt ;
& lt ; c : forEach items = "${inadimplentes}" var = "inadimplentes" & gt ;
& lt ; tr bgcolor = "#f1f1f1" & gt ;
& lt ; td & gt ; $ { inadimplentes . numeroNotaFiscal } & lt ; / td & gt ;
& lt ; td align = "right" & gt ; $ { inadimplentes . valorPrevista } & lt ; / td & gt ;
& lt ; td align = "center" & gt ; $ { inadimplentes . dataPrevista } & lt ; / td & gt ;
& lt ; td align = "center" & gt ; $ { inadimplentes . diasAtraso } & lt ; / td & gt ;
& lt ; / tr & gt ;
& lt ; / c : forEach & gt ;
& lt ; / table & gt ;
& lt ; / fieldset & gt ;
& lt ; / div & gt ;
juniorsatanas 9 de ago. de 2010
package br.ufc.action ;
import java.util.ArrayList ;
import java.util.GregorianCalendar ;
import java.util.List ;
import javax.servlet.http.HttpServletRequest ;
import javax.servlet.http.HttpServletResponse ;
import org.apache.struts.action.ActionForm ;
import org.apache.struts.action.ActionForward ;
import org.apache.struts.action.ActionMapping ;
import org.apache.struts.actions.DispatchAction ;
import br.com.ContasReceber ;
import br.ufc.BO.ContasReceberBO ;
import br.ufc.TO.ContasReceberTO ;
import br.ufc.assembler.ContasReceberAssembler ;
import com.converte.ConverteData ;
public class PaginaInicial extends DispatchAction {
/*
* Classe utilizada para listar os inadimplentes e vencimentos do dia
*/
private GregorianCalendar calendar = new GregorianCalendar ();
public ActionForward montarPaginaInicial ( ActionMapping mapping , ActionForm form ,
HttpServletRequest request , HttpServletResponse response )
throws Exception {
List & lt ; ContasReceber & gt ; vencimentosDia = new ArrayList & lt ; ContasReceber & gt ;();
List & lt ; ContasReceber & gt ; inadimplentes = new ArrayList & lt ; ContasReceber & gt ;();
try {
vencimentosDia = (( ContasReceberBO ) ContasReceberBO . getInstance ()). findAll ( calendar );
inadimplentes = (( ContasReceberBO ) ContasReceberBO . getInstance ()). findAllInadimplentes ( calendar );
final List & lt ; ContasReceberTO & gt ; vencimentosDiaTO = ContasReceberAssembler . getInstance (). entity2EntityTO ( vencimentosDia );
final List & lt ; ContasReceberTO & gt ; inadimplentesTO = ContasReceberAssembler . getInstance (). entity2EntityTO ( inadimplentes );
for ( int i = 0 ; i & lt ; inadimplentesTO . size (); i ++ ) {
final GregorianCalendar dataInadimplente = ConverteData . retornaData ( inadimplentesTO . get ( i ). getDataPrevista ());
final long diasAtraso = (( calendar . getTimeInMillis () / ( 24 * 60 * 60 * 1000 )) - ( dataInadimplente . getTimeInMillis () / ( 24 * 60 * 60 * 1000 )));
inadimplentesTO . get ( i ). setDiasAtraso ( String . valueOf ( diasAtraso ));
}
request . setAttribute ( & quot ; vencimentosDia & quot ;, vencimentosDiaTO );
request . setAttribute ( & quot ; inadimplentes & quot ;, inadimplentesTO );
} catch ( Exception e ) {
System . out . println ( & quot ; Nenhum registro encontrado !!& quot ;);
}
request . setAttribute ( & quot ; loadPage & quot ;, & quot ; / WEB - INF / pages / home . jsp & quot ;);
return mapping . findForward ( & quot ; index & quot ;);
}
public ActionForward paginaInicial ( ActionMapping mapping , ActionForm form ,
HttpServletRequest request , HttpServletResponse response )
throws Exception {
List & lt ; ContasReceber & gt ; vencimentosDia = new ArrayList & lt ; ContasReceber & gt ;();
List & lt ; ContasReceber & gt ; inadimplentes = new ArrayList & lt ; ContasReceber & gt ;();
try {
vencimentosDia = (( ContasReceberBO ) ContasReceberBO . getInstance ()). findAll ( calendar );
inadimplentes = (( ContasReceberBO ) ContasReceberBO . getInstance ()). findAllInadimplentes ( calendar );
final List & lt ; ContasReceberTO & gt ; vencimentosDiaTO = ContasReceberAssembler . getInstance (). entity2EntityTO ( vencimentosDia );
final List & lt ; ContasReceberTO & gt ; inadimplentesTO = ContasReceberAssembler . getInstance (). entity2EntityTO ( inadimplentes );
for ( int i = 0 ; i & lt ; inadimplentesTO . size (); i ++ ) {
final GregorianCalendar dataInadimplente = ConverteData . retornaData ( inadimplentesTO . get ( i ). getDataPrevista ());
final long diasAtraso = (( calendar . getTimeInMillis () / ( 24 * 60 * 60 * 1000 )) - ( dataInadimplente . getTimeInMillis () / ( 24 * 60 * 60 * 1000 )));
inadimplentesTO . get ( i ). setDiasAtraso ( String . valueOf ( diasAtraso ));
}
request . setAttribute ( & quot ; vencimentosDia & quot ;, vencimentosDiaTO );
request . setAttribute ( & quot ; inadimplentes & quot ;, inadimplentesTO );
} catch ( Exception e ) {
System . out . println ( & quot ; Nenhum registro encontrado !!& quot ;);
}
request . setAttribute ( & quot ; loadPage & quot ;, & quot ; / WEB - INF / pages / home . jsp & quot ;);
return mapping . findForward ( & quot ; paginaInicial & quot ;);
}
}