代码优化一:代码优化:合并 LoginServlet 和 RegistServlet 程序为 UserServlet 程序优化代码二:使用反射优化大量 else if 代码:代码优化三:抽取 BaseServlet 程序。