<html>
<head>
<title>testServlet</title>
</head>
<body>
<form action="/helloServlet" method="Get">
Item number: <input type="text" name="itemNum"><br>
Quantity: <input type="text" name="quantity"><br>
Price Each: <input type="text" name="price"><br>
<hr>
First Name: <input type="text" name="firstName"><br>
Last Name: <input type="text" name="lastName"><br>
Middle Initial: <input type="text" name="initial"><br>
Shipping Address: <textarea name="adress" rows=3,cols=40></textarea><br>
Credit Card:<br>
<input type="radio" name="cardType" value="Visa">Visa<br>
<input type="radio" name="cardType" value="Master Card">Master Card<br>
<input type="radio" name="cardType" value="America Express">America Express<br>
<input type="radio" name="cardType" value="Discover">Discover<br>
<input type="radio" name="cardType" value="Java SmartCard">Java SmartCard<br>
Credit Card Number:<input type="password" name="cardNum"><br>
Repeat Credit Card Number:<input type="password" name="cardNum"><br><br>
<center>
<input type="submit" value="submit">
</center>
</form>
</body>
</html>
这是index.html。也就是首页。import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;public class helloServlet extends HttpServlet
{
  public void doGet(HttpServletRequest request,HttpServletResponse response)
    throws ServletException,IOException
{
  PrintWriter out=response.getWriter();
  response.setContentType("text/html;charset=GB2312");
  Enumeration paramNames=request.getParameterNames();
  out.println("<html><body><table>");
  out.println("<tr><td>"+"Parameter Name"+"</td>");
  out.println("<td>"+"Parameter Value"+"</td></tr>");
  while(paramNames.hasMoreElements())
  {
    String paramName=(String)paramNames.nextElement();
out.print("<tr><td>"+paramName+"\n</td>");
String[] paramValues=request.getParameterValues(paramName);
out.println("<td>");
if(paramValues.length==1)
{
  
  String paramValue=paramValues[0];
  if(paramValues.length==0)
    out.println("No Value");
      else
    out.println(paramValue);
}
else 
{
    for(String str:paramValues)
    out.println(str);   
}
out.println("</td></tr>");
  }
  out.println("</table>\n</body></html>");
  out.flush();
  out.close();
}
}这是servlet类,为什么浏览器上不能显示网页?Servlet