没有合适的资源?快使用搜索试试~ 我知道了~
jsp与Servlet跳转实例借鉴.pdf
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 173 浏览量
2021-12-25
20:30:58
上传
评论
收藏 120KB PDF 举报
温馨提示
试读
21页
jsp与Servlet跳转实例借鉴.pdf
资源推荐
资源详情
资源评论
页面 Index.jsp
Input.jsp
Comfirm.jsp
Result.jsp
Error.jsp
服务 InputServerlet
ConfirmServerlet
ResultServerlet
代码:
Index.jsp
<%@ page language ="java" import ="java.util.*" pageEncoding ="UTF-8" %>
<%
String path = request.getContextPath();
String basePath =
request.getScheme()+ "://" +request.getServerName()+ ":" +request.getServ
erPort()+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 >
<center >
<h1 >
<a href ="/lianxi/servlet/InputServlet" >INPUT </ a >
</ h1 >
</ center >
</ body >
</ html >
Confirm :
<%@ page language ="java" import ="java.util.*" pageEncoding ="UTF-8" %>
<%
String path = request.getContextPath();
String basePath =
request.getScheme()+ "://" +request.getServerName()+ ":" +request.getServ
erPort()+path+ "/" ;
%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html >
<head >
<base href =" <%=basePath %>" >
<title >My JSP 'input.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">
-->
<style type ="text/css" >
<!--
.STYLE1 {
color : #00FF00 ;
font-weight : bold ;
font-size : 36px ;
}
-->
</ style >
</ head >
<body >
<%
request.setCharacterEncoding( "utf-8" );
String username = request.getParameter( "username" );
String password = request.getParameter( "password" );
%>
<p align ="center" class ="STYLE1" >请修改用户名和密码 </ p >
<form id ="form1" name ="form1" method ="post"
action ="/lianxi/servlet/ResultServlet" >
<table width ="394" border ="1" align ="center" >
<tr >
<td width ="162" >用户名; </ td >
<td width ="216" >< label >
<input name ="username" type ="text" id ="username"
value =" <%=username %>" size ="30" maxlength ="30" />
</ label ></ td >
</ tr >
<tr >
<td >密码: </ td >
<td >< label >
<input name ="password" type ="text" id ="password"
value =" <%=password %>" size ="30" maxlength ="30" />
</ label ></ td >
</ tr >
<tr >
<td >< label >
<input type ="submit" name ="submit" id ="submit" value =" 提交" />
</ label ></ td >
<td >< label >
<input type ="reset" name ="reset" id ="reset" value =" 重置" />
</ label ></ td >
</ tr >
</ table >
</ form >
<p > </ p >
</ body >
</ html >
Input:
<%@ page language ="java" import ="java.util.*" pageEncoding ="UTF-8" %>
<%
String path = request.getContextPath();
String basePath =
request.getScheme()+ "://" +request.getServerName()+ ":" +request.getServ
erPort()+path+ "/" ;
%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html >
<head >
<base href =" <%=basePath %>" >
<title >My JSP 'input.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">
-->
<style type ="text/css" >
<!--
.STYLE1 {
color : #00FF00 ;
font-weight : bold ;
font-size : 36px ;
}
-->
</ style >
</ head >
<body >
<p align ="center" class ="STYLE1" >请输入用户名和密码 </ p >
<form id ="form1" name ="form1" method ="post"
action ="/lianxi/servlet/ConfirmServlet" >
<table width ="394" border ="1" align ="center" >
<tr >
<td width ="162" >用户名; </ td >
<td width ="216" >< label >
<input name ="username" type ="text" id ="username" size ="30"
maxlength ="30" />
</ label ></ td >
</ tr >
<tr >
<td >密码: </ td >
<td >< label >
<input name ="password" type ="text" id ="password" size ="30"
maxlength ="30" />
</ label ></ td >
</ tr >
<tr >
<td >< label >
<input type ="submit" name ="submit" id ="submit" value =" 提交" />
</ label ></ td >
<td >< label >
<input type ="reset" name ="reset" id ="reset" value ="
重置
" />
</ label ></ td >
</ tr >
</ table >
</ form >
<p > </ p >
</ body >
</ html >
Result:
<%@ page language ="java" import ="java.util.*" pageEncoding ="UTF-8" %>
<%
String path = request.getContextPath();
String basePath =
request.getScheme()+ "://" +request.getServerName()+ ":" +request.getServ
erPort()+path+ "/" ;
%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html >
<head >
<base href =" <%=basePath %>" >
<title >My JSP 'result.jsp' starting page </ title >
<meta http-equiv ="pragma" content ="no-cache" >
剩余20页未读,继续阅读
资源评论
wxj15659998286
- 粉丝: 1
- 资源: 10万+
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功