Javascript

第一次jsp

本文主要是介绍第一次jsp,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

1.

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  </head>
  <body>
    Hello! <br>
  </body>
</html>

  2.英文字母表

<%@ 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>

  </head>
  
  <body>
     <p>英文字母:</p>
    <% 
    for(char a='A';a<='Z';a++){
             out.print(a+"("+(char)(a+32)+")"+"  ");
    }      
    %>
    
    <br>
  </body>
</html>

  3.99乘法表

<%@ 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>


  </head>
  
  <body>
      <p>九九乘法表:<p/>
    <%
    for(int j=1;j<=9;j++){
    for(int i=1;i<=j;i++){
    int n=i*j;
    out.print(i+"x"+j+"="+n+" ");
    }
    out.print("<br>");
    } 
     %>
    
    
    
   <br>
  </body>
</html>

  

这篇关于第一次jsp的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!