• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to create better controller  RSS feed

 
Timo Tamme
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 66152
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!