使用IDEA学习JSP代码第010课

new345.jsp

<%@ page import="java.util.Date" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%!
    Date date;
    int sum;
    public int add(int m,int n)
    {
        return m + n;
    }
%>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>bootstrap + jsp 的使用</title>
    <link rel="stylesheet" href="../other/boot/css/bootstrap.min.css">
    <script type="text/javascript" src="../other/jQuery/jQuery-3.4.1.js"></script>
    <script type="text/javascript" src="../other/boot/js/bootstrap.min.js"></script>

</head>
<body>
    <h3 class="h3">创建Date对象:</h3>
    <%
        date = new Date();
        out.println("<br><p>" + date + "</p>");
        sum = add(33,66);
    %>
<br> 在下一行输出和值:<br>
    <p><%= sum + 100 %></p>
</body>
</html>

new346.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%!
    private int add(int x,int y)
    {
        return  x + y;
    }

    private int sub(int x,int y)
    {
        return  x - y;
    }
%>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>bootstrap + jsp 的使用</title>
    <link rel="stylesheet" href="../other/boot/css/bootstrap.min.css">
    <script type="text/javascript" src="../other/jQuery/jQuery-3.4.1.js"></script>
    <script type="text/javascript" src="../other/boot/js/bootstrap.min.js"></script>

</head>
<body>
    <%
        out.println("<p>调用add方法计算200 与111 之间的和:</p>");
        int r1 = add(200,111);
        out.println(r1);
        out.println("<p>调用sub方法计算200 与111 之间的差:</p>");
        int r2 = sub(200,111);
        out.println(r2);
    %>
</body>
</html>

new347.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>bootstrap + jsp 的使用</title>
    <link rel="stylesheet" href="../other/boot/css/bootstrap.min.css">
    <script type="text/javascript" src="../other/jQuery/jQuery-3.4.1.js"></script>
    <script type="text/javascript" src="../other/boot/js/bootstrap.min.js"></script>

</head>
<body>
<%--
    create table ab_member(
		id int not null auto_increment primary key,
		loginname nvarchar(50) not null unique comment '登录名',
		password char(10) not null comment '密码',
		sex char(10) comment '性别',
		phone nvarchar(50) comment '电话',
		email nvarchar(50) comment '邮箱',
		message nvarchar(50) comment '简历',
		picture nvarchar(50) comment '照片的名称'
) comment '会员表'


--%>
<%--
new347.jsp          create table
new348.jsp          header
new349.jsp          index
new350.java         register bean
new351.jsp          register.jsp register会员注册
new352.jsp          showregisterMessage注册成功
new353.java         handleRegister.java
new354.java         login bean
new355.jsp          login.jsp
new356.jsp          showLoginMess.jsp
new357.java         handleLogin.java
new358.java         uploadFile bean
new359.jsp          upload.jsp
new360.jsp          showUploadMess.jsp
new361.java         handelUpload.java
new362.java         memberInform bean
new363.java         showByPage bean
new364.jsp          choiceLookType.jsp
new365.jsp          showAllMember.jsp
new366.jsp          showLookedMember.jsp
new367.java         handleDatabase.java



--%>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

虾米大王

有你的支持,我会更有动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值