zoukankan      html  css  js  c++  java
  • 简单的购物车应用案例 相关代码4

    <%@ 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 'd.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>
      <%request.setCharacterEncoding("utf-8"); %>
        小伙子你有钱吗?还买东西! <br>
        <a href="e.jsp">清空购物车</a>
      </body>
    </html>

    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <title>显示购物车购物信息</title>
      </head>
     
      <body>
                已经清空:<br>
      <%request.setCharacterEncoding("utf-8");
         String str=" ";
        if(session.getAttribute("s1")!=null){
      
       session.removeAttribute("s1");
      
       }
       if(session.getAttribute("s2")!=null){
      
        session.removeAttribute("s2");
      
      
       }
       if(session.getAttribute("s3")!=null){
     
        session.removeAttribute("s3");
     
       }
       if(session.getAttribute("s4")!=null){
     
       session.removeAttribute("s4");
       }
       if(session.getAttribute("s5")!=null){
     
        session.removeAttribute("s5");
       }
       if(session.getAttribute("s6")!=null){
     
      session.removeAttribute("s6");
       }
      
        %>
        <br><br>
        <a href="c.jsp">返回购物车</a><br>
       
      </body>
    </html>

  • 相关阅读:
    体检前注意事项
    SSO之CAS单点登录详细搭建教程
    如何通过session控制单点登录
    谈谈防止Ajax重复点击提交
    js判断是移动端还是pc端
    HttpClient通过GET和POST获取网页内容
    HttpClient 4.x 执行网站登录并抓取网页的代码
    360每日自动签到,领取积分 (java httpclient4.x)
    Java @override报错的解决方法
    无开发经验,初学python
  • 原文地址:https://www.cnblogs.com/www-hsy-com/p/7668577.html
Copyright © 2011-2022 走看看