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



Home Answers Viewqa JavaScriptQuestions How I get a variable from java script to use it in the scriptlet of jsp.
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Nibedita Pattnaik
How I get a variable from java script to use it in the scriptlet of jsp.
3 Answer(s)      2 years and 9 months ago
Posted in : JavaScript Questions


Hi i want to get the tinyUrl value in the scriptlet of jsp.


Advertisement
View Answers

January 19, 2012 at 12:19 PM


<html>
<script>
function selValue(){
var mytext = document.form.sel.options[document.form.sel.selectedIndex].text;
window.location.replace("pass.jsp?value="+mytext);
}

</script>
<form name="form" >
<select name="sel" id="sel" onchange="selValue();">
              <option value="<-Select->"><- Select- ></option>
              <option value="India">India</option>
              <option value="USA">USA</option>
              <option value="Srilanka">Srilanka</option>
              <option value="Japan">Japan</option>
              <option value="Australia">Australia</option>
            </select>
            </form>
            <% String st=request.getParameter("value");
            if(st!=null){
            out.println("value="+st); 
            }
%>


January 19, 2012 at 12:21 PM


<html>
<script language="javascript" type="text/javascript">
function call(){
var name = "roseindia";
window.location.replace("a.jsp?name="+name);
}
</script>
<input type="button" value="Get" onclick='call()'>
<%
String name=request.getParameter("name");
if(name!=null){
out.println(name);
}
%>
</html>


January 19, 2012 at 12:21 PM


<html>
<script>
var v="Roseindia";
</script>
<% String st="<script>document.writeln(v)</script>";
out.println("value="+st); %>
</html>


