Price: 35,000 Gs
final int age;
final float a, b, c;
final
double size = 1.72;
final boolean a = true, b = false, c = false;
/ / this is a one line comment
/ * this is a comment
several lines * /
/ **
this is a comment that comes in the javadoc documentation
* /
b = 0;
short a =- 100, b = 200;
int a =- 3000;
int b = 558;
long a = 2505L, / * indicates that the constant 2505 is long * /
long b = 13;
long c = 0xd / * hexadecimal value equivalent to 13 in decimal * /
float a = 2.5478;
float b = 254.78e-2;
/ / value of b is equal to the value of a
float c = 4/5f;
/ / with f indicate 5 which is a float, it is necessary to indicate
/ / that at least one of the two values \u200b\u200bof the division is
/ / a float, otherwise, the result will not be the expected * /
float d = 4f / 5;
/ * gives the same result as above * /
a = 4.5478;
double b = 4.5478D;
double c = 3D / 4;
double d = 3/4D;
boolean a = true;
boolean b = false;
/ / variables declared to below have the same value. AKEY
char = 'a';
AKEY char = 97, / * letter 'a' in decimal (ASCII) * / char
AKEY = 0x0061, / * letter 'a' in hexadecimal * /
\u0026lt;% @ page contentType = "text / html" pageEncoding = "UTF-8"%>
\u0026lt;! DOCTYPE HTML PUBLIC "- / / W3C / / DTD HTML 4.01 Transitional / / EN"
"http://www.w3.org/TR/html4/loose.dtd">
\u0026lt;html>
\u0026lt;head>
\u0026lt;meta http-equiv = "Content-Type" content = "text / html; charset = UTF-8">
\u0026lt;title> Send your opinion \u0026lt;/ title>
\u0026lt;/ head>
\u0026lt;body>
\u0026lt;h2> Please send us your opinion about web site \u0026lt;/ h2>
\u0026lt;form method="post"> action="ServletOpinion"
\u0026lt;p> Name: \u0026lt;input type="text" name="name" size="15"/> , \u0026lt;/ p>
\u0026lt;p> Surname: \u0026lt;input type="text" name="apellidos" size="30"/> \u0026lt;/ p> Opinion
which has earned this website
\u0026lt;input type="radio"
\u0026lt;p> checked name="opinion" value="buena"/> Good
\u0026lt;input type = "radio" name = " opinion "value =" regular "/> \u0026lt;input type="radio"
Regular Mala name="opinion" value="mala"/>
\u0026lt;/ p>
Comments
\u0026lt;p>
\u0026lt; ; textarea name = "comments" rows = "6" cols = "40"> \u0026lt;/ textarea>
\u0026lt;/ p> \u0026lt;input type="submit"
name="botonEnviar" value="Enviar">
\u0026lt;input type="reset" name="botonLimpiar" value="Limpiar">
\u0026lt;/ form>
\u0026lt;/ body>
\u0026lt;/ html>
mypackage package;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet. http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
ServletOpinion
public class extends HttpServlet {
/ / Declaration for
member variables / / form fields
private String name = null;
private String surname = null;
private String review = null;
private String comments = null;
protected void processRequest (HttpServletRequest request, HttpServletResponse response) throws ServletException
,
IOException {response.setContentType ("text / html; charset = UTF-8");
/ / Obtaining the values \u200b\u200bof the object form travez
req name = request.getParameter ("name");
surname = request.getParameter ("surname");
opinion = request.getParameter ("opinion");
feedback = request.getParameter ("comments");
PrintWriter out = response.getWriter
();
try {out.println ("\u0026lt;html>");
out.println ("\u0026lt;head>");
out.println ("\u0026lt;title> Securities listed on Form \u0026lt;/ title>");
out.println ("\u0026lt;/ head>");
out.println ("\u0026lt;body>");
out.println ("Securities listed on the form \u0026lt;h1> \u0026lt;/ h1>");
out.println ("Name \u0026lt;p> \u0026lt; ; / b> "+ name +" \u0026lt;/ p> ");
out.println (" Last \u0026lt;p> : \u0026lt;/ B> "+ surname +" \u0026lt;/ p> ");
out.println (" \u0026lt;p> Opinion: \u0026lt;/ b> "+ opinion +" \u0026lt;/ p> ") ;
out.println ("\u0026lt;p> Comments: \u0026lt;/ b>" + comment + "\u0026lt;/ p>");
out.println ("\u0026lt;/ body>");
out . println ("\u0026lt;/ html>");
} finally {out.close ();
}}
@ Override protected void doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException
,
IOException {processRequest (request, response);}
@ Override protected void doPost (HttpServletRequest request, HttpServletResponse response) throws ServletException
,
IOException {processRequest (request, response);}
@ Override public String
getServletInfo () {
return "This servlet reads data from a form" +
"and displays"}
}
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>ServletOpinion</servlet-name>
\u0026lt;servlet-class> mipaquete.ServletOpinion \u0026lt;/ servlet-class>
\u0026lt;/ servlet>
\u0026lt;servlet-mapping>
\u0026lt;servlet-name> ServletOpinion \u0026lt;/ servlet-name>
\u0026lt;url-pattern> / ServletOpinion \u0026lt;/ url-pattern>
\u0026lt;/ servlet-mapping>
\u0026lt;session-config>
\u0026lt;session-timeout>
30 \u0026lt;/ session-timeout>
\u0026lt;/ session-config>
\u0026lt; ; welcome-file-list> \u0026lt;welcome-file>
index.jsp \u0026lt;/ welcome-file>
\u0026lt;/ welcome-file-list>
\u0026lt;/ web-app>