Recently began to study the web on java. From the lessons I realized that it seems that thanks to these technologies, you can dynamically change the external interface of the page at the client. Nevertheless, I would like to get a more accurate, detailed and clear answer.

But this is only half the question. This video is very puzzled https://www.youtube.com/watch?v=iuTkG_BtwL0 . Judging by the words of the author, you can do without jsp / jsf at all by giving the implementation of their functionality to the frontend. Later I saw many topics about the death of these technologies. Why do such topics arise? And what is the jsp / jsf implemented on the frontend?

    2 answers 2

    JSP is a technology that allows a programmer to create web applications in the simplest way available from the Java platform. You simply create a text file containing html markup mixed with java code

    <html> <head> <title>Hello JSP</title> </head> <body> Текущее время: <%= new java.util.Date() %> Имя вашего хоста: <%= request.getRemoteHost() %> </body> </html> 

    Throw it on the server and open it in the browser. The code inside the <% %> %% <% %> is called a scriptlet. Instead of writing code on the page, you can define your own tags. For frequently used functions there is a library of ready-made tags - JSTL.

    JSP is an old technology from the late 90s, when web development was just emerging. At that time, the idea of ​​mixing code and presentation did not seem terrible, it was rapidly gaining momentum with PHP, which exploits this very principle. But it quickly became clear that this was a mistake. Therefore, today JSP is used as a means of writing presentation templates for web applications.

    JSF is a more sophisticated technology serving the same purpose — developing web applications. It exploits the component-oriented approach - the page consists of components, each of which is similar to a small specially arranged program that jointly process a request from a client and form an answer. If JSP resembles PHP, then JSF is similar to ASP.NET.


    Judging by the words of the author, you can do without jsp / jsf at all by giving the implementation of their functionality to frontend.

    Nowadays, the practice of transferring the presentation layer from backend to frontend is gaining popularity. That is, instead of forming an html-page from a dataset and giving it to the client, the server gives the client data in JSON (or another) format, and the javascript code in the client’s browser forms this page from this data. In such a scheme, neither JSP nor JSF is needed; a servlet is sufficient.

    Later I saw many topics about the death of these technologies.

    People tend to invent stories about the end of the world. But the rumors about the death of these technologies are greatly exaggerated. JSP and JSF are actively exploited and developed. In 2016, an updated version of JSF was released as part of Java EE 8.

    Why do these topics arise?

    As I already wrote, JSP is now used only as a template engine. And not the most popular besides. He has strong competitors, such as Thymeleaf. And JSF bit off the market Spring MVC. Although comparing these technologies is not entirely correct due to different approaches.

    And what is the jsp / jsf implemented on frontend?

    Read about AJAX and RESTful web services. It will be useful to look at JAX-RS.

      HTML language describes static content that is interpreted by a client-side web browser into a familiar web site. Accordingly, when you want to change the content of the page, you, for example, go to the server and make manual changes in the corresponding .html file.

      Automation is a process involved in technology jsp:

      You can describe dynamically modifiable blocks in the template of your page with jsp syntax and, for example, the logic in the servlet classes. And fill the HTML page based on the circumstances. For example, the editable user welcome page)

      As you understand, this is similar to tasks that solve such languages ​​and frameworks as js ts angular etc.

      The principal difference is that the filling takes place on the server side and all content is sent or changes were requested from the frontend and implemented on site.

      And as for me it is not necessary to consider jsp / jsf as outdated technologies, it is just a tool that will be convenient in certain circumstances.

      I would trust for example, having noticed now the conclusions of the results of the work of some web service jsp than on level ground I added a new language to the project)