关于Jsp页面的一道题,求大神看看我哪里错了???(题目是编写一个jsp页面,在该页面有一个文本框和一个按钮,文本框中输入数字,单击按钮,计算其平方根并在页面显
<%@ page language="java" contentType="text/html; charset=gbk"pageEncoding="gbk"%>
<%@ page import="java.awt.*" import="java.awt.event.*" import="java.math.*"%>
<html>
<head>
<title>Insert title here</title>
</head>
<body>
<%
class MyWindow extends Frame implements ActionListener{
TextField text1;
Button button1;
MyWindow(){
text1=new TextField(10);
button1=new Button();
//text1.addActionListener(this);
button1.addActionListener(this);
setLayout(new FlowLayout());
add(text1);
add(button1);
setBounds(100,100,150,150);
setVisible(true);
validate();
}
public void actionPerformed(ActionEvent e){
String number=e.getActionCommand();
double n=Double.parseDouble(number);
double m=Math.sqrt(n);
}
public static void main(String args[]){
MyWindow my=new MyWindow();
}
}
%>
<% out.println(m); %>
</body>
</html>