| Author |
How to create better controller
|
Timo Tamme
Greenhorn
Joined: Nov 10, 2011
Posts: 8
|
|
Hello!
I am new on J2EE and previously I have some experience with ASP.NET, so my question is about J2EE MVC. I know that servlet stands for controller and in view role is JSP page. So when I create view that contains many methods, so user can access to: delete item, update item, submit page, cancel etc. How is the best way to implement controller in J2EE? So far I have read from one basic J2EE book that servlet supports 'doGet' and 'doPost' methods (also it support some others, but its not relevant in my case). So far I have seen that servlet as controller is not for my needs, I want controller to be something where these view functions are in separate methods in controller. For example clicking delete in view calls from 'ItemController.class' method 'deleteItem'. How can I do that, or is it even possible? Which are the best practices?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56201
|
|
Sounds like rather than pure Servlets you want a framework that automatically maps URLs to methods. I'd suggest looking into Spring MVC or Play.
The former will still require you have a good grasp on Servlet and JSP concepts, the latter is not based upon JEE.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: How to create better controller
|
|
|