Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using Servlet technology Developing dynamic web page Reading HTML form data usin

ID: 3616087 • Letter: U

Question

Using Servlet technology Developing dynamic web page Reading HTML form data using servLet technology Dispatching request to another servlet Processing HTML form data and sending response back to client Guidelines Code should be properly aligned and well commented. Follow Java rules while writing variables names, function names etc We are required to write a small Conversion web application using HTML, servlet technology and request dispatching technique. This application contains one html file (index.html) and two servlet (.Java) files. From indexJitml file, user will enter a number hi text field and select its option from drop down list and the result will be displayed to the user. First Servlet: The first servlet must implement following functionalities Reading HTML form data Implement business logic (such as conversion of weight and temperature) Dispatching request to another servlet Second Servlet: The second servlet must implement the following functionality Displaying the result of first servlet on second servlet When user will enter the weight hi text field and select its option from the drop-down list men result will be displayed to the user as shown in the figure below.

Explanation / Answer

package name thepakage;

import java.io.*;

public class done implements Serializable{

private double weightText;

private double weightddl;

private double temperatureText;

private double temperatureddl;

private double weight;

private double temperature;

public done() {

weightText = 0;

weightddl = 0;

temperatureText = 0;

temperatureddl=0;

weight=0;

temperature=0;

}

public void setweightText(double n){

weightText = n;

}

public void setweightddl(double n){

weightddl = n;

}

public void settemperatureText(double n){

temperatureText = n;

}

public void settemperatureddl(double n){

temperatureddl = n;

}

public double getweight( ){

return weight;

}

public double gettemperature( ){

return temperature;

}

public void calculateWeight() {

if(weightddl==0)

{

weight = weightText*1000;

}

else if(weightddl==1)

{

weight = weightText/1000;

}

}

public void calculateTemperature() {

if(temperatureddl==0)

{

temperature = ( 9*temperatureText/5 +32);

}

else if(temperatureddl==1)

{

temperature = 5 * (temperatureText - 32) /9;

}

}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote