Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Which view technology would you recomment for a web site?  RSS feed

 
Ekaterina Galkina
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jsp, FreeMarker, Velocity, other?
 
Stephan van Hulst
Saloon Keeper
Posts: 7808
142
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think it really matters unless you have very specific requirements. Use whatever you're comfortable with. I know Bear is a big fan of JSP and he has quite some years of web development experience. Personally, if I were to start a new web application I would use Thymeleaf.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66204
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is your goal?

To create an app as quickly as possible? Then use what you already know.

To learn a specific technology? Then use that technology.

To create an app using the most modern approach? Then none of what you listed. Creating UIs on the server to send to the browser is yesterday's technology. Cutting edge apps create a RESTful API for the server, and use a JavaScript framework such as Angular, VuewJS, or React for the front-end.
 
Ekaterina Galkina
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
To create an app as quickly as possible?
To create an app using the most modern approach?

Yes
Bear Bibeault wrote:
Then none of what you listed. Creating UIs on the server to send to the browser is yesterday's technology. Cutting edge apps create a RESTful API for the server, and use a JavaScript framework such as Angular, VuewJS, or React for the front-end.

Then I don't need different views, just one page index.html whose data will be renewed, right? (Single Page Application)
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66204
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ekaterina Galkina wrote:
Then I don't need different views, just one page index.html whose data will be renewed, right? (Single Page Application)

In modern JS SPA frameworks you do have many views, they're just not displayed through full-page reloads, but rather via changes to the DOM.

So in essence while there is only one "page", there are many views. The old-fashioned concept of a "page" and a "view" being the same thing no longer applies.

In most such frameworks with modern tooling, you don't even create the index.html, it is generated for you. You define the components/views and the concept of "a page" doesn't even really come into play.
 
Ekaterina Galkina
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
Ekaterina Galkina wrote:
Then I don't need different views, just one page index.html whose data will be renewed, right? (Single Page Application)

In modern JS SPA frameworks you do have many views, they're just not displayed through full-page reloads, but rather via changes to the DOM.

So in essence while there is only one "page", there are many views. The old-fashioned concept of a "page" and a "view" being the same thing no longer applies.

In most such frameworks with modern tooling, you don't even create the index.html, it is generated for you. You define the components/views and the concept of "a page" doesn't even really come into play.

Thank you. It's time to look at Angular.
 
Stephan van Hulst
Saloon Keeper
Posts: 7808
142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear, years ago I would always hear that web applications would have to degrade gracefully (or use progressive enhancement, or whatever, it doesn't really matter) when dealing with matters such as disabled JavaScript. Lately I've been hearing you say that server-side view technologies will be a thing of the past and that we are moving towards a future where the entire view is built on the client-side. What is your stance on the whole degradation/enhancement issue? Do you require all your users to always have JavaScript enabled?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66204
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stephan van Hulst wrote:Do you require all your users to always have JavaScript enabled?

Yes, this is 2017. Anyone with JS disabled is going to miss out on a lot of the web. Few organizations are going to write and maintain both a React/Angular/Vue web app, along with an older-technology version of it.

My joke is that even sites that only show photos of kittens require JS these days.

If it is important to an organization to support the minority of people who insist on keeping JS disabled for all sites, or using antiquated browsers for whatever reason, (which include no organization I have been involved with for over a decade) then that organization should continue to use old technology to develop their sites.


 
Ekaterina Galkina
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now I doubt  if Spring is a modern technology...My friend who codes Python says he heard about Spring 6 years ago, but not now. Is modern Java EE really comparable with Spring and one should prefer it?
 
Ekaterina Galkina
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that modern java CDI + plain servlets can't be a replacement.
 
Stephan van Hulst
Saloon Keeper
Posts: 7808
142
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They're not, and there's also nothing wrong with using Spring. Spring is great for creating a RESTful API with. Another option is to use Jersey + CDI. Either way, you create your API and just return the results as a JSON response, and let the client worry about the presentation.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!