• 编写一个封装学生信息的JavaBean对象,在jsp页面中调用该对象,并将学生信息输出到页面中。


    package come.hanqi.test;
    
    public class XsBean {
    private String name;
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getBanj() {
        return banj;
    }
    public void setBanj(String banj) {
        this.banj = banj;
    }
    public String getXueh() {
        return xueh;
    }
    public void setXueh(String xueh) {
        this.xueh = xueh;
    }
    public String getXingb() {
        return xingb;
    }
    public void setXingb(String xingb) {
        this.xingb = xingb;
    }
    private String banj;
    private String xueh;
    private String xingb;
    
    }
    <%@page import="come.hanqi.test.XsBean"%>
    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    </head>
    <body>
    <% XsBean xb=new XsBean();
    xb.setBanj("6年级1班");
    xb.setName("张扬");
    xb.setXingb("男");
    xb.setXueh("201205404555");
    out.print("学生信息");
    out.print("<br>姓名:"+xb.getName());
    out.print("<br>班级:"+xb.getBanj());
    out.print("<br>性别:"+xb.getXingb());
    out.print("<br>学号:"+xb.getXueh());
    %>
    
    
    </body>
    </html>

  • 相关阅读:
    Docker之设置加速器
    Nginx之美多商城前台部署
    Nginx之负载均衡
    Nginx之反向代理
    美多商城后台MIS系统部署之Nginx配置
    Nginx之server和location配置使用
    题解 P4721 【【模板】分治 FFT】
    题解 P3338 【[ZJOI2014]力】
    题解 CHSEQ22 【Chef and Favourite Sequence】
    题解 CF813F 【Bipartite Checking】
  • 原文地址:https://www.cnblogs.com/jskbk/p/5627406.html
Copyright © 2020-2023  润新知