Skip to main content
added 36 characters in body
Source Link
davidxxx
  • 132.5k
  • 23
  • 231
  • 228

You are right : the two solutions (a doGet() methods which handles multiple use cases and as many servlets as usecases) are not good design in a general way.

That's why, since very long time, Java EE applications don't use massively directly their own HttpServlet implementation but use Java EE UI frameworks which allow to have a OOPflexible design in the web controllers.
Behind, a HttpServlet provided by the framework is used but we don't need to worry about it because it's ready to be used. One of their main goal is handling all boilerplate, complex and repetitive code to allow developers to have a flexible way of designing their web applications.

For example, JSF 1 (which is not very recent) allow to use JSF backingbean to map a JSP view to a almost classic Object Java and not a rigid servlet with just a single doGet() method to handle our needs. In this backingbean, you can add any methods as in a classic java class and you call these methods from your JSP in a OOPJava classic way : myBean.myMethod().

Most of Java EE UI frameworks (SpringMVC, GWT, Struts 2, etc...) allow to do that.

You are right : the two solutions (a doGet() methods which handles multiple use cases and as many servlets as usecases) are not good design in a general way.

That's why, since very long time, Java EE applications don't use massively directly their own HttpServlet implementation but use Java EE UI frameworks which allow to have a OOP design in the web controllers.
Behind, a HttpServlet provided by the framework is used but we don't need to worry about it because it's ready to be used. One of their main goal is handling all boilerplate, complex and repetitive code to allow developers to have a flexible way of designing their web applications.

For example, JSF 1 (which is not very recent) allow to use JSF backingbean to map a JSP view to a almost classic Object Java and not a rigid servlet with just a single doGet() method to handle our needs. In this backingbean, you can add any methods as in a classic java class and you call these methods from your JSP in a OOP way.

Most of Java EE UI frameworks (SpringMVC, GWT, Struts 2, etc...) allow to do that.

You are right : the two solutions (a doGet() methods which handles multiple use cases and as many servlets as usecases) are not good design in a general way.

That's why, since very long time, Java EE applications don't use massively directly their own HttpServlet implementation but use Java EE UI frameworks which allow to have a flexible design in the web controllers.
Behind, a HttpServlet provided by the framework is used but we don't need to worry about it because it's ready to be used. One of their main goal is handling all boilerplate, complex and repetitive code to allow developers to have a flexible way of designing their web applications.

For example, JSF 1 (which is not very recent) allow to use JSF backingbean to map a JSP view to a almost classic Object Java and not a rigid servlet with just a single doGet() method to handle our needs. In this backingbean, you can add any methods as in a classic java class and you call these methods from your JSP in a Java classic way : myBean.myMethod().

Most of Java EE UI frameworks (SpringMVC, GWT, Struts 2, etc...) allow to do that.

https://java.net/projects/javaee-spec/pages/JEE
Source Link
BalusC
  • 1.1m
  • 377
  • 3.7k
  • 3.6k

You are right : the two solutions (a doGet() methods which handles multiple use cases and as many servletsservlets as usecases) are not good design in a general way.
 

That's why, since very long time, JEEJava EE applications don't use massively directly their own HttpServlet implementation but use JEEJava EE UI frameworks which allow to have a OOP design in the web controllers.
Behind, a HttpServlet provided by the framework is used but we don't need to worry about it because it's ready to be used. One of their main goal is handling all boilerplate, complex and repetitive code to allow developers to have a flexible way of designing their web applications.
 

For example, JSF 1 (which is not very recent) allow to use JSF backingbeanbackingbean to map a JSP view to a almost classic Object Java and not a rigid servlet with just a single doGet() method to handle our needs.
  In this backingbean, you can add any methods as in a classic java class and you call these methods from your JSP in a OOP way.

Most of JEEJava EE UI frameworks (SpringMVC, GWT, Struts 2, etc...) allow to do that.

You are right : the two solutions (a doGet() methods which handles multiple use cases and as many servlets as usecases) are not good design in a general way.
 

That's why, since very long time, JEE applications don't use massively directly their own HttpServlet implementation but use JEE UI frameworks which allow to have a OOP design in the web controllers.
Behind, a HttpServlet provided by the framework is used but we don't need to worry about it because it's ready to be used. One of their main goal is handling all boilerplate, complex and repetitive code to allow developers to have a flexible way of designing their web applications.
 

