-1

There are several approaches to choose from when creating new Java EE 7 application.

  1. JSP

  2. JSF (Facelets)

  3. plain HTML 5 + JavaScript

  4. ???

The question is - please, show the conditions when it is better to use one or another UI technology, what are the pros and cons of using each of them, unique and cool features of the technology, in a couple of words, to make a complete picture inside my head. Sorry if this question seems you stupid. Thank you.

UPDATE 1: Also, what would be the best technology to use if the app should be as much cross-platform (i.e. desktop browsers, mobile browsers, etc.) as possible.

UPDATE 2: If nowadays almost everyone knows HTML and JS with its frameworks - why then to use JSP or JSF?

experimenter
  • 878
  • 1
  • 11
  • 27

2 Answers2

1

For a Java EE application you will need JSP or JSF (Facelets). Both technolgies use HTML and Javacript for the frontend. This Answer show a clear difference between JSF and JSP.

Regarding your requirement to have a cross-platform webpage, I would recommend you to use Bootstrap as frontend-framework. Bootstrap is in my opinion the best frontend-framework for cross-platform. However, you will need JSF or JSP in your backend.

Community
  • 1
  • 1
Samuel L
  • 139
  • 3
  • 5
0
  1. JSP: Easy, Faster than JSF, Mixture of HTML, Tag lib and Java.

  2. JSF: State-full and Component based framework. Slower than JSP but cleaner code base. Learning time.

  3. HTML+JAVASCRIPT: Independent of server side technology, big community. Various options to use latest client side frameworks, like AngularJS, Backbone.js and many more. Faster, able to manage clean code base.

Shamim Ahmmed
  • 8,265
  • 6
  • 25
  • 36
  • thanks for the answer, I have made an UPDATE 2: "If nowadays almost everyone knows HTML and JS with its frameworks - why then to use JSP or JSF?" – experimenter Apr 11 '14 at 14:43
  • Industry is moving to "Mobile first" centric approach where HTML5, CSS3 and JS based frameworks work well than JSF, JSP – Shamim Ahmmed Apr 11 '14 at 14:48
  • So, as I understood, if I know HTML JS CSS bundle very well - then I even don't need to learn Java EE JSP or JSF? – experimenter Apr 11 '14 at 14:50
  • You need Java EE for back end technology(web services) but option 3 is a replacement of java EE view technology (JSP, JSF). clear? – Shamim Ahmmed Apr 11 '14 at 14:52
  • yes, thanks, that's what I had in mind. – experimenter Apr 11 '14 at 14:54
  • How is JSF slower than JSP??? – MoFarid May 22 '14 at 15:45
  • @sfrued, Please check the JSF life-cycle. There are additional step before rendering JSF components and the components are state-full – Shamim Ahmmed May 22 '14 at 17:34
  • If you are using facelets with jsf it would definitely be faster than using jsp as a view. Don't you agree?? – MoFarid May 22 '14 at 19:46
  • well, facelets is template framework, it has nothing to do about performance but it helps to organize jsf code and to build composite jsf components – Shamim Ahmmed May 22 '14 at 20:11
  • @shamimz you are wrong, it has everything to do with performance, since you pointed out which is faster in the first place, please refer to this simple info: http://www.jsftoolbox.com/documentation/facelets/03-FaceletsConcepts/comparing-facelets-and-jsp.jsf – MoFarid May 26 '14 at 10:32
  • @sfrued,you are pointing something that is correct but I'm talking about something during Servlet execution time. The compilation process occurs once when you deploy the application and the first time the servlet has been called. In the subsequent request, the servlet container will execute java byte code, not xml parsing, no jsp to .class file generation. – Shamim Ahmmed May 27 '14 at 15:29