473,548 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
+ 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 4889
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.U RL" 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(getUrlPar am(0));
functio getUrlParam(n){
return document.URL.sp lit("?")[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
22158
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> <td><input name="sort" type="submit" value="Description"></td>
1
5963
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 a text box. When submitted my form posts its data to a servlet. I can click on the image, and the form is posted and the servlet is ran. However, I...
4
2955
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 Bilwin.
1
3951
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
1645
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
6053
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 java.io.*; public class LabWork3_Q1 extends HttpServlet {
1
2137
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 another servlet its work but i want to know hw to deploy the readed input from textfile is displayed in jsp through servlet2. here is my code import...
2
1588
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
7512
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7438
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7951
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7466
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7803
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5362
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3495
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1926
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 we have to send another system
1
1051
muto222
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.