calling web page accroding to if statement

calling web page accroding to if statement

View Answers

October 27, 2009 at 12:17 PM

Hi Friend,

Try it:
1)cal.jsp:

<%@page language="java"%>
<html>
<form method="post" action="calculate.jsp">
<table>
<tr><td>Enter Number1</td><td><input type="text" name="text1"></td></tr>
<tr><td>Enter Number2</td><td><input type="text" name="text2"></td></tr>
<tr><td><input type="submit"value="Submit"></td></tr>
</table>
</form>
</html>

2)calculate.jsp:
<%
String s1=request.getParameter("text1");
String s2=request.getParameter("text2");
int num1=Integer.parseInt(s1);
int num2=Integer.parseInt(s2);
int answer=num1-num2;
System.out.println(answer);
if(answer==1){
%>
<%@include file="webpage1.jsp"%>
<%
}
else if(answer==2){
%>
<%@include file="webpage2.jsp"%>
<%}
else if(answer==3){
%>
<%@include file="webpage2.jsp"%>
<%}
%>

Thanks









Related Tutorials/Questions & Answers:
calling web page accroding to if statement - JSP-Interview Questions
calling web page accroding to if statement  Dear, Please i have... the web page1 by include else if answer = '2' I want to call the web page1 by include else if answer = '3' I want to call the web
calling a web page when pressing on a Button - JSP-Interview Questions
calling a web page when pressing on a Button  Please perhaps I do... and Update. When the user clicks on a button View, I call a web page When the user clicks on a Button Print, I call another web page, When the user clicks on Update
Advertisements
Implement Java clients calling Web Services
Implement Java clients calling Web... clients calling Web Services Generating a Java client proxy and a sample... The Web Service Client wizard assists you
Calling a jsp page from Servlet
Calling a jsp page from Servlet  How can I do this? Suppose I have jsp page aaa.jsp. From aaa.jsp on form action I have made a call to a servlet... List and data is being retrieve. Now I want to pass this List to another jsp page
calling one jsp from another jsp page
calling one jsp from another jsp page  need coding for calling one jsp from another jsp including the xml file.Its urgent
calling one jap page from another jsp page
calling one jap page from another jsp page  i created a button in one jsp page i need to call another jsp page as an action to that button. so how can i call.. plz any one explain. its urgent
calling a javascript function by passing multiple values from applet in web application
calling a javascript function by passing multiple values from applet in web application  Hi all, I have a requirement like this, I have to call a javascript function from JApplet by passing 3 values. I am new to Applets
How to use 'if' statement in jsp page?
How to use 'if' statement in jsp page?  ... how to use 'if' statement in jsp page. This statement is used to test conditions. You can understand use of this statement by a real world example. Suppose
web page
web page  1.Create a web page with the following using HTML i) To embed an image map in a web page ii) To fix the hot spots iii) Show all the related information when the hot spots are clicked
WEB PAGE
WEB PAGE  How To Create A Simple web Page Of a gmail using applet
Web Page
Web Page    Use any programming language or package to create a Project 2 .The Main menu should only be displayed, if the user is valid and uses the correct password. If the user is not in the database, then the user should
Calling another web resources
Calling another web resources In this tutorial you will learn how a web component call to another web resources. There can another web resources be called... one web component to another. The requested URL locates the page
web page design
web page design  Great Applianz Ltd. was established in 1985, in New... the website to Smith, a developer. Problem Statement The management at Great Applianz.... The website should provide the following functionality: A Welcome page that gives
web service call in jsp page
,a simple example to demostrate the web service calling would be good for me... I...web service call in jsp page  I am wandering on internet for hours looking for a simple and good example on how to create a simple JSP page to call
connect a web page to a database
connect a web page to a database  how to connect a web page to a database
php web page capture
php web page capture  How to capture the history of a web page using PHP
Web Page Transaction
Web Page Transaction  Hello sir, i want to add an Effective page transaction when i go to my home page to other page in js...plllzzz help me...rppy soon
setting web page size
setting web page size  How to set the webpage size in Java
for statement
for statement  for(int i=0;i<5;i++); { system.out.println("The value of i is :"+i); } if i end for statement what will be the output   got the answer.. it displays only the last iteration that is "The value of i
create a one web page
create a one web page  create a one web page with stored values in a database
map on web page
map on web page   i want to insert an area map in my web page how can i do it ? please answer me soon. Its urgent
Web page example
Web page example  Hi, How to make sample web page? Thanks (adsbygoogle = window.adsbygoogle || []).push({});   Hi, If you are aware of HTML then you can write simple web page for your website. You have
new web page
new web page  I am creating a new web page for an user to sign up....how to give error messages if an user has not entered some fields(it can be one or many)... An example could be your webpage where you have indicated in red
web page access
web page access  I was store project in server and i will open that project file in client side add="http://server:8080/project..." this is very..." and project code = "Java Server Page" "HOW TO WRITE CODE CLIENT ACCESS SERVER
Web Page preprocessing
Web Page preprocessing  Java code to extract unique words from an XML file( has different web pages embedded inside <DOCNo>.. ) and display the unique set of words for each document. Say for example, the XML file has 49
web page reading in java
web page reading in java  i wanna read webpage in that i want to get the data from the particular tags like (,) and store into the data base...... can any body tell me the solution? plz urgnt. thanks and regards, jasti  
validation web page
validation web page  vivek i want to crate a webpage with specfic email id and password to that webpage . using jsp & servlets   Hi Friend, Try the following code:ADS_TO_REPLACE_1 <html> <script>
Sending form data from HTML page to SQLserver 2005 database by calling servlet code
Sending form data from HTML page to SQLserver 2005 database by calling servlet code  Hi sir, I would like to know how to send the form data from html page to database by calling servlet code from html page .   
Use if statement with LOOP statement
Use if statement with LOOP statement   ... if statement with LOOP statement. In this example we create a procedure display... Statement include  a declare keyword that define the variable and its data
how to add web cam in web page
how to add web cam in web page  how do i embed my webcam in web page. code for embedding web cam in web page
video calling
video calling  how to implement video calling using java? i am a final year mca student please give me some samplecodes
video calling
video calling  how to implement video calling using java? i am a final year mca student please give me some samplecodes
how to create web page on jsp?
how to create web page on jsp?  how to create web page on jsp
Bangla web page - JSP-Servlet
Bangla web page   what is the process to make a bangla web page in jee
Calling a function
Calling a function  Hi, I have a function xyz() in php code. When a button is clicked it should execute that particular function for that i have written as <form action="<?=$_SERVER['PHP_SELF'];?>" method="post">
Download Current Web Page As PDF
Download Current Web Page As PDF  Need a utility to save current web page as pdf file into specified directory... Thanks In Adv
transferring user to new web page
transferring user to new web page  How to transferring user to new web page automatically
Add music to my web page
Add music to my web page  How do I add midi music to my web page
get JavaScript onto a web page
get JavaScript onto a web page  How do we get JavaScript onto a web page
Calling Destructor
Calling Destructor  How can i call destructor in java using System.gc() or manually. Please anyone give me a example program   Java is a garbage collected language therefore you cannot predict when (or even
How to change functionlatiy in web page
How to change functionlatiy in web page  i need to change functionality of my web page..i came to know that by using collections it is possible..but i dont know how to use it...is any other way to change functionality of my web
creating web page for form registration
creating web page for form registration  I am creating web page for form registration to my department ..I have to Reprint the Application Form (i.e Download the PDf File from the Database ) , when the user gives the Application
Writing a web page to test drive each method in the web app
Writing a web page to test drive each method in the web app  I got an assignment in my university. I need to write a single web page, that lists all the classes in the particular web app. Selecting a class, the page should list
Calling Servlet to build a List of data from database and show this on the JSP page in table
Calling Servlet to build a List of data from database and show this on the JSP page in table          In this example we are calling a servet
attach file in my web page
attach file in my web page  hide button in input typ=file button in jsp
Front Page Web Hosting
Front Page Web Hosting Microsoft Front Page is leading WYSIWYG editor for the development of web site using HTML and DHTML. Front Page is used... providers provides Front Page Support on their web servers. Front Page extensions
Create Web Page with jsp
Web Page with jsp       In this example we will show you how to create first web page on tomcat... can take any existing HTML page and we change its extension to "Date.jsp
calling servlet from jsp
calling servlet from jsp  how to call a servlet from jsp
Web Page design and Development Company
Web Page design and Development Company We are web page designing... the world. Web page design and development is an art and skilled developers can create... complete web page design and development solution. Our company is expert
calling function - JSP-Servlet
calling function  Hai, How to call a java file in jsp file?  Hi friend, Step to be remember for solving the problem : 1.Create a jsp page "test.jsp" Example of Extends Attribute of page

Ads