473,480 Members | 3,069 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to pass the value from the servlet to javascritp

kaleeswaran
132 New Member
hi!
i need to pass the value from the servlet to javascritp.....how can i do that?..
give me some solution.....
thank you,
kaleeswaran
Nov 19 '07 #1
2 4883
r035198x
13,262 MVP
hi!
i need to pass the value from the servlet to javascritp.....how can i do that?..
give me some solution.....
thank you,
kaleeswaran
Servlets run on the server side and Javascripts run on the client side.
You can pass data from servlets to JSPs however using sessions or attributes
Nov 19 '07 #2
rajashekhar
2 New Member
we can pass values to html page wich contains javascript. For this we need to pass parameters in the url like get method.Then in javascript we can get that url string by using "document.URL" then we need to split that url string by "?" then we need to split by "&" then split by "=" then u will get the parameter values.

[HTML]
alert(getUrlParam(0));
functio getUrlParam(n){
return document.URL.split("?")[1].split("&")[n].split("=")[1];
}
[/HTML]

for examples view http://supportjavascript.googlepages.com.
Jan 21 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
22150
by: kaiwing18 | last post by:
Hi, I have a following jsp file called "showAsset.jsp" : <form action="showAsset.jsp" method="post"> <tr BGCOLOR=YELLOW> <td><input name="sort" type="submit" value="Asset_Number" > </td>...
1
5956
by: efiedler | last post by:
Hi - I have the following input field on my html page: <input type="image" name="submit" id="submit" src="c:\image.jpg" value="image.jpg"> I also have another input field on the form that is...
4
2948
by: Bilwin | last post by:
Hi friends, I would like to know how can i pass values to AJAX form from a servlet and how to display that value in a drop down box. Plz help me on this since i am a newbie to this. Thanks...
1
3936
by: deepthisoft | last post by:
hai, I have one jsp page.In that jsp i am passing two values using the javascript function to a servlet.In that servlet i get that 2 values.And then how to pass these 2 values to another jsp page.
1
1639
by: kirannallam | last post by:
I've wrote a servlet code from there I want to pass a value to jsp. How can I do it. can anyone suggest a code? Not using eniumuration
5
6045
by: xirowei | last post by:
i'm newbie in java servlet, how to let public void doPost can access to public void doGet, stringLength variable? below is my code: import javax.servlet.*; import javax.servlet.http.*; import...
1
2130
by: shiyamala | last post by:
Hi i am shiyam, i am having some problem in java, i am basic java programmer. i have to write one program is writing the data into textfile name "newfile.txt" from one servlet and read it from...
2
1584
by: MATTXtwo | last post by:
I want to get input element value in a form not using Javascritp like: var NICNo=document.getElementById("NewICNo").value;
0
7055
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6920
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7060
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6760
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7022
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3013
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3004
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
572
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.