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

 
 


hari prasad reddy
servlet code for finding the table for given number
1 Answer(s)      9 months ago
Posted in : JSP-Servlet

servlet code for finding the table for given number?

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 Pages:
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
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
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
Finding Average in JSP
number of elements.   The code of the program is given below:       <HTML> <HEAD> <TITLE>Finding...Finding Average in JSP      
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
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
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 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
Using JSTL For Finding Square
in the attribute end. The code of the program is given below:    ...Using JSTL For Finding Square     ... to finding out the square is the JSTL.  We are using the <c:forEach> core
Uploading an image into the table - JSP-Servlet
into the table in java  Hi friend, Code to help in solving the problem... number and database name. Here machine name id localhost and database name..."; /*declare a resultSet that works as a table resulted by execute a specified
Getting Number of Rows
the number of rows in the particular database table without touching our database. As we... on the browser. To get the number of rows from the database table there is a need... the number of rows from the database table inside the executeQuery() method
Getting Number of Columns
on the browser. To get the number of columns from the database table there is a need... interface. The number of columns in the databasd table will be retrieved... on the browser by the PrintWriter object. The code of the program is given below
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
Midpoint of two number
; The code of the program is given below:       <...Midpoint of two number      ... important to find the number that is exactly between two numbers. In this example
Finding a Factorial using while loop
Finding a Factorial using while loop     ... the while loop. In while loop the loop will run until the condition we have given... find a factorial of a number by using the temp variable which will help us
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
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 : 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 the eigenvalues and eigenvector of n*n matrix in java
finding the eigenvalues and eigenvector of n*n matrix in java  Here is my code: /** * Jacobi eigenvalue algorithm */ public class Jacobi... icmax = 10; // the maximum iterations number int[] colRowOfElMax = new int[size
jsp code - JSP-Servlet
colums are there... first colum shows one number , second colum shows second number and third colum shows sum of that 2 colum... and also want sum of all third colum.  Hi Friend, Try the following code: Add/Remove
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
JSP Code - JSP-Servlet
For the above code,we have created a table 'student'. CREATE TABLE `student...JSP Code  Hi, I have a problem in limiting the number of row display in the table. For example, if i have 1000 records in my table & want
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
Count number of "*"
Count number of "*"  I have this code to count the number of * from a string entered. but I need to find it from an text file. Any idea? import...++; } } System.out.println("The number of vowels in the given sentence
Finding start and end index of string using Regular expression
Finding start and end index of string using Regular expression... the way for finding start and end index of the string using regular expression. For this we are going to make program named Finding_index.java. The steps involved
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
coding for given question
coding for given question  Board of Control for Cricket in India... and above. The number of matches played is calculated by the number of digits... of best bowlers among the given lot. Input/Output Specs Input Specs Your program
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
servlet code - JSP-Servlet
servlet code  how to implement paging or pagination in java code using servlets.  Hi Friend, Try the following code: import java.io.... code, we have used following database table: CREATE TABLE `student
Count Rows from a Database Table
: SELECT COUNT(*) FROM table_name; This code is used to count the rows of given... to know number of rows in a table then we can get it very easily by using the simple... need to pass a table name from the given database in the query and the rows
Finding Lost Frames - Java tutorial
Finding Lost Frames 2001-05-10 The Java Specialists' Newsletter [Issue 019] - Finding Lost Frames Author: Dr. Heinz M. Kabutz If you are reading... fact to the Politburo, but perhaps I've read too many spy stories. Finding
Create a Table in Mysql database through SQL Query in JSP
; This is detailed java code to connect a jsp page to mysql database and create a table of given...; in the directory Tomcat-6.0.16/webapps/user/. This jsp code creates table of specified name... Create a Table in Mysql database through SQL Query in JSP
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
Find out the prime number
to find out whether a given number is prime or not. Here we have used the 'for loop' statement and given the required condition for a prime number. As we know... an integer 'i' as the integer other than 1 and the given number. That means, i>
JSTL - check odd/even number - JSP-Servlet
"this is an even (odd) number and it is in between so and so number? e.g. the random number is 4. It is an even number between 3 and 5. Much thanks all!  Hi Friend, Try the following code: Random Number: Random number
Java: Some problems in given condition
Java: Some problems in given condition   SIR, I want to get the values from the table( database), if any one of the column of the table value is 0...||att.getdata2()==0) If I use this code in Java.I am facing NullPointerException
jsp code - JSP-Servlet
jsp code  Can anyone help me in writing jsp/servlet code to retrieve files and display in the browser from a given directory.  Hi Friend, Try the following code: Thanks
Java file number of lines
Java file number of lines In this section, you will learn how to count the number of lines from the given file. Description of code: Java has provide... the lines from the file. You can see in the given example, we have created
Number Format Example
. In the code given below we are formatting number according to the locale... Number Format Example     ... number formats. NumberFormat.format() : This method returns a format string
generating time table - JSP-Servlet
..the code should be in jsp/servlet.. so please help me friends
Prime Number in Java
Prime Number in Java       This Java programming tutorial, we will be read how to get prime number between 1 to given number. First of all we have to define a class "
Getting Column Names from a database table in Java
with code that retrieves all columns name in a specific database table. Sometimes... and number of columns of specified table with the help of some APIs and methods... Getting Column Names from a database table in Java  
Table
Table  How i generate table in showMessageDialog. I want that i creat a table and run in showMessageDialogeprint("cprint("code sample");ode sample
display of colors in a table - JSP-Servlet
display of colors in a table  Hi, If i have a table of 4 by 4 boxes, numbering from 1-16 in sequence, how do i make them display one column of one..., Try the following jsp code: table.jsp: Column1,Row1
Table
Table  How I generate table in showMessageDialog. E.g 3X1=3 3X2=6 3X3=9print("code sample
Table
Table  How i generate table in JOptionpane.showMessageDialog with simple code. I dont know that what is result, buffer etc. U make a program using advance coding but i want u make the table using JOptionpane.showMessageDialog
table?
table?  Hi, how could i make a table in javascript, which would look like this: AA CODON Number /1000 Fraction .. (this row... can't figure out, how to construct a table,with two fixed columns, one that reads
Table
Table  Why u dont understand sir?? I want to make a table program which generate a table on showMessageDialog. I have learnt these methods until now... methods to be used. Write a table program which use only and only these above methods

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.