Simple Program in JSP For Generating Multiplication Tables Between Two Numbers. | I'M FROSTY

HTML Image

IMFROSTY

Whats Hot ?

This Domain Name is for Sale !! Please contact Admin : pandyanhardik@gmail.com, If you are interested to buy it..

Simple Program in JSP For Generating Multiplication Tables Between Two Numbers.

Before We create Multiplication Tables in JSP, we believe you already know little about it and how to execute JSP files, well It's combination of HTML and Java, where HTML is used for Displaying content and different logic is written in java. JSP is also known as Javaserver Pages. If you don't know anything regarding JSP still no worries, soon we are planning to put JSP Tutorials here on IMFROSTY so stay tuned.

Here we are going to create 2 JSP files named "Table1.jsp" and "Table.jsp" you can simply use notepad for it and save it on Apache Tomcat Directory and call it using any web browsers like Google Chrome, Firefox etc. We do not need to compile JSP files unlike Servlet, JSP files are auto executable. I'm using "jakarta-tomcat-4.1.12" for executing it. you may also checkout YouTube tutorial videos on how to run JSP using Apache Tomcat.

Multiplication Table JSP Program | IMFROSTY


On first page we are going to take input from user, that will be range in between 2 numbers, we want to generate Multiplication tables. 

Write below code on Table1.jsp

<html>
<body>
<h2>Enter Any 2 Numbers !!</h2>
<form action="Table2.jsp" method="post">
First No: <input type="text" name="fno"><br>
Second No: <input type="text" name="sno"><br>
<input type="submit" value="Show Tables">
</form>
<h5>IMFROSTY.COM</h5>
</body>
</html>


OUTPUT

Write Below Code in Table2.jsp

<html>
<body>
<%
int num1=Integer.parseInt(request.getParameter("fno"));
int num2=Integer.parseInt(request.getParameter("sno"));
int range=0;%>

<table cellpadding=0 cellspacing=0 align='center' bgcolor='yellow' width=70% >
<%
try
{
for (int j = 1; j <= 10; j++) {

%><tr><th>|</th><%

for (range = num1; range <= num2; range++) { %><td align='center'><%

out.println(range);
%></td><td align='center'><%

out.println("*");
%></td><td align='center'><%

out.println(j);
%></td><td align='center'><%

out.println(" = ");
%></td><td align='center'><%

out.println(range * j);
%><th>|</th><%
}
%></tr><%

}

}
catch(Exception e)
{
out.println("Error");
}
%>
</table>
<h5><center>IMFROSTY.COM</center></h5>

</body>
</html>

OUTPUT



Simple Program in JSP For Generating Multiplication Tables Between Two Numbers. Reviewed by Hardik Pandya on 10:44:00 PM Rating: 5

1 comment:

  1. "Great blog created by you. I read your blog, its best and useful information. You have done a great work. Super blogging and keep it up.php jobs in hyderabad.
    "

    ReplyDelete

All Rights Reserved by I'M FROSTY © 2014 - 2017
*The Content Is Copyrighted To & May Not Be Copied / Republished.

Biểu mẫu liên hệ

Name

Email *

Message *

Powered by Blogger.