VVoVe: [JAVA]ho creato unapagine jsp con una tabella da cui partono dei test su un altro progetto(jiv) che leggono dei file e danno un record ora come posso creare una barra di progressione che mi visualizzi la percentuale da 0 a100 della lettura o svolgimento del test?
pagina jsp listTest.jsp
pagina jsp eseguiTest.jspcodice:<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@page import="it.kedrios.jiv.web.run.WebTestManager"%> <%@page import="java.util.Vector"%> <%@page import="java.util.Iterator"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>JIVWEB ELENCO TEST</title> <link rel="stylesheet" type="text/css" href="/JIVWeb/css/style.css" /> <p class="nik">[img]/JIVWeb/images/logo.JPG[/img]PROGETTO JIV[img]/JIVWeb/images/logo.JPG[/img] <center> <p class="nik">[img]/JIVWeb/images/file.gif[/img]ELENCO TESTS DISPONIBILI DA LANCIARE [img]/JIVWeb/images/file.gif[/img] </center> </p> </head> <body> </table> <FORM name=listTestForm action=""> <table border=3 bordercolor=" 33CC33" width=650 height=150 align="center"> <% WebTestManager webTestManager = new WebTestManager(); Vector testVector = webTestManager.readFileTestVector(); Iterator testVectorIterator = testVector.iterator(); int pos; pos = 0; while (testVectorIterator.hasNext()) { String testName = (String) testVectorIterator.next(); pos++; %> <tr> <td bgcolor="99CCCC" align=center height=35><%=pos%></td> <td bgcolor="99CCCC" align=center height=35>Nome Test</td> <td bgcolor="99CCCC" align=center height=35><%=testName%></td> <td bgcolor="99CCCC" align=center height=35><input type="submit" value="Run" onclick="eseguiTest('<%=testName%>')"></td> <tr> <% } %> </TABLE> </FORM> </html>
QUESTA E IL CODICE DI UN RUN TEST DEL PROGETTOcodice:<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <%@page import="it.kedrios.jiv.manager.JIV"%> <%@page import="it.kedrios.jiv.loader.parser.data.mapping.MappingTest"%> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>PROGETTO JIV :ESEGUI TEST</title> <link rel="stylesheet" type="text/css" href="/JIVWeb/css/style.css" /> <p class="nik">[img]/JIVWeb/images/logo.JPG[/img]ESEGUI TEST[img]/JIVWeb/images/logo.JPG[/img] </head> <body> <td align=center> <form method="post" action="listTest.jsp"> </td> <% String testName = request.getParameter("testName"); JIV jiv = new JIV(); if (testName.equalsIgnoreCase(MappingTest.XML_TESTNAME_GENERIC)) { jiv.runTestGeneric(); } else if (testName .equalsIgnoreCase(MappingTest.XML_TESTNAME_CUSTOM_LEGAME)) { jiv.runTestcustomLegame(); } else if (testName .equalsIgnoreCase(MappingTest.XML_TESTNAME_ORDINI_PENDENTI)) { jiv.runTestOpLineCode(); } else if (testName .equalsIgnoreCase(MappingTest.XML_TESTNAME_PORTFOLIO_LINECODE)) { jiv.runTestPtLineCode();} response.sendRedirect("listTest.jsp"); %> </form> </body> </html>
UN GRAZIE DI CUORE A CHI MI PUO AIUTARE NIKOcodice:public static void runTestOpLineCode() { outputCons .writeln("################## S T A R T I N G ##################"); output.writeln("################## S T A R T I N G ##################"); ParseManage parseManage = new ParseManage(); Vector XMLTestsVector = parseManage.loadXMLTests(); boolean foundTest = false; int pos = 0; while (!foundTest && pos < XMLTestsVector.size()) { MappingTest mappingTest = (MappingTest) XMLTestsVector.get(pos); if (mappingTest.getName().equalsIgnoreCase( MappingTest.XML_TESTNAME_ORDINI_PENDENTI)) foundTest = true; else pos++; } MappingTestCustom mappingTestCustom = (MappingTestCustom) XMLTestsVector .get(pos); TestManage testManage = new TestManage(); boolean result = testManage.runTest(mappingTestCustom); output.writeln("Test Ordini Pendenti terminated. Result: " + result); outputCons .writeln("Test Ordini Pendenti terminated. Result: " + result); outputCons .writeln("################# T E R M I N A T E D ################"); output .writeln("################# T E R M I N A T E D ################"); }![]()

VVoVe: [JAVA]ho creato unapagine jsp con una tabella da cui partono dei test su un altro progetto(jiv) che leggono dei file e danno un record ora come posso creare una barra di progressione che mi visualizzi la percentuale da 0 a100 della lettura o svolgimento del test?
Rispondi quotando