<%!publicvoidjspInit(){}%><jsp:useBeanid="theBean"class="com.gilsonap.CalculatorBean2"/><%inti=2;%><jsp:setPropertyname="theBean"property="memory"value="<%= 100 * i %>"/>Thevalueofmemoryis<jsp:getPropertyname="theBean"property="memory"/>
A página emprega o CalculatorBean2 mostrado abaixo:
Você pode utilizar uma função javascript para recarregar a página:
<%!publicvoidjspInit(){}%><jsp:useBeanid="theBean"class="com.gilsonap.CalculatorBean2"/> <% int i = 1; try { i = Integer.parseInt(request.getParameter("i")); } catch (Exception e) { }%> <jsp:setProperty name="theBean" property="memory" value="<%=100*i%>"/> The value of memory is <jsp:getProperty name="theBean" property="memory"/>&lt;javascript&gt; function recarregar() { window.location.href="minhapagina.jsp?i=<%=i+1%>"; } window.setTimeOut("recarregar()", 5000);&lt;/javascript&gt;
Flw…
G
gilsonapPJ
Não funcionou,
o browser está imprimindo o seguinte:
The value of memory is 100 [color=“blue”]mais o código javascript[/color] (que aqui não estou conseguindo postar…)
e a página permanece estática não alterando o valor.