package web01;import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class HelloServlet02 extends HttpServlet{
public void service(HttpServletRequest request,HttpServletResponse response)
throws ServletException,IOException{
//读取请求参数值
//String width=request.getParameter("width");
//String height=request.getParameter("height");
//处理
// time="2015.10.13 16:27";
// double a=Double.parseDouble(width);
// double b=Double.parseDouble(height);
// double c =a/b/b;
String greeting="";
int a=0;
for (int i = 0; i < 10; i++) {
String d="";
for (int j = 1; j <= i; j++) {
String c="("+i+"*"+j+"="+(i*j)+") ";
d+=c;
}
greeting +="<span><p>"+d+"</p></span>";
}
//设置服务器返回的数据类型
response.setContentType("text/html");
PrintWriter out =response.getWriter();
out.println(greeting);
out.close();
}
}