For example, JSF 1 (which is not very recent) allow to use JSF backingbean to map a JSP view to a almost classic Object Java and not a rigid servlet with just a single doGet() method to handle our needs.
  In this backingbean, you can add any methods as in a classic java class and you call these methods from your JSP in a OOP way.

Most of JEE UI frameworks (SpringMVC, GWT, Struts 2, etc...) allow to do that.

You are right : the two solutions (a doGet() methods which handles multiple use cases and as many servlets as usecases) are not good design in a general way.

That's why, since very long time, Java EE applications don't use massively directly their own HttpServlet implementation but use Java EE UI frameworks which allow to have a OOP design in the web controllers.
Behind, a HttpServlet provided by the framework is used but we don't need to worry about it because it's ready to be used. One of their main goal is handling all boilerplate, complex and repetitive code to allow developers to have a flexible way of designing their web applications.

For example, JSF 1 (which is not very recent) allow to use JSF backingbean to map a JSP view to a almost classic Object Java and not a rigid servlet with just a single doGet() method to handle our needs. In this backingbean, you can add any methods as in a classic java class and you call these methods from your JSP in a OOP way.

Most of Java EE UI frameworks (SpringMVC, GWT, Struts 2, etc...) allow to do that.

added 33 characters in body
Source Link
davidxxx
  • 132.5k
  • 23
  • 231
  • 228

You are right : the two solutions (a doGet() methods which handles multiple use cases and as many servlets as usecases) are not good design in a general way.

That's why, since very long time, JEE applications don't use massively directly their own HttpServlet implementation but use JEE UI frameworks which allow to have a OOP design in yourthe web controllercontrollers.
Behind, a HttpServlet provided by the framework is used but we don't need to worry about it because it's ready to be used : its role. One of their main goal is handling all boilerplate, complex and repetitive code to createallow developers to have a flexible way of designing your applicationtheir web applications.

For example, JSF 1 (which is not very recent) allow to use JSF backingbean to map a JSP view to a almost classic Object Java and not a rigid servlet with just a single doGet()doGet() method to handle our needs.
In this backingbean, you can add any methods as in a classic java class and you call these methods from your JSP in a OOP way.

Most of JEE frameworkUI frameworks (SpringMVC, GWT, Struts 2, etc...) allow to do that.

You are right : the two solutions (a doGet() methods which handles multiple use cases and as many servlets as usecases) are not good design in a general way.

That's why, since very long time, JEE applications don't use massively directly their own HttpServlet implementation but use JEE frameworks which allow to have a OOP design in your web controller.
Behind, a HttpServlet provided by the framework is used but we don't need to worry about it because it's ready to be used : its role is handling all boilerplate code to create a flexible way of designing your application web

For example, JSF 1 (which is not very recent) allow to use JSF backingbean to map a JSP view to a almost classic Object Java and not a rigid servlet with just a single doGet() method to handle our needs.
In this backingbean, you can add any methods as in a classic java class and you call these methods from your JSP in a OOP way.

Most of JEE framework (SpringMVC, GWT, Struts 2, etc...) allow to do that.

You are right : the two solutions (a doGet() methods which handles multiple use cases and as many servlets as usecases) are not good design in a general way.

That's why, since very long time, JEE applications don't use massively directly their own HttpServlet implementation but use JEE UI frameworks which allow to have a OOP design in the web controllers.
Behind, a HttpServlet provided by the framework is used but we don't need to worry about it because it's ready to be used. One of their main goal is handling all boilerplate, complex and repetitive code to allow developers to have a flexible way of designing their web applications.

For example, JSF 1 (which is not very recent) allow to use JSF backingbean to map a JSP view to a almost classic Object Java and not a rigid servlet with just a single doGet() method to handle our needs.
In this backingbean, you can add any methods as in a classic java class and you call these methods from your JSP in a OOP way.

Most of JEE UI frameworks (SpringMVC, GWT, Struts 2, etc...) allow to do that.

Source Link
davidxxx
  • 132.5k
  • 23
  • 231
  • 228
Loading