Java web application Front end [closed]
Asked Answered
D

2

7

I have a large application that is using Java on the backend and struts, Jsp and JSTL tag library on the front end. Database is DB2 and we rely heavily on Stored procedures.

We are planning to upgrade the application to a new architecture/framework.

The main framework we are considering is Spring, although our leads are trying to push us to adopt Java EE instead claiming it's better framework.

Any recommendations as to which way to go with Spring or Java EE? Any main reasons to prefer one over the other (advantage/disadvantage)?

For each one of those, what is the best alternative for JSP taglib ? We use to have to write all the html tags manually to display dynamic data with JSTL. I am reading about new frameworks like Angular and JSF components. I am not sure also what is widely used these days. I read that more and more programmers are passing the data from REST services as JSON to front-end. What do they use to render the data, is it JSF, Angular?

I do .NET programming, and in ASP.NET we have data binding and components like ListView, etc. Are JSF and Angular the same?

Any web-site with good examples, documentation (especially architecture) that you recommend?

Distil answered 24/2, 2015 at 13:35 Comment(1)
So where can someone asks expert developers for recommendations when it comes to specific technologies ? I am upgrading an out-dated application and I needed some advice. I guess l need to find a different online technical site.Distil
G
12

Java EE and Spring are both very good and very comprehensive frameworks for writing backends. Both of them should be able to do exactly what you want. I would recommend using whichever your team is familiar with but I'm going to stay out of the details since you will be able to make a high quality application with either one very easily.

As far as the front-end goes, I have personally gotten the best results out of creating a RESTful API and using that to send data to a front-end Javascript framework. Angular is really good for this. One reason for this is that the Javascript frameworks tend to provide a lot of power when it comes to writing good web front-ends. JSF is a server-side, component based MVC framework, and that generally gives you less control over the the HTML + JavaScript that's being created and makes it a lot more difficult to write tests for.

I've also found that at large shops, you can't always trust people to do things the right away. Separation of concerns is important, and I like using a JavaScript framework like Angular for the front-end because it goes a long way to keep front-end code out of the back-end. The JSF applications we have at my workplace are rather terrible, because the developers abused things like sessions. The JSF code also lived in the same deployment as the backend. Instead of using web services and taking a service oriented approach and keeping everything loosely coupled, we wound up with giant 'blobs' of code that 'do everything'.

Gus answered 24/2, 2015 at 14:2 Comment(0)
D
1

A lot depends upon your team they are comfortable with.Both Spring and Java EE can do everything for you, but personally I will suggest spring jdbc + spring mvc modules for backend. Spring injection functionality is very helpful for web application. Also spring jdbc module create environment and create sessionFactory for your jdbc calls.

Create rest-api in your controller that will make your life very easy. Spring also provides a lot of templates which act as base classes to make using the Java EE standard technologies a breeze to work with. For example, the JdbcTemplate works well with JDBC, the JpaTemplate does good things with JPA, JmsTemplate makes JMS pretty straightforward.

Also for maintence point of view spring is best because it is popular and mostly developers are familier with spring.

For front end angular is superb because AngularJS has a built-in dependency injection subsystem that helps the developer by making the application easier to develop, understand, and test.

Data-binding is probably the coolest and most useful feature in AngularJS. It will save you from writing a considerable amount of boilerplate code.

Declinatory answered 24/2, 2015 at 14:39 Comment(2)
>JpaTemplate does good things with JPA - This is a bit debatable and has been a controversial topic. In fact this was the cause of some tension between the Hibernate (Gavin King) and Spring teams - JPA was a new and clean API and it's questionable whether it needed any wrapping or enhancement by Spring.Gerstner
> JmsTemplate makes JMS pretty straightforward - Note that in Java EE 7 the JMS API was radically simplified. Likely JmsTemplate doesn't make any sense for JMS 2.0 anymore.Gerstner

© 2022 - 2024 — McMap. All rights reserved.