JSP第七周作业

 

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page contentType="text/html" %>

<!DOCTYPE HTML>
<html>
  <head>
    
    <title>My JSP 'index.jsp' starting page</title>

  <%
  double price = 98.78; 
  %>
  </head>
  
  <body bgcolor="#ffccff">
      This is my JSP page. <br>
    <pstyle="font-famliy:宋体;font-size:36;color:blue">
    <a href="Link_Page.jsp?id=A1001&price=8756">购买</a><br>
    商品编号 A1001,价格8795
    </p>
    <pstyle="font-famliy:宋体;font-size:36;color:blue">
    <a href="Link_Page.jsp?id=A1002&price=8756">购买</a><br>
    商品编号 A1002,价格<%= price %>
    </p>
  </body>
  </html>

 

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%

%>

<!DOCTYPE HTML>
<html>
  <head>

    
    <title>My JSP 'Link_Page.jsp' starting page</title>
    

  </head>
  
  <body bgcolor="#EEEEFF">
    This is my JSP page. <br>
    <p styl"font-famliy:宋体; font-size:36;color:blue">
    <% 
    String id = request.getParameter("id");
    String price = request.getParameter("price");
    %>
    <b> 商品编号:<%= id %> <br>
    <b> 商品价格:<%= price %> 
    </p>
  </body>
</html>

 

 

posted @ 2022-04-13 09:30  计算机1903孙铭泽  阅读(20)  评论(0编辑  收藏  举报