File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Head First Android this week in the Android forum!
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: 32304

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]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
subject: Need help with req.getParameter ()method
It's not a secret anymore!