You want to use getParameter("submit"), first off. Form fields are turned
into parameters by the servlet engine, and then you get them using that
method. Attributes are another story, for which see the Javadoc for the
ServletRequest object. Anyway, that's why you're stuff is null -- you're
looking in the wrong basket.
Now the other thing is that getAttributeNames(), like getParameterNames(),
returns an Enumeration object. What you're seeing there:
allaire.jrun.util.FlatHashKeyEnumerator@313c11ce
is an instance of JRun's implementation of the Enumeration interface. The
number after the @ sign changes each time because it (the number) refers to
that particular object in memory, which is different each time. Printing
out an Enumeration is pretty useless, as you've discovered. What you do
with Enumeration objects is "enumerate over" the contents and then do stuff
with them.
Again, you want to use getParameterNames(), not getAttributeNames(), and if
you want to see what's inside that object, use a classic Enumeration idiom
like this:
Enumeration allParams = request.getParameterNames()
String name = "";
String value = "";
while(allParams.hasMoreElements())
{
name = allParams.nextElement();
value = request.getParameter(name);
out.println(name+" = "+value);
}
Scott Stirling
-----Original Message-----
From: John Minadeo [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 15, 2000 4:48 PM
To: JRun-Talk
Subject: request.getAttribute()
Hey there all,
I'm having an odd problem... I have a jsp page that submits to itself for
processing. I check the request.getAttribute("submit") != null and then if
not I compare the value against the value I'm looking for to start
processing instead of just displaying the form fields.
The problem is, submit always null, actually, all my form fields are null.
When I do a request.getAttributeNames() I get 1 no matter how many form
fields I have. It is :
allaire.jrun.util.FlatHashKeyEnumerator@313c11ce
although everything after the @ symbol changes with each request... Am I
missing something?
Thanks for your help!!
--
John Minadeo
[EMAIL PROTECTED]
------------------------------------------------------------------------------
Archives: http://www.egroups.com/group/jrun-interest/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the
body.