Make a class named main.java

Assignment Help JAVA Programming
Reference no: EM13768512

Make a class named Main.java after through the following steps. From step: 10 is related to your Main.java. Copy/paste your Main.java under the word:

1. Make an empty folder for eclipse.

2. Make a server (Tomcat v7.0 Server).

3. Make a dynamic project named: Project

4. Make an html document in eclipse named: Main.html.

5. Replace the content of Main.html by the following:

<<!-- Main.html. Do not change this html document -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>To display name and age</title>
</head>
<body>
<form action="https://localhost:8080/Project/Main" method = "get">
Enter Your Name: <input type="text" name="yourName"><br>
Enter Your Age&nbsp;&nbsp;&nbsp;&nbsp;:<input type="text" name="yourAge"><br>
<input type="submit" value="Click to submit">
</form>
</body>
</html>

6. Make a servlet named: Main.java.
7. Replace the class Main.java by the following.
Note: Only replace the class Main.java. Everything else is intact.

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.util.Enumeration;

@WebServlet("/Main")
public class Main extends HttpServlet {
private static final long serialVersionUID = 1L;
public Main() {
super();
}
protected void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
Enumeration<String> names = request.getParameterNames();
String name = (String)names.nextElement();
String value = request.getParameter(name);
String name2 = (String)names.nextElement();
String value2 = request.getParameter(name2);
System.out.println(value + " " + value2);
}
}

Reference no: EM13768512

Questions Cloud

Write an analysis essay on challenging veteran stereotypes : Write an Analysis Essay on Challenging Veteran Stereotypes by Ken Harbaugh. Introdation: Text, audie nce, purpose, genre, context, kairos. Thesis statement, effective or not?
The elimination of the domestic currency : Dollarization is when residents of a foreign country use the U.S. dollar alongside or instead of the domestic currency
Describe the flow of resources from one entity to another : Describe how each of these activities affects government, households, and businesses. Describe the flow of resources from one entity to another for each activity. Relate at least one current event to the activities.
Biology should be applied to a criminal investigation : Provide 2 significantly different examples where forensic biology should be applied to a criminal investigation. Justify your examples
Make a class named main.java : Make a class named Main.java after through the following steps. From step: 10 is related to your Main.java. Copy/paste your Main.java under the word:
By using r code : By using R code, Data on last year's sales ( y, in 100,000s of dollars) in 15 sales districts are given in the file sales. This file also contains promotional expenditures(x1, in thousands of dollars), the number of active accounts(x2), the number of..
Create a scenario in which you explain the overall manner : Create a scenario in which you explain the overall manner in which these functions interact. Justify your response with examples.
Research the affordable care act : Using the internet, research the Affordable Care Act. Summarize the intent of the law, as well as some of the controversy surrounding it. Specify how your state has adapted to this new policy
Differences between a t test and an f test : Explain the differences between a "t" test and an "F" test. In other words, under what circumstances, would a researcher uses the F test over the t test

Reviews

Write a Review

JAVA Programming Questions & Answers

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Construct 4 instances of your instrument

Create a Java test class that simulates using your MusicalInstrument class.  In your test class you should at a minimum construct 4 instances of your instrument,

  Typical industrial engineering problem

A company manufactures two products, A and B. Product A can be sold for $145 per unit and B for $75 per unit. Management requires that at least 1850 units be manufactured each month.

  Define output operators for clock and travelclock

Define output operators for Clock and TravelClock. Modify the classes Clock and TravelClock to declare the output operators as friends.

  Create a project in eclipse

Create a new project

  Consider a company that wants to keep track of its employees

Consider a company that wants to keep track of its employees, their positions and their telephone numbers. Your development team has developed a simple prototype using the Java code found in EmployeeDirectory.zip.

  How to apply filter in servlet

Can you do this assignment please help int this how to apply filter in servlet create 3 class and show the filter chaining phenomenon..... Show the working program thanks.............

  Java test program

Write a Java test program, all your code should be in the main method, that determines what type of organization is indicated by a web address. Your program should allow the user to enter a web address

  Write a java class

Write a Java class called PQueue that extends the provided abstract QueueADT class.

  Creation of classes and objects

Introduction of programming using the Java language. The foundation of object-oriented programming will be th topic here. This will include creation of classes and objects, object responsibilities and characteristics, and UML class diagrams

  Write a class named month

Write a class named Month. The class should have an int field named monthNumber that holds the number of the month.

  Project socket programming - udp objectives - learn socket

project socket programming - udp objectives - learn socket programming in java udp-nbsp cement your understanding of

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd