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



Home Answers Viewqa JSP-Interview-Questions calling web page accroding to if statement
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Fathi
calling web page accroding to if statement
1 Answer(s)      5 years ago
Posted in : JSP-Interview Questions



Advertisement
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
WEB PAGE
WEB PAGE  How To Create A Simple web Page Of a gmail using applet
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
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
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
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
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
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 by the web components in both direct and indirect way. A web resource that a web
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
setting web page size
setting web page size  How to set the webpage size in Java
create a one web page
create a one web page  create a one web page with stored values in a database
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
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
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   Hi, If you are aware of HTML then you can write simple web page for your website. You have to learn HTML. If you don't want to learn HTML then you can use
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
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 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 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
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
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  
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
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: <html> <script> function checkMail
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
get JavaScript onto a web page
get JavaScript onto a web page  How do we get JavaScript onto a web page
 

 

 

DMCA.com