jsp solution

jsp solution

how to display javascript value in current jsp page without refreshing page.. dont want alert... got value in 1 variable in javascript and want to print in current jsp page
View Answers

July 21, 2010 at 3:53 PM

Hi Friend,

You can use Ajax. Try the following code:

1)ajaxExample.jsp:

<html>
<head>
<script>
var xmlhttp

function loadContent(str){
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null) {
alert ("Your browser does not support Ajax HTTP");
return;
}
var url="getvalue.jsp";
url=url+"?q=roseindia";
xmlhttp.onreadystatechange=getOutput;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
function getOutput(){
if (xmlhttp.readyState==4) {
document.getElementById("var").innerHTML=xmlhttp.responseText;
}
}
function GetXmlHttpObject(){
if (window.XMLHttpRequest) {
return new XMLHttpRequest();
}
if (window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
}
return null;
}
</script>
</head>
<body>
<a href="javascript:loadContent('parameterValue')">Load</a>
<div id="var"></div>
</body>
</html>

2)getvalue.jsp:

<%
String q =request.getParameter("q");
out.print(q);
%>

Thanks









Related Tutorials/Questions & Answers:
jsp solution
jsp solution  Can you tell me i am ri8 now develop application eclipse where i suppose to create java file i know that jsp file will be put in web content folder... 2 nd que i had show many demo in you tube package (like folder
jsp solution - JSP-Servlet
jsp solution  how to display javascript value in current jsp page... and want to print in current jsp page  Hi Friend, You can use Ajax...="getvalue.jsp"; url=url+"?q=roseindia"; xmlhttp.onreadystatechange
Advertisements
I want solution for this jsp program..
I want solution for this jsp program..   <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ page import="java.sql.*" %> JSP Page <%! String
solution
solution   A developer wants you to develop a simple take away restaurant order service. The system reads from a file containing information about the restaurant (such as the name, place and menu). The system then allows the user
solution
solution   A developer wants you to develop a simple take away restaurant order service. The system reads from a file containing information about the restaurant (such as the name, place and menu). The system then allows the user
please give me solution how to display next page after 20 records ? - JSP-Servlet
please give me solution how to display next page after 20 records ?  Java Servlet Paging control example  here i have attached one example code. function validate() { for(j=0;j<30;j
Urgent Solution required
Urgent Solution required  This is possible to transfer that file from client to server and read that file and view it in JSP. If it is can you send the example. thanks alot in advance   Hi, You can create a JSP file
ModuleNotFoundError: No module named 'Solution'
ModuleNotFoundError: No module named 'Solution'  Hi, My Python... 'Solution' How to remove the ModuleNotFoundError: No module named 'Solution... to install padas library. You can install Solution python with following
ModuleNotFoundError: No module named 'Solution'
ModuleNotFoundError: No module named 'Solution'  Hi, My Python... 'Solution' How to remove the ModuleNotFoundError: No module named 'Solution... to install padas library. You can install Solution python with following
solution of k map in c
solution of k map in c  write a program in c to solve k-map with digital circuit
JSP Tutorials
is Sun's solution for developing dynamic web sites. JSP provide excellent... JSP Tutorials       JSP Tutorials and examples, you will find many examples
Solution to C prog
Solution to C prog   Hi, Pls any body help, why the following prog crashing while running. #include<stdio.h> #include<conio.h> int main(){ int n,*fact(int *n); printf("Enter the number:"); scanf
j2me solution - MobileApplications
send me the solution for this problem i am grateful to you. Thanks & Regards
A program solution needed
A program solution needed   I need a solve for this problem please ! a program that displays grade statistics. The program should read any number of grades (up to 100) and ends when the user enters -1, the program should reject
Introduction to JSP
Pages or JSP for short is Sun's solution for developing dynamic web sites. JSP... JSP Tutorials - Writing First JSP    ... applications. JSP enable the developers to directly insert java code into jsp file
JSP Training
JSP Training     Java Server Pages (JSP) is Sun's solution for developing dynamic web sites. JSP provides excellent.... JSP training course Objective: This JSP training course aims at teaching
ModuleNotFoundError: No module named 'Solution-Dates'
ModuleNotFoundError: No module named 'Solution-Dates'  Hi, My... named 'Solution-Dates' How to remove the ModuleNotFoundError: No module named 'Solution-Dates' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'Solution-Dates'
ModuleNotFoundError: No module named 'Solution-Dates'  Hi, My... named 'Solution-Dates' How to remove the ModuleNotFoundError: No module named 'Solution-Dates' error? Thanks   Hi, In your python
Please find me a solution that
Please find me a solution that   Write a java program that calculates the area of rectangular, square, triangular, and circle. Your program must have the following: Two classes named "Area" and "AreaTest". Class "Area
Can find a solution or code for this - XML
Can find a solution or code for this   Develop a java based tool which can be used to build a GUI structure based on the configurations given in the tool. Input XML Folders/Files E.g:Folder for Main Panel Files for required
jsp
" "http://www.w3.org/TR/html4/loose.dtd"> **<jsp:useBean id="obj" class="com.ingenious.bean.UserBean"scope="session"/>** <jsp:setProperty...;title>JSP Page</title> </head> <body>
Hosted E-Commerce Solution
Hosted E-Commerce Solution In this article we will explain Hosted E-Commerce Solution and tell you how to choose the best Hosted E-Commerce Solution... to provide best Hosted E-Commerce Solution. But sometime you may end up in choosing
Introduction to the JSP Java Server Pages
for short is Sun's solution for developing dynamic web sites. JSP provide excellent... JSP Tutorials       JSP Tutorials and examples, you will find many examples with working
JSP
JSP   how to open and view a flat file in browser using java code in jsp?   Hi Friend, If you want to simply open a file then try... not accepting. The " "(space) in the path creates the problem. Any solution
ModuleNotFoundError: No module named 'solution-efe-client-leader'
ModuleNotFoundError: No module named 'solution-efe-client-leader'  Hi...: No module named 'solution-efe-client-leader' How to remove the ModuleNotFoundError: No module named 'solution-efe-client-leader' error? Thanks
ModuleNotFoundError: No module named 'solution-efe-client-mailing'
ModuleNotFoundError: No module named 'solution-efe-client-mailing'  ...: No module named 'solution-efe-client-mailing' How to remove the ModuleNotFoundError: No module named 'solution-efe-client-mailing' error? Thanks
ModuleNotFoundError: No module named 'solution-efe-client-member'
ModuleNotFoundError: No module named 'solution-efe-client-member'  Hi...: No module named 'solution-efe-client-member' How to remove the ModuleNotFoundError: No module named 'solution-efe-client-member' error? Thanks
ModuleNotFoundError: No module named 'solution-efe-client-notification'
ModuleNotFoundError: No module named 'solution-efe-client-notification' ...: ModuleNotFoundError: No module named 'solution-efe-client-notification' How to remove the ModuleNotFoundError: No module named 'solution-efe-client-notification'
ModuleNotFoundError: No module named 'solution-efe-client-leader'
ModuleNotFoundError: No module named 'solution-efe-client-leader'  Hi...: No module named 'solution-efe-client-leader' How to remove the ModuleNotFoundError: No module named 'solution-efe-client-leader' error? Thanks
ModuleNotFoundError: No module named 'solution-efe-client-mailing'
ModuleNotFoundError: No module named 'solution-efe-client-mailing'  ...: No module named 'solution-efe-client-mailing' How to remove the ModuleNotFoundError: No module named 'solution-efe-client-mailing' error? Thanks
ModuleNotFoundError: No module named 'solution-efe-client-member'
ModuleNotFoundError: No module named 'solution-efe-client-member'  Hi...: No module named 'solution-efe-client-member' How to remove the ModuleNotFoundError: No module named 'solution-efe-client-member' error? Thanks
ModuleNotFoundError: No module named 'solution-efe-client-notification'
ModuleNotFoundError: No module named 'solution-efe-client-notification' ...: ModuleNotFoundError: No module named 'solution-efe-client-notification' How to remove the ModuleNotFoundError: No module named 'solution-efe-client-notification'
ModuleNotFoundError: No module named 'solution-efe-client-security'
ModuleNotFoundError: No module named 'solution-efe-client-security'  ...: No module named 'solution-efe-client-security' How to remove the ModuleNotFoundError: No module named 'solution-efe-client-security' error
ModuleNotFoundError: No module named 'solution-efe-client-user'
ModuleNotFoundError: No module named 'solution-efe-client-user'  Hi...: No module named 'solution-efe-client-user' How to remove the ModuleNotFoundError: No module named 'solution-efe-client-user' error? Thanks  
ModuleNotFoundError: No module named 'solution-efe-config'
ModuleNotFoundError: No module named 'solution-efe-config'  Hi, My... named 'solution-efe-config' How to remove the ModuleNotFoundError: No module named 'solution-efe-config' error? Thanks   Hi
ModuleNotFoundError: No module named 'solution-efe-database'
ModuleNotFoundError: No module named 'solution-efe-database'  Hi...: No module named 'solution-efe-database' How to remove the ModuleNotFoundError: No module named 'solution-efe-database' error? Thanks   Hi
ModuleNotFoundError: No module named 'solution-efe-function'
ModuleNotFoundError: No module named 'solution-efe-function'  Hi...: No module named 'solution-efe-function' How to remove the ModuleNotFoundError: No module named 'solution-efe-function' error? Thanks   Hi
ModuleNotFoundError: No module named 'solution-efe-setup'
ModuleNotFoundError: No module named 'solution-efe-setup'  Hi, My... named 'solution-efe-setup' How to remove the ModuleNotFoundError: No module named 'solution-efe-setup' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'solution-efe-test-rulman26'
ModuleNotFoundError: No module named 'solution-efe-test-rulman26'  Hi...: No module named 'solution-efe-test-rulman26' How to remove the ModuleNotFoundError: No module named 'solution-efe-test-rulman26' error? Thanks
E-commerce Hosting Solution
E-commerce Hosting Solution In this article we will explain you about E-commerce Hosting Solution. The E-commerce Hosting Solution is used by the shopping... Hosting Solution is essential in success of the online e-commerce portal
jsp
jsp  how jsp translated into servlets
JSP
JSP  How to run jsp program in eclipse
jsp
jsp  how to create jsp page
Jsp
Jsp  Can I implement interface in jsp
JSP
what is JSP forward tag for  what is JSP forward tag for   It forwards the current request to another JSP page. Below is the syntax for the same:- <jsp:forward page="...url..." /> We can also forward parameter
jsp
jsp  how to include two jsp page
jsp
jsp  how to create a table in oracle using jsp and the table name is entered in text feild of jsp page
jsp
jsp  write a code for jsp file generator to generate a jsp page automatically taking html page as input
jsp functions - JSP-Servlet
jsp functions  hi,sir i need a simple jsp program using page directive with session attribute  Hi friend, To get the solution of your problem visit this link.... http://www.roseindia.net/jsp
JSP
JSP  Hi, What is JSP? What is the use of JSP? Thanks   Hi, JSP Stands for Java Server Pages. It is Java technology for developing web applications. JSP is very easy to learn and it allows the developers to use Java

Ads