public class sendsms extends HttpServlet
{
public void doPost(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
{
//发送给服务器的信息不能超过8K
if(req.getContentLength()>8*1024)
{
res.setContentType("text/html");
ServletOutputStream out=res.getOutputStream();
out.println("<html><head><title>Too much data transformed!</title></head>");
out.println("<body><font color='red'>Error--Content length can not be bigger than 8K!</font></body>");
out.println("</html>");
}
else
{
doGet(req,res);
}
}