Hello:
This is the first time for me to post here and I hope my question isn't
totally rudimentary.
I am trying to convert a large program, which is currently in Perl, to
one or a couple of Java servlets, but I can't seem to get past a simple
step. I can submit data to a servlet and do some basic tests if the
fields sent are text or text area fields. As soon as I try to test
against a value sent via a radio, check box or menu element, I get
strange results. For example:
res.setContentType("text/plain");
PrintWriter out = res.getWriter();
out.println(req.getParameter("radio1"));
if (req.getParameter("radio1") == "y") {
out.println("Yes");
}
else {
out.println("No");
}
The output will look something like this:
y
No
If the radio wasn't checked at all the first line of output will be
null, but if I test against that I get a NullPointerException. If I
use:
out.println(req.getParameterValues("radio1"));
I get something like:
[Ljava.lang.String;@7310a09a
I don't need the memory address, I need the string in the memory
address.
This is something that should be simple and it's making me want to stay
with Perl, if Servlet development is this peculiar.
Thanks for ANY help given.
--
Peter Tierney
[EMAIL PROTECTED]
http://www.mckenzie-int.com
The very wise person, when
wishing to elevate people,
Places their position below others.
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html