From .NET to Java, which technologies or frameworks to use?

5

I currently have a .NET-based workflow with Angular JS and a possibility has arisen for a new project using Java.

With .NET I use the following technologies:

ASP.NET Identity
Used for authentication and authorization. Managing access users with roles.

ASP.NET Web API
A REST layer that is consumed by an HTML5 client with Angular JS, with authentication and authorization capabilities based on ASP.NET Identity.

ASP.NET Web Pages
As the client side uses Angular JS instead of generating templates using .html (pure) that would not allow any server-side preprocessing, I chose to use .cshtml (web pages) that makes it possible to do checks like this:

<div>
    @if (User.IsInRole("admin")) { 
        <a href="/api/emp/excluir/5">Excluir</a> 
    }
</div>

That is, if the logged-in user does not have the privilege of the information, or certain sections of the template, they will never be sent to the browser. This is necessary to increase security.

As the Java world has a myriad of frameworks available for a wide range of needs, what Java technologies could be used to maintain a similar architecture?

    
asked by anonymous 25.03.2015 / 20:00

2 answers

4

My suggestion: From the version 2.5.0 the Demoiselle Framework facilitates the use of an architecture very similar to the one you commented. Reference Guide

If you already work with Apache-Maven, you can use the demoiselle-html-rest archetype to generate an example application.

    
26.03.2015 / 15:36
2

Authentication & Authorization

You can use JAAS that has its own specification, however, its settings often change from vendor (implementer) to vendor. If you want to get out of the pattern, you can use Spring Security , it is easier to use, easier to understand and more flexible .

View

You can use JSP primitives that fit the scenario you cited, or, if you have to use templates, you can use the Tiles that makes the job much easier (I'd say it's a JSP ++)

REST

You can use JAX-RS which is a default in java, for example JBoss RESTEasy or even Jersey (reference implementation).

The advantage of all these technologies is that all of them can integrate and are already well accepted in the market.

    
26.03.2015 / 19:34