What is JavaServer Faces?

Small overview of a Java web application framework
01 September 2017   2487

JavaServer Faces (JSF) is a framework for web applications written in Java. It serves to facilitate the development of user interfaces for Java EE-applications. Unlike other MVC frameworks that are managed by queries, the JSF approach is based on the components usage. The state of the user interface components is retained when the user requests a new page and then restores if the request is repeated. To display the data, JSP, Facelets is usually used, but JSF can be adapted to other technologies, for example XUL.

JavaServer Faces technology includes:

  • A set of APIs for representing user interface components (UI) and managing their state, processing events and validating input information, defining navigation, as well as supporting internationalization (i18n) and accessibility.
  • A special JSP tag library for expressing the JSF interface on a JSP page. In JSF 2.0, the Facelets technology is used as the view handler, which came to replace the JSP.

 

Most Popular Java Snippet At StackOverflow is Flawed

The code in question was posted in 2010 and has accumulated over a thousand recommendations, and can be found in 7k GitHub repos
05 December 2019   95

The most popular example of Java code published on StackOverflow turned out to be an error leading to the conclusion, under certain conditions, of an incorrect result. The code in question was posted in 2010 and has accumulated over a thousand recommendations, and has also been copied to many projects and is found in repositories on GitHub about 7 thousand times. It is noteworthy that the mistake was not found by the users copying this code into their projects, but by the original author of the council.

The considered code converted byte size into readable form, for example 110592 converted to "110.6 kB" or "108.0 KiB". The code was proposed as a logarithm-optimized version of the previously proposed tip, in which the value was determined by dividing the initial value in a cycle by 1018, 1015, 1012, 1019, 106, 103, and 100, until the divisor is larger than the original value in bytes . Due to inaccurate calculations in the optimized version (overflow of the long value), the result of processing very large numbers (exabytes) did not correspond to reality.

The author of the council also tried to draw attention to the problem of copying examples without reference to the source and without specifying a license. According to a previous study, 46% of developers copied the code from Stack Overflow without specifying the author, 75% did not know that the code is licensed under CC BY-SA, and 67% did not know that this implies the need for attribution.