问一个servlet手工编译问题
近来学了其他知识,竟然会忘了以前的基础知识,在这请教大家了,有以下三个文件,请问用命令提示符怎么样编译?请写出具体命令,谢谢了AdmInfo.java :
package com;
public class AdmInfo {
private String username;
private String password;
public AdmInfo(){
}
public AdmInfo(String username, String password) {
//super();
this.username = username;
this.password = password;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
}
AdminService.java :
package com;
import com.AdmInfo;
public class AdminService {
public boolean isValidateLogin(AdmInfo adminfo){
boolean bl = false;
String uName=adminfo.getUsername();
String pWord=adminfo.getPassword();
System.out.println(uName);
if(uName.equals("admin")&&pWord.equals("123")){
bl=true;
}
return bl;
}
}
LoginServlet.java :
package com;
import com.AdmInfo;
import com.AdminService;
import
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class LoginServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request,response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String username=request.getParameter("username");
String password=request.getParameter("password");
System.out.println("pass");
AdmInfo adminfo= new AdmInfo(username,password);
AdminService adminservice= new AdminService();
boolean bl= adminservice.isValidateLogin(adminfo);
RequestDispatcher dispatcher=null;
String path=null;
if(bl){
request.getSession().setAttribute("userId", username);
path="/ok.jsp" ;
}
else{
request.setAttribute("status", "<font color=red>用户名或密码错误!请重新输入!</font>");
path="/login.jsp" ;
}
dispatcher=request.getRequestDispatcher(path);
dispatcher.forward(request, response);
}
}