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



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

Have Programming Question? Ask it here!
 
 
 


hari prasad reddy
servlet code for finding the table for given number
1 Answer(s)      a year and 11 months 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
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
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
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
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
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
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 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
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
2. Given a string and a number ‘n’, find the ‘n’th distinct repeating character.
2. 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 Abracadabra, 2 Abracadabra, 3
Finding A Date
Finding A Date  My Frequency Start Date is 24-08-2012 My frequency end date - not defined Calculation Frequency is Weekly(Sunday) My calculation will be from 24-08-2012 to the following sunday My question is how to find
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
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
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
generating time table - JSP-Servlet
..the code should be in jsp/servlet.. so please help me friends
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
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
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
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
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
MySQL take backup of a table - example code needed
MySQL take backup of a table - example code needed  How to take backup of a table in MySQL? I have a database which contains many tables. What is the command to take the backup of one table with data from database? Thanks
jsp code - JSP-Servlet
jsp code  how to write a code in jsp with out using servelts finding sum and avg of 40 numbers  Hi Friend, Try the following code: Thanks  Hi Friend, Do one change in the provided code.As we
How to make auto number? - JSP-Servlet
How to make auto number?  Dear, my friend... I really need your help.... I want to ask you, how to make auto number in mysql database... number 08 = month (august) 09 = year If system of date change
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
Validating Number Very Urgent - JSP-Servlet
Validating Number Very Urgent  Respected Sir/Madam, I am R.Ragavendran.. I want u to insert the coding for validating number in the place of Emp ID text box.. I am sending the code for your kind reference which tends you
How create auto number? - JSP-Servlet
How create auto number?  Dear, my friend... I really need your help.... I want to ask you, how to make auto number in mysql database... number 08 = month (august) 09 = year If system of date change to be next
 

 

 

DMCA.com