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

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

编写一个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")%>位同样喜爱他的人

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/zaji/5161733.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-18
下一篇 2022-11-18

发表评论

登录后才能评论

评论列表(0条)

保存