File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes problem in requesting a parameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "problem in requesting a parameter" Watch "problem in requesting a parameter" New topic

problem in requesting a parameter

preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
I need to get a parameter in my program.I am working in asteriskjava.I used the method request.getParameter(String name) .
even i have hardcoded the string name like

String param=request.getParameter("chennai");

when i compile this i am getting null instead of chennai.please anyone assist me

Christophe Verré

Joined: Nov 24, 2005
Posts: 14687

Where does this parameter come from ? Did you post the parameter from an html form, or via the URL ?

It sounds like a servlet question. There is a servlets forum where you can ask this kind of question.

[My Blog]
All roads lead to JavaRanch
Laxman Guru

Joined: Feb 26, 2008
Posts: 17
Parameters in a request are set by the HTML client when the request is created, typically form elements (input and file elements to be exact) within a HTML form. Therefore if the form that called your servlet/JSP page had an element with a name "chennai", you would retrieve the value of that form element by using getParameter("chennai").

preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
Actually here i am using asterisk and this request.getParameter wii retreive the data from the asterisk.if a person calls from chennai,it will be displayed in the asterisk console like

from this console i have to get the parameter chennai.neither servlet or jsp is used here.but i am not getting the parameter eventhough i hardcoded the parameter.thats why i am confused why it is displaying null even the string i have passed is chennai directly.
I agree. Here's the link:
subject: problem in requesting a parameter
Similar Threads
Enumeration or a better way
can anyone tell me how do we update the values in servlet?
problem with accessing JSP init parameters
Applet always use same Resource file
How to Send Parameters from One JSP to Another using Links?