jsp登录页面
来源:互联网 发布:rmvb转mp4 mac 编辑:程序博客网 时间:2024/06/01 17:02
<%@ page language="java" import="java.util.*" contentType = "text/html; charset=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 'index.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> <h1>用户登录</h1> <hr> <form action = "chuli.jsp" name = "loginForm" method = "post"> <table> <tr> <td>用户名</td> <td><input type="text" name = "username"></td> </tr> <tr> <td>密码</td> <td><input type = "text" name = "password"></td> </tr> <tr> <td colspan = "2"><input type = "submit" value = "登陆"></td> <!-- 这个colspan是指 表格单元横跨两列的表格 submit指的是表格中的提交按钮--> </tr> </table> </form></body></html>
<%@ page language="java" import="java.util.*" contentType = "text/html; charset=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 'index.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> <h1>处理页面</h1> <% request.setCharacterEncoding("utf-8") ; //在接收数据之前更改编码 解决中文乱码问题 因为把数据放进tomcat中默认以ios编码输出 但是无法解决url传递进参数的乱码问题 要是想解决url传递进去的问题话 需要修改tomcat服务器 %> <% if(request.getParameter("username").equals("admin") && request.getParameter("password").equals("admin")) { request.getReque/stDispatcher("login_success.jsp").forward(request,response); //请求转发到login_success.jsp }else { response.sendRedirect("login_failure.jsp"); //请求重定向 } %></body></html>
//在处理页面转换格式为utf-8防止乱码
<%@ 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 'index.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> <h1>登录成功</h1> 用户:<%=request.getParameter("username") %><br> </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 'index.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> <h1>登录失败</h1> </body></html>
阅读全文
0 0
- jsp&server登录页面
- jsp页面登录验证
- jsp登录页面
- JSP+Servlet登录页面制作
- Jsp页面注册与登录
- jsp页面验证登录账号
- Jsp页面注册与登录
- JSP制作登录页面:login.jsp
- jsp页面登录超时页面嵌套解决办法
- WebWork/JSP/Velocity建立登录页面
- 用JSP实现WEB页面登录验证
- JBuilder2005实战JSP之登录页面
- JBuilder2005实战JSP之登录页面(2)
- JBuilder2005实战JSP之登录页面
- JBuilder2005实战JSP之登录页面(2)
- jsp登录页面应证码如何生成
- JBuilder2005实战JSP之登录页面(2)
- 拦截JSP页面,校验是否已登录
- 3-10·Linux服务管理
- jenkins
- 浅谈list的remove方法
- memcache
- 牛客练习赛8解题报告
- jsp登录页面
- Spring--装配Bean
- 【Python数据分析与展示】(七)数据加载存储和文件格式
- [RK3399][Android7.1] 调试笔记 --- 默认板子无法亮屏
- AnimatorSet 动画集合以及它的监听事件
- 《Java编程技巧1001条》360条:用日期函数获得当前日期
- ACRUSH 楼教主的回忆录
- jQuery 遍历
- IIS 中设置文件上传最大长度