Related Tutorials/Questions & Answers:
How I get a variable from java script to use it in the scriptlet of jsp.
How I get a variable from java script to use it in the scriptlet of jsp.  Hi i want to get the tinyUrl value in the scriptlet of jsp. // Bit.ly API var url="http://cplive.com/dealDetail.do?method=displayDealDetail&
how to call the array variable in scriptlet from javascript function
how to call the array variable in scriptlet from javascript function  This is the scriptlet code:- <% String[] abc={"saab","volvo","bmw","Benz","Porsche","Jaguar"}; %> Actually i want the array variable one by one
Advertisements
How Can I get ArrayList of Data from jsp with ajax request
How Can I get ArrayList of Data from jsp with ajax request  Hi, I retereved 5 Employee Record of Data from Struts Action class to jsp with ajax response. But I don't how how can reterve this dynamic 5 employee records
is it possible to use jsp in java script
is it possible to use jsp in java script  is it possible to use jsp inside the javascript while using java script in body tag on that time i am calculate number of records in mysql, so that i am using jsp.if count value
is it possible to use jsp in java script
is it possible to use jsp in java script  is it possible to use jsp inside the javascript while using java script in body tag on that time i am calculate number of records in mysql, so that i am using jsp.if count value
In JSP page, inside a javascript function, can I place a java code using scriptlet tag?
In JSP page, inside a javascript function, can I place a java code using... is trying to close a window, I am calling a java script function closeWind() in jsp page. In a separate java file, in a method checkListValue(), I am doing
i want to pass Javascript value to JSP scriptlet..
i want to pass Javascript value to JSP scriptlet..  i am having a problem that, i am having a combo box in the JSP page when i select an item from... now i want to pass this value to JSP scriptlet
JSP Scriptlet
in the page scripting language. JSP Scriptlet Syntax is: <% //java codes...JSP Scriptlet   Explain JSP Scriptlet and give the syntax of this Scriplet.   Hi, The JSP Scriptlet can contain any number of language
How to use email validation check through java script in jsp page
How to use email validation check through java script in jsp page...; This is detailed java code that explains how to use java script validator in jsp page... valid email using java script. */ function emailCheck(str) { var
I don't know how to use counter variable in this Qustion ....:(
I don't know how to use counter variable in this Qustion ....:(  Declare and initialize value of array in int type. read and assgin all the mark to every students by using counter variable, k. output should be like
Converting jsp variable to java variable
Converting jsp variable to java variable  Hi how to convert java script variable to java variable on same jsp page
JSP Scriptlet Tag
JSP Scriptlet Tag   Defined JSP Scriptlet Tag ?   A scriptlet tag is used within a Java Server page to execute a java source code scriplet... the code in between the Scriptlet tag accesses any variable or bean declared. <
How do i get the number of online users from a site using jsp?
How do i get the number of online users from a site using jsp?  Hi, Can any one tell me how to get the number of records from a database dynamically, when each person got logged into the page in jsp
jsp scriptlet
jsp scriptlet  can a method defined in the jsp scriptlet
how to pass variable from simple java main class(not servlet) to the jsp page?
how to pass variable from simple java main class(not servlet) to the jsp page?  I have a simple Java class in which I invoke a call to a JSP page... from the simple Java class to the JSP page. How can I do that? Here is my
How to save and get value from JSP
How to save and get value from JSP  Employee Name Time... 324 2012-12-12 save i want to save dis value jsp to action ...how can i get all value ..and store..how can its values goes
how i get experience wise resume from database when i submit from browser
how i get experience wise resume from database when i submit from browser  how i get experience wise resume from database when i submit from browser   Please go through the following link: Visit Here
how to get a values from processRecord - JSP-Servlet
how to get a values from processRecord  dear sir, i have a problem in getting a values from java to jsp.Here jsp is used to read a excel sheet that intern call a java program so i want a column values i.e a column contains
how to execute a unix shell script from a java program
how to execute a unix shell script from a java program  well , i am... the script name from a java code .once you execute this java program... solution . could anyone please give a sample code as of how to do this... what i am
How can I get the full URL with the attached parameters? - JSP-Servlet
How can I get the full URL with the attached parameters?  Hi, I'm trying to figure out how to get the current url and use it in my jsp page. I...:8080/MesEduSchoolsProject/displayMenu.jsp How can I get the full URL with the attached parameters
How to get jSon object in servlet from jsp - JSP-Servlet
How to get jSon object in servlet from jsp  How to get jSon object in servlet from jsp? In jsp page i have written: var sel... variable in my configurationServlet. Can any one tel me how to get this json
how to get data from checkboxes - JSP-Servlet
how to get data from checkboxes  hi, i got list of tables on screen by invoking webservices.when the user selects the tables by using checkboxes, i need to get only those tables to the next page where i can get list of columns
how to assign javascript variable value to a jsp variable
how to assign javascript variable value to a jsp variable  how to assign javascript variable value to a jsp variable
Extracting variable from jsp
Extracting variable from jsp  how to Write a java program which will be extracting the variables and putting them in an excel format?   ..., these field values will get inserted into the excel file. 1)Create form.jsp <html>
how to get data from database into dropdownlist in jsp
how to get data from database into dropdownlist in jsp  Can anybody tell me what is the problem in this code as i am not able to fetch the data from... tutorial go through the link JSP Get Data Into Dropdown list From Database   
How to get data from DB in to Text box by using Jsp & Ajax
How to get data from DB in to Text box by using Jsp & Ajax   I want to get the data from database in to text box in a jsp page by using Ajax. If I... with a and from that i need to select the required value and i should store
How to use Java Beans in JSP?
How to use Java Beans in JSP?  Hi, I have developed a employee bean...; ..... } Please tell me how I can use Employee Java bean in JSP page? Thanks   Hi, Read at Java Bean in JSP. Thanks   hi dude your qus
How To Get the Uploaded File Information in the Receiving Script?
How To Get the Uploaded File Information in the Receiving Script?  How To Get the Uploaded File Information in the Receiving Script
Get Environment Variable Java
Get Environment Variable Java       In this example we are getting environment variable. To get the environment variable we use getenv() method. Map is an interface
how to get data from database into dropdownlist in jsp
how to get data from database into dropdownlist in jsp  //Customer Name: <select name="name"> <% try{ Class.forName...="select * from staff"; ResultSet rs=st.executeQuery(sql); while(rs.next
java how to get domain name from url
java how to get domain name from url  How to get the domain name from a url string? Example program in java for "how to get domain name from url" Thanks   Hi, You can use the following example code: URL linkURL
Advertisements
 

 

 

DMCA.com