<%@ page contentType="text/html;charset=gb2312"%>
<form action="" method=post name=form>
<input type="text" name="ok">
<br>
<input type="submit" name="submit" value="送出">
</form>
<% String s=request.getParameter("ok");
  if(s==null)
   {s="1";}   //避免下面出现异常
  try{
      double number=Integer.parseInt(s);
      out.print("<br>"+Math.abs(number));
      }
   catch(NumberFormatException e)
     {
       out.print("<br>"+"请输入数字字符");
     }
%>