JSP内置对象response
来源:互联网 发布:微信授权登陆 java 编辑:程序博客网 时间:2024/05/17 09:18
response对象用于响应客户端请求并向客户端输出信息
void sendRedirect(String location)重定向
跳转到相应的页面:会员页面、管理员页面、普通游客页面等等。
头标签中action=“”指的是网页提交的页面路径。
sendRedirect脚本示例:
<%
String
username = request.gerParameter(“username”);
String password = request.getParameter(“password”);
if(username.equals(“admin”)&&password.equals(“123456”){
response.sendRedirect(“此处写跳转页面的url”);
}else{
response.sendRedirect(“此处写跳转回去的网页url路径”);
}
%>
跳转到欢迎页面时,页面获取用户名方法:
在上例的中转页面中
将response修改为 response.sendRedirect(“此处写跳转页面的url?username=”+username);
在跳转页中
<% String username = request.getParameter(“username”);%>
在body里面
<%=username%>,欢迎进入会员中心。
或者改为:
if(username.equals(“admin”)&&password.equals(“123456”){
response.sendRedirect(“此处写跳转页面的url”).forward(request,response);
}
输入时覆盖后面的文字的快捷键是HOME键左边的INS键。
- JSP内置对象----response
- JSP内置对象----response
- JSP内置对象---response
- JSP内置对象response
- JSP内置对象---response
- JSP 内置对象Response
- jsp内置对象response
- JSP内置对象response
- jsp内置对象---response对象
- jsp内置对象response对象
- JSP内置对象之response
- 06JSP内置对象response
- 【Jsp+Servlet】 Jsp内置对象-Response
- JSP内置对象之response对象
- JSP内置对象之response对象
- JSP内置对象之response对象
- ch6.jsp内置对象--response对象
- JSP内置对象(二)response对象
- KW41Z_FreeRTOS学习笔记
- 用户登录
- Java版中文分词 IKAnalyzer
- LintCode 解题记录17.5.10(tag:线段树)
- 面向容器技术资源调度关键技术对比
- JSP内置对象response
- POJ 1185 炮兵阵地 (状态压缩DP)
- 学习main函数的时候遇到的一些问题
- 山东省第八届ACM省赛 I 题(Parity check)
- 模板:排序(五)
- 简述几种分布式锁
- 【干货合集】Docker快速入门与进阶
- 语言100个经典的算法
- sublime 配置gcc/g++编译环境