Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which Java web framework is best if want to use jQuery

I am very good at jQuery and have used it in many PHP websites.

Now I want to only choose that Web framework by which I can use jQuery to the same level as PHP, but in Java.

So, which web framework should I go for?

like image 441
user564477 Avatar asked Jan 24 '11 06:01

user564477


People also ask

Is jQuery a web framework?

jQuery is a JavaScript framework. It facilitates the readability and the manipulation of HTML DOM elements, event handling, animations, and AJAX calls. It's also free, open-source software that adheres to the MIT License. As a result, it is one of the most popular JavaScript libraries.

What is framework in jQuery?

The framework is a set of pre-written code libraries designed to be used by developers. A programming language is a specified method of communication between the programmer and the computer.; whereas, jQuery is a Library.

Is jQuery a good framework?

One of the oldest JS frameworks is the Jquery. This framework has been around for over 12 years and it's still going strong.

Which JavaScript framework should I learn 2022?

Vue. js offers a simple and swift fix for apps, user interface, and engaging web-based interface development. It can empower modern-day single-page web-based apps. It is one of the most powerful and best JS Frameworks in 2022.


2 Answers

As you already have heard, component based frameworks are a bit wonky when it comes to using certain JavaScript libraries. I have personally used only a few so I can't create a definite list of them. I do have, however, used both component and template based frameworks so I'd dare to say that I have at least somewhat educated opinion to express on the matter:

In general, component based frameworks are usually a bit harder to work with mainly since they integrate the "Ajax channel" to their own internals. As an example, the currently very popular Apache Wicket implements all of its Ajax stuff natively which, at times, does show as being broken on certain platforms et cetera. The reason for this integration usually is so that the developers of the framework can rely on the behaviour of the Ajax functions in their framework completely; by making a custom implementation, they can lean on it and potentially debug it faster. There are of course exceptions to this (even Wicket has its own jQuery implementation called wiQuery) but even then that integration may be subpar to what you would be able to write normally.

Now, request based frameworks as you call them (I'd categorize them as template based frameworks based purely on my experience) usually allow you to have more fine grained control over various parts of the page, usually you end up even writing the final markup with some magic tags here and there for linking the dynamic part of the web application with the static layout. With this in mind, it's rather obvious that these usually allow you as a developer to choose - among a lot of other things - the JavaScript library of your choice, but it's a trade-off; whatever the component based framework would provide at this point is something you need to reimplement by yourself. Most commonly this is limited to handling Ajax requests but that varies from framework to framework.

To summarize, if you really want to use jQuery (and why wouldn't you) and you can't agree with the way it has been integrated in component based frameworks, look what the other kind has to offer.


If I had to recommend something that I would believe would fit you perfectly, I'd recommend GSP on top of Spring MVC using plain Java for backend stuff and such, but this combination doesn't actually even exist since GSP is the view part of Grails, a Groovy based web application framework.

like image 82
Esko Avatar answered Oct 24 '22 23:10

Esko


For Java, I would suggest Spring's REST framework, where you can use JSON in your requests and your response. By using JSON to return your data back to the client side, you could use JQuery to parse the JSON, manipulate the data, and then manipulate the HTML document programmatically.

The advantage of this method is that it makes it easier to keep your content, behavior, and presentation separate. If you're working on a project with a design team of varying programming backgrounds, and if your HTML/CSS skills aren't as good as theirs, this method can be very powerful for maintaining a separation of concern.

Other than that, any framework could work, as JavaScript and server-side languages run in completely different environments.

like image 33
jmort253 Avatar answered Oct 24 '22 21:10

jmort253