aspose file tools*
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
Author

Need help with req.getParameter ()method

harpd dhillon
Greenhorn

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
Greenhorn

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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30309
    
150

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.


[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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help with req.getParameter ()method