tempconvert0.jsp

来自「这是另一部分..只是供大家参考下拉..到时候有什么不明白的可以」· JSP 代码 · 共 32 行

JSP
32
字号
<!-- tempconvert0.jsp 
     A document that converts a Celsius temperature received
     from tempconvert0.html to Fahrenheit
     -->

<html xmlns = "http://www.w3.org/1999/xhtml">

  <head>
    <title> Temperature converter </title>
  </head>
  <body>
    <p>
      <%

// Get the Celsius temperature from the form 

         String strCtemp = request.getParameter("ctemp");
         float ftemp;

// convert the value to Fahrenheit

         ftemp = 1.8f * Integer.parseInt(strCtemp) + 32.0f;
      %>
<!-- Use an expression to display the value of the 
     Fahrenheit temperature -->

     Fahrenheit temperature:

     <%= ftemp %>
  </body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?