statement_class.jsp
来自「servlet初学者最好的例子……希望能对大家有所帮助」· JSP 代码 · 共 47 行
JSP
47 行
<%@ page language="java" %>
<%@ page contentType="text/html;charset=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>声明类</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 bgcolor="#FFFFFF">
<%!public class sayHello
{
boolean county;
sayHello(boolean county)
{
this.county=county;
}
String Hello()
{
if(county)
return "Hello!";
else return "您好!";
}
}
%>
<% sayHello a=new sayHello(false); %>
<%=a.Hello()%>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?