Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet servlet code for finding the table for given number
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


hari prasad reddy
servlet code for finding the table for given number
1 Answer(s)      2 years and a month ago
Posted in : JSP-Servlet


servlet code for finding the table for given number?


Advertisement
View Answers

August 16, 2012 at 12:56 PM


Here is a an example that accepts a number from the user and display its multiplication table using servlet.

1)table.html

<html>
<body>
<form method="get" action="../TableServlet">
<table>
<tr><td>Enter a number to find its table:</td><td><input type="text" name="text1"/></td></tr>
<tr><td></td><td><input type="submit" value="ok"/></td></tr>
</table>
</form>
</body>
</html>

2)TableServlet.java

package simpleServletExample;

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;

public class FactorialServlet extends HttpServlet {

public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
int num = Integer.parseInt(request.getParameter("text1"));
for(int i=1;i<=10;i++){
    int t=num*i;
out.println(t+"<br>");
}
}
}


Related Tutorials/Questions & Answers:
servlet code for finding the table for given number
servlet code for finding the table for given number  servlet code for finding the table for given number?   Here is a an example that accepts a number from the user and display its multiplication table using servlet. 1
finding divisors of a number
finding divisors of a number   write a c program to input a number and print all its divisors using while loop
Advertisements
finding divisors of a number
finding divisors of a number   write a c program to input a number and print all its divisors using while loop
finding divisors of a number
finding divisors of a number   write a c program to input a number and print all its divisors using while loop
finding java code on internet
finding java code on internet  Is there anybody to help me? i want to some java coding web sites.it is prerequest for me
Finding the longest word in a user given string
Finding the longest word in a user given string  In java, accept a string from the user and find the longest word in it.   The given code finds the longest word from the string. import java.util.*; class LongestWord
how to write a function to print for finding the longest palindrome in the given string
how to write a function to print for finding the longest palindrome in the given string  how to write a function to print for finding the longest palindrome in the given string
Location finding error - JSP-Servlet
Location finding error  Location needs from drive name: My file uploading program has an error. It requires the location should be given from the directory name. Instead of this if only parent directory is given it shows
program on factorial of a given number in java
program on factorial of a given number in java  please tell me, how to write program on factorial of a given number in java
program on factorial of a given number in java
program on factorial of a given number in java  please tell me, how to write program on factorial of a given number in java
Preparing table of a number by using loop
of preparing the table of a given number by using loop condition. As we know the loop... Preparing table of a number by using loop   ...; Here we will take a number a=25 of which we have to prepare a table. Define
i need a java code for finding typemismatch in an editor.
i need a java code for finding typemismatch in an editor.  hi im sriram, i need a java code in such a way that typemismatch code is embedded with the simple java editor. the sample output is shown below !alt text
java code for given query
java code for given query  i am not able to display to display graph in all browsers it is only displaying in ie using java
jsp code for dynamic time table generation - JSP-Servlet
jsp code for dynamic time table generation  hi I am doing my academic project college automation. I want to generate time table dynamically... For the above code, we have created three database tables 1)btech: CREATE TABLE
Java : Square root of any number
Java : Square root of any number In this section we will write code for finding square root of any number without using system methods. Square root : It is number when we square it, find the specified number. There is simplest way
Finding a given word using regular expression
Finding a given word using regular expression  ... a given word from the String and also the no of times the word exists using regular... the given regular expression into a pattern. Matcher matcher = pattern.matcher(text
Write a program to find a factorial in any given number
Write a program to find a factorial in any given number This programming tutorial will teach you how to write a factorial of any given number... the factorial of any given number import java.util.Scanner; class
Write a program to calculate factorial of any given number
given number      ... program to calculate factorial of any given number. First of all define a class... result will be like fact=fact*i. Here is the code of the program
Write a query to find the total number of rows in a table
Write a query to find the total number of rows in a table  Write a query to find the total number of rows in a table?   Hi, Here is the answer, we can find the total number of rows in a table using following query
Delete row and column from table through java code
will see how to delete row and column from given table through java code. Java code... Delete row and column from table through java code... execute specified sql query. Here this query checks number of rows present in table
java code for swaping two number
java code for swaping two number  how to code for swaping two number without taking third variables
finding the prime numbers
finding the prime numbers  Hi, I am a beginner to java and I have problem with the code in finding the prime numbers, can someone tell me about the problem. Thanks.   Want to know about how to find out the given
I determine where a given table is referenced via foreign keys.
I determine where a given table is referenced via foreign keys.  How can I determine where a given table is referenced via foreign keys
Probability Vs. Number of people table - Java Beginners
loops we need to create a program that will show the table: probability vs. number of people. The table will display the minimum number of people that would...Probability Vs. Number of people table  The probability that at least
Please provide the java code for the given program.
Please provide the java code for the given program.   We need an application for managing an educational institute. That application should provide the details of Students Courses Faculty Fee details etc..,   
JSP phone number - JSP-Servlet
JSP phone number  Hi! when i am trying to insert phone number in dbase. Only 9 numbers are inserting. i have given data type as numeric(11,0). I have tried with numeric(12,0). but no use if i give 9 numbers it is going to insert
MySQLselect into new table Example code
. Then follow the steps given below: First of create a table table2 with the same...MySQLselect into new table Example code  Hi, I have a big table in MySQL database and I want to create a new table with all the data in it. I have
How can we know the number of days between two given dates using PHP?
How can we know the number of days between two given dates using PHP?  How can we know the number of days between two given dates using PHP
To download a website from a given url. - JSP-Servlet
To download a website from a given url.  write a program to download a website from a given URL.it must download all the pages from that website.it should take the depth of retrieval from user input.all the files pages must
servlet code
servlet code  how to implement insert update n delete in one servlet in net beans   If you want to perform insert, update and delete functions in the same servlet, then please visit the following links: http
plz give me program to this: Given a string and a number ‘n’, find the ‘n’th distinct repeating character.
plz give me program to this: Given a string and a number ?n?, find the ?n?th distinct repeating character.    Given a string and a number ?n?, find the ?n?th distinct repeating character. For example, Input: Abracadabra, 1
 

 

 

DMCA.com