运行后无法显示页面内容,,,,请帮忙看下,,,谢谢
package assetsmanage;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2006</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class Servlet2 extends HttpServlet {
private static final String CONTENT_TYPE = "text/html; charset=GBK";
//Initialize global variables
public void init() throws ServletException {
}
//Process the HTTP Get request
public void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
response.setContentType(CONTENT_TYPE);
response.setCharacterEncoding("GB2312");
PrintWriter out = response.getWriter();
String username=request.getParameter("username");
String password=request.getParameter("password");
if(username.equals("")||password.equals(""))
{
userInterface(response);
}
else
{
out.println("欢迎第一次使用");
}
}
public void userInterface(HttpServletResponse response) throws
IOException {
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head><title>loginservlet</title></head>");
out.println("<body bgcolor=\"#ffffff\">");
out.println("<h1 align=center>欢迎第一次使用Servlet</h1>");
out.println("<form method=post action=/ServletModule/loginservlet>");
out.println("<br/>");
out.println("用户名:<input type='text' name='username'><br/>");
out.println("密 码:<input type='password' name='password'><br/>");
out.println("<input type=submit value='提交'><br/>");
out.println("</form>");
out.println("</body>");
out.println("</html>");
}
//Process the HTTP Post request
public void doPost(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
doGet(request, response);
}
//Clean up resources
public void destroy() {
}
}