Spring MVC Support for mobile devices and standard browser - spring

I am designing a dashboard application using Spring MVC Restful APIs. One of the requirements is to support mobile devices and standard browser.
Please let me know if I can implement this in Presentation layer (JSP), if yes, how can we achieve it?

Related

SSO for .net core 3.1 web api

We would like to achieve SSO(Google, Microsoft, Twitter, Facebook) for a .net core 3.1 web api (console api controllers) application. I have gone through few links that achieves this with the help of MVC or angular front end and IdentityServer4. Our application is purely an web api. Can some one guide me with sample code or link to achieve this? How does SignInWithGoogle/FB/Twitter/Microsoft button and its click will be handled?

What is the best way to get location of users and show on the spring boot web application

I i have spring boot web application and a react native mobile application, and all of the oprations in the mobile application doing by call APIs that exists in the web application.
Now, in the specific form in the web application, system administrator wants to see the realtime location of users.
What is the best to do this and make communication with mobile application.
I doesn't have enough information about react native and mobile developments.

How enable Angular Universal with a Java/Spring backend?

I have an app, where backend implements on Spring using Spring Boot and front-end side use Angular2. Can somebody help me and explain how to integrate Universal using Java becken. Or show me a good example how I can do that.
how to integrate Universal using Java beckend?
You cannot do that directly as universal needs a different server side technology -nodejs
But you have a another (better) solution
Spin off a separate nodejs app for the angular and universal then route all the API calls through the nodeJs to your Spring boot application. Now your spring boot application will be just a (micro)service which will only deal with the data, not the presentation (markup/style etc)

Spring REST API for web- and mobile-clients

This is my first question on StackOverflow and I hope someone can help me. :-)
I am planning to build a web-application (backend) with spring roo. For the backend I will use Spring and Hibernate/JPA. In the future I will implement a web client (JSF/Primefaces), a mobile client (Android) and a Windows App.
With spring roo it is easy to create a layered architecture with domain classes, repositories and services. This part is fun.
But now I am thinking about remoting and how to connect all the clients (web, mobile, windows) with my backend.
1.) What do you prefer for the remoting between client and backend? SOAP-Web Services or a REST-API (e.g. with JSON).
2.) If REST-API: How should the API look like for authentication/login functionality? REST is resource-oriented but how do you implement authentication with REST API?
At the moment I think a REST-API is a good idea. Because I am using spring it is easy to create a Spring MVC controller with REST support. But is this the correct way to implement a REST API for all the three devices? The web client e.g. should be implemented with JSF and Primefaces and I donĀ“t use spring MVC for the web layer.
3.)Can I nevertheless use Spring MVC controllers to build the REST API (together with JSF in the web layer)? Or is there a better way?
1.) What do you prefer for the remoting between client and backend? SOAP-Web Services or a REST-API (e.g. with JSON).
I don't have too much experience with SOAP-WS, but I have a ton of experience with REST-APIs using JSON. There are many implementations for mobile, web and server side clients that are fairly simple to implement.
2.) If REST-API: How should the API look like for authentication/login functionality? REST is resource oriented but how to implement authentication with REST API?
If you are already using spring, I recommend securing your API with Spring Security. You can use spring security even if you don't end up going with Spring MVC for your API implementation. There are many ways to secure a rest API with spring security, but I the simplest is to send the basic auth header with every request to a secure URI
3.)Can I nevertheless use Spring MVC controllers to build the REST API (together with JSF in the web layer)? Or is there a better way?
Spring MVC Controllers will work fine, but I would recommend going with RestEasy or Jersey. I find them to be more flexable.
I agree with #mad_fox. Additionally, i want to add another option regarding your question#2. If you dont want to use Spring security, you can write your own token based authentication mechanism using spring and basic java interceptors.
You can store the token in your browser local storage.

spring mvc + desktop app = best protocol and gui framework

I wanna create spring app which will consists of 2 parts :
spring backend + spring mvc (server + web app)
desktop app which need to acces to backend
Whats best protocol to comunicate between spring and desktop app? Can i use SOAP for this? Can someone do quick overview of avaliable technologies (why not/yes)?
And whats best choice for desktop app GUI framework? or its better to use pure Swing / AWT.
I want to notice that i wanna use solutions which is most popular in software companies.
I appreciate every opinions.
The companies I work for aren't interested in Swing. Apps are web-based, not desktop. You're more likely to find mobile apps rather than Swing these days.
With that said, your instinct is a good one: separate the services, which are unlikely to change, from the UIs that come and go.
Start with Spring POJO, interface-based services and remote them any way you like.
An HTTP-based protocol will be more reusable by different clients.
Spring allows you to use HTTP remoting, SOAP or REST web services. If you write web services, learn how to write "contract first". Start with the .xsd for your XML messages.

Resources