第四天

 <body>
 <table border="1">
    <%for(int i=0;i<3;i++){%>
    <tr>
        <td width="50"><%=i %></td>
        <td width="50"><%=i %></td>
        <td width="50"><%=i %></td>
    </tr>
    <%} %>
    </table>
     <jsp:plugin   code="Clock.class"   codebase="Applet" type="applet"></jsp:plugin>
    其实真的很想你,只是你不知道而已 <br>
  </body>
编写一个jsp程序,使用<jsp:forward>动做实现跳转,并经过<jsp:param>动做元素传递参数,在跳转页中接收参数并输出。
<%@ page language="java"   pageEncoding="GB2312"%>
<%
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>跳转页面1</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>
   使用jsp:forward动做指令实现服务器端跳转。
   <jsp:forward page="practiceforward2.jsp">
   <jsp:param name="name" value="yaoming"/>
   </jsp:forward>
  </body>
</html>

 
 
<%@ page language="java"  pageEncoding="GB2312"%>
<%
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>跳转页面2</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>
   使用jsp:forward动做指令实现服务器端跳转。
   <jsp:forward page="practiceforward3.jsp">
   <jsp:param name="name" value="James"/>
   </jsp:forward>
  </body>
</html>

 
 
 
<%@ page language="java"  pageEncoding="gb2312"%>
<%
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>跳转到的页面</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>
    <h2>跳转到的页面</h2>
    <p>接收到的参数</p>
    <%
     string strname=request.getParameter("name");
     
     %>
     <%="name参数值为"+strname %>
  </body>
</html>
 
 
因为时间问题,这个程序还有一些问题,但愿尽快解决!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
相关文章
相关标签/搜索