JSP脚本及指令

JSP脚本及指令

 

 JSP脚本及指令

 

 JSP脚本及指令

 

 JSP脚本及指令

 

 JSP脚本及指令

 

 

<%@ page import="java.util.Date" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page pageEncoding="UTF-8" buffer="16kb" %>
<%--
  Created by IntelliJ IDEA.
  User: zengy
  Date: 2022/1/31
  Time: 15:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>$Title$</title>
  </head>
  <body>
  <%@ include file="view/top.jsp" %>
  <%-- 声明变量定义方法 --%>
  <%!
    String mess = "";//
    void sayHello(String name,String sex){
      if (sex.equals("男"))
        mess = "你好!"+name+" 先生";
      else
        mess = "你好!"+name+" 女士";
    }
  %>
  <%
    sayHello("King","男");
    Date dat = new Date();
    SimpleDateFormat sim = new SimpleDateFormat();
  %>
  <%=mess%>
  </body>
</html>
<%--
  Created by IntelliJ IDEA.
  User: zengy
  Date: 2022/1/31
  Time: 21:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>pages</title>
</head>
<body>
    <img src="imgs/68670770_p0.jpg">
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0">
    <welcome-file-list>
        <welcome-file>hello.jsp</welcome-file>
    </welcome-file-list>
</web-app>

 

上一篇:Python指定解释器


下一篇:Markdown