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?

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
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
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
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
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
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
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
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
servlet code - JSP-Servlet
servlet code  Create a servlet to develop a login application with javascript clientside validations and serverside validations
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
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
java code for swaping two number
java code for swaping two number  how to code for swaping two number without taking third variables
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 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,ADS_TO_REPLACE_1 we can find the total number of rows in a table using
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...;Number of Rows present in table : "+count); /* Here sql query find
servlet code to update password?
servlet code to update password?  Create a servlet page which helps the user to update his password. The user should give the username,old password... users.then Store it into a table. please tell me the code for the above question
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
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... operator. So output result will be like fact=fact*i. Here is the code
Searching for Code - JSP-Servlet
JSP, Servlet Searching for Code  Hi, i am looking for a jsp servlet code examples for the search function in my application.Thanks
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
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
code - Servlet Interview Questions
by the servlet container. The status code of the response always should...code  servlet service method along with an example code  Hi Friend, Servlet service() method: Once the servlet starts getting
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
atm code in servlet& jsp
atm code in servlet& jsp  pls send me the code of ATM project in servlet jsp . my requirements are first of all an user login window open then balance enquiry, withdraw of money, money transfer, then log out. pls send as early
code required in servlet
code required in servlet  hello... you provided me the answer with javascript.. i want to check which button is clicked in the servlet.. i have only 1 servlet an in that separate codes for different button clicks.. can u plzzz
servlet code problem - JSP-Servlet
servlet code problem  This is my JSP code index.jsp Sync... here!!!..., i want to pass the texbox value and file to servlet im stuck with this error plzz help me..., in servlet if i use request.getParameter() its
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
Encryption code - JSP-Servlet
Encryption code  Iam developing a web security application for that reason i need a code of encryption in servlet. Can u please send it to me.Its very urgent Because my project delivery date is very near
servlet code problem - JSP-Servlet
servlet code problem  This is my JSP code index.jsp Sync Data Sync Data Please use the following input box to upload file or enter... to servlet im stuck with this error plzz help me..., thanks in advance....  
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
Help in completing Servlet code!
Help in completing Servlet code!  Complete the following Servlet codes to store the information read from the input form to session object. public... String comment = req.getParameter(?commentText?); //Complete the code to store
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..,   
code for JSP and Servlet - JSP-Servlet
code for JSP and Servlet  i have to create a jsp page that contains username and password, so how to code servlet according to it?  Hi sushil, package javacode; import java.io.*; import javax.servlet.*; import
jsp code - JSP-Servlet
jsp code  in a jsp a table is existed ,in table each row contain one checkbox and name and desription how to delete specific rows in a table .  Hi Friend, Try the following code: 1)form.jsp: Name
jsp code - JSP-Servlet
jsp code  in my table there are 3 fields named orderid ,itemname, itemqty. i want code that fetch orderid in dropdown... on select dropdown get table of item details of that orderid... there are multiple items at one orderid
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
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
servlet code - Applet
servlet code  how to communicate between applet and servlet  Hi Friend, We are providing you the code that will display the message sent from the servlet to applet. Here is the code of 'ServletExample.java
Code - JSP-Servlet
Code  Using servlet,JSP,JDBC and XML create a Web application for a courrier company to provide online help in tracking the delivery status of items
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
java servlet code - Servlet Interview Questions
java servlet code  iam doing a project in java, preparation of on line examination in that how to prepare a question paper using servlet code
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
jsp code - JSP-Servlet
the second drop down list is displayed from mysql data base table by using select statement? pls provide code how to get first selected drop down list value..., Try the following code: function city(){ var cid

Ads