The moose likes Servlets and the fly likes Need help with req.getParameter ()method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Need help with req.getParameter ()method" Watch "Need help with req.getParameter ()method" New topic

Need help with req.getParameter ()method

harpd dhillon

Joined: Jun 03, 2003
Posts: 8
I'm trying to get the values from the form and update the corrosponding database record.
I know for String variable , i would use:
member.password = req.getParameter("password");
I need to know how to get variable of type int and timestamp object.
Any suggestions would be greatly appreciated. Thanks a lot
SJ Adnams
Ranch Hand

Joined: Sep 28, 2001
Posts: 925
they're all strings so you gotta parse em.
harpd dhillon

Joined: Jun 03, 2003
Posts: 8
Hello Simon,
I'm totally new to this. COuld you plz gimme an example??...I'd appreciate it greatly
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33102

Take a look in the API under the class you want. For example, to get an integer:

You may also want to check whether the parameter is null first, to avoid an exception.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Need help with req.getParameter ()method
It's not a secret anymore!