How to use jsp to implement a simple calculator (3) and jsp to implement a calculator

Source: Internet
Author: User

How to use jsp to implement a simple calculator (3) and jsp to implement a calculator

This jsp page is mainly used to implementThe ability to submit and accept data on the same page.

This small program has many shortcomings. I hope you can criticize and correct it more.

<% @ Page language = "java" contentType = "text/html;" pageEncoding = "gbk" %> <! DOCTYPE html PUBLIC "-// W3C // dtd html 4.01 Transitional // EN" "http://www.w3.org/TR/html4/loose.dtd"> 


The implementation result is as follows:



Compile a JSP page to implement a simple calculator (only one JSP page can be used)

Something simple. Jsp and js are all done. It can be written in addition, subtraction, multiplication, division, and js. I think more about LZ.
 
Eager to use jsp for simple calculator code

<Html>
<Head>
<Title> calculator </title>
</Head>
<Body bgcolor = "# ffffff" onload = "FKeyPad. ReadOut. focus (); FKeyPad. ReadOut. select ();">
<FORM name = "Keypad" action = "">
<TABLE align = "center">
<B>
<TABLE align = "center" border = 2 width = 50 height = 60 cellpadding = 1 cellspacing = 5>
<TR>
<TD colspan = 3 align = middle> <input name = "ReadOut" type = "Text" onkeypress = "CheckOut () "size = 24 value =" 0 "width = 100%> </TD>
<TD> </TD>
<TD> <input name = "btnClear" type = "Button" value = "C" onclick = "Clear ()"> </TD>
<TD> <input name = "btnClearEntry" type = "Button" value = "CE" onclick = "ClearEntry ()"> </TD>
</TR>
<TR>
<TD> <input name = "btnSeven" type = "Button" value = "7" onclick = "NumPressed (7)"> </TD>
<TD> <input name = "btnEight" type = "Button" value = "8" onclick = "NumPressed (8)"> </TD>
<TD> <input name = "btnNine" type = "Button" value = "9" onclick = "NumPressed (9)"> </TD>
<TD> </TD>
<TD> <input name = "btnNeg" type = "Button" val ...... the remaining full text>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.