login_do.jsp
来自「实现在线书店的基本功能 应用了hibernate+jsp 技术采用了mvc三层」· JSP 代码 · 共 39 行
JSP
39 行
<%@page contentType="text/html" pageEncoding="UTF-8"%><%@ page import="mypack.*" %><%@ page session="true" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><jsp:useBean id="userDao" scope="page" class="mypack.UserDao" /><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>login_do</title> <style type="text/css"></style> </head> <body> <% request.setCharacterEncoding("UTF-8"); String username=request.getParameter("username"); String password0=request.getParameter("password0"); Customer user=userDao.userCheck(username,password0); if(user!=null){ session.setAttribute("user",user ); %> <jsp:forward page="bookstore.jsp" /> <%} else{ %> <center> <h3>用户名或密码错误!</h3> </center> <% response.setHeader("refresh","3;url=login.jsp"); }%> </body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?