wood burning stoves*
The moose likes Servlets and the fly likes Multiple forms, but only one servlet to handle requests. Is it possible? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Multiple forms, but only one servlet to handle requests. Is it possible?" Watch "Multiple forms, but only one servlet to handle requests. Is it possible?" New topic
Author

Multiple forms, but only one servlet to handle requests. Is it possible?

Javedali Shaikh
Greenhorn

Joined: Sep 13, 2008
Posts: 12

Hi All

Can we design mutliple forms in single page, and accept values on single servlet only? Is it possible? I referred the following link http://www.javakb.com/Uwe/Forum.aspx/java-programmer/12999/multiple-forms-and-one-servlet, and followed the instructions there but it is giving nullpointerexception. May I know the reason? Or please suggest something which serves the purpose.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
Easy - just use a hidden variable in each form to direct the processing of the request.

My crystal ball is in the shop for the 10,000 vision checkup so I can't see your code - perhaps you should post some of it? NOT all of it, the part getting the NPE.

Bill
 
jQuery in Action, 2nd edition
 
subject: Multiple forms, but only one servlet to handle requests. Is it possible?
 
Similar Threads
how many instances???
HttpURLConnection and MultpartResponse Servlet
One clarification needed regarding Servlet
Question regarding SingleThreadModel
Multiple Drop Down Boxes With same name