File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Check null field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Check null field" Watch "Check null field" New topic

Check null field

Elahe Shafie
Ranch Hand

Joined: Dec 12, 2001
Posts: 291
Hi friends,
I'm passing bdesc to the servlet with contain some text so why I hit the exception and gives me
"request parameter missing String bdesc"
bdesc = req.getParameter("bdesc");
if( null == bdesc )
{throw new Exception( "request parameter missing");}

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
1. Exactly how are you passing this parameter?
2. Is this code in a doGet or doPost?
3. Are there other parameters that get passed correctly?
Elahe Shafie
Ranch Hand

Joined: Dec 12, 2001
Posts: 291
Thank you so much Bill I solved my program.
Sorry for late reply...
I agree. Here's the link:
subject: Check null field
It's not a secret anymore!