- <%@ page language="java" import="java.util.*" pageEncoding="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>My JSP 'MyCompute.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>
- <style type="text/css">
- div{
- width:215px;
- height:290px;
- border:2px solid black;
- background-image:url(c1.jpg);
- }
- #aniu{
- width:35px;
- height:25px;
- }
- </style>
- <body>
- <div align="center">
- <h1>My Computer</h1>
- <font size="4" >请输入第一个数:</font><br/>
- <input type="text" id="num1" style="width:150;"/><br/>
- <font size="4" >请输入第二个数:</font><br/>
- <input type="text" id="num2" style="width:150;"/> <br/>
- <font size="4" >请选择运算方式:</font><br/>
- <table>
- <tr>
- <td><input type="button" value="+" id="aniu" onclick="jia();"/></td>
- <td><input type
JavaWeb网页版计算器实现
最新推荐文章于 2024-09-26 09:19:23 发布
这是一个使用JavaWeb技术实现的网页计算器,用户可以输入两个数并选择运算符进行加减乘除操作。通过JavaScript处理按钮点击事件,或者使用Servlet进行表单提交和结果计算。两种方法都实现了基本的四则运算功能。
摘要由CSDN通过智能技术生成