Tabuada controlada em JSP

Description

Tabuada em JSP com get e controle if else.
Gabriel Rocha
Note by Gabriel Rocha, updated more than 1 year ago
Gabriel Rocha
Created by Gabriel Rocha over 6 years ago
154
0

Resource summary

Page 1

Primeiro um formulário básico <html>     <head>         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">         <title>JSP Page</title>     </head>     <body>         <h1>Tabuada</h1>         <form action="tabuada.jsp">      Insira um número:<br>     <input type="text" name="num" placeholder="número">   <br>  <br><br>   <input type="submit" value="Submit">     </body> </html>   Depois um get com a ação controlada ( O usuário só pode inserir valores menores ou iguais a 10) <html>     <head>         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">         <title>JSP Page</title>     </head>     <body>         <h1>Resultado</h1>         <%          String n1 = request.getParameter("num");         int n;          n = Integer.parseInt(n1);         %>          <%              if (n <=10){                 for (int i=1;i<=10;i++)                     out.println(n +"*"+i + " = " + n*i+"<br><br>");                   }                 else{                        out.print("Valor não disponível");                         }                               %>     </body> </html>

Show full summary Hide full summary

Similar

Programação
Prepara Palhoça
Sequência  fibonacci
Gabriel Rocha
Servlet com jsp e classes java
Gabriel Rocha
ORIGAMID - Web Design
Guilherme Giorgi
Maior valor
Gabriel Rocha
Desenv. Paginas Padrão Web
silviacunha.m
Curso AlgaWorks - Angular, Rest,SpringBoot
Carlos Eduardo De Barros Souza
Oracle Certified Java Associate 7
Rafael Mulock
O.Objetos Java
Lorran Alves