473,499 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to retrieve a parameter?

I have the following function in a html file:

function selectEdit(fileID, processCode, processID, fileName,fileDesc)
{
document.forms[0].recordID.value = fileID;
document.forms[0].processor.value = processCode; `
document.forms[0].processorID.value = processID;
document.forms[0].interfaceFileName.value = fileName;
document.forms[0].fileNameDesc.value=fileDesc;
document.forms[0].submit();
}
The function is called by many buttons in the same form.
Each button is supposed to be redirecting to different html pages
based on the parameter "document.forms[0].recordID.value" i have
directed the form action to a jsp page to handle the redirection but i
cannot get the parameter using jsp. Can i retrieve the
"document.forms[0].recordID.value" if so how?
Do i use javascript to retrieve? I tried using
request.getParameter("recordID")in my jsp but i get a null pointer
exception.
Am i retrieving the value corrrectly?

Thanks
Jul 23 '05 #1
1 4086
In article <59**************************@posting.google.com >, scout3014
@gmail.com enlightened us with...
I have the following function in a html file:

function selectEdit(fileID, processCode, processID, fileName,fileDesc)
{
document.forms[0].recordID.value = fileID;
document.forms[0].processor.value = processCode; `
document.forms[0].processorID.value = processID;
document.forms[0].interfaceFileName.value = fileName;
document.forms[0].fileNameDesc.value=fileDesc;
document.forms[0].submit();
}
The function is called by many buttons in the same form.
Each button is supposed to be redirecting to different html pages
based on the parameter "document.forms[0].recordID.value" i have
directed the form action to a jsp page to handle the redirection but i
cannot get the parameter using jsp. Can i retrieve the
"document.forms[0].recordID.value" if so how?
Do i use javascript to retrieve? I tried using
request.getParameter("recordID")in my jsp but i get a null pointer
exception.
Am i retrieving the value corrrectly?


Javascript runs on the client. It has nothing at all to do with Java, despite
the name of the language.
JSP is Java Server Pages. It IS Java. (java is OT here)

Javascript cannot retrieve posted form values. It can parse a URL for GET
params.
JSP can retrieve either.

request.getParameter will never give you a null pointer exception - it's what
you're doing afterwards that is giving you the exception. If no value exists
for the param, it returns null.
From what I can tell, request.getParameter is getting null for recordID. That
means there is no value. Check what is actually get sent to the server. Just
out.print the values of the form params in the JSP and comment everything
else out. Did you get a value for recordID? If so, it's your JSP code that is
the issue, not your javascript.

Javascript is NOT a typed language - if you call the function wrong, it won't
complain overmuch. Not like Java. Are you SURE you're passing the right info
to the javascript function? Place some alerts in there if you're not sure.
See what you're really passing for fileID (which is then assigned to
recordID).

HTH

--
--
~kaeli~
Synonym: the word you use in place of a word you can't
spell.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
409
by: Eugfene | last post by:
i have the following function in a html file: function selectEdit(fileID, processCode, processID, fileName,fileDesc) { document.forms.recordID.value = fileID; document.forms.processor.value =...
0
1258
by: Ramkumar | last post by:
Hi I am calling a DB2 stored procedure with 3 parameters. The last one is an inout parameter in which a value is returned (SQLCODE). I am using the DB2DataAdapter object's fill method to return a...
12
4682
by: Dica | last post by:
i can't seem to find a way to cast the value in my comboBox to integer. i've tried the following: short iProjectID = Convert.ToInt16(cboProjects.SelectedValue); i keep getting a "Sepcified...
5
6651
by: bobdydd | last post by:
Hi Everybody I have an Access database that passes a Parameter to a web page something like this. http://localhost/index.htm?paramName=1234-54321 I want to be able to retrieve the parameter...
1
1636
by: tomjbr.32022025 | last post by:
I have started looking at the nhibernate framework, but do not really like the string based API which makes it impossible to use automatic refactoring of a property name without the risk of getting...
0
1378
by: onno.willems | last post by:
Hi, In our project we have a large library of VB script (.vbs) files. Each file has 1 function. I want to document these functions, so a VB.NET application can retrieve the documentation and...
5
25515
by: Ken | last post by:
I'm trying to run a loop to capture column property information from a table in my datasource. Can anybody see where this is going wrong? Dim tbl As New DataTable Dim col As DataColumn Dim x...
3
3313
by: DhruviTrivedi | last post by:
Is there any way to get parameter value from variable like @Param1 varchar(50) @Param2 varchar(50) set Param1 ='value1' while --condition-- begin
5
9431
by: =?Utf-8?B?QXhlbCBEYWhtZW4=?= | last post by:
Hi, I've created a class library assembly containing several string resource files, like: - TableColumns.resx - TableColumns.de.resx - General.resx - General.de.resx
0
7130
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
7171
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,...
0
7386
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
5468
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4918
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...
0
3098
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
3090
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
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
664
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.