概述
login,jsp
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<form action="login_success.jsp" method = "post">
用户名:<input type ="text" name = "username"/><br>
密码:<input type = "password" name ="password"><br>
<input type ="submit" value="提交"/>
</form>
</body>
</html>
login_success.jsp 用于显示用户信息
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<%
String uname = request.getParameter("username");
String pwd = request.getParameter("password");
out.println(uname);
out.println(pwd);
%>
</body>
</html>
最后
以上就是热心草莓为你收集整理的JSP实现简单的用户登录,并显示出用户的信息的全部内容,希望文章能够帮你解决JSP实现简单的用户登录,并显示出用户的信息所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复