import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
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{
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
resp.setContentType("text/html;charset=\"utf-8\"");
PrintWriter out = resp.getWriter();
//获取从登录界面传递过来的参数值
/*
* 在此添加获取username和password值的语句
*/
if (action != null) {
/*
* 在此添加判断登录的条件
*/
if ( ) {
printContent(out);
}
}
//获取点击了左侧导航栏链接时传递过来的值
String list = req.getParameter("list");
if (list != null) {
/*
* 在此添加 点击了主页后执行的操作
*/
if (list.equals("homepage")) {
}
}
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
doPost(req, resp);
}
private void printContent(PrintWriter out) {
out.println("<html>");
out.println("<frameset cols='120,*'>");
out.println("<frame noresize='noresize' src='content/navlist.html'>");
out.println("<frame src='content/frameContent/ziliao.html' name='mainframe'>");
out.println("</frameset>");
out.println("</html>");
}
}
Frank_W毅3947945
相关分类