急求关于Servlet的一个问题
我是用JBuilder2006做了一个简单的Serlet的程序
可是出现了一个问题,就是第一个页面出来了,可是点提交后,就没有反映了,希望大家能帮我看看,下面是代码:
package example1;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
/**
* <p> Title: </p>
*
* <p> Description: </p>
*
* <p> Copyright: Copyright (c) 2007 </p>
*
* <p> Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class LoginServlet extends HttpServlet {
private static final String CONTENT_TYPE = "text/html; charset=GBK ";
//初始化全局变量
public void init() throws
ServletException {
}
//处理HTTP Get 请求
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException,
IOException {
response.setContentType(CONTENT_TYPE);
response.setCharacterEncoding( "GB2312 ");
PrintWriter out = response.getWriter();
try
{
String username =request.getParameter( "username ");
String password =request.getParameter( "password ");
if(username.equals( " ")||password.equals( " "))
{
userInterface(response);
}
else
{
out.println( " <b> " + username + "/b 欢迎第一次使用Servlet <br/> ");
out.println( " <b> 今天的日期是: </b> "+new Date());