Get em jsp

Description

Get simples em jsp
Gabriel Rocha
Note by Gabriel Rocha, updated more than 1 year ago
Gabriel Rocha
Created by Gabriel Rocha over 6 years ago
4
0

Resource summary

Page 1

Primeiro vem o arquivo jsp com o formulário   <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html>     <head>         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">         <title>JSP Page</title>     </head>     <body>         <form action="newjsp1.jsp">             Nome:<br>             <input type="text" name="name" placeholder="insira">             <br>             Sobrenome:<br>             <input type="text" name="last" placeholder="insira">             <br>              Qual é a melhor série do mundo?<br>             <input type="text" name="serie" placeholder="insira"><br>             <input type="submit" value="Submit">                      </form>      </body> </html>   Depois vem o get das informações   <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html>     <head>         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">         <title>JSP Page</title>     </head>     <body>         <h1>Resultado</h1>                  <% String nome = request.getParameter("name");             String sobrenome = request.getParameter("last");             String serie = request.getParameter("serie");             %>             <%=(nome)                      %>                      <%=(sobrenome)                      %><br>                     <% if (nome == "Gabriel"){                     out.print("Você é o gabriel");                     }else{                     out.print("Seu nome é diferente"+"<br>");                             }                                       if ( (serie.equals("game of thrones")) || (serie.equals("Game of thrones")) ){                         out.print("<br>"+"<br>"+"Você escolheu Game of thrones e está mais do que correta"+"<br>");                     }                     else                     {                         out.print("<br>"+"Você escolheu "+serie+" e não está certo." );} %>     </body> </html>

Show full summary Hide full summary

Similar

Tabuada controlada em JSP
Gabriel Rocha
Sequência  fibonacci
Gabriel Rocha
Maior valor
Gabriel Rocha
Servlet com jsp e classes java
Gabriel Rocha
Nouns & Definite Articles Notes
Selam H
3. The Bolshevik's Seizure of Power
ShreyaDas
Data Structures & Algorithms
Reuben Caruana
Frankenstein by Mary Shelley
nina.stuer14
A-level Psychology Key Terms & Definitions
Andrea Leyden
Maths GCSE - What to revise!
livvy_hurrell
GENERAL PRACTICE-1
Luis Felipe Chávez Choque