Personally I would suggest that both doPost and doGet call another method to
do common processing, which allows for special case processing in either
doPost or doGet if necessary.
Dan
> ----------
> From: Rupesh Choubey[SMTP:[EMAIL PROTECTED]]
> Reply To: Rupesh Choubey
> Sent: Monday, October 11, 1999 7:56 PM
> To: [EMAIL PROTECTED]
> Subject: doPost versus doGet - DESIGN DECISION???
>
> quick question for the DESIGN gurus.......
>
> we have a html+servlet+EJB+jsp application we are building.....
>
> the servlets we use have the primary function of determining where we come
> from and what actions were taken on the pages, etc....
>
> some of our servlets serve MULTIPLE pages......hence in certain servlets,
> we
> need to first detemine which page we came from and then determine what
> actions were taken.....
>
> the pages have URLs as well as other elements such as listboxes, buttons,
> etc.
>
> my question is: does it make sense to have both doPost and doGet
> methods...here are some of my approaches....i need help validate which is
> a
> better one and which people have been successful with.....
>
> *****Approach 1****: servlet has BOTH doGet and doPost. doGet serves URL
> requests and doPost serves button presses and such events
>
> *****Approach 2****: servlet has all the code in the doPost method.....the
> doGet method only redirects to the doPost
> doGet(HttpServletRequest req, HttpServletResponse res) {
> doPost(req, res);
> }
> doPost(HttpServletRequest req, HttpServletResponse res) {
> if (req.getParameter("pageId") == LOGIN_PAGE) {
> do_login_stuff();
> } else .......BLAH BLAH BLAH
> }
>
> please help with as much detail as possible....also, if you know of any
> sites with such info, it will be awesome..
>
> thanks,
> Rupesh.
>
> ==========================================================================
> =
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> FAQs on JSP can be found at:
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html