What is a right way to use servlets?
Posted
by
vikp
on Stack Overflow
See other posts from Stack Overflow
or by vikp
Published on 2011-02-22T22:45:50Z
Indexed on
2011/02/22
23:25 UTC
Read the original article
Hit count: 283
Hi,
I'm studying EJB3.
I have a session bean which provides services to create/update customer accounts.
This session bean offers services on the lines of:
public void addCustomer(Customer c);
public void updateCustomer(Customer c);
Ideally I'd like to have a single servlet: CustomerServlet and it would invoke the session beans that I have listed above.
Problem is that I have two JSPs: UpdateAccount.jsp and CreateAccount.jsp. Both of these JSPs have a form with a method POST and action "CustomerServlet".
How can I distinguish in a customer servlet which operation I should carry out: createAccount or updateAccount?
I guess the alternative is to have a separate servlet for each operation...
Thank you
© Stack Overflow or respective owner