栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

编写一个JSP页面,使用application统计所有用户投票喜欢的明星

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

编写一个JSP页面,使用application统计所有用户投票喜欢的明星

<%@ page import="javax.management.modelmbean.ModelMBeanInfoSupport" %><%--
  Created by IntelliJ IDEA.
  User: xc
  Date: 2021/11/6
  Time: 21:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>


    统计投票


    欢迎你访问,请投票你喜欢的明星!

    刘亦菲
    周星驰
    张迪
    百里守约

<%--
  Created by IntelliJ IDEA.
  User: xc
  Date: 2021/11/7
  Time: 13:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>


    百里守约


<%
    if(application.getAttribute("count2")==null){
        application.setAttribute("count2",new Integer(0));
    }
    Integer count = (Integer) application.getAttribute("count2");
    application.setAttribute("count2",new Integer(count.intValue()+1));
%>
投票成功!有<%=application.getAttribute("count2")%>位同样喜爱他的人

<%--
  Created by IntelliJ IDEA.
  User: xc
  Date: 2021/11/7
  Time: 13:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>


    刘亦菲


<%
if(application.getAttribute("count")==null){
    application.setAttribute("count",new Integer(0));
}
Integer count = (Integer) application.getAttribute("count");
application.setAttribute("count",new Integer(count.intValue()+1));
%>
投票成功!有<%=application.getAttribute("count")%>位同样喜爱她的人

<%--
  Created by IntelliJ IDEA.
  User: xc
  Date: 2021/11/7
  Time: 13:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>


    张迪


<%
    if(application.getAttribute("count4")==null){
        application.setAttribute("count4",new Integer(0));
    }
    Integer count = (Integer) application.getAttribute("count4");
    application.setAttribute("count4",new Integer(count.intValue()+1));
%>
投票成功!有<%=application.getAttribute("count4")%>位同样喜爱她的人

<%--
  Created by IntelliJ IDEA.
  User: xc
  Date: 2021/11/7
  Time: 13:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>


    刘亦菲


<%
    if(application.getAttribute("count3")==null){
        application.setAttribute("count3",new Integer(0));
    }
    Integer count = (Integer) application.getAttribute("count3");
    application.setAttribute("count3",new Integer(count.intValue()+1));
%>
投票成功!有<%=application.getAttribute("count3")%>位同样喜爱他的人

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/445929.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号