Modern HTML / CSS / JS layout with Java backend

Introduction

Mostly I come from two sides of the development teams. I started building web applications using PHP. Thus, I had to implement everything manually. Shapes, graphic elements, how everything is connected to each other (for example, what happens when you press a button).

On the other hand, some time ago I entered the world of Java Web, namely JSF. This, in my opinion, is a good way to create "serious" applications. (why I think so, read below)

Problem

I would like to create a web application consisting of a nice and usable interface that was developed after my specifications (basically making HTML and a graphic layout as a horizontal prototype first - as much as possible), then make a full webapp from it). But on the other hand, I would like to make all the business logic in Java because of its many good frameworks - Hibernate, Morphia, Lombok, Dozer, just to name a few that I met and fell in love with.

I could create an interface with JSF myself, but I still think I'm too limited, because I have to use built-in components that can only be configured for a certain amount. What if I want to use my own design patterns and user interface elements and behavior, but still want them to work with the Java backend?

What will be the β€œbest” choice of tools to achieve my goal? Choose a different web structure, for example, Wicket or similar?

My idea: Create a Java web application that understands the good old GET commands and translates it into Java methods. An example of a RESTful service β€” although I'm not a big fan of doing everything RESTful in an interface β€” unless you tell me it's good and reliable.

+4
source share
2 answers

Have you reviewed / reviewed the Google Web Toolkit for what you are trying to create?

GWT is Java behind the scenes, but it can still help you if you want, if I understand what you are asking. Strike>

Just an update:

If GWT is not your thing, check out the Groovy / Grails route.

Just some development here based on the comment ...

With Groovy / Grails, you actually don't need to combine your front and back ends. I saw that this is done, but not always 100% is required.

For example, you can create a web application in Grails, where your AJAX functions can be generated and saved with the provision of a user interface for the client for Great-UI-Justice. For added pleasure, you can even instruct Grails to include a JS framework such as jQuery to help you with the user interface.

Now at the rear end you can remove your Java back end and apply it directly, without any changes. However, I would recommend to study everything that you have done so far in order to use the Grails methodology.

+6
source

There are many JSF libraries such as ICEfaces , RICHfaces , etc. that use things like AJAX, etc.

In my personal opinion, it is always a good idea to have a RESTful API and treat your web page just like any other client;)

0
source

Source: https://habr.com/ru/post/1394669/


All Articles