• JSP第一周作业


    <%@ 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 'index.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>
        我的第一个页面
        <br>
    </body>
    </html>
    编写jsp页面,计算1-100之间所有素数和
    <%@ 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 'index.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>
        我的第一个页面
        <br>
        <%
            int s, count = 0;
            for (int i = 2; i <= 100; i++) {
                for (s = 2; s < i; s++) {
                    if (i % s == 0)
                        break;
                }
                if (s == i)
                    count += s;
     
            }
            out.print(count);
        %>
    </body>
    </html>
    <%@ 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 'index.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>
        我的第一个页面
        <br>
        <%
            int s, count = 0;
            for (int i = 2; i <= 100; i++) {
                for (s = 2; s < i; s++) {
                    if (i % s == 0)
                        break;
                }
                if (s == i)
                    count += s;
     
            }
            out.print(count);
        %>
    </body>
    </html>

  • 相关阅读:
    问题解决:访问自己搭建网页时出现:此地址使用了一个通常用于网络浏览以外的端口。出于安全原因,Firefox 取消了该请求。
    cracer教程5----漏洞分析(下)
    cracer教程3----信息收集
    linux3
    pwdump7的用法及其hash值解密
    maven scope含义的说明
    Spark2.0协同过滤与ALS算法介绍
    Jmeter压力测试工具安装及使用教程
    过滤器(Filter)与拦截器(Interceptor )区别
    @Value()读取配置文件属性,读出值为null的问题
  • 原文地址:https://www.cnblogs.com/1774ax/p/14505452.html
Copyright © 2020-2023  润新知