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>