package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

public final class exa2_005f6_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.Vector _jspx_dependants;

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html;charset=GB2312");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("<HTML>\r\n");
      out.write("<BODY>\r\n");
      out.write("<P> 请输入一个数:\r\n");
      out.write("<BR>\r\n");
      out.write(" <!-- 以下是HTML表单，向服务器这个数 -->\r\n");
      out.write("  <FORM action=\"exa2_6.jsp\" method=post name=form>\r\n");
      out.write("       <P>这个数是:\r\n");
      out.write("       <INPUT type=\"text\" name=\"a\">\r\n");
      out.write("        <BR> \r\n");
      out.write("       <INPUT TYPE=\"submit\" value=\"送出\" name=submit>\r\n");
      out.write("  </FORM>  \r\n");
      out.write(" ");
      out.write("\r\n");
      out.write("  ");
 String string_a=request.getParameter("a");
     double a=0;
  
      out.write('\r');
      out.write('\n');
      out.write("\r\n");
      out.write("      ");
 if(string_a==null)
           {string_a="0";
           } 
      
      out.write("\r\n");
      out.write("  ");
      out.write("\r\n");
      out.write("       ");
 try{ a=Double.valueOf(string_a).doubleValue();
               a=a*a;                    //平方
               out.print("<BR>"+"平方为："+a); 
              }
            catch(NumberFormatException e)
             {out.print("<BR>"+"请输入数字字符");
             }
     
      out.write(" \r\n");
      out.write("</BODY>\r\n");
      out.write("</HTML> ");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
