利用jsp标签完成将用户登录的信息显示到该页面
2012-11-21 21:36
796 查看
FormEnter.jsp:
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
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>
<base href="<%=basePath%>">
<title>My JSP 'FormEnter.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<form action="Enter.jsp" method="post">
UserName:
<input type="text" id="username" name="username">
<br />
PassWord:
<input type="password" id="password" name="password" />
<br />
<br/>
<input type="submit" id="button" value="Submit" />
<input type="reset" id="button" value="Reset" />
</form>
</body>
</html>
Enter.jsp:
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
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>
<base href="<%=basePath%>">
<title>My JSP 'Enter.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
Welcome ! !
<br/>
UserName:<c:out value="${param.username}"></c:out>
<br/>
PassWord<c:out value="${param.password}"></c:out>
</body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
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>
<base href="<%=basePath%>">
<title>My JSP 'FormEnter.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<form action="Enter.jsp" method="post">
UserName:
<input type="text" id="username" name="username">
<br />
PassWord:
<input type="password" id="password" name="password" />
<br />
<br/>
<input type="submit" id="button" value="Submit" />
<input type="reset" id="button" value="Reset" />
</form>
</body>
</html>
Enter.jsp:
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
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>
<base href="<%=basePath%>">
<title>My JSP 'Enter.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
Welcome ! !
<br/>
UserName:<c:out value="${param.username}"></c:out>
<br/>
PassWord<c:out value="${param.password}"></c:out>
</body>
</html>
相关文章推荐
- 实现jsp页面显示用户登录信息,利用session保存。
- 1 完成登录页面(到记事本文件进行密码和用户名的验证)。 2 完成 用户注册页面(将注册信息显示在本页面 div 中)。
- 利用Servlet和jsp实现客户端与服务器端的用户登录信息验证
- JSP实现简单的用户登录并显示出用户信息的方法
- jsp页面中用户登录的实现(利用javascript实现非空判断等……)
- 登录成功后 页面头部通过sessionstroge显示用户信息
- JSP实现简单的用户登录,并显示出用户的信息
- JSP实现简单的用户登录并显示出用户信息的方法
- 编写一个jsp程序,实现用户登录,当用户输入的用户或密码错误时,将页面重定向到错误提示页,并在该页面显示30秒后 自动回到用户登录界面
- jsp计数器--页面统计特定用户的登录次数或所有人的访问信息
- [JSP 网站开发] 用户登录信息同步显示方案(struts2,jQuery)
- Servlet+JSP+MySQL实现用户管理模块之六、实现用户信息显示
- BDF2-JAVA代码以及view页面获取当前登录用户的信息
- JSP页面上显示XML信息(库里读出)
- 利用JavaScript在JSP页面上显示一个钟表,简单。
- 权限判断——用户登录成功是才能查看相应的信息,登录失败不能查看并且返回登录页面
- 利用Session完成用户的登录和注销
- jsp利用表单跳转到另一个jsp页面传参时中文显示乱码
- Suse10下用户登录信息显示为乱码
- Sybase数据库在UNIX、Windows上的实施和管理 讨论6 显示某个登录用户的信息