在线等~Duplicate local variable问题
不管怎么改servlet和jsp程序,总是出现同一个错误。重启了机器也一样,所以估计不是缓存问题……
错误如下:
exception
javax.servlet.ServletException: Servlet execution threw an exception
root cause
java.lang.Error: Unresolved compilation problems:
Duplicate local variable username
Duplicate local variable username
servletSet.register.doPost(register.java:31)
servletSet.register.doGet(register.java:23)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
而servlet程序已经被我改成这样子了,还是会报那个错误!:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("Hello!");
this.doPost(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.getRequestDispatcher("/html/index.jsp")
.forward(request, response);
//System.out.println("Hello!");
}
另外,jsp文件我也检查过了,只有一个username的变量。但是其他页面有……不过应该不影响的吧……
在线等~急~望高人指点~
我真不知道哪里出了问题!