t1122:
Thank you for your answer.
but I have some difficulty to realize this following programme:
I want to input a number(The current number) and add all my input
numbers (The sum is
.
Could you try to run this pg?
/*
<HTML>
<HEAD>
<%@page language="java" import="java.sql.*" contentType="text/html;charset=x-sjis"%>
</HEAD>
<body>
<p><b>追加Data</b></p>
<%!
String num;
String nn;
String pp;
String mm;
String bb1;
int len;
int tt;
int n;
int m;
int bb;
%>
<%
m=0;
if(session.getAttribute("line")!=null){
Object o=session.getAttribute("line");
mm=(String)o;
m=Integer.parseInt(mm);
}
if(session.getAttribute("connect")=="First")
{
num=request.getParameter("textfield22");
if (num.length()==0){
out.println("error");
}
else
{
tt=Integer.parseInt(num);
bb=m+tt;
bb1=Integer.toString(bb);
out.println("The current num"+num);
out.println("The sum is:"+bb1);
session.setAttribute("line",bb1);
}
}%>
<table width="588" border="1">
<tr>
<td colspan="3"><span class="red10p12lb">※</span><span class="black10p12l">学部名を追加登録する場合は、必要な行数を入力してください。</span></td>
</tr>
<tr>
<form method="post" action="testsession2.jsp">
<td align="middle" colspan="3">
<div align="left"><span class="black10p12l">記入欄をさらに
<input name="textfield22" size="2" > 行追加します。</span>
<input type=submit Value=" " style="BACKGROUND-IMAGE: url(file://N:/llnewsyllabus/image/tuika.gif);
COLOR: silver;
DISPLAY: list-item;
VERTICAL-ALIGN: sub" id=submit1 name=submit1>
</div>
</td>
<%session.putValue("connect","First");
%>
</form>
</tr>
</table>
</BODY>
</HTML>
*/
This following pg runs right,but when I hit the "refresh button" the
session still works.That is the input item has no number,the sum add the before session number.That's not right.I just want to keep the sum not to change when hitting the "refresh button".
So I want to Application to control the pg.
Ido
n't know how to realize it.
Please give me some advise.
Thanks a lot!