What is the difference between servlets and struts




















Difference between Spring and Struts architecture. At a glance. A servlet is a Java programming language class that is used to extend the capabilities of servers that host applications accessed by means of a request-response programming model. Although servlets can respond to any type of request, they are commonly used to extend the applications hosted by web servers.

The JSPs -while under the covers indeed being compiled to servlets- should be used as view only, not as controller. Servlets are the Java programs that runs on the Java-enabled web server or application server. They are used to handle the request obtained from the web server, process the request, produce the response, then send response back to the web server. Properties of Servlets : Servlets work on the server-side. HTTP servlets provide a service method that automatically routes the request to another method in the servlet based on which HTTP transfer method is used.

There are two main packages which this chapter makes use of: javax. Examples are sending data after filling up a form or sending login id and password. Yes, there are other HTTP 1. The doGet method is used for getting the information from server while the doPost method is used for sending information to the server.

Expression Language strut 1. Configuration File strut 1. Action Classes strut 1. Thread Safety strut 1. Type Conversion strut 1. Servlet Dependency strut 1. View strut 1. Comments Nice explanation!!! This was the reason of the rise of the model 2 architecture, where the servlet controls the flow of the request, calls a model class to do the business logic, decides which view jsp or other to send to the user, and then sends the response to the user.

Another pattern was also created and widely used, and that is the front controller pattern. This pattern simply says "Why do we have a separate controller for each request? From the previous paragraph, I'm sure that you have already guessed that struts is a web framework based on the front controller design pattern, and this is correct.

Using struts will simplify development a lot, since it separates the business logic from the flow control and the view. Another thing is that struts provides a set of useful tag libraries, a validation framework and the tiles framework which allows you to create complex layouts by gluing simple JSPs together.

I hope that this would help you. Hussein Baghdadi. We don't We use web frameworks to make our life easier and to devote more time to our life as web frameworks are supposed to handle the common task we to do in each web application we work on data validation, type conversation Raghavan Muthu.

As such they both are different.



0コメント

  • 1000 / 1000