zoukankan      html  css  js  c++  java
  • 我的JSP的HelloWorld

    在4317机房,跟着小海写下第一个JSP。

    <%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
    <%
    	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 'a.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>
    		<%
    			double r, s;
    			String radius = request.getParameter("radius");
    			if (radius == null)
    				s = 0;
    			else {
    				r = Double.parseDouble(radius);
    				s = 3.14159*r*r;
    			}
    		%>
    		<font size=6 color=red>圆面积计算</font>
    		<form action="" method="post" name=f1>
    			请输入半径
    			<input type=text name=radius value="0" size=5 />
    			面积=
    			<input type=text name=area value="0" size=5 />
    			<input type="submit" value="计算" />
    		</form>
    	</body>
    </html>
    <script language="javascript">
    document.f1.area.value="<%=s%>";
    document.f1.radius.value="<%=radius%>";
    </script>
    
  • 相关阅读:
    jexboss-20170328 帮助信息
    clusterd-20151119 帮助信息
    XSStrike-20191220 帮助信息
    Astra-20190405 帮助信息
    InsightScan-20150320 帮助信息
    BBScan-20200419 帮助信息
    Tplmap-20210117 帮助信息
    HDU-5446 Unknown Treasure
    中国剩余定理学习笔记
    [BZOJ5042]LWD的分科岛
  • 原文地址:https://www.cnblogs.com/jentle/p/3579330.html
Copyright © 2011-2022 走看看